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__User__Detail__Topics__Gr...

445 lines
1.2 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[276,5,6,7],{"+NIl":function(nt,xe,Z){(function(ne){ne(Z("VrN/"))})(function(ne){"use strict";ne.defineMode("stex",function(J,P){"use strict";function X(h,l){h.cmdState.push(l)}function j(h){return h.cmdState.length>0?h.cmdState[h.cmdState.length-1]:null}function B(h){var l=h.cmdState.pop();l&&l.closeBracket()}function K(h){for(var l=h.cmdState,f=l.length-1;f>=0;f--){var o=l[f];if(o.name=="DEFAULT")continue;return o}return{styleIdentifier:function(){return null}}}function G(h,l,f){return function(){this.name=h,this.bracketNo=0,this.style=l,this.styles=f,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var r={};r.importmodule=G("importmodule","tag",["string","builtin"]),r.documentclass=G("documentclass","tag",["","atom"]),r.usepackage=G("usepackage","tag",["atom"]),r.begin=G("begin","tag",["atom"]),r.end=G("end","tag",["atom"]),r.label=G("label","tag",["atom"]),r.ref=G("ref","tag",["atom"]),r.eqref=G("eqref","tag",["atom"]),r.cite=G("cite","tag",["atom"]),r.bibitem=G("bibitem","tag",["atom"]),r.Bibitem=G("Bibitem","tag",["atom"]),r.RBibitem=G("RBibitem","tag",["atom"]),r.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function L(h,l){h.f=l}function v(h,l){var f;if(h.match(/^\\[a-zA-Z@]+/)){var o=h.current().slice(1);return f=r.hasOwnProperty(o)?r[o]:r.DEFAULT,f=new f,X(l,f),L(l,p),f.style}if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/\\]/))return"tag";if(h.match("\\["))return L(l,function(a,s){return m(a,s,"\\]")}),"keyword";if(h.match("\\("))return L(l,function(a,s){return m(a,s,"\\)")}),"keyword";if(h.match("$$"))return L(l,function(a,s){return m(a,s,"$$")}),"keyword";if(h.match("$"))return L(l,function(a,s){return m(a,s,"$")}),"keyword";var u=h.next();if(u=="%")return h.skipToEnd(),"comment";if(u=="}"||u=="]"){if(f=j(l),f)f.closeBracket(u),L(l,p);else return"error";return"bracket"}else return u=="{"||u=="["?(f=r.DEFAULT,f=new f,X(l,f),"bracket"):/\d/.test(u)?(h.eatWhile(/[\w.%]/),"atom"):(h.eatWhile(/[\w\-_]/),f=K(l),f.name=="begin"&&(f.argument=h.current()),f.styleIdentifier())}function m(h,l,f){if(h.eatSpace())return null;if(f&&h.match(f))return L(l,v),"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 o=h.next();return o=="{"||o=="}"||o=="["||o=="]"||o=="("||o==")"?"bracket":o=="%"?(h.skipToEnd(),"comment"):"error"}function p(h,l){var f=h.peek(),o;return f=="{"||f=="["?(o=j(l),o.openBracket(f),h.eat(f),L(l,v),"bracket"):/[ \t\r]/.test(f)?(h.eat(f),null):(L(l,v),B(l),v(h,l))}return{startState:function(){var h=P.inMathMode?function(l,f){return m(l,f)}:v;return{cmdState:[],f:h}},copyState:function(h){return{cmdState:h.cmdState.slice(),f:h.f}},token:function(h,l){return l.f(h,l)},blankLine:function(h){h.f=v,h.cmdState.length=0},lineComment:"%"}}),ne.defineMIME("text/x-stex","stex"),ne.defineMIME("text/x-latex","stex")})},"+ua5":function(nt,xe,Z){},"/cxE":function(nt,xe,Z){"use strict";Z.d(xe,"f",function(){return P}),Z.d(xe,"g",function(){return X}),Z.d(xe,"h",function(){return j}),Z.d(xe,"e",function(){return K}),Z.d(xe,"b",function(){return G}),Z.d(xe,"c",function(){return r}),Z.d(xe,"d",function(){return L}),Z.d(xe,"a",function(){return v});class ne{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(m){setTimeout(()=>{throw m.stack?new Error(m.message+`
`+m.stack):m},0)}}emit(m){this.listeners.forEach(p=>{p(m)})}onUnexpectedError(m){this.unexpectedErrorHandler(m),this.emit(m)}onUnexpectedExternalError(m){this.unexpectedErrorHandler(m)}}const J=new ne;function P(m){K(m)||J.onUnexpectedError(m);return}function X(m){K(m)||J.onUnexpectedExternalError(m);return}function j(m){if(m instanceof Error){let{name:p,message:h}=m;const l=m.stacktrace||m.stack;return{$isError:!0,name:p,message:h,stack:l}}return m}const B="Canceled";function K(m){return m instanceof Error&&m.name===B&&m.message===B}function G(){const m=new Error(B);return m.name=m.message,m}function r(m){return m?new Error(`Illegal argument: ${m}`):new Error("Illegal argument")}function L(m){return m?new Error(`Illegal state: ${m}`):new Error("Illegal state")}class v extends Error{constructor(m){super("NotSupported");m&&(this.message=m)}}},"19Vz":function(nt,xe,Z){(function(ne){ne(Z("VrN/"))})(function(ne){ne.defineOption("placeholder","",function(G,r,L){var v=L&&L!=ne.Init;if(r&&!v)G.on("blur",j),G.on("change",B),G.on("swapDoc",B),ne.on(G.getInputField(),"compositionupdate",G.state.placeholderCompose=function(){X(G)}),B(G);else if(!r&&v){G.off("blur",j),G.off("change",B),G.off("swapDoc",B),ne.off(G.getInputField(),"compositionupdate",G.state.placeholderCompose),J(G);var m=G.getWrapperElement();m.className=m.className.replace(" CodeMirror-empty","")}r&&!G.hasFocus()&&j(G)});function J(G){G.state.placeholder&&(G.state.placeholder.parentNode.removeChild(G.state.placeholder),G.state.placeholder=null)}function P(G){J(G);var r=G.state.placeholder=document.createElement("pre");r.style.cssText="height: 0; overflow: visible",r.style.direction=G.getOption("direction"),r.className="CodeMirror-placeholder CodeMirror-line-like";var L=G.getOption("placeholder");typeof L=="string"&&(L=document.createTextNode(L)),r.appendChild(L),G.display.lineSpace.insertBefore(r,G.display.lineSpace.firstChild)}function X(G){setTimeout(function(){var r=!1,L=G.getInputField();L.nodeName=="TEXTAREA"?r=!L.value:G.lineCount()==1&&(r=!/[^\u200b]/.test(L.querySelector(".CodeMirror-line").textContent)),r?P(G):J(G)},20)}function j(G){K(G)&&P(G)}function B(G){var r=G.getWrapperElement(),L=K(G);r.className=r.className.replace(" CodeMirror-empty","")+(L?" CodeMirror-empty":""),L?P(G):J(G)}function K(G){return G.lineCount()===1&&G.getLine(0)===""}})},"1eCo":function(nt,xe,Z){(function(ne){ne(Z("VrN/"))})(function(ne){"use strict";var J={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},P={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ne.defineMode("xml",function(X,j){var B=X.indentUnit,K={},G=j.htmlMode?J:P;for(var r in G)K[r]=G[r];for(var r in j)K[r]=j[r];var L,v;function m(c,w){function y(F){return w.tokenize=F,F(c,w)}var b=c.next();if(b=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?y(l("atom","]]>")):null:c.match("--")?y(l("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),y(f(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),w.tokenize=l("meta","?>"),"meta"):(L=c.eat("/")?"closeTag":"openTag",w.tokenize=p,"tag bracket");if(b=="&"){var U;return c.eat("#")?c.eat("x")?U=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):U=c.eatWhile(/[\d]/)&&c.eat(";"):U=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),U?"atom":"error"}else return c.eatWhile(/[^&<]/),null}m.isInText=!0;function p(c,w){var y=c.next();if(y==">"||y=="/"&&c.eat(">"))return w.tokenize=m,L=y==">"?"endTag":"selfcloseTag","tag bracket";if(y=="=")return L="equals",null;if(y=="<"){w.tokenize=m,w.state=s,w.tagName=w.tagStart=null;var b=w.tokenize(c,w);return b?b+" tag error":"tag error"}else return/[\'\"]/.test(y)?(w.tokenize=h(y),w.stringStartCol=c.column(),w.tokenize(c,w)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(c){var w=function(y,b){for(;!y.eol();)if(y.next()==c){b.tokenize=p;break}return"string"};return w.isInAttribute=!0,w}function l(c,w){return function(y,b){for(;!y.eol();){if(y.match(w)){b.tokenize=m;break}y.next()}return c}}function f(c){return function(w,y){for(var b;(b=w.next())!=null;){if(b=="<")return y.tokenize=f(c+1),y.tokenize(w,y);if(b==">")if(c==1){y.tokenize=m;break}else return y.tokenize=f(c-1),y.tokenize(w,y)}return"meta"}}function o(c,w,y){this.prev=c.context,this.tagName=w,this.indent=c.indented,this.startOfLine=y,(K.doNotIndent.hasOwnProperty(w)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function u(c){c.context&&(c.context=c.context.prev)}function a(c,w){for(var y;;){if(!c.context)return;if(y=c.context.tagName,!K.contextGrabbers.hasOwnProperty(y)||!K.contextGrabbers[y].hasOwnProperty(w))return;u(c)}}function s(c,w,y){return c=="openTag"?(y.tagStart=w.column(),R):c=="closeTag"?_:s}function R(c,w,y){return c=="word"?(y.tagName=w.current(),v="tag",O):K.allowMissingTagName&&c=="endTag"?(v="tag bracket",O(c,w,y)):(v="error",R)}function _(c,w,y){if(c=="word"){var b=w.current();return y.context&&y.context.tagName!=b&&K.implicitlyClosed.hasOwnProperty(y.context.tagName)&&u(y),y.context&&y.context.tagName==b||K.matchClosing===!1?(v="tag",C):(v="tag error",D)}else return K.allowMissingTagName&&c=="endTag"?(v="tag bracket",C(c,w,y)):(v="error",D)}function C(c,w,y){return c!="endTag"?(v="error",C):(u(y),s)}function D(c,w,y){return v="error",C(c,w,y)}function O(c,w,y){if(c=="word")return v="attribute",A;if(c=="endTag"||c=="selfcloseTag"){var b=y.tagName,U=y.tagStart;return y.tagName=y.tagStart=null,c=="selfcloseTag"||K.autoSelfClosers.hasOwnProperty(b)?a(y,b):(a(y,b),y.context=new o(y,b,U==y.indented)),s}return v="error",O}function A(c,w,y){return c=="equals"?S:(K.allowMissing||(v="error"),O(c,w,y))}function S(c,w,y){return c=="string"?T:c=="word"&&K.allowUnquoted?(v="string",O):(v="error",O(c,w,y))}function T(c,w,y){return c=="string"?T:O(c,w,y)}return{startState:function(c){var w={tokenize:m,state:s,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(w.baseIndent=c),w},token:function(c,w){if(!w.tagName&&c.sol()&&(w.indented=c.indentation()),c.eatSpace())return null;L=null;var y=w.tokenize(c,w);return(y||L)&&y!="comment"&&(v=null,w.state=w.state(L||y,c,w),v&&(y=v=="error"?y+" error":v)),y},indent:function(c,w,y){var b=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+B;if(b&&b.noIndent)return ne.Pass;if(c.tokenize!=p&&c.tokenize!=m)return y?y.match(/^(\s*)/)[0].length:0;if(c.tagName)return K.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+B*(K.multilineTagIndentFactor||1);if(K.alignCDATA&&/<!\[CDATA\[/.test(w))return 0;var U=w&&/^<(\/)?([\w_:\.-]*)/.exec(w);if(U&&U[1])for(;b;)if(b.tagName==U[2]){b=b.prev;break}else if(K.implicitlyClosed.hasOwnProperty(b.tagName))b=b.prev;else break;else if(U)for(;b;){var F=K.contextGrabbers[b.tagName];if(F&&F.hasOwnProperty(U[2]))b=b.prev;else break}for(;b&&b.prev&&!b.startOfLine;)b=b.prev;return b?b.indent+B:c.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:K.htmlMode?"html":"xml",helperType:K.htmlMode?"html":"xml",skipAttribute:function(c){c.state==S&&(c.state=O)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var w=[],y=c.context;y;y=y.prev)y.tagName&&w.push(y.tagName);return w.reverse()}}}),ne.defineMIME("text/xml","xml"),ne.defineMIME("application/xml","xml"),ne.mimeModes.hasOwnProperty("text/html")||ne.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return J});class ne{constructor(P){this.element=P,this.next=ne.Undefined,this.prev=ne.Undefined}}ne.Undefined=new ne(void 0);class J{constructor(){this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ne.Undefined}clear(){let P=this._first;for(;P!==ne.Undefined;){const X=P.next;P.prev=ne.Undefined,P.next=ne.Undefined,P=X}this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}unshift(P){return this._insert(P,!1)}push(P){return this._insert(P,!0)}_insert(P,X){const j=new ne(P);if(this._first===ne.Undefined)this._first=j,this._last=j;else if(X){const K=this._last;this._last=j,j.prev=K,K.next=j}else{const K=this._first;this._first=j,j.next=K,K.prev=j}this._size+=1;let B=!1;return()=>{B||(B=!0,this._remove(j))}}shift(){if(this._first===ne.Undefined)return;{const P=this._first.element;return this._remove(this._first),P}}pop(){if(this._last===ne.Undefined)return;{const P=this._last.element;return this._remove(this._last),P}}_remove(P){if(P.prev!==ne.Undefined&&P.next!==ne.Undefined){const X=P.prev;X.next=P.next,P.next.prev=X}else P.prev===ne.Undefined&&P.next===ne.Undefined?(this._first=ne.Undefined,this._last=ne.Undefined):P.next===ne.Undefined?(this._last=this._last.prev,this._last.next=ne.Undefined):P.prev===ne.Undefined&&(this._first=this._first.next,this._first.prev=ne.Undefined);this._size-=1}*[Symbol.iterator](){let P=this._first;for(;P!==ne.Undefined;)yield P.element,P=P.next}}},"3/fG":function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return J});function ne(P,X){let j;return X.length===0?j=P:j=P.replace(/\{(\d+)\}/g,function(B,K){const G=K[0];return typeof X[G]!="undefined"?X[G]:B}),j}function J(P,X,...j){return ne(X,j)}},"55Ip":function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return a});var ne=Z("Ty5D"),J=Z("dI71"),P=Z("q1tI"),X=Z.n(P),j=Z("YS25"),B=Z("17x9"),K=Z.n(B),G=Z("wx14"),r=Z("zLVn"),L=Z("9R94"),v=function(S){Object(J.a)(T,S);function T(){for(var w,y=arguments.length,b=new Array(y),U=0;U<y;U++)b[U]=arguments[U];return w=S.call.apply(S,[this].concat(b))||this,w.history=Object(j.a)(w.props),w}var c=T.prototype;return c.render=function(){return X.a.createElement(ne.c,{history:this.history,children:this.props.children})},T}(X.a.Component),m=function(S){Object(J.a)(T,S);function T(){for(var w,y=arguments.length,b=new Array(y),U=0;U<y;U++)b[U]=arguments[U];return w=S.call.apply(S,[this].concat(b))||this,w.history=Object(j.b)(w.props),w}var c=T.prototype;return c.render=function(){return X.a.createElement(ne.c,{history:this.history,children:this.props.children})},T}(X.a.Component),p=function(T,c){return typeof T=="function"?T(c):T},h=function(T,c){return typeof T=="string"?Object(j.c)(T,null,null,c):T},l=function(T){return T},f=X.a.forwardRef;typeof f=="undefined"&&(f=l);function o(S){return!!(S.metaKey||S.altKey||S.ctrlKey||S.shiftKey)}var u=f(function(S,T){var c=S.innerRef,w=S.navigate,y=S.onClick,b=Object(r.a)(S,["innerRef","navigate","onClick"]),U=b.target,F=Object(G.a)({},b,{onClick:function(N){try{y&&y(N)}catch(I){throw N.preventDefault(),I}!N.defaultPrevented&&N.button===0&&(!U||U==="_self")&&!o(N)&&(N.preventDefault(),w())}});return l!==f?F.ref=T||c:F.ref=c,X.a.createElement("a",F)}),a=f(function(S,T){var c=S.component,w=c===void 0?u:c,y=S.replace,b=S.to,U=S.innerRef,F=Object(r.a)(S,["component","replace","to","innerRef"]);return X.a.createElement(ne.e.Consumer,null,function(E){E||Object(L.a)(!1);var N=E.history,I=h(p(b,E.location),E.location),g=I?N.createHref(I):"",H=Object(G.a)({},F,{href:g,navigate:function(){var ie=p(b,E.location),oe=y?N.replace:N.push;oe(ie)}});return l!==f?H.ref=T||U:H.innerRef=U,X.a.createElement(w,H)})});if(!1)var s,R;var _=function(T){return T},C=X.a.forwardRef;typeof C=="undefined"&&(C=_);function D(){for(var S=arguments.length,T=new Array(S),c=0;c<S;c++)T[c]=arguments[c];return T.filter(function(w){return w}).join(" ")}var O=C(function(S,T){var c=S["aria-current"],w=c===void 0?"page":c,y=S.activeClassName,b=y===void 0?"active":y,U=S.activeStyle,F=S.className,E=S.exact,N=S.isActive,I=S.location,g=S.sensitive,H=S.strict,$=S.style,ie=S.to,oe=S.innerRef,Ce=Object(r.a)(S,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return X.a.createElement(ne.e.Consumer,null,function(ve){ve||Object(L.a)(!1);var Se=I||ve.location,Ae=h(p(ie,Se),Se),Oe=Ae.pathname,he=Oe&&Oe.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ce=he?Object(ne.f)(Se.pathname,{path:he,exact:E,sensitive:g,strict:H}):null,re=!!(N?N(ce,Se):ce),fe=re?D(F,b):F,se=re?Object(G.a)({},$,{},U):$,ke=Object(G.a)({"aria-current":re&&w||null,className:fe,style:se,to:Ae},Ce);return _!==C?ke.ref=T||oe:ke.innerRef=oe,X.a.createElement(a,ke)})});if(!1)var A},"5VLF":function(nt,xe,Z){"use strict";var ne,J;function P(X,j,B){var K=function(G,r){return X.js_beautify(G,r)};return K.js=X.js_beautify,K.css=j.css_beautify,K.html=B.html_beautify,K.js_beautify=X.js_beautify,K.css_beautify=j.css_beautify,K.html_beautify=B.html_beautify,K}!(ne=[Z("6UM0"),Z("TXwP"),Z("psGv")],J=function(X,j,B){return P(X,j,B)}.apply(xe,ne),J!==void 0&&(nt.exports=J))},"5Y4S":function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return P});var ne=Z("MNsG");const J=ne.b.performance&&typeof ne.b.performance.now=="function";class P{constructor(X){this._highResolution=J&&X,this._startTime=this._now(),this._stopTime=-1}static create(X=!0){return new P(X)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?ne.b.performance.now():Date.now()}}},"6UM0":function(nt,xe,Z){var ne,J;(function(){var P;(function(){"use strict";var j=[function(r,L,v){var m=v(1).Beautifier,p=v(5).Options;function h(l,f){var o=new m(l,f);return o.beautify()}r.exports=h,r.exports.defaultOptions=function(){return new p}},function(r,L,v){var m=v(2).Output,p=v(3).Token,h=v(4),l=v(5).Options,f=v(7).Tokenizer,o=v(7).line_starters,u=v(7).positionable_operators,a=v(7).TOKEN;function s(g,H){return H.indexOf(g)!==-1}function R(g){return g.replace(/^\s+/g,"")}function _(g){for(var H={},$=0;$<g.length;$++)H[g[$].replace(/-/g,"_")]=g[$];return H}function C(g,H){return g&&g.type===a.RESERVED&&g.text===H}function D(g,H){return g&&g.type===a.RESERVED&&s(g.text,H)}var O=["case","return","do","if","throw","else","await","break","continue","async"],A=["before-newline","after-newline","preserve-newline"],S=_(A),T=[S.before_newline,S.preserve_newline],c={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function w(g,H){if(H.multiline_frame||H.mode===c.ForInitializer||H.mode===c.Conditional)return;g.remove_indent(H.start_line_index)}function y(g){g=g.replace(h.allLineBreaks,`
`);for(var H=[],$=g.indexOf(`
`);$!==-1;)H.push(g.substring(0,$)),g=g.substring($+1),$=g.indexOf(`
`);return g.length&&H.push(g),H}function b(g){return g===c.ArrayLiteral}function U(g){return s(g,[c.Expression,c.ForInitializer,c.Conditional])}function F(g,H){for(var $=0;$<g.length;$++){var ie=g[$].trim();if(ie.charAt(0)!==H)return!1}return!0}function E(g,H){for(var $=0,ie=g.length,oe;$<ie;$++)if(oe=g[$],oe&&oe.indexOf(H)!==0)return!1;return!0}function N(g,H){H=H||{},this._source_text=g||"",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 l(H)}N.prototype.create_flags=function(g,H){var $=0;g&&($=g.indentation_level,!this._output.just_added_newline()&&g.line_indent_level>$&&($=g.line_indent_level));var ie={mode:H,parent:g,last_token:g?g.last_token:new p(a.START_BLOCK,""),last_word:g?g.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:$,alignment:0,line_indent_level:g?g.line_indent_level:$,start_line_index:this._output.get_line_number(),ternary_depth:0};return ie},N.prototype._reset=function(g){var H=g.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,H),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(c.BlockStatement);var $=new f(g,this._options);return this._tokens=$.tokenize(),g},N.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var g,H=this._reset(this._source_text),$=this._options.eol;this._options.eol==="auto"&&($=`
`,H&&h.lineBreak.test(H||"")&&($=H.match(h.lineBreak)[0]));for(var ie=this._tokens.next();ie;)this.handle_token(ie),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ie,ie=this._tokens.next();return g=this._output.get_code($),g},N.prototype.handle_token=function(g,H){g.type===a.START_EXPR?this.handle_start_expr(g):g.type===a.END_EXPR?this.handle_end_expr(g):g.type===a.START_BLOCK?this.handle_start_block(g):g.type===a.END_BLOCK?this.handle_end_block(g):g.type===a.WORD?this.handle_word(g):g.type===a.RESERVED?this.handle_word(g):g.type===a.SEMICOLON?this.handle_semicolon(g):g.type===a.STRING?this.handle_string(g):g.type===a.EQUALS?this.handle_equals(g):g.type===a.OPERATOR?this.handle_operator(g):g.type===a.COMMA?this.handle_comma(g):g.type===a.BLOCK_COMMENT?this.handle_block_comment(g,H):g.type===a.COMMENT?this.handle_comment(g,H):g.type===a.DOT?this.handle_dot(g):g.type===a.EOF?this.handle_eof(g):g.type===a.UNKNOWN?this.handle_unknown(g,H):this.handle_unknown(g,H)},N.prototype.handle_whitespace_and_comments=function(g,H){var $=g.newlines,ie=this._options.keep_array_indentation&&b(this._flags.mode);if(g.comments_before)for(var oe=g.comments_before.next();oe;)this.handle_whitespace_and_comments(oe,H),this.handle_token(oe,H),oe=g.comments_before.next();if(ie)for(var Ce=0;Ce<$;Ce+=1)this.print_newline(Ce>0,H);else if(this._options.max_preserve_newlines&&$>this._options.max_preserve_newlines&&($=this._options.max_preserve_newlines),this._options.preserve_newlines&&$>1){this.print_newline(!1,H);for(var ve=1;ve<$;ve+=1)this.print_newline(!0,H)}};var I=["async","break","continue","return","throw","yield"];N.prototype.allow_wrap_or_preserved_newline=function(g,H){if(H=H===void 0?!1:H,this._output.just_added_newline())return;var $=this._options.preserve_newlines&&g.newlines||H,ie=s(this._flags.last_token.text,u)||s(g.text,u);if(ie){var oe=s(this._flags.last_token.text,u)&&s(this._options.operator_position,T)||s(g.text,u);$=$&&oe}if($)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(D(this._flags.last_token,I))return;this._output.set_wrap_point()}},N.prototype.print_newline=function(g,H){if(!H&&(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 $=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&C($,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(g)&&(this._flags.multiline_frame=!0)},N.prototype.print_token_line_indentation=function(g){this._output.just_added_newline()&&(this._options.keep_array_indentation&&g.newlines&&(g.text==="["||b(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(g.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))},N.prototype.print_token=function(g){if(this._output.raw){this._output.add_raw_token(g);return}if(this._options.comma_first&&g.previous&&g.previous.type===a.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var H=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(H),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(g),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(g),this._output.non_breaking_space=!0,this._output.add_token(g.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},N.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},N.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))},N.prototype.set_mode=function(g){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,g),this._flags=this.create_flags(this._previous_flags,g),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},N.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&&w(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},N.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||D(this._flags.last_token,["get","set"]))},N.prototype.start_of_statement=function(g){var H=!1;return H=H||D(this._flags.last_token,["var","let","const"])&&g.type===a.WORD,H=H||C(this._flags.last_token,"do"),H=H||!(this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement)&&D(this._flags.last_token,I)&&!g.newlines,H=H||C(this._flags.last_token,"else")&&!(C(g,"if")&&!g.comments_before),H=H||this._flags.last_token.type===a.END_EXPR&&(this._previous_flags.mode===c.ForInitializer||this._previous_flags.mode===c.Conditional),H=H||this._flags.last_token.type===a.WORD&&this._flags.mode===c.BlockStatement&&!this._flags.in_case&&!(g.text==="--"||g.text==="++")&&this._last_last_text!=="function"&&g.type!==a.WORD&&g.type!==a.RESERVED,H=H||this._flags.mode===c.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||D(this._flags.last_token,["get","set"])),H?(this.set_mode(c.Statement),this.indent(),this.handle_whitespace_and_comments(g,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g,D(g,["do","for","if","while"])),!0):!1},N.prototype.handle_start_expr=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g);var H=c.Expression;if(g.text==="["){if(this._flags.last_token.type===a.WORD||this._flags.last_token.text===")"){D(this._flags.last_token,o)&&(this._output.space_before_token=!0),this.print_token(g),this.set_mode(H),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}H=c.ArrayLiteral,b(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,H=c.ForInitializer):s(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,H=c.Conditional):s(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&g.whitespace_before===""?this._output.space_before_token=!1:(s(this._flags.last_token.text,o)||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(g);else if(this._flags.last_token.type===a.WORD){this._output.space_before_token=!1;var $=this._tokens.peek(-3);if(this._options.space_after_named_function&&$){var ie=this._tokens.peek(-4);D($,["async","function"])||$.text==="*"&&D(ie,["async","function"])?this._output.space_before_token=!0:this._flags.mode===c.ObjectLiteral?($.text==="{"||$.text===","||$.text==="*"&&(ie.text==="{"||ie.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(g);(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(g,g.newlines),this.print_token(g),this.set_mode(H),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},N.prototype.handle_end_expr=function(g){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(g),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(g,g.text==="]"&&b(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(g),this.restore_mode(),w(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)},N.prototype.handle_start_block=function(g){this.handle_whitespace_and_comments(g);var H=this._tokens.peek(),$=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):$&&(s($.text,[":",","])&&s(H.type,[a.STRING,a.WORD,a.RESERVED])||s(H.text,["get","set","..."])&&s($.type,[a.WORD,a.RESERVED]))?s(this._last_last_text,["class","interface"])&&!s($.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])||D(this._flags.last_token,["return","throw","import","default"])?this.set_mode(c.ObjectLiteral):this.set_mode(c.BlockStatement),this._flags.last_token&&(D(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ie=!H.comments_before&&H.text==="}",oe=ie&&this._flags.last_word==="function"&&this._flags.last_token.type===a.END_EXPR;if(this._options.brace_preserve_inline){var Ce=0,ve=null;this._flags.inline_frame=!0;do if(Ce+=1,ve=this._tokens.peek(Ce-1),ve.newlines){this._flags.inline_frame=!1;break}while(ve.type!==a.EOF&&!(ve.type===a.END_BLOCK&&ve.opened===g))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&g.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==a.OPERATOR&&(oe||this._flags.last_token.type===a.EQUALS||D(this._flags.last_token,O)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(b(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(g),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(g),this.indent(),!ie&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},N.prototype.handle_end_block=function(g){for(this.handle_whitespace_and_comments(g);this._flags.mode===c.Statement;)this.restore_mode();var H=this._flags.last_token.type===a.START_BLOCK;this._flags.inline_frame&&!H?this._output.space_before_token=!0:this._options.brace_style==="expand"?H||this.print_newline():H||(b(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(g)},N.prototype.handle_word=function(g){if(g.type===a.RESERVED){if(s(g.text,["set","get"])&&this._flags.mode!==c.ObjectLiteral)g.type=a.WORD;else if(g.text==="import"&&s(this._tokens.peek().text,["(","."]))g.type=a.WORD;else if(s(g.text,["as","from"])&&!this._flags.import_block)g.type=a.WORD;else if(this._flags.mode===c.ObjectLiteral){var H=this._tokens.peek();H.text===":"&&(g.type=a.WORD)}}if(this.start_of_statement(g)?D(this._flags.last_token,["var","let","const"])&&g.type===a.WORD&&(this._flags.declaration_statement=!0):g.newlines&&!U(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||!D(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(g),this.print_newline()):this.handle_whitespace_and_comments(g),this._flags.do_block&&!this._flags.do_while)if(C(g,"while")){this._output.space_before_token=!0,this.print_token(g),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&&C(g,"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&&D(g,["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(g),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(g)),C(g,"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()&&!g.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD?D(this._flags.last_token,["get","set","new","export"])||D(this._flags.last_token,I)?this._output.space_before_token=!0:C(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&&(U(this._flags.mode)||b(this._flags.mode))||this.print_newline(),this.print_token(g),this._flags.last_word=g.text;return}var $="NONE";if(this._flags.last_token.type===a.END_BLOCK?this._previous_flags.inline_frame?$="SPACE":D(g,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&g.newlines?$="NEWLINE":($="SPACE",this._output.space_before_token=!0):$="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&this._flags.mode===c.BlockStatement?$="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&U(this._flags.mode)?$="SPACE":this._flags.last_token.type===a.STRING?$="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,["{",","]))?$="SPACE":this._flags.last_token.type===a.START_BLOCK?this._flags.inline_frame?$="SPACE":$="NEWLINE":this._flags.last_token.type===a.END_EXPR&&(this._output.space_before_token=!0,$="NEWLINE"),D(g,o)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?$="SPACE":$="NEWLINE"),D(g,["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"&&g.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ie=this._output.current_line;ie.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else $==="NEWLINE"?D(this._flags.last_token,O)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&D(g,["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||!D(g,["var","let","const"]))&&this._flags.last_token.text!==":"&&(C(g,"if")&&C(g.previous,"else")?this._output.space_before_token=!0:this.print_newline()):D(g,o)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&b(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():$==="SPACE"&&(this._output.space_before_token=!0);g.previous&&(g.previous.type===a.WORD||g.previous.type===a.RESERVED)&&(this._output.space_before_token=!0),this.print_token(g),this._flags.last_word=g.text,g.type===a.RESERVED&&(g.text==="do"?this._flags.do_block=!0:g.text==="if"?this._flags.if_block=!0:g.text==="import"?this._flags.import_block=!0:this._flags.import_block&&C(g,"from")&&(this._flags.import_block=!1))},N.prototype.handle_semicolon=function(g){this.start_of_statement(g)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(g);for(var H=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&C(H,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(g)},N.prototype.handle_string=function(g){g.text.startsWith("`")&&g.newlines===0&&g.whitespace_before===""&&(g.previous.text===")"||this._flags.last_token.type===a.WORD)||(this.start_of_statement(g)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(g),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(g):g.text.startsWith("`")&&this._flags.last_token.type===a.END_EXPR&&(g.previous.text==="]"||g.previous.text===")")&&g.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(g)},N.prototype.handle_equals=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0},N.prototype.handle_comma=function(g){this.handle_whitespace_and_comments(g,!0),this.print_token(g),this._output.space_before_token=!0,this._flags.declaration_statement?(U(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(g)):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(g)},N.prototype.handle_operator=function(g){var H=g.text==="*"&&(D(this._flags.last_token,["function","yield"])||s(this._flags.last_token.type,[a.START_BLOCK,a.COMMA,a.END_BLOCK,a.SEMICOLON])),$=s(g.text,["-","+"])&&(s(this._flags.last_token.type,[a.START_BLOCK,a.START_EXPR,a.EQUALS,a.OPERATOR])||s(this._flags.last_token.text,o)||this._flags.last_token.text===",");if(!this.start_of_statement(g)){var ie=!H;this.handle_whitespace_and_comments(g,ie)}if(g.text==="*"&&this._flags.last_token.type===a.DOT){this.print_token(g);return}if(g.text==="::"){this.print_token(g);return}if(this._flags.last_token.type===a.OPERATOR&&s(this._options.operator_position,T)&&this.allow_wrap_or_preserved_newline(g),g.text===":"&&this._flags.in_case){this.print_token(g),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 oe=!0,Ce=!0,ve=!1;if(g.text===":"?this._flags.ternary_depth===0?oe=!1:(this._flags.ternary_depth-=1,ve=!0):g.text==="?"&&(this._flags.ternary_depth+=1),!$&&!H&&this._options.preserve_newlines&&s(g.text,u)){var Se=g.text===":",Ae=Se&&ve,Oe=Se&&!ve;switch(this._options.operator_position){case S.before_newline:this._output.space_before_token=!Oe,this.print_token(g),(!Se||Ae)&&this.allow_wrap_or_preserved_newline(g),this._output.space_before_token=!0;return;case S.after_newline:this._output.space_before_token=!0,!Se||Ae?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(g):this._output.space_before_token=!1,this.print_token(g),this._output.space_before_token=!0;return;case S.preserve_newline:Oe||this.allow_wrap_or_preserved_newline(g),oe=!(this._output.just_added_newline()||Oe),this._output.space_before_token=oe,this.print_token(g),this._output.space_before_token=!0;return}}if(H){this.allow_wrap_or_preserved_newline(g),oe=!1;var he=this._tokens.peek();Ce=he&&s(he.type,[a.WORD,a.RESERVED])}else if(g.text==="...")this.allow_wrap_or_preserved_newline(g),oe=this._flags.last_token.type===a.START_BLOCK,Ce=!1;else if(s(g.text,["--","++","!","~"])||$){if((this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR)&&this.allow_wrap_or_preserved_newline(g),oe=!1,Ce=!1,g.newlines&&(g.text==="--"||g.text==="++"||g.text==="~")){var ce=D(this._flags.last_token,O)&&g.newlines;ce&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ce,!0)}this._flags.last_token.text===";"&&U(this._flags.mode)&&(oe=!0),this._flags.last_token.type===a.RESERVED?oe=!0:this._flags.last_token.type===a.END_EXPR?oe=!(this._flags.last_token.text==="]"&&(g.text==="--"||g.text==="++")):this._flags.last_token.type===a.OPERATOR&&(oe=s(g.text,["--","-","++","+"])&&s(this._flags.last_token.text,["--","-","++","+"]),s(g.text,["+","-"])&&s(this._flags.last_token.text,["--","++"])&&(Ce=!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||oe,this.print_token(g),this._output.space_before_token=Ce},N.prototype.handle_block_comment=function(g,H){if(this._output.raw){this._output.add_raw_token(g),g.directives&&g.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(g.directives){this.print_newline(!1,H),this.print_token(g),g.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!h.newline.test(g.text)&&!g.newlines){this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0;return}else this.print_block_commment(g,H)},N.prototype.print_block_commment=function(g,H){var $=y(g.text),ie,oe=!1,Ce=!1,ve=g.whitespace_before,Se=ve.length;if(this.print_newline(!1,H),this.print_token_line_indentation(g),this._output.add_token($[0]),this.print_newline(!1,H),$.length>1){for($=$.slice(1),oe=F($,"*"),Ce=E($,ve),oe&&(this._flags.alignment=1),ie=0;ie<$.length;ie++)oe?(this.print_token_line_indentation(g),this._output.add_token(R($[ie]))):Ce&&$[ie]?(this.print_token_line_indentation(g),this._output.add_token($[ie].substring(Se))):(this._output.current_line.set_indent(-1),this._output.add_token($[ie])),this.print_newline(!1,H);this._flags.alignment=0}},N.prototype.handle_comment=function(g,H){g.newlines?this.print_newline(!1,H):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(g),this.print_newline(!1,H)},N.prototype.handle_dot=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),D(this._flags.last_token,O)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(g,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(g)},N.prototype.handle_unknown=function(g,H){this.print_token(g),g.text[g.text.length-1]===`
`&&this.print_newline(!1,H)},N.prototype.handle_eof=function(g){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(g)},r.exports.Beautifier=N},function(r){function L(p){this.__parent=p,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=[]}L.prototype.clone_empty=function(){var p=new L(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},L.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},L.prototype.has_match=function(p){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(p))return!0;return!1},L.prototype.set_indent=function(p,h){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},L.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)},L.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},L.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},L.prototype.is_empty=function(){return this.__items.length===0},L.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},L.prototype.push=function(p){this.__items.push(p);var h=p.lastIndexOf(`
`);h!==-1?this.__character_count=p.length-h:this.__character_count+=p.length},L.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},L.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},L.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},L.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},L.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function v(p,h){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),h=h||"",p.indent_level>0&&(h=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}v.prototype.get_indent_size=function(p,h){var l=this.__base_string_length;return h=h||0,p<0&&(l=0),l+=p*this.__indent_size,l+=h,l},v.prototype.get_indent_string=function(p,h){var l=this.__base_string;return h=h||0,p<0&&(p=0,l=""),h+=p*this.__indent_size,this.__ensure_cache(h),l+=this.__cache[h],l},v.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var p=this.__cache.length,h=0,l="";this.__indent_size&&p>=this.__indent_size&&(h=Math.floor(p/this.__indent_size),p-=h*this.__indent_size,l=new Array(h+1).join(this.__indent_string)),p&&(l+=new Array(p+1).join(" ")),this.__cache.push(l)};function m(p,h){this.__indent_cache=new v(p,h),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new L(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(p,h){return this.__indent_cache.get_indent_string(p,h)},m.prototype.get_indent_size=function(p,h){return this.__indent_cache.get_indent_size(p,h)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(p){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 l=this.__lines.join(`
`);return p!==`
`&&(l=l.replace(/[\n]/g,p)),l},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,h){return p=p||0,h=h||0,this.next_line.set_indent(p,h),this.__lines.length>1?(this.current_line.set_indent(p,h),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var h=0;h<p.newlines;h++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.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(" "))},m.prototype.remove_indent=function(p){for(var h=this.__lines.length;p<h;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&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},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(p,h){for(var l=this.__lines.length-2;l>=0;){var f=this.__lines[l];if(f.is_empty())break;if(f.item(0).indexOf(p)!==0&&f.item(-1)!==h){this.__lines.splice(l+1,0,new L(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},r.exports.Output=m},function(r){function L(v,m,p,h){this.type=v,this.text=m,this.comments_before=null,this.newlines=p||0,this.whitespace_before=h||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}r.exports.Token=L},function(r,L){var v="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\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",l="(?:\\\\u[0-9a-fA-F]{4}|["+v+p+"])",f="(?:\\\\u[0-9a-fA-F]{4}|["+m+p+h+"])*";L.identifier=new RegExp(l+f,"g"),L.identifierStart=new RegExp(l),L.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+p+h+"])+");var o=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;L.newline=/[\n\r\u2028\u2029]/,L.lineBreak=new RegExp(`\r
|`+L.newline.source),L.allLineBreaks=new RegExp(L.lineBreak.source,"g")},function(r,L,v){var m=v(6).Options,p=["before-newline","after-newline","preserve-newline"];function h(l){m.call(this,l,"js");var f=this.raw_options.brace_style||null;f==="expand-strict"?this.raw_options.brace_style="expand":f==="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 o=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<o.length;u++)o[u]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=o[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",p),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}h.prototype=new m,r.exports.Options=h},function(r){function L(p,h){this.raw_options=v(p,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"])}L.prototype._get_array=function(p,h){var l=this.raw_options[p],f=h||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(f=l.concat()):typeof l=="string"&&(f=l.split(/[^a-zA-Z0-9_\/\-]+/)),f},L.prototype._get_boolean=function(p,h){var l=this.raw_options[p],f=l===void 0?!!h:!!l;return f},L.prototype._get_characters=function(p,h){var l=this.raw_options[p],f=h||"";return typeof l=="string"&&(f=l.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),f},L.prototype._get_number=function(p,h){var l=this.raw_options[p];h=parseInt(h,10),isNaN(h)&&(h=0);var f=parseInt(l,10);return isNaN(f)&&(f=h),f},L.prototype._get_selection=function(p,h,l){var f=this._get_selection_list(p,h,l);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
`+h+`
You passed in: '`+this.raw_options[p]+"'");return f[0]},L.prototype._get_selection_list=function(p,h,l){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[h[0]],!this._is_valid_selection(l,h))throw new Error("Invalid Default Value!");var f=this._get_array(p,l);if(!this._is_valid_selection(f,h))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
`+h+`
You passed in: '`+this.raw_options[p]+"'");return f},L.prototype._is_valid_selection=function(p,h){return p.length&&h.length&&!p.some(function(l){return h.indexOf(l)===-1})};function v(p,h){var l={};p=m(p);var f;for(f in p)f!==h&&(l[f]=p[f]);if(h&&p[h])for(f in p[h])l[f]=p[h][f];return l}function m(p){var h={},l;for(l in p){var f=l.replace(/-/g,"_");h[f]=p[l]}return h}r.exports.Options=L,r.exports.normalizeOpts=m,r.exports.mergeOpts=v},function(r,L,v){var m=v(8).InputScanner,p=v(9).Tokenizer,h=v(9).TOKEN,l=v(13).Directives,f=v(4),o=v(12).Pattern,u=v(14).TemplatablePattern;function a(F,E){return E.indexOf(F)!==-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},R=new l(/\/\*/,/\*\//),_=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,C=/[0-9]/,D=/[^\d\.]/,O=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),A=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";A=A.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),A="\\?\\.(?!\\d) "+A,A=A.replace(/ /g,"|");var S=new RegExp(A),T="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),c=T.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),w=new RegExp("^(?:"+c.join("|")+")$"),y,b=function(F,E){p.call(this,F,E),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var N=new o(this._input),I=new u(this._input).read_options(this._options);this.__patterns={template:I,identifier:I.starting_with(f.identifier).matching(f.identifierMatch),number:N.matching(_),punct:N.matching(S),comment:N.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:N.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:N.matching(/<!--/),html_comment_end:N.matching(/-->/),include:N.starting_with(/#include/).until_after(f.lineBreak),shebang:N.starting_with(/#!/).until_after(f.lineBreak),xml:N.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:I.until(/['\\\n\r\u2028\u2029]/),double_quote:I.until(/["\\\n\r\u2028\u2029]/),template_text:I.until(/[`\\$]/),template_expression:I.until(/[`}\\]/)}};b.prototype=new p,b.prototype._is_comment=function(F){return F.type===s.COMMENT||F.type===s.BLOCK_COMMENT||F.type===s.UNKNOWN},b.prototype._is_opening=function(F){return F.type===s.START_BLOCK||F.type===s.START_EXPR},b.prototype._is_closing=function(F,E){return(F.type===s.END_BLOCK||F.type===s.END_EXPR)&&E&&(F.text==="]"&&E.text==="["||F.text===")"&&E.text==="("||F.text==="}"&&E.text==="{")},b.prototype._reset=function(){y=!1},b.prototype._get_next_token=function(F,E){var N=null;this._readWhitespace();var I=this._input.peek();return I===null?this._create_token(s.EOF,""):(N=N||this._read_non_javascript(I),N=N||this._read_string(I),N=N||this._read_word(F),N=N||this._read_singles(I),N=N||this._read_comment(I),N=N||this._read_regexp(I,F),N=N||this._read_xml(I,F),N=N||this._read_punctuation(),N=N||this._create_token(s.UNKNOWN,this._input.next()),N)},b.prototype._read_word=function(F){var E;if(E=this.__patterns.identifier.read(),E!=="")return E=E.replace(f.allLineBreaks,`
`),!(F.type===s.DOT||F.type===s.RESERVED&&(F.text==="set"||F.text==="get"))&&w.test(E)?(E==="in"||E==="of")&&(F.type===s.WORD||F.type===s.STRING)?this._create_token(s.OPERATOR,E):this._create_token(s.RESERVED,E):this._create_token(s.WORD,E);if(E=this.__patterns.number.read(),E!=="")return this._create_token(s.WORD,E)},b.prototype._read_singles=function(F){var E=null;return F==="("||F==="["?E=this._create_token(s.START_EXPR,F):F===")"||F==="]"?E=this._create_token(s.END_EXPR,F):F==="{"?E=this._create_token(s.START_BLOCK,F):F==="}"?E=this._create_token(s.END_BLOCK,F):F===";"?E=this._create_token(s.SEMICOLON,F):F==="."&&D.test(this._input.peek(1))?E=this._create_token(s.DOT,F):F===","&&(E=this._create_token(s.COMMA,F)),E&&this._input.next(),E},b.prototype._read_punctuation=function(){var F=this.__patterns.punct.read();if(F!=="")return F==="="?this._create_token(s.EQUALS,F):F==="?."?this._create_token(s.DOT,F):this._create_token(s.OPERATOR,F)},b.prototype._read_non_javascript=function(F){var E="";if(F==="#"){if(this._is_first_token()&&(E=this.__patterns.shebang.read(),E))return this._create_token(s.UNKNOWN,E.trim()+`
`);if(E=this.__patterns.include.read(),E)return this._create_token(s.UNKNOWN,E.trim()+`
`);F=this._input.next();var N="#";if(this._input.hasNext()&&this._input.testChar(C)){do F=this._input.next(),N+=F;while(this._input.hasNext()&&F!=="#"&&F!=="=");return F==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(N+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(N+="{}",this._input.next(),this._input.next())),this._create_token(s.WORD,N)}this._input.back()}else if(F==="<"&&this._is_first_token()){if(E=this.__patterns.html_comment_start.read(),E){for(;this._input.hasNext()&&!this._input.testChar(f.newline);)E+=this._input.next();return y=!0,this._create_token(s.COMMENT,E)}}else if(y&&F==="-"&&(E=this.__patterns.html_comment_end.read(),E))return y=!1,this._create_token(s.COMMENT,E);return null},b.prototype._read_comment=function(F){var E=null;if(F==="/"){var N="";if(this._input.peek(1)==="*"){N=this.__patterns.block_comment.read();var I=R.get_directives(N);I&&I.ignore==="start"&&(N+=R.readIgnored(this._input)),N=N.replace(f.allLineBreaks,`
`),E=this._create_token(s.BLOCK_COMMENT,N),E.directives=I}else this._input.peek(1)==="/"&&(N=this.__patterns.comment.read(),E=this._create_token(s.COMMENT,N))}return E},b.prototype._read_string=function(F){if(F==="`"||F==="'"||F==='"'){var E=this._input.next();return this.has_char_escapes=!1,F==="`"?E+=this._read_string_recursive("`",!0,"${"):E+=this._read_string_recursive(F),this.has_char_escapes&&this._options.unescape_strings&&(E=U(E)),this._input.peek()===F&&(E+=this._input.next()),E=E.replace(f.allLineBreaks,`
`),this._create_token(s.STRING,E)}return null},b.prototype._allow_regexp_or_xml=function(F){return F.type===s.RESERVED&&a(F.text,["return","case","throw","else","do","typeof","yield"])||F.type===s.END_EXPR&&F.text===")"&&F.opened.previous.type===s.RESERVED&&a(F.opened.previous.text,["if","while","for"])||a(F.type,[s.COMMENT,s.START_EXPR,s.START_BLOCK,s.START,s.END_BLOCK,s.OPERATOR,s.EQUALS,s.EOF,s.SEMICOLON,s.COMMA])},b.prototype._read_regexp=function(F,E){if(F==="/"&&this._allow_regexp_or_xml(E)){for(var N=this._input.next(),I=!1,g=!1;this._input.hasNext()&&(I||g||this._input.peek()!==F)&&!this._input.testChar(f.newline);)N+=this._input.peek(),I?I=!1:(I=this._input.peek()==="\\",this._input.peek()==="["?g=!0:this._input.peek()==="]"&&(g=!1)),this._input.next();return this._input.peek()===F&&(N+=this._input.next(),N+=this._input.read(f.identifier)),this._create_token(s.STRING,N)}return null},b.prototype._read_xml=function(F,E){if(this._options.e4x&&F==="<"&&this._allow_regexp_or_xml(E)){var N="",I=this.__patterns.xml.read_match();if(I){for(var g=I[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),H=g.indexOf("{")===0,$=0;I;){var ie=!!I[1],oe=I[2],Ce=!!I[I.length-1]||oe.slice(0,8)==="![CDATA[";if(!Ce&&(oe===g||H&&oe.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ie?--$:++$),N+=I[0],$<=0)break;I=this.__patterns.xml.read_match()}return I||(N+=this._input.match(/[\s\S]*/g)[0]),N=N.replace(f.allLineBreaks,`
`),this._create_token(s.STRING,N)}}return null};function U(F){for(var E="",N=0,I=new m(F),g=null;I.hasNext();)if(g=I.match(/([\s]|[^\\]|\\\\)+/g),g&&(E+=g[0]),I.peek()==="\\"){if(I.next(),I.peek()==="x")g=I.match(/x([0-9A-Fa-f]{2})/g);else if(I.peek()==="u")g=I.match(/u([0-9A-Fa-f]{4})/g);else{E+="\\",I.hasNext()&&(E+=I.next());continue}if(!g)return F;if(N=parseInt(g[1],16),N>126&&N<=255&&g[0].indexOf("x")===0)return F;if(N>=0&&N<32){E+="\\"+g[0];continue}else N===34||N===39||N===92?E+="\\"+String.fromCharCode(N):E+=String.fromCharCode(N)}return E}b.prototype._read_string_recursive=function(F,E,N){var I,g;F==="'"?g=this.__patterns.single_quote:F==='"'?g=this.__patterns.double_quote:F==="`"?g=this.__patterns.template_text:F==="}"&&(g=this.__patterns.template_expression);for(var H=g.read(),$="";this._input.hasNext();){if($=this._input.next(),$===F||!E&&f.newline.test($)){this._input.back();break}else $==="\\"&&this._input.hasNext()?(I=this._input.peek(),I==="x"||I==="u"?this.has_char_escapes=!0:I==="\r"&&this._input.peek(1)===`
`&&this._input.next(),$+=this._input.next()):N&&(N==="${"&&$==="$"&&this._input.peek()==="{"&&($+=this._input.next()),N===$&&(F==="`"?$+=this._read_string_recursive("}",E,"`"):$+=this._read_string_recursive("`",E,"${"),this._input.hasNext()&&($+=this._input.next())));$+=g.read(),H+=$}return H},r.exports.Tokenizer=b,r.exports.TOKEN=s,r.exports.positionable_operators=O.slice(),r.exports.line_starters=T.slice()},function(r){var L=RegExp.prototype.hasOwnProperty("sticky");function v(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position<this.__input_length},v.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},v.prototype.peek=function(m){var p=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(p=this.__input.charAt(m)),p},v.prototype.__match=function(m,p){m.lastIndex=p;var h=m.exec(this.__input);return h&&!(L&&m.sticky)&&(h.index!==p&&(h=null)),h},v.prototype.test=function(m,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(m,p):!1},v.prototype.testChar=function(m,p){var h=this.peek(p);return m.lastIndex=0,h!==null&&m.test(h)},v.prototype.match=function(m){var p=this.__match(m,this.__position);return p?this.__position+=p[0].length:p=null,p},v.prototype.read=function(m,p,h){var l="",f;return m&&(f=this.match(m),f&&(l+=f[0])),p&&(f||!m)&&(l+=this.readUntil(p,h)),l},v.prototype.readUntil=function(m,p){var h="",l=this.__position;m.lastIndex=this.__position;var f=m.exec(this.__input);return f?(l=f.index,p&&(l+=f[0].length)):l=this.__input_length,h=this.__input.substring(this.__position,l),this.__position=l,h},v.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},v.prototype.get_regexp=function(m,p){var h=null,l="g";return p&&L&&(l="y"),typeof m=="string"&&m!==""?h=new RegExp(m,l):m&&(h=new RegExp(m.source,l)),h},v.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(m){var p=this.__position,h=this.readUntilAfter(m);return this.__position=p,h},v.prototype.lookBack=function(m){var p=this.__position-1;return p>=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},r.exports.InputScanner=v},function(r,L,v){var m=v(8).InputScanner,p=v(3).Token,h=v(10).TokenStream,l=v(11).WhitespacePattern,f={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(u,a){this._input=new m(u),this._options=a||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};o.prototype.tokenize=function(){this._input.restart(),this.__tokens=new h,this._reset();for(var u,a=new p(f.START,""),s=null,R=[],_=new h;a.type!==f.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)?(R.push(s),s=u):s&&this._is_closing(u,s)&&(u.opened=s,s.closed=u,s=R.pop(),u.parent=s),u.previous=a,a.next=u,this.__tokens.add(u),a=u}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(u,a){this._readWhitespace();var s=this._input.read(/.+/g);return s?this._create_token(f.RAW,s):this._create_token(f.EOF,"")},o.prototype._is_comment=function(u){return!1},o.prototype._is_opening=function(u){return!1},o.prototype._is_closing=function(u,a){return!1},o.prototype._create_token=function(u,a){var s=new p(u,a,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return s},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},r.exports.Tokenizer=o,r.exports.TOKEN=f},function(r){function L(v){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=v}L.prototype.restart=function(){this.__position=0},L.prototype.isEmpty=function(){return this.__tokens_length===0},L.prototype.hasNext=function(){return this.__position<this.__tokens_length},L.prototype.next=function(){var v=null;return this.hasNext()&&(v=this.__tokens[this.__position],this.__position+=1),v},L.prototype.peek=function(v){var m=null;return v=v||0,v+=this.__position,v>=0&&v<this.__tokens_length&&(m=this.__tokens[v]),m},L.prototype.add=function(v){this.__parent_token&&(v.parent=this.__parent_token),this.__tokens.push(v),this.__tokens_length+=1},r.exports.TokenStream=L},function(r,L,v){var m=v(12).Pattern;function p(h,l){m.call(this,h,l),l?this._line_regexp=this._input.get_regexp(l._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}p.prototype=new m,p.prototype.__set_whitespace_patterns=function(h,l){h+="\\t ",l+="\\n\\r",this._match_pattern=this._input.get_regexp("["+h+l+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+l+"]")},p.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 l=this.__split(this._newline_regexp,h);this.newline_count=l.length-1,this.whitespace_before_token=l[this.newline_count]}return h},p.prototype.matching=function(h,l){var f=this._create();return f.__set_whitespace_patterns(h,l),f._update(),f},p.prototype._create=function(){return new p(this._input,this)},p.prototype.__split=function(h,l){h.lastIndex=0;for(var f=0,o=[],u=h.exec(l);u;)o.push(l.substring(f,u.index)),f=u.index+u[0].length,u=h.exec(l);return f<l.length?o.push(l.substring(f,l.length)):o.push(""),o},r.exports.WhitespacePattern=p},function(r){function L(v,m){this._input=v,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,m&&(this._starting_pattern=this._input.get_regexp(m._starting_pattern,!0),this._match_pattern=this._input.get_regexp(m._match_pattern,!0),this._until_pattern=this._input.get_regexp(m._until_pattern),this._until_after=m._until_after)}L.prototype.read=function(){var v=this._input.read(this._starting_pattern);return(!this._starting_pattern||v)&&(v+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),v},L.prototype.read_match=function(){return this._input.match(this._match_pattern)},L.prototype.until_after=function(v){var m=this._create();return m._until_after=!0,m._until_pattern=this._input.get_regexp(v),m._update(),m},L.prototype.until=function(v){var m=this._create();return m._until_after=!1,m._until_pattern=this._input.get_regexp(v),m._update(),m},L.prototype.starting_with=function(v){var m=this._create();return m._starting_pattern=this._input.get_regexp(v,!0),m._update(),m},L.prototype.matching=function(v){var m=this._create();return m._match_pattern=this._input.get_regexp(v,!0),m._update(),m},L.prototype._create=function(){return new L(this._input,this)},L.prototype._update=function(){},r.exports.Pattern=L},function(r){function L(v,m){v=typeof v=="string"?v:v.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+m,"g")}L.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(v);p;)m[p[1]]=p[2],p=this.__directive_pattern.exec(v);return m},L.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=L},function(r,L,v){var m=v(12).Pattern,p={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function h(l,f){m.call(this,l,f),this.__template_pattern=null,this._disabled=Object.assign({},p),this._excluded=Object.assign({},p),f&&(this.__template_pattern=this._input.get_regexp(f.__template_pattern),this._excluded=Object.assign(this._excluded,f._excluded),this._disabled=Object.assign(this._disabled,f._disabled));var o=new m(l);this.__patterns={handlebars_comment:o.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:o.starting_with(/{{{/).until_after(/}}}/),handlebars:o.starting_with(/{{/).until_after(/}}/),php:o.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:o.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:o.starting_with(/{%/).until_after(/%}/),django_value:o.starting_with(/{{/).until_after(/}}/),django_comment:o.starting_with(/{#/).until_after(/#}/),smarty:o.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:o.starting_with(/{\*/).until_after(/\*}/),smarty_literal:o.starting_with(/{literal}/).until_after(/{\/literal}/)}}h.prototype=new m,h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){this.__set_templated_pattern()},h.prototype.disable=function(l){var f=this._create();return f._disabled[l]=!0,f._update(),f},h.prototype.read_options=function(l){var f=this._create();for(var o in p)f._disabled[o]=l.templating.indexOf(o)===-1;return f._update(),f},h.prototype.exclude=function(l){var f=this._create();return f._excluded[l]=!0,f._update(),f},h.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 f=this._read_template();f;)this._match_pattern?f+=this._input.read(this._match_pattern):f+=this._input.readUntil(this.__template_pattern),l+=f,f=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},h.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("|")+")")},h.prototype._read_template=function(){var l="",f=this._input.peek();if(f==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(l=l||this.__patterns.erb.read())}else f==="{"&&(!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},r.exports.TemplatablePattern=h}],B={};function K(r){var L=B[r];if(L!==void 0)return L.exports;var v=B[r]={exports:{}};return j[r](v,v.exports,K),v.exports}var G=K(0);P=G})();var X=P;!(ne=[],J=function(){return{js_beautify:X}}.apply(xe,ne),J!==void 0&&(nt.exports=J))})()},"6xqJ":function(nt,xe,Z){"use strict";Z.r(xe);var ne=Z("+L6B"),J=Z("2/Rp"),P=Z("sRBo"),X=Z("kaz8"),j=Z("14J3"),B=Z("BMrR"),K=Z("jCWc"),G=Z("kPKH"),r=Z("giR+"),L=Z("fyUT"),v=Z("DZo9"),m=Z("8z0m"),p=Z("0Owb"),h=Z("5NDa"),l=Z("5rEg"),f=Z("sPJy"),o=Z("bE4q"),u=Z("oBTY"),a=Z("k1fw"),s=Z("9og8"),R=Z("miYZ"),_=Z("tsqr"),C=Z("y8nQ"),D=Z("Vl3Y"),O=Z("tJVT"),A=Z("WmNS"),S=Z.n(A),T=Z("q1tI"),c=Z.n(T),w=Z("Ty5D"),y=Z("9kvl"),b=Z("55Ip"),U=Z("Ot1p"),F=Z("XYT7"),E=Z("m3rI"),N=Z("I98M"),I=Z.n(N),g=function($){var ie,oe=$.shixunHomeworks,Ce=$.newCourse,ve=$.globalSetting,Se=$.loading,Ae=$.dispatch,Oe=$.match,he=Object(w.i)(),ce=D.a.useForm(),re=Object(O.a)(ce,1),fe=re[0],se=Object(T.useState)({}),ke=Object(O.a)(se,2),Ne=ke[0],Re=ke[1],Pe=Object(T.useState)(!1),je=Object(O.a)(Pe,2),ue=je[0],Ee=je[1],Le=Object(T.useState)([]),Ie=Object(O.a)(Le,2),Ge=Ie[0],Xe=Ie[1],Je=Object(T.useState)([]),Qe=Object(O.a)(Je,2),at=Qe[0],qe=Qe[1],tt=oe.commonHomeWorkEditDefaultData,Be={name:"file",multiple:!0,action:E.a.API_SERVER+"/api/attachments.json",defaultFileList:Ge,onChange:function(Te){var me=Te.file.status;me!=="uploading",me==="done"?_.b.success("".concat(Te.file.name," \u6587\u4EF6\u4E0A\u4F20\u6210\u529F")):me==="error"&&_.b.error("".concat(Te.file.name," \u6587\u4EF6\u4E0A\u4F20\u5931\u8D25"))}};Object(T.useEffect)(function(){ot()},[he.topicId]);var ut=function(Te){return Te==null?void 0:Te.map(function(me){return{uid:me.id,response:{id:me.id},name:me.title,status:"done",url:me.url}})},ot=function(){var He=Object(s.a)(S.a.mark(function Te(){var me;return S.a.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:return ae.next=2,Ae({type:"shixunHomeworks/editCommonHomeWorkDefaultBankData",payload:{id:he.topicId}});case 2:me=ae.sent,me&&(fe.setFieldsValue({name:me.name}),fe.setFieldsValue({description:me.description}),fe.setFieldsValue(Object(a.a)({},me)),Re(Object(a.a)({},me)),Xe(Object(u.a)(ut(me.attachments))),qe(Object(u.a)(ut(me.reference_attachments))),Ee(!0));case 4:case"end":return ae.stop()}},Te)}));return function(){return He.apply(this,arguments)}}(),Ue=function(){var He=Object(s.a)(S.a.mark(function Te(me){var be,ae,le,de;return S.a.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:return be=Object(a.a)({},me),be.attachment_ids&&(be.attachment_ids=be==null||((ae=be.attachment_ids.fileList)===null||ae===void 0)?void 0:ae.map(function(Fe){return Fe.response.id})),be.reference_attachment_ids&&(be.reference_attachment_ids=be==null||((le=be.reference_attachment_ids.fileList)===null||le===void 0)?void 0:le.map(function(Fe){return Fe.response.id})),we.next=5,Object(F.n)(Object(a.a)(Object(a.a)(Object(a.a)({id:he.topicId},Oe.params),be),{},{type:3}));case 5:de=we.sent,de&&y.d.push("/users/".concat(he.username,"/topics/").concat(he.topicId,"/").concat(he.topictype,"/group/detail"));case 7:case"end":return we.stop()}},Te)}));return function(me){return He.apply(this,arguments)}}();return c.a.createElement("section",{className:I.a.bg},c.a.createElement("section",{className:"animated fadeIn"},c.a.createElement("aside",{className:"mt10"},c.a.createElement(o.a,{separator:">"},c.a.createElement(o.a.Item,null,c.a.createElement(b.a,{to:"/users/".concat(he.username,"/").concat(he.topictype==="personal"?"topics":"topicbank","/").concat(he.topictype)},he.topictype==="personal"?"\u6211\u7684\u8BFE\u5802\u8D44\u6E90":"\u516C\u5171\u9898\u5E93")),c.a.createElement(o.a.Item,null,c.a.createElement(b.a,{to:"/users/".concat(he.username,"/topics/").concat(he.topicId,"/").concat(he.topictype,"/group/detail")},"\u8BE6\u60C5")),c.a.createElement(o.a.Item,null,"\u7F16\u8F91")))),c.a.createElement("aside",{className:"font24 bold mt20 mb20"},"\u7F16\u8F91\u666E\u901A\u4F5C\u4E1A"),c.a.createElement(D.a,{form:fe,className:I.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(){Re(Object(a.a)({},fe.getFieldsValue()))},onFinish:Ue},c.a.createElement("div",{className:I.a.fieldWrap},c.a.createElement(D.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u9898"}]},c.a.createElement(l.a,{maxLength:60,suffix:"".concat(((ie=Ne.name)===null||ie===void 0?void 0:ie.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),c.a.createElement("div",{className:I.a.mdWrap},c.a.createElement(D.a.Item,{name:"description",label:"\u7B80\u4ECB:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:5e3,message:"\u4F5C\u4E1A\u7B80\u4ECB\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"}]},c.a.createElement(U.a,{watch:!0,defaultValue:tt.description})),c.a.createElement("div",null,c.a.createElement(D.a.Item,{name:"attachment_ids"},ue&&c.a.createElement(m.a,Object(p.a)({defaultFileList:Ge},Be),c.a.createElement("span",{className:"c-blue"},"\u4E0A\u4F20\u9644\u4EF6")," \uFF08\u5355\u4E2A\u6587\u4EF6150MB\u4EE5\u5185\uFF09"))),c.a.createElement(B.a,{gutter:[20,20]},c.a.createElement(G.a,{flex:"230px"},c.a.createElement(D.a.Item,{name:"min_num",label:"\u5206\u7EC4\u8BBE\u7F6E",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u6BCF\u7EC4\u6700\u5C0F\u4EBA\u6570"}]},c.a.createElement(L.a,{style:{width:200},min:1,placeholder:"\u8BF7\u586B\u5199\u6BCF\u7EC4\u6700\u5C0F\u4EBA\u6570"}))),c.a.createElement(G.a,{flex:"230px"},c.a.createElement(D.a.Item,{name:"max_num",label:c.a.createElement("div",null,"\xA0"),rules:[{required:!0,message:"\u8BF7\u586B\u5199\u6BCF\u7EC4\u6700\u5927\u4EBA\u6570"}]},c.a.createElement(L.a,{style:{width:200},max:10,placeholder:"\u8BF7\u586B\u5199\u6BCF\u7EC4\u6700\u5927\u4EBA\u6570"}))),c.a.createElement(G.a,null,c.a.createElement("div",{className:"mt30"},"\uFF08\u5B66\u751F\u63D0\u4EA4\u4F5C\u54C1\u65F6\u9700\u8981\u5173\u8054\u540C\u7EC4\u6210\u5458\uFF0C\u7EC4\u5185\u6210\u5458\u4F5C\u54C1\u5171\u4EAB\uFF09"))),c.a.createElement(B.a,null,c.a.createElement(G.a,null,c.a.createElement(D.a.Item,{name:"base_on_project",valuePropName:"checked"},c.a.createElement(X.a,{value:1,defaultChecked:!0},"\u57FA\u4E8E\u9879\u76EE\u5B9E\u65BD")),c.a.createElement("span",{className:"c-light-black"},"\uFF08\u9009\u4E2D\uFF0C\u5219\u5FC5\u987B\u5728\u672C\u5E73\u53F0\u521B\u5EFA\u9879\u76EE\uFF0C\u9879\u76EE\u7BA1\u7406\u5458\u53EF\u4EE5\u63D0\u4EA4\u4F5C\u54C1\uFF1B\u4E0D\u9009\u4E2D\uFF0C\u65E0\u9700\u5728\u5E73\u53F0\u521B\u5EFA\u9879\u76EE\uFF0C\u4EFB\u610F\u5C0F\u7EC4\u6210\u5458\u5747\u53EF\u4EE5\u63D0\u4EA4\u4F5C\u54C1\uFF09")))),c.a.createElement("div",{className:I.a.mdWrap},c.a.createElement(D.a.Item,{name:"reference_answer",label:"\u53C2\u8003\u7B54\u6848:"},c.a.createElement(U.a,{defaultValue:tt.reference_answer,watch:!0})),c.a.createElement("div",null,c.a.createElement(D.a.Item,{name:"reference_attachment_ids"},ue&&c.a.createElement(m.a,Object(p.a)({},Be,{defaultFileList:at}),c.a.createElement("span",{className:"c-blue"},"\u4E0A\u4F20\u9644\u4EF6")," \uFF08\u5355\u4E2A\u6587\u4EF6150MB\u4EE5\u5185\uFF09")))),c.a.createElement("div",{className:I.a.backgroundFa},c.a.createElement("div",{className:"pt40 mb30"},c.a.createElement(D.a.Item,null,c.a.createElement(J.a,{size:"large",type:"primary",className:"".concat(I.a.button," mr20"),htmlType:"submit"},"\u63D0\u4EA4"),c.a.createElement(J.a,{size:"large",type:"primary",ghost:!0,className:I.a.button,onClick:function(){return y.d.push("/users/".concat(he.username,"/topics/").concat(he.topicId,"/").concat(he.topictype,"/group/detail"))}},"\u53D6\u6D88"))))))};xe.default=Object(y.a)(function(H){var $=H.shixunHomeworks,ie=H.newCourse,oe=H.loading,Ce=H.globalSetting;return{shixunHomeworks:$,newCourse:ie,globalSetting:Ce,loading:oe.effects}})(g)},"746U":function(nt,xe,Z){"use strict";Z.d(xe,"f",function(){return ne}),Z.d(xe,"l",function(){return J}),Z.d(xe,"k",function(){return P}),Z.d(xe,"j",function(){return X}),Z.d(xe,"g",function(){return j}),Z.d(xe,"m",function(){return B}),Z.d(xe,"h",function(){return K}),Z.d(xe,"n",function(){return G}),Z.d(xe,"c",function(){return r}),Z.d(xe,"a",function(){return L}),Z.d(xe,"i",function(){return v}),Z.d(xe,"o",function(){return m}),Z.d(xe,"e",function(){return l}),Z.d(xe,"d",function(){return f}),Z.d(xe,"p",function(){return o}),Z.d(xe,"b",function(){return u});function ne(a){return Array.isArray(a)}function J(a){return typeof a=="string"}function P(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)&&!(a instanceof RegExp)&&!(a instanceof Date)}function X(a){return typeof a=="number"&&!isNaN(a)}function j(a){return a===!0||a===!1}function B(a){return typeof a=="undefined"}function K(a){return!G(a)}function G(a){return B(a)||a===null}function r(a,s){if(!a)throw new Error(s?`Unexpected type, expected '${s}'`:"Unexpected type")}function L(a){if(G(a))throw new Error("Assertion Failed: argument is undefined or null");return a}function v(a){return typeof a=="function"}function m(a,s){const R=Math.min(a.length,s.length);for(let _=0;_<R;_++)p(a[_],s[_])}function p(a,s){if(J(s)){if(typeof a!==s)throw new Error(`argument does not match constraint: typeof ${s}`)}else if(v(s)){try{if(a instanceof s)return}catch(R){}if(!G(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=[],R=Object.getPrototypeOf(a);for(;Object.prototype!==R;)s=s.concat(Object.getOwnPropertyNames(R)),R=Object.getPrototypeOf(R);return s}function l(a){const s=[];for(const R of h(a))typeof a[R]=="function"&&s.push(R);return s}function f(a,s){const R=C=>function(){const D=Array.prototype.slice.call(arguments,0);return s(C,D)};let _={};for(const C of a)_[C]=R(C);return _}function o(a){return a===null?void 0:a}function u(a,s="Unreachable"){throw new Error(s)}},"7Cbv":function(nt,xe,Z){"use strict";var ne=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),J=new Uint8Array(16);function P(){if(!ne)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ne(J)}var X=/^(?:[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 j(p){return typeof p=="string"&&X.test(p)}for(var B=j,K=[],G=0;G<256;++G)K.push((G+256).toString(16).substr(1));function r(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,l=(K[p[h+0]]+K[p[h+1]]+K[p[h+2]]+K[p[h+3]]+"-"+K[p[h+4]]+K[p[h+5]]+"-"+K[p[h+6]]+K[p[h+7]]+"-"+K[p[h+8]]+K[p[h+9]]+"-"+K[p[h+10]]+K[p[h+11]]+K[p[h+12]]+K[p[h+13]]+K[p[h+14]]+K[p[h+15]]).toLowerCase();if(!B(l))throw TypeError("Stringified UUID is invalid");return l}var L=r;function v(p,h,l){p=p||{};var f=p.random||(p.rng||P)();if(f[6]=f[6]&15|64,f[8]=f[8]&63|128,h){l=l||0;for(var o=0;o<16;++o)h[l+o]=f[o];return h}return L(f)}var m=xe.a=v},"7ahc":function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return R});var ne=Z("k1fw"),J=Z("0Owb"),P=Z("+L6B"),X=Z("2/Rp"),j=Z("y8nQ"),B=Z("Vl3Y"),K=Z("tJVT"),G=Z("OaEy"),r=Z("2fM7"),L=Z("q1tI"),v=Z.n(L),m=Z("VrN/"),p=Z.n(m),h=Z("p77/"),l=Z.n(h),f=Z("c5Ni"),o=Z.n(f),u=r.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"]};xe.b=function(_){var C=_.callback,D=_.onCancel,O=Object(L.useState)("python"),A=Object(K.a)(O,2),S=A[0],T=A[1];function c(y){T(s[y][1])}function w(y){C(y)}return v.a.createElement(B.a,Object(J.a)({},a,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:w}),v.a.createElement(B.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},v.a.createElement(r.a,{onChange:c},Object.keys(s).map(function(y){return v.a.createElement(u,{key:y,value:y},s[y][0])}))),v.a.createElement(B.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},v.a.createElement(R,{mode:S})),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(X.a,{type:"ghost",onClick:D},"\u53D6\u6D88")))};function R(_){var C=_.value,D=_.onChange,O=_.mode,A=_.options,S=A===void 0?{}:A,T=Object(L.useRef)(),c=Object(L.useState)(),w=Object(K.a)(c,2),y=w[0],b=w[1];return Object(L.useEffect)(function(){if(y){function U(F){var E=F.getValue();D&&D(E)}return y.on("change",U),function(){y.off("change",U)}}},[y,D]),Object(L.useEffect)(function(){y&&y.setOption("mode",O)},[y,O]),Object(L.useEffect)(function(){y&&((C!==y.getValue()||C==="")&&setTimeout(function(){y.setValue(C||" ")},300))},[y,C]),Object(L.useEffect)(function(){if(T.current&&!y){var U=p.a.fromTextArea(T.current,Object(ne.a)({mode:O,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},S));b(U)}},[T.current,y]),v.a.createElement("div",{className:"my-codemirror-container"},v.a.createElement("textarea",{ref:T}))}},"8EBN":function(nt,xe,Z){(function(ne){ne(Z("VrN/"))})(function(ne){"use strict";ne.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 J=0;J<ne.modeInfo.length;J++){var P=ne.modeInfo[J];P.mimes&&(P.mime=P.mimes[0])}ne.findModeByMIME=function(X){X=X.toLowerCase();for(var j=0;j<ne.modeInfo.length;j++){var B=ne.modeInfo[j];if(B.mime==X)return B;if(B.mimes){for(var K=0;K<B.mimes.length;K++)if(B.mimes[K]==X)return B}}if(/\+xml$/.test(X))return ne.findModeByMIME("application/xml");if(/\+json$/.test(X))return ne.findModeByMIME("application/json")},ne.findModeByExtension=function(X){X=X.toLowerCase();for(var j=0;j<ne.modeInfo.length;j++){var B=ne.modeInfo[j];if(B.ext){for(var K=0;K<B.ext.length;K++)if(B.ext[K]==X)return B}}},ne.findModeByFileName=function(X){for(var j=0;j<ne.modeInfo.length;j++){var B=ne.modeInfo[j];if(B.file&&B.file.test(X))return B}var K=X.lastIndexOf("."),G=K>-1&&X.substring(K+1,X.length);if(G)return ne.findModeByExtension(G)},ne.findModeByName=function(X){X=X.toLowerCase();for(var j=0;j<ne.modeInfo.length;j++){var B=ne.modeInfo[j];if(B.name.toLowerCase()==X)return B;if(B.alias){for(var K=0;K<B.alias.length;K++)if(B.alias[K].toLowerCase()==X)return B}}}})},"8HAY":function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return j}),Z.d(xe,"b",function(){return B}),Z.d(xe,"d",function(){return K}),Z.d(xe,"e",function(){return G}),Z.d(xe,"c",function(){return r});var ne=Z("MI8n"),J=Z("pmY6"),P=Z("3/fG"),X=function(L,v,m,p){function h(l){return l instanceof m?l:new m(function(f){f(l)})}return new(m||(m=Promise))(function(l,f){function o(s){try{a(p.next(s))}catch(R){f(R)}}function u(s){try{a(p.throw(s))}catch(R){f(R)}}function a(s){s.done?l(s.value):h(s.value).then(o,u)}a((p=p.apply(L,v||[])).next())})};class j extends J.a{constructor(L,v="",m="",p=!0,h){super();this._onDidChange=this._register(new ne.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=L,this._label=v,this._cssClass=m,this._enabled=p,this._actionCallback=h}get id(){return this._id}get label(){return this._label}set label(L){this._setLabel(L)}_setLabel(L){this._label!==L&&(this._label=L,this._onDidChange.fire({label:L}))}get tooltip(){return this._tooltip||""}set tooltip(L){this._setTooltip(L)}_setTooltip(L){this._tooltip!==L&&(this._tooltip=L,this._onDidChange.fire({tooltip:L}))}get class(){return this._cssClass}set class(L){this._setClass(L)}_setClass(L){this._cssClass!==L&&(this._cssClass=L,this._onDidChange.fire({class:L}))}get enabled(){return this._enabled}set enabled(L){this._setEnabled(L)}_setEnabled(L){this._enabled!==L&&(this._enabled=L,this._onDidChange.fire({enabled:L}))}get checked(){return this._checked}set checked(L){this._setChecked(L)}_setChecked(L){this._checked!==L&&(this._checked=L,this._onDidChange.fire({checked:L}))}run(L,v){return X(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(L))})}}class B extends J.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new ne.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new ne.b),this.onDidRun=this._onDidRun.event}run(L,v){return X(this,void 0,void 0,function*(){if(!L.enabled)return;this._onBeforeRun.fire({action:L});let m;try{yield this.runAction(L,v)}catch(p){m=p}this._onDidRun.fire({action:L,error:m})})}runAction(L,v){return X(this,void 0,void 0,function*(){yield L.run(v)})}}class K extends j{constructor(L){super(K.ID,L,L?"separator text":"separator");this.checked=!1,this.enabled=!1}}K.ID="vs.actions.separator";class G{constructor(L,v,m,p){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=L,this.label=v,this.class=p,this._actions=m}get actions(){return this._actions}dispose(){}run(){return X(this,void 0,void 0,function*(){})}}class r extends j{constructor(){super(r.ID,P.a("submenu.empty","(empty)"),void 0,!1)}}r.ID="vs.actions.empty"},"8hTe":function(nt,xe,Z){nt.exports={button:"button___1wy9m"}},"9Bee":function(nt,xe,Z){"use strict";var ne=Z("DYRE"),J=Z("zeV3"),P=Z("+L6B"),X=Z("2/Rp"),j=Z("k1fw"),B=Z("9og8"),K=Z("tJVT"),G=Z("WmNS"),r=Z.n(G),L=Z("q1tI"),v=Z.n(L),m=Z("vg9a"),p=Z("DlQD"),h=Z.n(p),l=Z("rUJ1");function f(Y,x){var k=Y.match(/^(\s+)(?:```)/);if(k===null)return x;var W=k[1];return x.split(`
`).map(function(ee){var V=ee.match(/^\s+/);if(V===null)return ee;var _e=Object(K.a)(V,1),Ke=_e[0];return Ke.length>=W.length?ee.slice(W.length):ee}).join(`
`)}var o=[],u=["<ul>"],a=new h.a.Renderer,s=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function R(){o.length=0,u=["<ul>"]}var _={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function C(Y,x,k,W){if(x>=Y.length||Y[x].level<=k)return x;var ee=Y[x];W.push("<li><a href='#"+ee.anchor+"'>"+ee.text+"</a>"),x++;var V=[];return x=C(Y,x,ee.level,V),V.length>0&&(W.push("<ul>"),V.forEach(function(_e){W.push(_e)}),W.push("</ul>")),W.push("</li>"),x=C(Y,x,k,W),x}function D(){return C(o,0,0,u),u.push("</ul>"),u.join("")}var O={heading:function(x){var k=s.exec(x);if(k)return{type:"heading",raw:k[0],depth:k[1].length,text:k[2]}},fences:function(x){var k=this.rules.block.fences.exec(x);if(k){var W=k[0],ee=f(W,k[3]||""),V=k[2]?k[2].trim():k[2];if(["latex","katex","math"].indexOf(V)>=0){var _e=T(),Ke=ee;ee=_e,c[_e]={type:"block",expression:Ke}}return{type:"code",raw:W,lang:V,text:ee}}}},A=/(?:\${2})([^\n`]+?)(?:\${2})/gi,S=0,T=function(){return"__special_katext_id_".concat(S++,"__")},c={};function w(){return c}function y(){S=0,c={}}function b(Y){return Y=Y.replace(A,function(x,k){var W=T();return c[W]={type:"inline",expression:k},W}),Y}var U=a.listitem;a.listitem=function(Y){return U(b(Y))};var F=a.paragraph;a.paragraph=function(Y){return F(b(Y))};var E=a.tablecell;a.tablecell=function(Y,x){return E(b(Y),x)},a.code=function(Y,x,k){var W=(x||"").match(/\S*/)[0];return W?["latex","katex","math"].indexOf(W)>=0?"<p class='editormd-tex'>".concat(Y,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(x,'">').concat(k?Y:Object(l.escape)(Y,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(k?Y:Object(l.escape)(Y,!0))+"</code></pre>"},a.heading=function(Y,x,k){var W=this.options.headerPrefix+k.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return o.push({anchor:W,level:x,text:Y}),"<h"+x+' id="'+W+'">'+Y+"</h"+x+">"},h.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),h.a.use({tokenizer:O,renderer:a});var N=h.a,I=Z("SJMd"),g=Z("ulZh"),H=Z.n(g),$=Z("m3rI"),ie=Z("Oy/b"),oe=Z("p5ED"),Ce=Z("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var ve=function(Y,x){return(ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,W){k.__proto__=W}||function(k,W){for(var ee in W)Object.prototype.hasOwnProperty.call(W,ee)&&(k[ee]=W[ee])})(Y,x)};function Se(Y,x){function k(){this.constructor=Y}ve(Y,x),Y.prototype=x===null?Object.create(x):(k.prototype=x.prototype,new k)}function Ae(Y,x,k,W){return new(k||(k=Promise))(function(ee,V){function _e(pt){try{et(W.next(pt))}catch(Ve){V(Ve)}}function Ke(pt){try{et(W.throw(pt))}catch(Ve){V(Ve)}}function et(pt){var Ve;pt.done?ee(pt.value):(Ve=pt.value,Ve instanceof k?Ve:new k(function(_t){_t(Ve)})).then(_e,Ke)}et((W=W.apply(Y,x||[])).next())})}function Oe(Y,x){var k,W,ee,V,_e={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return V={next:Ke(0),throw:Ke(1),return:Ke(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function Ke(et){return function(pt){return function(Ve){if(k)throw new TypeError("Generator is already executing.");for(;_e;)try{if(k=1,W&&(ee=2&Ve[0]?W.return:Ve[0]?W.throw||((ee=W.return)&&ee.call(W),0):W.next)&&!(ee=ee.call(W,Ve[1])).done)return ee;switch(W=0,ee&&(Ve=[2&Ve[0],ee.value]),Ve[0]){case 0:case 1:ee=Ve;break;case 4:return _e.label++,{value:Ve[1],done:!1};case 5:_e.label++,W=Ve[1],Ve=[0];continue;case 7:Ve=_e.ops.pop(),_e.trys.pop();continue;default:if(!(ee=_e.trys,(ee=ee.length>0&&ee[ee.length-1])||Ve[0]!==6&&Ve[0]!==2)){_e=0;continue}if(Ve[0]===3&&(!ee||Ve[1]>ee[0]&&Ve[1]<ee[3])){_e.label=Ve[1];break}if(Ve[0]===6&&_e.label<ee[1]){_e.label=ee[1],ee=Ve;break}if(ee&&_e.label<ee[2]){_e.label=ee[2],_e.ops.push(Ve);break}ee[2]&&_e.ops.pop(),_e.trys.pop();continue}Ve=x.call(Y,_e)}catch(_t){Ve=[6,_t],W=0}finally{k=ee=0}if(5&Ve[0])throw Ve[1];return{value:Ve[0]?Ve[1]:void 0,done:!0}}([et,pt])}}}function he(){for(var Y=0,x=0,k=arguments.length;x<k;x++)Y+=arguments[x].length;var W=Array(Y),ee=0;for(x=0;x<k;x++)for(var V=arguments[x],_e=0,Ke=V.length;_e<Ke;_e++,ee++)W[ee]=V[_e];return W}var ce=function(){function Y(){}return Y.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Y.setAttributes=function(x,k){for(var W=0,ee=k;W<ee.length;W++){var V=ee[W],_e=V[0],Ke=V[1];x.setAttribute(_e,Ke)}},Y.createRect=function(x,k,W){var ee=document.createElementNS("http://www.w3.org/2000/svg","rect");return ee.setAttribute("width",x.toString()),ee.setAttribute("height",k.toString()),W&&Y.setAttributes(ee,W),ee},Y.createLine=function(x,k,W,ee,V){var _e=document.createElementNS("http://www.w3.org/2000/svg","line");return _e.setAttribute("x1",x.toString()),_e.setAttribute("y1",k.toString()),_e.setAttribute("x2",W.toString()),_e.setAttribute("y2",ee.toString()),V&&Y.setAttributes(_e,V),_e},Y.createPolygon=function(x,k){var W=document.createElementNS("http://www.w3.org/2000/svg","polygon");return W.setAttribute("points",x),k&&Y.setAttributes(W,k),W},Y.createCircle=function(x,k){var W=document.createElementNS("http://www.w3.org/2000/svg","circle");return W.setAttribute("cx",(x/2).toString()),W.setAttribute("cy",(x/2).toString()),W.setAttribute("r",x.toString()),k&&Y.setAttributes(W,k),W},Y.createEllipse=function(x,k,W){var ee=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ee.setAttribute("cx",(x/2).toString()),ee.setAttribute("cy",(k/2).toString()),ee.setAttribute("rx",(x/2).toString()),ee.setAttribute("ry",(k/2).toString()),W&&Y.setAttributes(ee,W),ee},Y.createGroup=function(x){var k=document.createElementNS("http://www.w3.org/2000/svg","g");return x&&Y.setAttributes(k,x),k},Y.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Y.createMarker=function(x,k,W,ee,V,_e,Ke){var et=document.createElementNS("http://www.w3.org/2000/svg","marker");return Y.setAttributes(et,[["id",x],["orient",k],["markerWidth",W.toString()],["markerHeight",ee.toString()],["refX",V.toString()],["refY",_e.toString()]]),et.appendChild(Ke),et},Y.createText=function(x){var k=document.createElementNS("http://www.w3.org/2000/svg","text");return k.setAttribute("x","0"),k.setAttribute("y","0"),x&&Y.setAttributes(k,x),k},Y.createTSpan=function(x,k){var W=document.createElementNS("http://www.w3.org/2000/svg","tspan");return W.textContent=x,k&&Y.setAttributes(W,k),W},Y.createImage=function(x){var k=document.createElementNS("http://www.w3.org/2000/svg","image");return x&&Y.setAttributes(k,x),k},Y.createPoint=function(x,k){var W=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return W.x=x,W.y=k,W},Y.createPath=function(x,k){var W=document.createElementNS("http://www.w3.org/2000/svg","path");return W.setAttribute("d",x),k&&Y.setAttributes(W,k),W},Y}(),re=function(){function Y(){}return Y.addKey=function(x){Y.key=x},Object.defineProperty(Y,"isLicensed",{get:function(){return!!Y.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Y.key)},enumerable:!1,configurable:!0}),Y}(),fe=function(){function Y(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Y.prototype.rasterize=function(x,k,W){var ee=this;return new Promise(function(V){var _e=W!==void 0?W:document.createElement("canvas");x===null&&(ee.markersOnly=!0,ee.naturalSize=!1);var Ke=document.createElementNS("http://www.w3.org/2000/svg","svg");Ke.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ke.setAttribute("width",k.width.baseVal.valueAsString),Ke.setAttribute("height",k.height.baseVal.valueAsString),Ke.setAttribute("viewBox","0 0 "+k.viewBox.baseVal.width.toString()+" "+k.viewBox.baseVal.height.toString()),Ke.innerHTML=k.innerHTML,ee.naturalSize===!0?(Ke.width.baseVal.value=x.naturalWidth,Ke.height.baseVal.value=x.naturalHeight):ee.width!==void 0&&ee.height!==void 0&&(Ke.width.baseVal.value=ee.width,Ke.height.baseVal.value=ee.height),_e.width=Ke.width.baseVal.value,_e.height=Ke.height.baseVal.value;var et=Ke.outerHTML,pt=_e.getContext("2d");ee.markersOnly!==!0&&pt.drawImage(x,0,0,_e.width,_e.height);var Ve=window.URL,_t=new Image(_e.width,_e.height);_t.setAttribute("crossOrigin","anonymous");var jt=new Blob([et],{type:"image/svg+xml"}),$t=Ve.createObjectURL(jt);_t.onload=function(){pt.drawImage(_t,0,0),Ve.revokeObjectURL($t);var jr=_e.toDataURL(ee.imageType,ee.imageQuality);V(jr)},_t.src=$t})},Y}(),se=function(){},ke=function(){function Y(x){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+x+"_"}return Object.defineProperty(Y.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Y.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(Y.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),Y.prototype.addClass=function(x){return this.styleSheet===void 0&&this.addStyleSheet(),x.name=""+this.classNamePrefix+x.localName,this.classes.push(x),this.styleSheet.sheet.insertRule("."+x.name+" {"+x.style+"}",this.styleSheet.sheet.cssRules.length),x},Y.prototype.addRule=function(x){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(x),this.styleSheet.sheet.insertRule(x.selector+" {"+x.style+"}",this.styleSheet.sheet.cssRules.length)},Y.prototype.addStyleSheet=function(){var x;this.styleSheet=document.createElement("style"),((x=this.styleSheetRoot)!==null&&x!==void 0?x:document.head).appendChild(this.styleSheet),this.addRule(new Ne("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ne("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Ne("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Re("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Re("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},Y.prototype.removeStyleSheet=function(){var x;this.styleSheet&&(((x=this.styleSheetRoot)!==null&&x!==void 0?x:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Y}(),Ne=function(Y,x){this.selector=Y,this.style=x},Re=function(Y,x){this.localName=Y,this.style=x},Pe=function(){function Y(x,k,W,ee,V){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=x,this.displayMode=k,this.markerItems=W,this.uiStyleSettings=ee,this.styles=V,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return Y.prototype.show=function(x){var k=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=x,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var W=document.createElement("div");W.className=this.toolbarBlockStyleClass.name,W.style.whiteSpace="nowrap",this.uiContainer.appendChild(W),this.addActionButton(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(V){var _e=document.createElement("div");_e.className=""+k.toolbarButtonStyleClass.name,_e.setAttribute("data-type-name",V.typeName),_e.innerHTML=V.icon,_e.addEventListener("click",function(){k.markerToolbarButtonClicked(_e,V)}),k.buttons.push(_e),k.markerButtons.push(_e)}),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 ee=document.createElement("div");ee.className=this.toolbarBlockStyleClass.name,ee.style.whiteSpace="nowrap",ee.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ee),this.addActionButton(ee,'<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(ee,'<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()},Y.prototype.addButtonClickListener=function(x){this.buttonClickListeners.push(x)},Y.prototype.removeButtonClickListener=function(x){this.buttonClickListeners.indexOf(x)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(x),1)},Y.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Y.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var x=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var k=0;k<this.markerButtons.length;k++)k<x||k===x&&this.markerButtons.length-1===x?this.markerButtonBlock.appendChild(this.markerButtons[k]):(k===x&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[k]))}},Y.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")},Y.prototype.resetButtonStyles=function(){var x=this;this.buttons.forEach(function(k){k.className=k.className.replace(x.uiStyleSettings.toolbarButtonStyleColorsClassName?x.uiStyleSettings.toolbarButtonStyleColorsClassName:x.toolbarButtonStyleColorsClass.name,"").trim(),k.className=k.className.replace(x.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?x.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:x.toolbarActiveButtonStyleColorsClass.name,"").trim(),k.className+=" "+(x.uiStyleSettings.toolbarButtonStyleColorsClassName?x.uiStyleSettings.toolbarButtonStyleColorsClassName:x.toolbarButtonStyleColorsClass.name)})},Y.prototype.addActionButton=function(x,k,W){var ee=this,V=document.createElement("div");switch(V.className=""+this.toolbarButtonStyleClass.name,V.innerHTML=k,V.setAttribute("data-action",W),V.addEventListener("click",function(){ee.actionToolbarButtonClicked(V,W)}),W){case"select":V.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":V.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":V.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":V.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":V.style.fill=this.uiStyleSettings.closeButtonColor}x.appendChild(V),this.buttons.push(V)},Y.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Re("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 Re("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Re("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Re("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 Re("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var x=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Re("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*x)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*x)+`px;
padding: `+x+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Re("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Re("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ne("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Ne("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},Y.prototype.markerToolbarButtonClicked=function(x,k){this.setActiveButton(x),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(W){return W("marker",k)}),this.markerButtonOverflowBlock.style.display="none"},Y.prototype.actionToolbarButtonClicked=function(x,k){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(W){return W("action",k)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Y.prototype.setActiveButton=function(x){this.resetButtonStyles(),x.className=x.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),x.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Y.prototype.setActiveMarkerButton=function(x){var k=this.markerButtons.find(function(W){return W.getAttribute("data-type-name")===x});k&&this.setActiveButton(k)},Y.prototype.setCurrentMarker=function(x){var k=this;this.currentMarker=x,this.buttons.filter(function(W){return/delete|notes/.test(W.getAttribute("data-action"))}).forEach(function(W){k.currentMarker===void 0?(W.style.fillOpacity="0.4",W.style.pointerEvents="none"):(W.style.fillOpacity="1",W.style.pointerEvents="all")})},Y}(),je=function(){function Y(x,k,W,ee){this.panels=[],this.panelButtons=[],this.markerjsContainer=x,this.displayMode=k,this.uiStyleSettings=W,this.styles=ee,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Y.prototype.addStyles=function(){var x;this.toolboxStyleClass=this.styles.addClass(new Re("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 Re("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var k=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Re("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Re("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Re("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 Re("toolbox-panel-row_colors",`
background-color: `+((x=this.uiStyleSettings.toolboxBackgroundColor)!==null&&x!==void 0?x:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Re("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
padding: `+k+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Re("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Re("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ne("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ne("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},Y.prototype.show=function(x){var k;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=x,this.uiContainer.className=this.toolboxStyleClass.name+" "+((k=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Y.prototype.setPanelButtons=function(x){var k,W,ee=this;this.panels=x,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((k=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((W=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&W!==void 0?W:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(V){var _e;V.uiStyleSettings=ee.uiStyleSettings;var Ke=document.createElement("div");Ke.className=ee.toolboxButtonStyleClass.name+" "+((_e=ee.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&_e!==void 0?_e:ee.toolboxButtonStyleColorsClass.name),Ke.innerHTML=V.icon,Ke.title=V.title,Ke.addEventListener("click",function(){ee.panelButtonClick(V)}),ee.panelButtons.push(Ke),ee.buttonRow.appendChild(Ke)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Y.prototype.panelButtonClick=function(x){var k=this,W=-1;if(x!==this.activePanel){W=this.panels.indexOf(x),this.panelRow.innerHTML="";var ee=x.getUi();ee.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ee),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=x}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){k.displayMode==="inline"?k.panelRow.style.display="none":k.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(V,_e){var Ke,et;V.className=k.toolboxButtonStyleClass.name+" "+(_e===W?""+((Ke=k.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ke!==void 0?Ke:k.toolboxActiveButtonStyleColorsClass.name):""+((et=k.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&et!==void 0?et:k.toolboxButtonStyleColorsClass.name))})},Y}(),ue=function(Y,x){this.title=Y,this.icon=x},Ee=function(Y){function x(k,W,ee,V){var _e=Y.call(this,k,V||'<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 _e.colors=[],_e.addTransparent=!1,_e.colorBoxes=[],_e.colors=W,_e.currentColor=ee,_e.setCurrentColor=_e.setCurrentColor.bind(_e),_e.getColorBox=_e.getColorBox.bind(_e),_e}return Se(x,Y),x.prototype.getUi=function(){var k=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.whiteSpace="nowrap",this.colors.forEach(function(ee){var V=k.getColorBox(ee);W.appendChild(V),k.colorBoxes.push(V)}),W},x.prototype.getColorBox=function(k){var W=this,ee=this.uiStyleSettings.toolbarHeight/4,V=this.uiStyleSettings.toolbarHeight-ee,_e=document.createElement("div");_e.style.display="inline-block",_e.style.boxSizing="content-box",_e.style.width=V-2+"px",_e.style.height=V-2+"px",_e.style.padding="1px",_e.style.marginRight="2px",_e.style.marginBottom="2px",_e.style.borderWidth="2px",_e.style.borderStyle="solid",_e.style.borderRadius=(V+2)/2+"px",_e.style.borderColor=k===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",_e.addEventListener("click",function(){W.setCurrentColor(k,_e)});var Ke=document.createElement("div");return Ke.style.display="inline-block",Ke.style.width=V-2+"px",Ke.style.height=V-2+"px",Ke.style.backgroundColor=k,Ke.style.borderRadius=V/2+"px",k==="transparent"&&(Ke.style.fill=this.uiStyleSettings.toolboxAccentColor,Ke.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>`),_e.appendChild(Ke),_e},x.prototype.setCurrentColor=function(k,W){var ee=this;this.currentColor=k,this.colorBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(k)},x}(ue),Le=function(){function Y(x,k,W){this._state="new",this._isSelected=!1,this._container=x,this._overlayContainer=k,this.globalSettings=W,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Y.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Y.prototype.ownsTarget=function(x){return!1},Object.defineProperty(Y.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Y.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Y.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Y.prototype.pointerDown=function(x,k){},Y.prototype.dblClick=function(x,k){},Y.prototype.manipulate=function(x){},Y.prototype.pointerUp=function(x){this.stateChanged()},Y.prototype.dispose=function(){},Y.prototype.addMarkerVisualToContainer=function(x){this.container.childNodes.length>0?this.container.insertBefore(x,this.container.childNodes[0]):this.container.appendChild(x)},Y.prototype.getState=function(){return{typeName:Y.typeName,state:this.state,notes:this.notes}},Y.prototype.restoreState=function(x){this._state=x.state,this.notes=x.notes},Y.prototype.scale=function(x,k){},Y.prototype.colorChanged=function(x){this.onColorChanged&&this.onColorChanged(x),this.stateChanged()},Y.prototype.fillColorChanged=function(x){this.onFillColorChanged&&this.onFillColorChanged(x),this.stateChanged()},Y.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var x=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),x.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(x)&&this.onStateChanged(this)}},Y.typeName="MarkerBase",Y}(),Ie=function(){function Y(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Y.prototype.findGripByVisual=function(x){return this.topLeft.ownsTarget(x)?this.topLeft:this.topCenter.ownsTarget(x)?this.topCenter:this.topRight.ownsTarget(x)?this.topRight:this.centerLeft.ownsTarget(x)?this.centerLeft:this.centerRight.ownsTarget(x)?this.centerRight:this.bottomLeft.ownsTarget(x)?this.bottomLeft:this.bottomCenter.ownsTarget(x)?this.bottomCenter:this.bottomRight.ownsTarget(x)?this.bottomRight:void 0},Y}(),Ge=function(){function Y(){this.GRIP_SIZE=10,this.visual=ce.createGroup(),this.visual.appendChild(ce.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ce.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Y.prototype.ownsTarget=function(x){return x===this.visual||x===this.visual.childNodes[0]||x===this.visual.childNodes[1]},Y}(),Xe=function(){function Y(){}return Y.toITransformMatrix=function(x){return{a:x.a,b:x.b,c:x.c,d:x.d,e:x.e,f:x.f}},Y.toSVGMatrix=function(x,k){return x.a=k.a,x.b=k.b,x.c=k.c,x.d=k.d,x.e=k.e,x.f=k.f,x},Y}(),Je=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.left=0,V.top=0,V.width=0,V.height=0,V.defaultSize={x:50,y:20},V.offsetX=0,V.offsetY=0,V.rotationAngle=0,V.CB_DISTANCE=10,V._suppressMarkerCreateEvent=!1,V.container.transform.baseVal.appendItem(ce.createTransform()),V.setupControlBox(),V}return Se(x,Y),Object.defineProperty(x.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"visual",{get:function(){return this._visual},set:function(k){this._visual=k;var W=ce.createTransform();this._visual.transform.baseVal.appendItem(W)},enumerable:!1,configurable:!0}),x.prototype.ownsTarget=function(k){return!!Y.prototype.ownsTarget.call(this,k)||!!(this.controlGrips.findGripByVisual(k)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(k))},x.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.state==="new"&&(this.left=k.x,this.top=k.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ee=this.unrotatePoint(k);if(this.manipulationStartX=ee.x,this.manipulationStartY=ee.y,this.offsetX=ee.x-this.left,this.offsetY=ee.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(W),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(W)){this.activeGrip=this.rotatorGrip;var V=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=V.x-this.width/2,this.top=V.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var _e=this.container.transform.baseVal.getItem(0);_e.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(_e,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},x.prototype.pointerUp=function(k){var W=this.state;Y.prototype.pointerUp.call(this,k),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(k),this._state="select",W==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},x.prototype.moveVisual=function(k){this.visual.style.transform="translate("+k.x+"px, "+k.y+"px)"},x.prototype.manipulate=function(k){var W=this.unrotatePoint(k);this.state==="creating"?this.resize(k):this.state==="move"?(this.left=this.manipulationStartLeft+(W.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(W.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(W):this.state==="rotate"&&this.rotate(k)},x.prototype.resize=function(k){var W=this.manipulationStartLeft,ee=this.manipulationStartWidth,V=this.manipulationStartTop,_e=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:W=this.manipulationStartLeft+k.x-this.manipulationStartX,ee=this.manipulationStartWidth+this.manipulationStartLeft-W;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ee=this.manipulationStartWidth+k.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:V=this.manipulationStartTop+k.y-this.manipulationStartY,_e=this.manipulationStartHeight+this.manipulationStartTop-V;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:_e=this.manipulationStartHeight+k.y-this.manipulationStartY}ee>=0?(this.left=W,this.width=ee):(this.left=W+ee,this.width=-ee),_e>=0?(this.top=V,this.height=_e):(this.top=V+_e,this.height=-_e),this.setSize()},x.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},x.prototype.rotate=function(k){if(Math.abs(k.x-this.centerX)>.1){var W=Math.sign(k.x-this.centerX);this.rotationAngle=180*Math.atan((k.y-this.centerY)/(k.x-this.centerX))/Math.PI+90*W,this.applyRotation()}},x.prototype.applyRotation=function(){var k=this.container.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(k,0)},x.prototype.rotatePoint=function(k){if(this.rotationAngle===0)return k;var W=this.container.getCTM(),ee=ce.createPoint(k.x,k.y);return{x:(ee=ee.matrixTransform(W)).x,y:ee.y}},x.prototype.unrotatePoint=function(k){if(this.rotationAngle===0)return k;var W=this.container.getCTM();W=W.inverse();var ee=ce.createPoint(k.x,k.y);return{x:(ee=ee.matrixTransform(W)).x,y:ee.y}},x.prototype.select=function(){Y.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},x.prototype.deselect=function(){Y.prototype.deselect.call(this),this.controlBox.style.display="none"},x.prototype.setupControlBox=function(){this.controlBox=ce.createGroup();var k=ce.createTransform();k.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(k),this.container.appendChild(this.controlBox),this.controlRect=ce.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=ce.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 Ie,this.addControlGrips(),this.controlBox.style.display="none"},x.prototype.adjustControlBox=function(){var k=this.controlBox.transform.baseVal.getItem(0);k.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(k,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()},x.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()},x.prototype.createGrip=function(){var k=new Ge;return k.visual.transform.baseVal.appendItem(ce.createTransform()),this.controlBox.appendChild(k.visual),k},x.prototype.positionGrips=function(){var k=this.controlGrips.topLeft.GRIP_SIZE,W=-k/2,ee=W,V=(this.width+this.CB_DISTANCE)/2-k/2,_e=(this.height+this.CB_DISTANCE)/2-k/2,Ke=this.height+this.CB_DISTANCE-k/2,et=this.width+this.CB_DISTANCE-k/2;this.positionGrip(this.controlGrips.topLeft.visual,W,ee),this.positionGrip(this.controlGrips.topCenter.visual,V,ee),this.positionGrip(this.controlGrips.topRight.visual,et,ee),this.positionGrip(this.controlGrips.centerLeft.visual,W,_e),this.positionGrip(this.controlGrips.centerRight.visual,et,_e),this.positionGrip(this.controlGrips.bottomLeft.visual,W,Ke),this.positionGrip(this.controlGrips.bottomCenter.visual,V,Ke),this.positionGrip(this.controlGrips.bottomRight.visual,et,Ke),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,V,ee-3*this.CB_DISTANCE)},x.prototype.positionGrip=function(k,W,ee){var V=k.transform.baseVal.getItem(0);V.setTranslate(W,ee),k.transform.baseVal.replaceItem(V,0)},x.prototype.hideControlBox=function(){this.controlBox.style.display="none"},x.prototype.showControlBox=function(){this.controlBox.style.display=""},x.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Xe.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Xe.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Y.prototype.getState.call(this))},x.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var W=k;this.left=W.left,this.top=W.top,this.width=W.width,this.height=W.height,this.rotationAngle=W.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Xe.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,W.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Xe.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,W.containerTransformMatrix))},x.prototype.scale=function(k,W){Y.prototype.scale.call(this,k,W);var ee=this.rotatePoint({x:this.left,y:this.top}),V=this.unrotatePoint({x:ee.x*k,y:ee.y*W});this.left=V.x,this.top=V.y,this.width=this.width*k,this.height=this.height*W,this.adjustControlBox()},x}(Le),Qe=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.createVisual=V.createVisual.bind(V),V}return Se(x,Y),x.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual)},x.prototype.createVisual=function(){this.visual=ce.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)},x.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},x.prototype.manipulate=function(k){Y.prototype.manipulate.call(this,k)},x.prototype.resize=function(k){Y.prototype.resize.call(this,k),this.setSize()},x.prototype.setSize=function(){Y.prototype.setSize.call(this),ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},x.prototype.pointerUp=function(k){Y.prototype.pointerUp.call(this,k),this.setSize()},x.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&ce.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},x.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&ce.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},x.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&ce.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},x.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&ce.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},x.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Y.prototype.getState.call(this))},x.prototype.restoreState=function(k){var W=k;this.fillColor=W.fillColor,this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.opacity=W.opacity,this.createVisual(),Y.prototype.restoreState.call(this,k),this.setSize()},x.prototype.scale=function(k,W){Y.prototype.scale.call(this,k,W),this.setSize()},x.title="Rectangle marker",x}(Je),at=function(Y){function x(k,W,ee,V){var _e=Y.call(this,k,V||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return _e.widths=[],_e.widthBoxes=[],_e.widths=W,_e.currentWidth=ee,_e.setCurrentWidth=_e.setCurrentWidth.bind(_e),_e}return Se(x,Y),x.prototype.getUi=function(){var k=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.widths.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.flexGrow="2",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=ee===k.currentWidth?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentWidth(ee,V)}),W.appendChild(V);var _e=document.createElement("div");_e.innerText=ee.toString(),_e.style.marginRight="5px",V.appendChild(_e);var Ke=document.createElement("div");Ke.style.minHeight="20px",Ke.style.flexGrow="2",Ke.style.display="flex",Ke.style.alignItems="center";var et=document.createElement("hr");et.style.minWidth="20px",et.style.border="0px",et.style.borderTop=ee+"px solid "+k.uiStyleSettings.toolboxColor,et.style.flexGrow="2",Ke.appendChild(et),V.appendChild(Ke),k.widthBoxes.push(V)}),W},x.prototype.setCurrentWidth=function(k,W){var ee=this;this.currentWidth=k,this.widthBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},x}(ue),qe=function(Y){function x(k,W,ee,V){var _e=Y.call(this,k,V||'<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 _e.styles=[],_e.styleBoxes=[],_e.styles=W,_e.currentStyle=ee,_e.setCurrentStyle=_e.setCurrentStyle.bind(_e),_e}return Se(x,Y),x.prototype.getUi=function(){var k=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.styles.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/k.styles.length-5+"%",V.style.borderColor=ee===k.currentStyle?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentStyle(ee,V)}),W.appendChild(V);var _e=document.createElement("div");_e.style.minHeight="20px",_e.style.flexGrow="2",_e.style.overflow="hidden";var Ke=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+k.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ee!==""?'stroke-dasharray="'+ee+'"':"")+` />
</svg>`;_e.innerHTML=Ke,V.appendChild(_e),k.styleBoxes.push(V)}),W},x.prototype.setCurrentStyle=function(k,W){var ee=this;this.currentStyle=k,this.styleBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},x}(ue),tt=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new Ee("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new at("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new qe("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Se(x,Y),Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=x.typeName,k},x.typeName="FrameMarker",x.title="Frame marker",x.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',x}(Qe),Be=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},ut=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.x1=0,V.y1=0,V.x2=0,V.y2=0,V.defaultLength=50,V.manipulationStartX=0,V.manipulationStartY=0,V.manipulationStartX1=0,V.manipulationStartY1=0,V.manipulationStartX2=0,V.manipulationStartY2=0,V.setupControlBox(),V}return Se(x,Y),x.prototype.ownsTarget=function(k){return!!Y.prototype.ownsTarget.call(this,k)||!(!this.grip1.ownsTarget(k)&&!this.grip2.ownsTarget(k))},x.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.manipulationStartX=k.x,this.manipulationStartY=k.y,this.state==="new"&&(this.x1=k.x,this.y1=k.y,this.x2=k.x,this.y2=k.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(W)?this.activeGrip=this.grip1:this.grip2.ownsTarget(W)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},x.prototype.pointerUp=function(k){var W=this.state;Y.prototype.pointerUp.call(this,k),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(k),this._state="select",W==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},x.prototype.adjustVisual=function(){},x.prototype.manipulate=function(k){this.state==="creating"?this.resize(k):this.state==="move"?(this.x1=this.manipulationStartX1+k.x-this.manipulationStartX,this.y1=this.manipulationStartY1+k.y-this.manipulationStartY,this.x2=this.manipulationStartX2+k.x-this.manipulationStartX,this.y2=this.manipulationStartY2+k.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(k)},x.prototype.resize=function(k){switch(this.activeGrip){case this.grip1:this.x1=k.x,this.y1=k.y;break;case this.grip2:case void 0:this.x2=k.x,this.y2=k.y}this.adjustVisual(),this.adjustControlBox()},x.prototype.select=function(){Y.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},x.prototype.deselect=function(){Y.prototype.deselect.call(this),this.controlBox.style.display="none"},x.prototype.setupControlBox=function(){this.controlBox=ce.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},x.prototype.adjustControlBox=function(){this.positionGrips()},x.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},x.prototype.createGrip=function(){var k=new Ge;return k.visual.transform.baseVal.appendItem(ce.createTransform()),this.controlBox.appendChild(k.visual),k},x.prototype.positionGrips=function(){var k=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-k/2,this.y1-k/2),this.positionGrip(this.grip2.visual,this.x2-k/2,this.y2-k/2)},x.prototype.positionGrip=function(k,W,ee){var V=k.transform.baseVal.getItem(0);V.setTranslate(W,ee),k.transform.baseVal.replaceItem(V,0)},x.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Y.prototype.getState.call(this))},x.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var W=k;this.x1=W.x1,this.y1=W.y1,this.x2=W.x2,this.y2=W.y2},x.prototype.scale=function(k,W){Y.prototype.scale.call(this,k,W),this.x1=this.x1*k,this.y1=this.y1*W,this.x2=this.x2*k,this.y2=this.y2*W,this.adjustVisual(),this.adjustControlBox()},x}(Le),ot=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new Ee("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new at("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new qe("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Se(x,Y),x.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorLine&&k!==this.visibleLine)},x.prototype.createVisual=function(){this.visual=ce.createGroup(),this.selectorLine=ce.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ce.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)},x.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},x.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()),ce.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ce.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},x.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},x.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},x.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Y.prototype.getState.call(this));return k.typeName=x.typeName,k},x.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var W=k;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.createVisual(),this.adjustVisual()},x.typeName="LineMarker",x.title="Line marker",x.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',x}(ut),Ue=function(Y){function x(k,W,ee,V){var _e=Y.call(this,k,V||'<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 _e.fonts=[],_e.fontBoxes=[],_e.fonts=W,_e.currentFont=ee,_e.setCurrentFont=_e.setCurrentFont.bind(_e),_e}return Se(x,Y),x.prototype.getUi=function(){var k=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.flexGrow="2",this.fonts.forEach(function(ee){var V=document.createElement("div");V.style.display="inline-block",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/k.fonts.length-5+"%",V.style.borderColor=ee===k.currentFont?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentFont(ee,V)}),W.appendChild(V);var _e=document.createElement("div");_e.style.display="flex",_e.style.minHeight="20px",_e.style.flexGrow="2",_e.style.fontFamily=ee,_e.style.overflow="hidden";var Ke=document.createElement("div");Ke.style.whiteSpace="nowrap",Ke.style.overflow="hidden",Ke.style.textOverflow="ellipsis",Ke.innerHTML="The quick brown fox jumps over the lazy dog",_e.appendChild(Ke),V.appendChild(_e),k.fontBoxes.push(V)}),W},x.prototype.setCurrentFont=function(k,W){var ee=this;this.currentFont=k,this.fontBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},x}(ue),He=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.color="transparent",V.padding=5,V.DEFAULT_TEXT="your text here",V.text=V.DEFAULT_TEXT,V.isMoved=!1,V.color=ee.defaultColor,V.fontFamily=ee.defaultFontFamily,V.defaultSize={x:100,y:30},V.setColor=V.setColor.bind(V),V.setFont=V.setFont.bind(V),V.renderText=V.renderText.bind(V),V.sizeText=V.sizeText.bind(V),V.textEditDivClicked=V.textEditDivClicked.bind(V),V.showTextEditor=V.showTextEditor.bind(V),V.setSize=V.setSize.bind(V),V.positionTextEditor=V.positionTextEditor.bind(V),V.colorPanel=new Ee("Color",ee.defaultColorSet,ee.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.fontFamilyPanel=new Ue("Font",ee.defaultFontFamilies,ee.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V}return Se(x,Y),x.prototype.ownsTarget=function(k){if(Y.prototype.ownsTarget.call(this,k)||k===this.visual||k===this.textElement||k===this.bgRectangle)return!0;var W=!1;return this.textElement.childNodes.forEach(function(ee){ee===k&&(W=!0)}),W},x.prototype.createVisual=function(){this.visual=ce.createGroup(),this.bgRectangle=ce.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ce.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ce.createTransform()),this.textElement.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},x.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.isMoved=!1,this.pointerDownPoint=k,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},x.prototype.renderText=function(){var k=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(W){k.textElement.appendChild(ce.createTSpan(W.trim()===""?" ":W.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},x.prototype.getTextScale=function(){var k=this.textElement.getBBox(),W=1;if(k.width>0&&k.height>0){var ee=(1*this.width-this.width*this.padding*2/100)/k.width,V=(1*this.height-this.height*this.padding*2/100)/k.height;W=Math.min(ee,V)}return W},x.prototype.getTextPosition=function(k){var W=this.textElement.getBBox(),ee=0,V=0;return W.width>0&&W.height>0&&(ee=(this.width-W.width*k)/2,V=this.height/2-W.height*k/2),{x:ee,y:V}},x.prototype.sizeText=function(){var k=this.textElement.getBBox(),W=this.getTextScale(),ee=this.getTextPosition(W);ee.y-=k.y*W,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ee.x+"px, "+ee.y+"px) scale("+W+", "+W+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ee.x,ee.y),this.textElement.transform.baseVal.getItem(1).setScale(W,W))},x.prototype.manipulate=function(k){Y.prototype.manipulate.call(this,k),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(k.x-this.pointerDownPoint.x)>5||Math.abs(k.y-this.pointerDownPoint.y)>5)},x.prototype.resize=function(k){Y.prototype.resize.call(this,k),this.isMoved=!0,this.setSize(),this.sizeText()},x.prototype.setSize=function(){Y.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},x.prototype.pointerUp=function(k){var W=this.state;W==="creating"&&(this._suppressMarkerCreateEvent=!0),Y.prototype.pointerUp.call(this,k),this.setSize(),(W==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},x.prototype.showTextEditor=function(){var k=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(W){W.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var W=Number.parseFloat(k.textEditor.style.fontSize);k.textEditor.clientWidth>=Number.parseInt(k.textEditor.style.maxWidth)&&W>.9;)W-=.1,k.textEditor.style.fontSize=Math.max(W,.9)+"em"}),this.textEditor.addEventListener("keyup",function(W){W.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(W){if(W.clipboardData){var ee=W.clipboardData.getData("text"),V=window.getSelection();if(!V.rangeCount)return!1;V.deleteFromDocument(),V.getRangeAt(0).insertNode(document.createTextNode(ee)),W.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){k.textEditDivClicked(k.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},x.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var k=this.getTextScale(),W=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ee=this.textElement.getBBox(),V={x:ee.width*k,y:ee.height*k};W.x-=V.x/2,W.y-=V.y/2,this.textEditor.style.top=W.y+"px",this.textEditor.style.left=W.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-W.x+"px",this.textEditor.style.fontSize=Math.max(16*k,12)+"px",this.textElement.style.display="none"}},x.prototype.textEditDivClicked=function(k){this.text=k.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},x.prototype.select=function(){Y.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},x.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Y.prototype.deselect.call(this)},x.prototype.dblClick=function(k,W){Y.prototype.dblClick.call(this,k,W),this.showTextEditor()},x.prototype.setColor=function(k){this.textElement&&ce.setAttributes(this.textElement,[["fill",k]]),this.color=k,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(k)},x.prototype.setFont=function(k){this.textElement&&ce.setAttributes(this.textElement,[["font-family",k]]),this.fontFamily=k,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},x.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},x.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Y.prototype.getState.call(this));return k.typeName=x.typeName,k},x.prototype.restoreState=function(k){var W=k;this.color=W.color,this.fontFamily=W.fontFamily,this.padding=W.padding,this.text=W.text,this.createVisual(),Y.prototype.restoreState.call(this,k),this.setSize()},x.prototype.scale=function(k,W){Y.prototype.scale.call(this,k,W),this.setSize(),this.sizeText(),this.positionTextEditor()},x.typeName="TextMarker",x.title="Text marker",x.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>',x}(Je),Te=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.color="transparent",V.lineWidth=3,V.drawing=!1,V.pixelRatio=1,V.color=ee.defaultColor,V.lineWidth=ee.defaultStrokeWidth,V.pixelRatio=ee.freehandPixelRatio,V.setColor=V.setColor.bind(V),V.addCanvas=V.addCanvas.bind(V),V.finishCreation=V.finishCreation.bind(V),V.setLineWidth=V.setLineWidth.bind(V),V.colorPanel=new Ee("Color",ee.defaultColorSet,ee.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.lineWidthPanel=new at("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.lineWidthPanel.onWidthChanged=V.setLineWidth,V}return Se(x,Y),x.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.drawingImage)},x.prototype.createVisual=function(){this.visual=ce.createGroup(),this.drawingImage=ce.createImage(),this.visual.appendChild(this.drawingImage);var k=ce.createTransform();this.visual.transform.baseVal.appendItem(k),this.addMarkerVisualToContainer(this.visual)},x.prototype.pointerDown=function(k,W){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(k.x,k.y),this.drawing=!0):Y.prototype.pointerDown.call(this,k,W)},x.prototype.manipulate=function(k){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(k.x,k.y),this.canvasContext.stroke()):Y.prototype.manipulate.call(this,k)},x.prototype.resize=function(k){Y.prototype.resize.call(this,k),ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},x.prototype.pointerUp=function(k){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Y.prototype.pointerUp.call(this,k)},x.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)},x.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.select.call(this)},x.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.deselect.call(this)},x.prototype.finishCreation=function(){for(var k=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),W=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ee=W[0],V=W[1],_e=W[2],Ke=W[3],et=!1,pt=0;pt<this.canvasElement.height;pt++)for(var Ve=0;Ve<this.canvasElement.width;Ve++)k.data[pt*this.canvasElement.width*4+4*Ve+3]>0&&(et=!0,pt<V&&(V=pt),Ve<ee&&(ee=Ve),pt>Ke&&(Ke=pt),Ve>_e&&(_e=Ve));if(et){this.left=ee/this.pixelRatio,this.top=V/this.pixelRatio,this.width=(_e-ee)/this.pixelRatio,this.height=(Ke-V)/this.pixelRatio;var _t=document.createElement("canvas");_t.width=_e-ee,_t.height=Ke-V,_t.getContext("2d").putImageData(this.canvasContext.getImageData(ee,V,_e-ee,Ke-V),0,0),this.drawingImgUrl=_t.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},x.prototype.setDrawingImage=function(){ce.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},x.prototype.setColor=function(k){this.color=k,this.colorChanged(k)},x.prototype.setLineWidth=function(k){this.lineWidth=k},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Object.assign({drawingImgUrl:this.drawingImgUrl},Y.prototype.getState.call(this));return k.typeName=x.typeName,k},x.prototype.restoreState=function(k){this.createVisual(),Y.prototype.restoreState.call(this,k),this.drawingImgUrl=k.drawingImgUrl,this.setDrawingImage()},x.prototype.scale=function(k,W){Y.prototype.scale.call(this,k,W),this.setDrawingImage()},x.typeName="FreehandMarker",x.title="Freehand marker",x.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>',x}(Je),me=function(Y){function x(k,W,ee){var V=Y.call(this,k,ee||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return V.typeBoxes=[],V.currentType=W,V.setCurrentType=V.setCurrentType.bind(V),V}return Se(x,Y),x.prototype.getUi=function(){var k=this,W=document.createElement("div");W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2";for(var ee=function(Ke){var et="both";switch(Ke){case 0:et="both";break;case 1:et="start";break;case 2:et="end";break;case 3:et="none"}var pt=document.createElement("div");if(pt.style.display="flex",pt.style.flexGrow="2",pt.style.alignItems="center",pt.style.justifyContent="space-between",pt.style.padding="5px",pt.style.borderWidth="2px",pt.style.borderStyle="solid",pt.style.borderColor=et===V.currentType?V.uiStyleSettings.toolboxAccentColor:"transparent",pt.addEventListener("click",function(){k.setCurrentType(et,pt)}),W.appendChild(pt),et==="both"||et==="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="`+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Ve.style.marginLeft="5px",pt.appendChild(Ve)}var _t=document.createElement("div");_t.style.display="flex",_t.style.alignItems="center",_t.style.minHeight="20px",_t.style.flexGrow="2";var jt=document.createElement("hr");if(jt.style.minWidth="20px",jt.style.border="0px",jt.style.borderTop="3px solid "+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee"),jt.style.flexGrow="2",_t.appendChild(jt),pt.appendChild(_t),et==="both"||et==="end"){var $t=document.createElement("div");$t.style.display="flex",$t.style.alignItems="center",$t.style.minHeight="20px",$t.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="`+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,$t.style.marginRight="5px",pt.appendChild($t)}V.typeBoxes.push(pt)},V=this,_e=0;_e<4;_e++)ee(_e);return W},x.prototype.setCurrentType=function(k,W){var ee=this;this.currentType=k,this.typeBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings!==void 0?ee.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},x}(ue),be=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.arrowType="end",V.arrowBaseHeight=10,V.arrowBaseWidth=10,V.getArrowPoints=V.getArrowPoints.bind(V),V.setArrowType=V.setArrowType.bind(V),V.arrowTypePanel=new me("Arrow type","end"),V.arrowTypePanel.onArrowTypeChanged=V.setArrowType,V}return Se(x,Y),x.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.arrow1&&k!==this.arrow2)},x.prototype.getArrowPoints=function(k,W){var ee=this.arrowBaseWidth+2*this.strokeWidth,V=this.arrowBaseHeight+2*this.strokeWidth;return k-ee/2+","+(W+V/2)+" "+k+","+(W-V/2)+" "+(k+ee/2)+","+(W+V/2)},x.prototype.createTips=function(){this.arrow1=ce.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ce.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.arrow2)},x.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.state==="creating"&&this.createTips()},x.prototype.adjustVisual=function(){if(Y.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",ce.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ce.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.arrow1.transform.baseVal.getItem(0);W.setRotate(k,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(W,0);var ee=this.arrow2.transform.baseVal.getItem(0);ee.setRotate(k+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ee,0)}},x.prototype.setArrowType=function(k){this.arrowType=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Object.assign({arrowType:this.arrowType},Y.prototype.getState.call(this));return k.typeName=x.typeName,k},x.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var W=k;this.arrowType=W.arrowType,this.createTips(),this.adjustVisual()},x.typeName="ArrowMarker",x.title="Arrow marker",x.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',x}(ot),ae=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.fillColor=ee.defaultFillColor,V.strokeWidth=0,V.fillPanel=new Ee("Color",ee.defaultColorSet,ee.defaultFillColor),V.fillPanel.onColorChanged=V.setFillColor,V}return Se(x,Y),Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=x.typeName,k},x.typeName="CoverMarker",x.title="Cover marker",x.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',x}(Qe),le=function(Y){function x(k,W,ee,V){var _e=Y.call(this,k,V||'<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 _e.opacities=[],_e.opacityBoxes=[],_e.opacities=W,_e.currentOpacity=ee,_e.setCurrentOpacity=_e.setCurrentOpacity.bind(_e),_e}return Se(x,Y),x.prototype.getUi=function(){var k=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",W.style.justifyContent="space-between",this.opacities.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="center",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=ee===k.currentOpacity?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentOpacity(ee,V)}),W.appendChild(V);var _e=document.createElement("div");_e.innerText=100*ee+"%",V.appendChild(_e),k.opacityBoxes.push(V)}),W},x.prototype.setCurrentOpacity=function(k,W){var ee=this;this.currentOpacity=k,this.opacityBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},x}(ue),de=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.setOpacity=V.setOpacity.bind(V),V.fillColor=ee.defaultHighlightColor,V.strokeWidth=0,V.opacity=ee.defaultHighlightOpacity,V.fillPanel=new Ee("Color",ee.defaultColorSet,V.fillColor),V.fillPanel.onColorChanged=V.setFillColor,V.opacityPanel=new le("Opacity",ee.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return Se(x,Y),x.prototype.setOpacity=function(k){this.opacity=k,this.visual&&ce.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=x.typeName,k},x.typeName="HighlightMarker",x.title="Highlight marker",x.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>',x}(ae),ge='<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>',we=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.bgColor="transparent",V.tipPosition={x:0,y:0},V.tipBase1Position={x:0,y:0},V.tipBase2Position={x:0,y:0},V.tipMoving=!1,V.color=ee.defaultStrokeColor,V.bgColor=ee.defaultFillColor,V.fontFamily=ee.defaultFontFamily,V.defaultSize={x:100,y:30},V.setBgColor=V.setBgColor.bind(V),V.getTipPoints=V.getTipPoints.bind(V),V.positionTip=V.positionTip.bind(V),V.setTipPoints=V.setTipPoints.bind(V),V.colorPanel=new Ee("Text color",ee.defaultColorSet,V.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>'),V.colorPanel.onColorChanged=V.setColor,V.bgColorPanel=new Ee("Fill color",ee.defaultColorSet,V.bgColor,ge),V.bgColorPanel.onColorChanged=V.setBgColor,V.fontFamilyPanel=new Ue("Font",ee.defaultFontFamilies,ee.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V.tipGrip=new Ge,V.tipGrip.visual.transform.baseVal.appendItem(ce.createTransform()),V.controlBox.appendChild(V.tipGrip.visual),V}return Se(x,Y),x.prototype.ownsTarget=function(k){return Y.prototype.ownsTarget.call(this,k)||this.tipGrip.ownsTarget(k)||this.tip===k},x.prototype.createTip=function(){ce.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ce.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},x.prototype.pointerDown=function(k,W){this.state==="new"&&Y.prototype.pointerDown.call(this,k,W),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(W)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Y.prototype.pointerDown.call(this,k,W)},x.prototype.pointerUp=function(k){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Y.prototype.pointerUp.call(this,k);else{var W=this.state==="creating";Y.prototype.pointerUp.call(this,k),this.setTipPoints(W),this.positionTip()}},x.prototype.manipulate=function(k){if(this.tipMoving){var W=this.unrotatePoint(k);this.tipPosition={x:W.x-this.manipulationStartLeft,y:W.y-this.manipulationStartTop},this.positionTip()}else Y.prototype.manipulate.call(this,k)},x.prototype.setBgColor=function(k){this.bgRectangle&&this.tip&&(ce.setAttributes(this.bgRectangle,[["fill",k]]),ce.setAttributes(this.tip,[["fill",k]])),this.bgColor=k,this.fillColorChanged(k)},x.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},x.prototype.setTipPoints=function(k){k===void 0&&(k=!1);var W=Math.min(this.height/2,15),ee=this.height/5;k&&(this.tipPosition={x:W+ee/2,y:this.height+20});var V=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?V<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ee=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:W,y:0},this.tipBase2Position={x:W+ee,y:0}):(this.tipBase1Position={x:0,y:W},this.tipBase2Position={x:0,y:W+ee}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?V<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ee=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-W-ee,y:0},this.tipBase2Position={x:this.width-W,y:0}):(this.tipBase1Position={x:this.width,y:W},this.tipBase2Position={x:this.width,y:W+ee}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?V<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ee=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-W-ee,y:this.height},this.tipBase2Position={x:this.width-W,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-W-ee},this.tipBase2Position={x:this.width,y:this.height-W}):V<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ee=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:W,y:this.height},this.tipBase2Position={x:W+ee,y:this.height}):(this.tipBase1Position={x:0,y:this.height-W},this.tipBase2Position={x:0,y:this.height-W-ee})},x.prototype.resize=function(k){Y.prototype.resize.call(this,k),this.positionTip()},x.prototype.positionTip=function(){ce.setAttributes(this.tip,[["points",this.getTipPoints()]]);var k=this.tipGrip.visual.transform.baseVal.getItem(0);k.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(k,0)},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),x.prototype.select=function(){this.positionTip(),Y.prototype.select.call(this)},x.prototype.getState=function(){var k=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Y.prototype.getState.call(this));return k.typeName=x.typeName,k},x.prototype.restoreState=function(k){var W=k;this.bgColor=W.bgColor,this.tipPosition=W.tipPosition,Y.prototype.restoreState.call(this,k),this.createTip(),this.setTipPoints()},x.prototype.scale=function(k,W){Y.prototype.scale.call(this,k,W),this.tipPosition={x:this.tipPosition.x*k,y:this.tipPosition.y*W},this.positionTip()},x.typeName="CalloutMarker",x.title="Callout marker",x.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>',x}(He),Fe=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.fillColor=ee.defaultFillColor,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.setOpacity=V.setOpacity.bind(V),V.createVisual=V.createVisual.bind(V),V.strokePanel=new Ee("Line color",he(ee.defaultColorSet,["transparent"]),ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.fillPanel=new Ee("Fill color",he(ee.defaultColorSet,["transparent"]),V.fillColor,ge),V.fillPanel.onColorChanged=V.setFillColor,V.strokeWidthPanel=new at("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new qe("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V.opacityPanel=new le("Opacity",ee.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return Se(x,Y),x.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual)},x.prototype.createVisual=function(){this.visual=ce.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)},x.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},x.prototype.manipulate=function(k){Y.prototype.manipulate.call(this,k)},x.prototype.resize=function(k){Y.prototype.resize.call(this,k),this.setSize()},x.prototype.setSize=function(){Y.prototype.setSize.call(this),ce.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},x.prototype.pointerUp=function(k){Y.prototype.pointerUp.call(this,k),this.setSize()},x.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&ce.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},x.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&ce.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(k),this.stateChanged()},x.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&ce.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},x.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&ce.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},x.prototype.setOpacity=function(k){this.opacity=k,this.visual&&ce.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Y.prototype.getState.call(this));return k.typeName=x.typeName,k},x.prototype.restoreState=function(k){var W=k;this.fillColor=W.fillColor,this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.opacity=W.opacity,this.createVisual(),Y.prototype.restoreState.call(this,k),this.setSize()},x.prototype.scale=function(k,W){Y.prototype.scale.call(this,k,W),this.setSize()},x.typeName="EllipseMarker",x.title="Ellipse marker",x.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>',x}(Je),ze=function(Y){function x(k,W,ee){return Y.call(this,k,W,ee)||this}return Se(x,Y),Object.defineProperty(x.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),x.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.tip1&&k!==this.tip2)},x.prototype.createTips=function(){this.tip1=ce.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(ce.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ce.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(ce.createTransform()),this.visual.appendChild(this.tip2)},x.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.state==="creating"&&this.createTips()},x.prototype.adjustVisual=function(){if(Y.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ce.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()]]),ce.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 k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.tip1.transform.baseVal.getItem(0);W.setRotate(k,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(W,0);var ee=this.tip2.transform.baseVal.getItem(0);ee.setRotate(k+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ee,0)}},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=x.typeName,k},x.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k),this.createTips(),this.adjustVisual()},x.typeName="MeasurementMarker",x.title="Measurement marker",x.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>',x}(ot),st=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.strokePanel.colors=ee.defaultColorSet,V.fillColor="transparent",V}return Se(x,Y),Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=x.typeName,k},x.typeName="EllipseFrameMarker",x.title="Ellipse frame marker",x.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>',x}(Fe),mt=function(){function Y(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Y.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Y.prototype.addUndoStep=function(x){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(x)||(this.undoStack.push(x),JSON.stringify(this.lastRedoStep)!==JSON.stringify(x)&&this.redoStack.splice(0,this.redoStack.length))},Y.prototype.replaceLastUndoStep=function(x){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=x)},Y.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Y.prototype.undo=function(){if(this.undoStack.length>1){var x=this.undoStack.pop();return x!==void 0&&this.redoStack.push(x),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Y.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Y}(),ft=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.curveX=0,V.curveY=0,V.manipulationStartCurveX=0,V.manipulationStartCurveY=0,V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.positionGrips=V.positionGrips.bind(V),V.addControlGrips=V.addControlGrips.bind(V),V.adjustVisual=V.adjustVisual.bind(V),V.setupControlBox=V.setupControlBox.bind(V),V.resize=V.resize.bind(V),V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new Ee("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new at("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new qe("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Se(x,Y),x.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorCurve&&k!==this.visibleCurve&&!this.curveGrip.ownsTarget(k))},x.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},x.prototype.createVisual=function(){this.visual=ce.createGroup(),this.selectorCurve=ce.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ce.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)},x.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=k.x,this.curveY=k.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(W)&&(this.activeGrip=this.curveGrip,this._state="resize")},x.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ce.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ce.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},x.prototype.setupControlBox=function(){Y.prototype.setupControlBox.call(this),this.curveControlLine1=ce.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ce.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)},x.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Y.prototype.addControlGrips.call(this)},x.prototype.positionGrips=function(){Y.prototype.positionGrips.call(this);var k=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-k/2,this.curveY-k/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()))},x.prototype.manipulate=function(k){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+k.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+k.y-this.manipulationStartY),Y.prototype.manipulate.call(this,k)},x.prototype.resize=function(k){this.activeGrip===this.curveGrip&&(this.curveX=k.x,this.curveY=k.y),Y.prototype.resize.call(this,k),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},x.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},x.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},x.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual()},x.prototype.scale=function(k,W){this.curveX=this.curveX*k,this.curveY=this.curveY*W,Y.prototype.scale.call(this,k,W)},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Y.prototype.getState.call(this));return k.typeName=x.typeName,k},x.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var W=k;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.curveX=W.curveX,this.curveY=W.curveY,this.createVisual(),this.adjustVisual()},x.typeName="CurveMarker",x.title="Curve marker",x.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>',x}(ut),wt=function(){function Y(x,k){k===void 0&&(k=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=x,this.cancelable=k}return Object.defineProperty(Y.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Y.prototype.preventDefault=function(){this._defaultPrevented=!0},Y}(),St=function(Y){function x(k,W,ee){var V=Y.call(this,k,!1)||this;return V.dataUrl=W,V.state=ee,V}return Se(x,Y),x}(wt),ct=function(Y){function x(k,W,ee){ee===void 0&&(ee=!1);var V=Y.call(this,k,ee)||this;return V.marker=W,V}return Se(x,Y),x}(wt),Ut=function(){function Y(){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 Y.prototype.addEventListener=function(x,k){this[x].push(k)},Y.prototype.removeEventListener=function(x,k){var W=this[x].indexOf(k);W>-1&&this[x].splice(W,1)},Y}(),Lt=function(){function Y(x){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Be,this._isOpen=!1,this.undoRedoManager=new mt,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 Ut,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Y.instanceCounter++,this.styles=new ke(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=x,this.targetRoot=document.body,this.width=x.clientWidth,this.height=x.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(Y.prototype,"ALL_MARKER_TYPES",{get:function(){return[tt,Te,be,He,st,Fe,de,we,ze,ae,ot,ft]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[tt,Te,be,He,Fe,de,we]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"BASIC_MARKER_TYPES",{get:function(){return[tt,Te,be,He,de]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(x){var k=this;this._availableMarkerTypes.splice(0),x.forEach(function(W){if(typeof W=="string"){var ee=k.ALL_MARKER_TYPES.find(function(V){return V.typeName===W});ee!==void 0&&k._availableMarkerTypes.push(ee)}else k._availableMarkerTypes.push(W)})},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(x){this._zoomLevel=x,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(Y.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Y.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),re.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Y.prototype.show=function(){var x=this;this.styles.styleSheetRoot===void 0&&se.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=se.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(k){return k(new wt(x))})},Y.prototype.render=function(){return Ae(this,void 0,void 0,function(){var x;return Oe(this,function(k){switch(k.label){case 0:return this.setCurrentMarker(),(x=new fe).naturalSize=this.renderAtNaturalSize,x.imageType=this.renderImageType,x.imageQuality=this.renderImageQuality,x.markersOnly=this.renderMarkersOnly,x.width=this.renderWidth,x.height=this.renderHeight,[4,x.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return k.sent(),[4,x.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,k.sent()]}})})},Y.prototype.close=function(x){var k=this;if(x===void 0&&(x=!1),this.isOpen){var W=!1;x||this.eventListeners.beforeclose.forEach(function(ee){var V=new wt(k,!0);ee(V),V.defaultPrevented&&(W=!0)}),W||(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(ee){return ee(new wt(k))}),this.detachEvents(),this._isOpen=!1)}},Y.prototype.addMarkersToToolbar=function(){for(var x,k=[],W=0;W<arguments.length;W++)k[W]=arguments[W];(x=this._availableMarkerTypes).push.apply(x,k)},Y.prototype.addRenderEventListener=function(x){this.addEventListener("render",function(k){x(k.dataUrl,k.state)})},Y.prototype.removeRenderEventListener=function(x){},Y.prototype.addCloseEventListener=function(x){this.addEventListener("close",function(){x()})},Y.prototype.removeCloseEventListener=function(x){},Y.prototype.setupResizeObserver=function(){var x=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){x.resize(x.target.clientWidth,x.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return x.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Y.prototype.onPopupTargetResize=function(){var x=1*this.target.clientWidth/this.target.clientHeight,k=this.editorCanvas.clientWidth/x>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*x:this.editorCanvas.clientWidth,W=k<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/x;this.resize(k,W)},Y.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Y.prototype.resize=function(x,k){this._isResizing=!0;var W=x/this.imageWidth,ee=k/this.imageHeight;this.imageWidth=Math.round(x),this.imageHeight=Math.round(k),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(W,ee),this._isResizing=!1},Y.prototype.scaleMarkers=function(x,k){var W,ee=this;this._currentMarker&&this._currentMarker instanceof He?this._currentMarker.scale(x,k):(W=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(V){V!==ee._currentMarker&&V.scale(x,k)}),W!==void 0&&this.setCurrentMarker(W)},Y.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"},Y.prototype.setTopLeft=function(){var x=this.editingTarget.getBoundingClientRect(),k=this.editorCanvas.getBoundingClientRect();this.left=x.left-k.left,this.top=x.top-k.top},Y.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)},Y.prototype.addDefs=function(){for(var x,k=[],W=0;W<arguments.length;W++)k[W]=arguments[W];this.defs=ce.createDefs(),this.addDefsToImage(),(x=this.defs).append.apply(x,k)},Y.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},Y.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)},Y.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},Y.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},Y.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)},Y.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},Y.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)},Y.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 x=document.createElement("a");x.href="https://markerjs.com/",x.target="_blank",x.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>',x.title="Powered by marker.js",x.style.display="grid",x.style.alignItems="center",x.style.justifyItems="center",x.style.padding="3px",x.style.width="20px",x.style.height="20px",this.logoUI.appendChild(x),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Y.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")},Y.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"},Y.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Y.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 x=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=x+"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 Pe(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 je(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},Y.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Y.prototype.removeMarker=function(x){this.markerImage.removeChild(x.container),this.markers.indexOf(x)>-1&&this.markers.splice(this.markers.indexOf(x),1),x.dispose()},Y.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())},Y.prototype.toolbarButtonClicked=function(x,k){if(x==="marker"&&k!==void 0)this.createNewMarker(k);else if(x==="action")switch(k){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()}},Y.prototype.deleteSelectedMarker=function(){var x=this;if(this._currentMarker!==void 0){var k=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ee){var V=new ct(x,x._currentMarker,!0);ee(V),V.defaultPrevented&&(k=!0)}),!k){var W=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(ee){return ee(new ct(x,W))})}}},Y.prototype.clear=function(){var x=this,k=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(_e){var Ke=new ct(x,void 0,!0);_e(Ke),Ke.defaultPrevented&&(k=!0)}),!k)){this.setCurrentMarker();for(var W=function(_e){var Ke=ee.markers[_e];ee.setCurrentMarker(ee.markers[_e]),ee._currentMarker.dispose(),ee.markerImage.removeChild(ee._currentMarker.container),ee.markers.splice(ee.markers.indexOf(ee._currentMarker),1),ee.eventListeners.markerdelete.forEach(function(et){return et(new ct(x,Ke))})},ee=this,V=this.markers.length-1;V>=0;V--)W(V);this.addUndoStep()}},Object.defineProperty(Y.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Y.prototype.showNotesEditor=function(){var x;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=(x=this._currentMarker.notes)!==null&&x!==void 0?x:"",this.overlayContainer.appendChild(this.notesArea))},Y.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)},Y.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Y.prototype.addUndoStep=function(){var x=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var k=this.getState(),W=this.undoRedoManager.getLastUndoStep();if(!W||W.width===k.width&&W.height===k.height){var ee=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(k),ee<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(V){return V(new wt(x))})}else this.undoRedoManager.replaceLastUndoStep(k),this.eventListeners.statechange.forEach(function(V){return V(new wt(x))})}},Y.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Y.prototype.undoStep=function(){var x=this,k=this.undoRedoManager.undo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(W){return W(new wt(x))}))},Y.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Y.prototype.redoStep=function(){var x=this,k=this.undoRedoManager.redo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(W){return W(new wt(x))}))},Y.prototype.stepZoom=function(){var x=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=x<this.zoomSteps.length-1?this.zoomSteps[x+1]:this.zoomSteps[0]},Y.prototype.panTo=function(x){this.contentDiv.scrollBy({left:this.prevPanPoint.x-x.x,top:this.prevPanPoint.y-x.y}),this.prevPanPoint=x},Y.prototype.startRenderAndClose=function(){return Ae(this,void 0,void 0,function(){var x,k,W=this;return Oe(this,function(ee){switch(ee.label){case 0:return[4,this.render()];case 1:return x=ee.sent(),k=this.getState(),this.eventListeners.render.forEach(function(V){return V(new St(W,x,k))}),this.close(!0),[2]}})})},Y.prototype.getState=function(x){x===!0&&this.setCurrentMarker();var k={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(W){return k.markers.push(W.getState())}),k},Y.prototype.restoreState=function(x){var k=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);x.markers.forEach(function(W){var ee=k._availableMarkerTypes.find(function(_e){return _e.typeName===W.typeName});if(ee!==void 0){var V=k.addNewMarker(ee);V.restoreState(W),k.markers.push(V)}}),x.width&&x.height&&(x.width!==this.imageWidth||x.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/x.width,this.imageHeight/x.height),this.eventListeners.restorestate.forEach(function(W){return W(new wt(k))})},Y.prototype.addNewMarker=function(x){var k=ce.createGroup();return this.markerImage.appendChild(k),new x(k,this.overlayContainer,this.settings)},Y.prototype.createNewMarker=function(x){var k,W=this;(k=typeof x=="string"?this._availableMarkerTypes.find(function(ee){return ee.typeName===x}):x)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(k),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(k.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ee){return ee(new ct(W,W._currentMarker))}))},Y.prototype.markerCreated=function(x){var k=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(x),this.setCurrentMarker(x),x instanceof Te&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Te):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(W){return W(new ct(k,k._currentMarker))})},Y.prototype.colorChanged=function(x){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=x,this.settings.defaultStrokeColor=x)},Y.prototype.fillColorChanged=function(x){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=x)},Y.prototype.markerStateChanged=function(x){var k=this;this.eventListeners.markerchange.forEach(function(W){return W(new ct(k,x))})},Y.prototype.setCurrentMarker=function(x){var k=this;this._currentMarker!==x&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(W){return W(new ct(k,k._currentMarker))})),this._currentMarker=x,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(W){return W(new ct(k,k._currentMarker))}))},Y.prototype.onPointerDown=function(x){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||x.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var k=this.markers.find(function(W){return W.ownsTarget(x.target)});k!==void 0?(this.setCurrentMarker(k),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(x.clientX,x.clientY),x.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:x.clientX,y:x.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(x.clientX,x.clientY))},Y.prototype.onDblClick=function(x){if(this._isFocused||this.focus(),this.mode==="select"){var k=this.markers.find(function(W){return W.ownsTarget(x.target)});k!==void 0&&k!==this._currentMarker&&this.setCurrentMarker(k),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(x.clientX,x.clientY),x.target):this.setCurrentMarker()}},Y.prototype.onPointerMove=function(x){this.touchPoints!==1&&x.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||x.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(x.clientX,x.clientY)):this.zoomLevel>1&&this.panTo({x:x.clientX,y:x.clientY}))},Y.prototype.onPointerUp=function(x){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(x.clientX,x.clientY)),this.isDragging=!1,this.addUndoStep()},Y.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Y.prototype.onKeyUp=function(x){this._currentMarker===void 0||this.notesArea!==void 0||x.key!=="Delete"&&x.key!=="Backspace"||this.deleteSelectedMarker()},Y.prototype.clientToLocalCoordinates=function(x,k){var W=this.markerImage.getBoundingClientRect();return{x:(x-W.left)/this.zoomLevel,y:(k-W.top)/this.zoomLevel}},Y.prototype.onWindowResize=function(){this.positionUI()},Y.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var x=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=x+"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()},Y.prototype.addLicenseKey=function(x){re.addKey(x)},Y.prototype.addEventListener=function(x,k){this.eventListeners.addEventListener(x,k)},Y.prototype.removeEventListener=function(x,k){this.eventListeners.removeEventListener(x,k)},Y.prototype.renderState=function(x){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(x),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Y.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Y.prototype.focus=function(){var x=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(k){return k(new wt(x))}))},Y.prototype.blur=function(){var x=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(k){return k(new wt(x))}))},Y.instanceCounter=0,Y}();/* **********************************
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 qt=function(Y,x){return(qt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,W){k.__proto__=W}||function(k,W){for(var ee in W)Object.prototype.hasOwnProperty.call(W,ee)&&(k[ee]=W[ee])})(Y,x)};function Qt(Y,x){if(typeof x!="function"&&x!==null)throw new TypeError("Class extends value "+String(x)+" is not a constructor or null");function k(){this.constructor=Y}qt(Y,x),Y.prototype=x===null?Object.create(x):(k.prototype=x.prototype,new k)}function It(Y,x,k,W){return new(k||(k=Promise))(function(ee,V){function _e(pt){try{et(W.next(pt))}catch(Ve){V(Ve)}}function Ke(pt){try{et(W.throw(pt))}catch(Ve){V(Ve)}}function et(pt){var Ve;pt.done?ee(pt.value):(Ve=pt.value,Ve instanceof k?Ve:new k(function(_t){_t(Ve)})).then(_e,Ke)}et((W=W.apply(Y,x||[])).next())})}function Cr(Y,x){var k,W,ee,V,_e={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return V={next:Ke(0),throw:Ke(1),return:Ke(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function Ke(et){return function(pt){return function(Ve){if(k)throw new TypeError("Generator is already executing.");for(;_e;)try{if(k=1,W&&(ee=2&Ve[0]?W.return:Ve[0]?W.throw||((ee=W.return)&&ee.call(W),0):W.next)&&!(ee=ee.call(W,Ve[1])).done)return ee;switch(W=0,ee&&(Ve=[2&Ve[0],ee.value]),Ve[0]){case 0:case 1:ee=Ve;break;case 4:return _e.label++,{value:Ve[1],done:!1};case 5:_e.label++,W=Ve[1],Ve=[0];continue;case 7:Ve=_e.ops.pop(),_e.trys.pop();continue;default:if(!(ee=_e.trys,(ee=ee.length>0&&ee[ee.length-1])||Ve[0]!==6&&Ve[0]!==2)){_e=0;continue}if(Ve[0]===3&&(!ee||Ve[1]>ee[0]&&Ve[1]<ee[3])){_e.label=Ve[1];break}if(Ve[0]===6&&_e.label<ee[1]){_e.label=ee[1],ee=Ve;break}if(ee&&_e.label<ee[2]){_e.label=ee[2],_e.ops.push(Ve);break}ee[2]&&_e.ops.pop(),_e.trys.pop();continue}Ve=x.call(Y,_e)}catch(_t){Ve=[6,_t],W=0}finally{k=ee=0}if(5&Ve[0])throw Ve[1];return{value:Ve[0]?Ve[1]:void 0,done:!0}}([et,pt])}}}var Kr=function(){function Y(){}return Y.addKey=function(x){Y.key=x},Object.defineProperty(Y,"isLicensed",{get:function(){return!!Y.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Y.key)},enumerable:!1,configurable:!0}),Y}(),yt=function(){function Y(){}return Y.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Y.setAttributes=function(x,k){for(var W=0,ee=k;W<ee.length;W++){var V=ee[W],_e=V[0],Ke=V[1];x.setAttribute(_e,Ke)}},Y.createRect=function(x,k,W){var ee=document.createElementNS("http://www.w3.org/2000/svg","rect");return ee.setAttribute("width",x.toString()),ee.setAttribute("height",k.toString()),W&&Y.setAttributes(ee,W),ee},Y.createLine=function(x,k,W,ee,V){var _e=document.createElementNS("http://www.w3.org/2000/svg","line");return _e.setAttribute("x1",x.toString()),_e.setAttribute("y1",k.toString()),_e.setAttribute("x2",W.toString()),_e.setAttribute("y2",ee.toString()),V&&Y.setAttributes(_e,V),_e},Y.createPolygon=function(x,k){var W=document.createElementNS("http://www.w3.org/2000/svg","polygon");return W.setAttribute("points",x),k&&Y.setAttributes(W,k),W},Y.createCircle=function(x,k){var W=document.createElementNS("http://www.w3.org/2000/svg","circle");return W.setAttribute("cx",(x/2).toString()),W.setAttribute("cy",(x/2).toString()),W.setAttribute("r",x.toString()),k&&Y.setAttributes(W,k),W},Y.createEllipse=function(x,k,W){var ee=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ee.setAttribute("cx",(x/2).toString()),ee.setAttribute("cy",(k/2).toString()),ee.setAttribute("rx",(x/2).toString()),ee.setAttribute("ry",(k/2).toString()),W&&Y.setAttributes(ee,W),ee},Y.createGroup=function(x){var k=document.createElementNS("http://www.w3.org/2000/svg","g");return x&&Y.setAttributes(k,x),k},Y.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Y.createMarker=function(x,k,W,ee,V,_e,Ke){var et=document.createElementNS("http://www.w3.org/2000/svg","marker");return Y.setAttributes(et,[["id",x],["orient",k],["markerWidth",W.toString()],["markerHeight",ee.toString()],["refX",V.toString()],["refY",_e.toString()]]),et.appendChild(Ke),et},Y.createText=function(x){var k=document.createElementNS("http://www.w3.org/2000/svg","text");return k.setAttribute("x","0"),k.setAttribute("y","0"),x&&Y.setAttributes(k,x),k},Y.createTSpan=function(x,k){var W=document.createElementNS("http://www.w3.org/2000/svg","tspan");return W.textContent=x,k&&Y.setAttributes(W,k),W},Y.createImage=function(x){var k=document.createElementNS("http://www.w3.org/2000/svg","image");return x&&Y.setAttributes(k,x),k},Y.createPoint=function(x,k){var W=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return W.x=x,W.y=k,W},Y.createPath=function(x,k){var W=document.createElementNS("http://www.w3.org/2000/svg","path");return W.setAttribute("d",x),k&&Y.setAttributes(W,k),W},Y.createElement=function(x,k){var W=document.createElementNS("http://www.w3.org/2000/svg",x);return k&&Y.setAttributes(W,k),W},Y.getHollowRectanglePath=function(x,k,W,ee,V,_e,Ke,et){return"M"+x+","+k+"V"+(k+ee)+"H"+(x+W)+"V"+k+"H"+V+"V"+_e+"H"+(V+Ke)+"V"+(_e+et)+"H"+V+"V"+k+"Z"},Y}(),Lr=function(){function Y(x){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+x+"_"}return Object.defineProperty(Y.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Y.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(Y.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),Y.prototype.addClass=function(x){return this.styleSheet===void 0&&this.addStyleSheet(),x.name=""+this.classNamePrefix+x.localName,this.classes.push(x),this.styleSheet.sheet.insertRule("."+x.name+" {"+x.style+"}",this.styleSheet.sheet.cssRules.length),x},Y.prototype.addRule=function(x){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(x),this.styleSheet.sheet.insertRule(x.selector+" {"+x.style+"}",this.styleSheet.sheet.cssRules.length)},Y.prototype.addStyleSheet=function(){var x;this.styleSheet=document.createElement("style"),((x=this.styleSheetRoot)!==null&&x!==void 0?x:document.head).appendChild(this.styleSheet),this.addRule(new bt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new bt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new bt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new xt("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new xt("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},Y.prototype.removeStyleSheet=function(){var x;this.styleSheet&&(((x=this.styleSheetRoot)!==null&&x!==void 0?x:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Y}(),bt=function(Y,x){this.selector=Y,this.style=x},xt=function(Y,x){this.localName=Y,this.style=x},Ft=function(){function Y(){this.blocks=[],this.display=""}return Y.prototype.addButtonBlock=function(x){x.className=this.blockClassName,x.buttonClassName=this.buttonClassName,x.buttonColorsClassName=this.buttonColorsClassName,x.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(x)},Y.prototype.addElementBlock=function(x){x.className===void 0&&(x.className=this.blockClassName),this.blocks.push(x)},Y.prototype.getUI=function(){var x=document.createElement("div");return x.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,x.style.display=this.display,this.blocks.forEach(function(k){return x.appendChild(k.getUI())}),x},Y}(),tr=function(){function Y(){}return Y.prototype.getUI=function(){var x=document.createElement("div");if(x.className=this.className,this.minWidth!==void 0&&(x.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":x.style.justifyContent="flex-start";break;case"center":x.style.justifyContent="center";break;case"end":x.style.justifyContent="flex-end"}return x.style.whiteSpace="nowrap",x},Y}(),cr=function(Y){function x(){var k=Y!==null&&Y.apply(this,arguments)||this;return k.buttons=[],k}return Qt(x,Y),x.prototype.addButton=function(k){k.className=this.buttonClassName,k.colorsClassName=this.buttonColorsClassName,k.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(k)},x.prototype.getUI=function(){var k=Y.prototype.getUI.call(this);return this.buttons.forEach(function(W){return k.appendChild(W.getUI())}),k},x}(tr),Pt=function(){function Y(x,k){this._isActive=!1,this._isHidden=!1,this._icon=x,this.title=k,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(Y.prototype,"icon",{get:function(){return this._icon},set:function(x){this._icon=x,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isActive",{get:function(){return this._isActive},set:function(x){this._isActive=x,this.adjustClassName()},enumerable:!1,configurable:!0}),Y.prototype.getUI=function(){var x=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 x.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},Y.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,"")))},Y.prototype.hide=function(){this._isHidden=!0},Y}(),dt=function(Y){function x(){var k=Y!==null&&Y.apply(this,arguments)||this;return k.elements=[],k}return Qt(x,Y),x.prototype.addElement=function(k){this.elements.push(k)},x.prototype.getUI=function(){var k=Y.prototype.getUI.call(this);return this.elements.forEach(function(W){return k.appendChild(W)}),k},x}(tr),Ur=function(){function Y(x,k){this.horizontal=x,this.vertical=k}return Object.defineProperty(Y.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),Y.prototype.getVerticalLength=function(x){return x/this.ratio},Y.prototype.getHorizontalLength=function(x){return x*this.ratio},Y}(),Vt=function(){function Y(){}return Y.getIcon=function(x,k){if(x>0&&k>0){var W=new Ur(x,k),ee=W.ratio>=1?20:W.getHorizontalLength(20),V=W.ratio<1?20:W.getVerticalLength(20),_e=document.createElementNS("http://www.w3.org/2000/svg","svg");_e.setAttribute("xmlns","http://www.w3.org/2000/svg"),_e.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(_e);var Ke=yt.createDefs();_e.appendChild(Ke);var et=yt.createElement("clipPath",[["id","text-bg-clip"]]);Ke.appendChild(et);var pt=yt.createPath(yt.getHollowRectanglePath((24-ee)/2,(24-V)/2,ee,V,(24-ee)/2+2,(24-V)/2+2,ee-4,V-4));_e.appendChild(pt);var Ve=yt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ve.appendChild(yt.createTSpan(x+":"+k)),_e.appendChild(Ve);var _t=Ve.getBBox();yt.setAttributes(Ve,[["x",((24-_t.width)/2).toString()],["y",((24-_t.height)/2-_t.y).toString()]]);var jt=yt.createPath(yt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(_t.width))/2,(24-Math.ceil(_t.height))/2,Math.ceil(_t.width),Math.ceil(_t.height)));return et.appendChild(jt),yt.setAttributes(pt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(_e),_e.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>'},Y}(),Jt=function(Y){function x(k,W,ee){var V=Y.call(this,k,W)||this;return V.isDropdownOpen=!1,V.onClick=V.dropdownButtonClicked,V.dropdownButtons=ee,V}return Qt(x,Y),x.prototype.setupDropdown=function(){var k=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(W){W.className=k.className,W.colorsClassName=k.colorsClassName,k.dropdownBlock.appendChild(W.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},x.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},x.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},x.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},x.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},x.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},x}(Pt),Rt=function(){function Y(x,k){this.GRIP_SIZE=10,this.color=x,this.fillColor=k,this.visual=yt.createGroup(),this.visual.appendChild(yt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(yt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Y.prototype.ownsTarget=function(x){return x===this.visual||x===this.visual.childNodes[0]||x===this.visual.childNodes[1]},Y.prototype.setCenter=function(x,k){this.visual.childNodes.forEach(function(W){return yt.setAttributes(W,[["cx",x.toString()],["cy",k.toString()]])})},Y}(),lr=function(){function Y(x,k,W,ee){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=x,this.canvasHeight=k,this.margin=W,this.container=ee,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(Y.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(x){this._aspectRatio=x,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(x){this._isGridVisible=x,this.gridContainer&&yt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(x){this._zoomFactor=x,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Y.prototype.open=function(){var x=this;this.cropShadeElement=yt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=yt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var k=0;k<this.numberOfGridLines;k++)this.horizontalGridLines.push(yt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(yt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(W){return x.gridContainer.appendChild(W)}),this.verticalGridLines.forEach(function(W){return x.gridContainer.appendChild(W)}),this.cropRectElement=yt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Rt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Rt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Rt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Rt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},Y.prototype.setCropRectangle=function(x){this.cropRect=x;var k=Object.assign({},this.cropRect);this.zoomFactor!==1&&(k.width=this.cropRect.width*this.zoomFactor,k.height=this.cropRect.height*this.zoomFactor,k.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-k.width/2,k.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-k.height/2),yt.setAttributes(this.cropRectElement,[["x",k.x.toString()],["y",k.y.toString()],["width",k.width.toString()],["height",k.height.toString()]]);var W=k.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(V,_e){var Ke=k.y+W*(_e+1);yt.setAttributes(V,[["x1",""+k.x],["y1",""+Ke],["x2",""+(k.x+k.width)],["y2",""+Ke]])});var ee=k.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(V,_e){var Ke=k.x+ee*(_e+1);yt.setAttributes(V,[["x1",""+Ke],["y1",""+k.y],["x2",""+Ke],["y2",""+(k.y+k.height)]])}),yt.setAttributes(this.cropShadeElement,[["d",yt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,k.x,k.y,k.width,k.height)]]),this.topLeftGrip.setCenter(k.x,k.y),this.topRightGrip.setCenter(k.x+k.width,k.y),this.bottomLeftGrip.setCenter(k.x,k.y+k.height),this.bottomRightGrip.setCenter(k.x+k.width,k.y+k.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},Y.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)},Y.prototype.clientToLocalCoordinates=function(x,k){var W=this.container.getBoundingClientRect();return{x:x-W.left+this.margin,y:k-W.top+this.margin}},Y.prototype.onPointerDown=function(x){this.container.setPointerCapture(x.pointerId),this.previousPoint=this.clientToLocalCoordinates(x.clientX,x.clientY),this.cropRectElement===x.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(x.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(x.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(x.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(x.target)&&(this.activeGrip=this.bottomRightGrip)},Y.prototype.onPointerMove=function(x){if(this.isMoving)this.move(this.clientToLocalCoordinates(x.clientX,x.clientY));else if(this.activeGrip){var k=this.clientToLocalCoordinates(x.clientX,x.clientY);this.resize(k)}x.preventDefault()},Y.prototype.onPointerUp=function(x){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(x.pointerId)},Y.prototype.move=function(x){var k=x.x-this.previousPoint.x,W=x.y-this.previousPoint.y;this.zoomFactor!==1&&(k=-k/this.zoomFactor,W=-W/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+k),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+W),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=x},Y.prototype.resize=function(x){var k=Object.assign({},this.cropRect),W=x.x-this.previousPoint.x,ee=x.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:k.x+W<this.margin&&(W=this.margin-k.x),k.x+=W,k.width=this.cropRect.x+this.cropRect.width-k.x;break;case this.bottomRightGrip:case this.topRightGrip:k.width+W>this.canvasWidth*this.zoomFactor&&(W=this.canvasWidth*this.zoomFactor-k.width),k.width+=W}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(k.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(W),k.height=this.aspectRatio.getVerticalLength(k.width)):(k.y+=ee,k.height=this.cropRect.y+this.cropRect.height-k.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?k.height=this.aspectRatio.getVerticalLength(k.width):k.height+=ee}k.width<10&&(k.x=this.cropRect.x,k.width=10),k.height<10&&(k.y=this.cropRect.y,k.height=10),this.previousPoint=x,k.x>=this.margin&&k.y>=this.margin&&k.x-this.margin+k.width<=this.canvasWidth&&k.y-this.margin+k.height<=this.canvasHeight&&(this.cropRect=k,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},Y.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var x=this.cropRect.x+this.cropRect.width/2,k=this.cropRect.y+this.cropRect.height/2,W=this.aspectRatio.getHorizontalLength(this.cropRect.height),ee=this.aspectRatio.getVerticalLength(this.cropRect.width);W/this.canvasWidth<ee/this.canvasHeight?this.cropRect.width=W:this.cropRect.height=ee,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=x-this.cropRect.width/2,this.cropRect.y=k-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)}},Y.prototype.getRescaledRect=function(x,k,W,ee,V,_e){var Ke=W/x,et=ee/k;return{x:(V.x-_e)*Ke+_e,y:(V.y-_e)*et+_e,width:V.width*Ke,height:V.height*et}},Y.prototype.scaleCanvas=function(x,k){var W=this.getRescaledRect(this.canvasWidth,this.canvasHeight,x,k,this.cropRect,this.margin);this.canvasWidth=x,this.canvasHeight=k,this.onCropChange&&this.onCropChange(W),this.setCropRectangle(W)},Y}(),Ir=function(){function Y(x){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=x,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(Y.prototype,"angle",{get:function(){return this._angle},set:function(x){this._angle=x,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),Y.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},Y.prototype.onPointerDown=function(x){this.controlContainer.setPointerCapture(x.pointerId),this.isDragging=!0,this.previousPoint={x:x.clientX,y:x.clientY}},Y.prototype.onPointerMove=function(x){this.isDragging&&(this.onAngleChange&&this.onAngleChange((x.clientX-this.previousPoint.x)/5),this.previousPoint.x=x.clientX)},Y.prototype.onPointerUp=function(x){this.isDragging&&this.onAngleChange&&this.onAngleChange((x.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(x.pointerId)},Y.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var x=this.angleLabelText.getBBox();yt.setAttributes(this.angleLabelElement,[["x",((this.width-x.width)/2).toString()],["y",(this.height/2).toString()]])}},Y.prototype.positionScaleShape=function(){if(this.scaleShape){var x=this.scaleShape.transform.baseVal.getItem(0);x.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(x,0)}},Y.prototype.getVisual=function(){var x=document.createElementNS("http://www.w3.org/2000/svg","svg");x.setAttribute("xmlns","http://www.w3.org/2000/svg"),x.setAttribute("width",this.width+"px"),x.setAttribute("height",this.height+"px"),x.setAttribute("viewBox","0 0 "+this.width+" "+this.height),x.style.flexShrink="0",document.body.appendChild(x);for(var k="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,W=1;W<=this.width/5+10;W++){var ee=W%5==0?this.height/3:this.height/6;k+="h4v"+-ee+"h1v"+ee}k+="v1H0Z",this.scaleShape=yt.createPath(k);var V=yt.createTransform();this.scaleShape.transform.baseVal.appendItem(V),x.appendChild(this.scaleShape),this.angleLabelElement=yt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=yt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var _e=yt.createTSpan("");return _e.innerHTML="&deg;",this.angleLabelElement.appendChild(_e),x.appendChild(this.angleLabelElement),document.body.removeChild(x),x},Y}(),Xr=function(){function Y(){this.naturalSize=!1,this.imageType="image/png"}return Y.prototype.rasterize=function(x,k,W,ee,V,_e,Ke){var et=this;return new Promise(function(pt){var Ve=document.createElement("canvas");Ve.width=x.width.baseVal.value-2*ee,Ve.height=x.height.baseVal.value-2*ee;var _t=1,jt=1;et.naturalSize===!0?(_t=k.naturalWidth/(x.width.baseVal.value-2*ee)/_e,jt=k.naturalHeight/(x.height.baseVal.value-2*ee)/Ke,Ve.width=k.naturalWidth/_e,Ve.height=k.naturalHeight/Ke):et.width!==void 0&&et.height!==void 0&&(_t=et.width/W.width,jt=et.height/W.height,Ve.width*=_t,Ve.height*=jt);var $t=Ve.getContext("2d");$t.translate(Ve.width/2,Ve.height/2),$t.rotate(V*Math.PI/180),$t.scale(_e,Ke),$t.translate(-Ve.width/2,-Ve.height/2),$t.drawImage(k,0,0,Ve.width,Ve.height);var jr=document.createElement("canvas");jr.width=W.width*_t,jr.height=W.height*jt,jr.getContext("2d").putImageData($t.getImageData((W.x-ee)*_t,(W.y-ee)*jt,W.width*_t,W.height*jt),0,0),pt(jr.toDataURL(et.imageType,et.imageQuality))})},Y}(),$e=function(){function Y(x){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=Y.instanceCounter++,this.styles=new Lr(this.instanceNo),this.target=x,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(Y.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(x){this._zoomToCropEnabled=x,x?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(x){this._isGridVisible=x,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"gridLines",{get:function(){return this._gridLines},set:function(x){this._gridLines=x,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(x){this._rotationAngle=x,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"aspectRatio",{get:function(){var x;return(x=this._aspectRatio)!==null&&x!==void 0?x:this.aspectRatios[0]},set:function(x){this._aspectRatio=x},enumerable:!1,configurable:!0}),Y.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},Y.prototype.show=function(){this.showUI(),this.open()},Y.prototype.close=function(x){x===void 0&&(x=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),x||this.closeEventListeners.forEach(function(k){return k()}),this._isOpen=!1)},Y.prototype.addRenderEventListener=function(x){this.renderEventListeners.push(x)},Y.prototype.removeRenderEventListener=function(x){this.renderEventListeners.indexOf(x)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(x),1)},Y.prototype.addCloseEventListener=function(x){this.closeEventListeners.push(x)},Y.prototype.removeCloseEventListener=function(x){this.closeEventListeners.indexOf(x)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(x),1)},Y.prototype.setupResizeObserver=function(){var x=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){x.resize(x.target.clientWidth,x.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))},Y.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var x=1*this.target.clientWidth/this.target.clientHeight,k=this.contentDiv.clientWidth/x>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*x:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,W=k+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/x;this.resize(k,W)}},Y.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Y.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",yt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},Y.prototype.resize=function(x,k){this.imageWidth=Math.round(x),this.imageHeight=Math.round(k),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()},Y.prototype.setEditingTarget=function(){var x=document.createElement("canvas");x.width=this.target.naturalWidth,x.height=this.target.naturalHeight,x.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var k=x.toDataURL();yt.setAttributes(this.editingTarget,[["href",k]]),this.setEditingTargetSize()},Y.prototype.setTopLeft=function(){var x=this.target.getBoundingClientRect(),k=this.editorCanvas.getBoundingClientRect();this.left=x.left-k.left-this.CANVAS_MARGIN,this.top=x.top-k.top-this.CANVAS_MARGIN},Y.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=yt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=yt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=yt.createGroup(),this.editingTargetRotationScaleContainer=yt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var x=yt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(x);var k=yt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(k),this.editingTargetContainer=yt.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)},Y.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},Y.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=yt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new lr(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()},Y.prototype.zoomToCrop=function(){if(this.cropRect){var x=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,k=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=x+"px "+k+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-x+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-k+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},Y.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)},Y.prototype.cropRectChanged=function(x){this.cropRect=x,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},Y.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},Y.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"},Y.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Y.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 x=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,k=this.target.offsetTop>x+this.CANVAS_MARGIN?this.target.offsetTop-(x+this.CANVAS_MARGIN):0;this.coverDiv.style.top=k+"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},Y.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},Y.prototype.addTopToolbar=function(){var x=this;this.topToolbar=new Ft,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 k=new cr;k.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(k);var W=[];this.aspectRatios.forEach(function(jt){var $t=new Pt(Vt.getIcon(jt.horizontal,jt.vertical),jt.horizontal===0&&jt.vertical===0?"FREE":jt.horizontal+":"+jt.vertical);$t.onClick=function(){return x.ratioButtonClicked(jt)},W.push($t)}),this.aspectRatioButton=new Jt(Vt.getIcon(0,0),"Aspect ratio",W),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,k.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ee=new Pt('<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");ee.isActive=this.isGridVisible,ee.onClick=function(){x.isGridVisible=!x.isGridVisible,ee.isActive=x.isGridVisible},k.addButton(ee);var V=new Pt('<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(V.isActive=this.zoomToCropEnabled,V.onClick=function(){x.zoomToCropEnabled=!x.zoomToCropEnabled,V.isActive=x.zoomToCropEnabled},k.addButton(V),!Kr.isLicensed){var _e=new dt;this.topToolbar.addElementBlock(_e);var Ke=document.createElement("div");Ke.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var et=document.createElement("a");et.style.color="currentColor",et.href="https://markerjs.com/products/cropro",et.target="_blank",et.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>',Ke.appendChild(et),_e.addElement(Ke)}var pt=new cr;pt.minWidth=3*this.toolbarHeight+"px",pt.contentAlign="end",this.topToolbar.addButtonBlock(pt);var Ve=new Pt('<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");Ve.onClick=this.startRenderAndClose,pt.addButton(Ve),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ve.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var _t=new Pt('<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");_t.onClick=this.close,pt.addButton(_t),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(_t.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},Y.prototype.addBottomToolbar=function(){var x=this;this.bottomToolbar=new Ft,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 k=new cr;k.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(k);var W=new Pt('<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");W.onClick=this.rotateLeftButtonClicked,k.addButton(W);var ee=new Pt('<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");ee.onClick=this.rotateRightButtonClicked,k.addButton(ee);var V=new dt;V.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(V),this.straightener=new Ir("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(pt){x.rotateBy(pt),x.straightener.angle=x.rotationAngle},V.addElement(this.straightener.getUI());var _e=new cr;_e.minWidth=2*this.toolbarHeight+"px",_e.contentAlign="end",this.bottomToolbar.addButtonBlock(_e);var Ke=new Pt('<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");Ke.onClick=this.flipHorizontallyButtonClicked,_e.addButton(Ke);var et=new Pt('<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");et.onClick=this.flipVerticallyButtonClicked,_e.addButton(et)},Y.prototype.ratioButtonClicked=function(x){this.aspectRatio=x,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},Y.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Vt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},Y.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Ur(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},Y.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Y.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},Y.prototype.restoreState=function(x){if(x){var k=this.cropLayer.getRescaledRect(x.width,x.height,this.imageWidth,this.imageHeight,x.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(k),this.cropRectChanged(k),this.flippedHorizontally=x.flippedHorizontally,this.flippedVertically=x.flippedVertically,this.applyFlip(),this.rotationAngle=x.rotationAngle,this.applyRotation()}},Y.prototype.clientToLocalCoordinates=function(x,k){var W=this.cropImage.getBoundingClientRect();return{x:x-W.left,y:k-W.top}},Y.prototype.onWindowResize=function(){this.positionUI()},Y.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var x=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=x+"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()},Y.prototype.rotateLeftButtonClicked=function(){var x=this.rotationAngle-90;this.rotationAngle%90!=0&&(x+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(x)},Y.prototype.rotateRightButtonClicked=function(){var x=this.rotationAngle+90;this.rotationAngle%90!=0&&(x-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(x)},Y.prototype.rotateTo=function(x){x=(x=x>180?x-360:x)<=-180?x+360:x,this.rotationAngle=x,this.applyRotation()},Y.prototype.rotateBy=function(x){this.rotateTo((this.rotationAngle+x)%360)},Y.prototype.applyRotation=function(){var x=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var k=this.editingTargetRotationContainer.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(k,0);var W=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/W.width,this.imageHeight/W.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=x},Y.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},Y.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},Y.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},Y.prototype.startRenderAndClose=function(){return It(this,void 0,void 0,function(){var x,k;return Cr(this,function(W){switch(W.label){case 0:return[4,this.render()];case 1:return x=W.sent(),k=this.getState(),this.renderEventListeners.forEach(function(ee){return ee(x,k)}),this.close(!0),[2]}})})},Y.prototype.render=function(){return It(this,void 0,void 0,function(){var x;return Cr(this,function(k){switch(k.label){case 0:return(x=new Xr).naturalSize=this.renderAtNaturalSize,x.imageType=this.renderImageType,x.imageQuality=this.renderImageQuality,x.width=this.renderWidth,x.height=this.renderHeight,this.unzoomFromCrop(),yt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,x.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 k.sent(),[4,x.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,k.sent()]}})})},Y.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new xt("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 xt("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new xt("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var x=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new xt("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*x)+`px;
height: `+(this.toolbarHeight-2*x)+`px;
padding: `+x+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new xt("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new xt("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new bt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new bt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new xt("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 xt("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new xt("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 xt("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*x)+`px;
padding: `+x+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new xt("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},Y.instanceCounter=0,Y}(),Ct=Z("8hTe"),pi=Z.n(Ct),mi=/<pre[^>]*>/g;function gi(Y){var x=document.createElement("div");return x.innerHTML=Y,x.childNodes.length===0?"":x.childNodes[0].nodeValue}var vi=xe.a=function(Y){var x=Y.value,k=x===void 0?"":x,W=Y.edit,ee=W===void 0?!1:W,V=Y.className,_e=Y.showTextOnly,Ke=Y.showLines,et=Y.replaces,pt=Y.zoomImg,Ve=Y.hasMask,_t=Y.style,jt=_t===void 0?{}:_t,$t=Y.stylesPrev,jr=$t===void 0?{}:$t,Er=String(k),xr=Object(L.useRef)(),Qr=Object(L.useRef)(),Ii=Object(L.useState)(""),dr=Object(K.a)(Ii,2),zr=dr[0],li=dr[1],ui=Object(L.useState)("office"),Hr=Object(K.a)(ui,2),Di=Hr[0],yi=Hr[1],Ki=function(){var Ht=new $e(Qr.current);Ht.displayMode="popup",Ht.addRenderEventListener(function(){var yr=Object(B.a)(r.a.mark(function kt(ar){var Kt;return r.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:return xr.current.style.display="none",fr.next=3,Object(Ce.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ar}});case 3:Kt=fr.sent,Kt!=null&&Kt.id&&et(Qr.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 5:case"end":return fr.stop()}},kt)}));return function(kt){return yr.apply(this,arguments)}}()),Ht.show()},zi=function(){var Ht=new Lt(Qr.current);Ht.settings.displayMode="popup",Ht.addEventListener("render",function(){var yr=Object(B.a)(r.a.mark(function kt(ar){var Kt;return r.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:if(xr.current.style.display="none",!Qr.current){fr.next=6;break}return fr.next=4,Object(Ce.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ar.dataUrl}});case 4:Kt=fr.sent,Kt!=null&&Kt.id&&et(Qr.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 6:case"end":return fr.stop()}},kt)}));return function(kt){return yr.apply(this,arguments)}}()),Ht.show(),window.markerArea=Ht},Zr=Object(L.useMemo)(function(){xr.current&&(xr.current.style.zIndex=-1);try{var ir=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ht=/\"\/api\/attachments\/|\"\/attachments\/download\//g,yr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Er=Er.replace(ir,"("+$.a.API_SERVER+"/api/attachments/").replace(Ht,'"'+$.a.API_SERVER+"/api/attachments/").replace(yr,'"'+$.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(ii){}var kt=N(Er),ar=w();if(Er.match(/\[TOC\]/)&&(kt=kt.replace("<p>[TOC]</p>",D()),R()),kt=kt.replace(/(__special_katext_id_\d+__)/g,function(ii,fr){var Ar=ar[fr],Vi=Ar.type,Ei=Ar.expression;return Object(ie.renderToString)(gi(Ei)||"",{displayMode:Vi==="block",throwOnError:!1,output:"html"})}),kt=kt.replace(/▁/g,"\u2581\u2581\u2581"),y(),_e){var Kt=document.createElement("div");return Kt.innerHTML=kt,Kt.innerText}return setTimeout(function(){return cn()},500),kt},[Er]),$r=Object(L.useRef)();_.WebkitLineClamp=Ke,Ke&&(jt=Object(j.a)(Object(j.a)({},jt),_));function bi(ir){var Ht=ir.target;if(Ht.tagName.toUpperCase()==="IMG"){if(pt){var yr=Ht.getAttribute("src");li(yr),yi("image")}}else if(Ht.tagName.toUpperCase()==="A"){var kt=Ht.getAttribute("href");if(kt.indexOf("office")>-1)ir.preventDefault(),li(kt),yi("office");else if(kt.indexOf("application/pdf")>-1)ir.preventDefault(),li(kt),yi("pdf");else if(kt.indexOf("text/html")>-1)ir.preventDefault(),li(kt),yi("html");else if(kt.startsWith("#")){ir.preventDefault();var ar=document.getElementById(kt.replace("#",""));ar&&ar.scrollIntoView(!0)}}}var cn=function(){var Ht,yr=(Ht=$r.current)===null||Ht===void 0?void 0:Ht.querySelectorAll("video");yr==null||yr.forEach(function(kt){if(kt.oncontextmenu=function(){return!1},kt.src.indexOf(".m3u8")>-1&&!kt.canPlayType("application/vnd.apple.mpegurl")){if(H.a.isSupported()){var ar=new H.a;ar.loadSource(kt.src),ar.attachMedia(kt)}}})};Object(L.useEffect)(function(){if($r.current&&Zr&&(Zr.match(mi)&&window.PR.prettyPrint()),$r.current)return $r.current.addEventListener("click",bi),function(){$r.current.removeEventListener("click",bi),y(),R()}},[Zr,$r.current,bi]);var _i=function(Ht){if(!ee)return;Ht.target.nodeName==="IMG"?(xr.current.style.zIndex=1,xr.current.style.display="flex",xr.current.style.width=Ht.target.clientWidth+"px",xr.current.style.height=Ht.target.clientHeight+"px",xr.current.style.top=Ht.target.offsetTop+"px",xr.current.style.left=Ht.target.offsetLeft+"px",Qr.current.src=Ht.target.getAttribute("src")):xr.current.style.display="none"};return v.a.createElement("div",{style:{position:"relative"}},v.a.createElement("div",{ref:$r,style:Object(j.a)({},jt),className:"".concat(V||""," markdown-body ").concat(pi.a.mdBody),onMouseOver:_i,dangerouslySetInnerHTML:{__html:Zr}}),v.a.createElement("div",{ref:xr,className:pi.a.button},v.a.createElement(J.a,null,v.a.createElement(X.a,{onClick:function(){return Ki()}},"\u88C1\u526A"),v.a.createElement(X.a,{onClick:function(){return zi()}},"\u7F16\u8F91"))),v.a.createElement("img",{ref:Qr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),v.a.createElement(oe.a,{close:!0,data:zr,type:zr!=null&&zr.length?Di:"",style:Object(j.a)({},jr),onClose:function(){return li("")}}))}},"9VGf":function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return P});var ne=Z("q1tI"),J=Z.n(ne);function P(X,j){var B=Object(ne.useRef)();Object(ne.useEffect)(function(){B.current=X}),Object(ne.useEffect)(function(){function K(){B.current()}if(j!==null){var G=setInterval(K,j);return function(){return clearInterval(G)}}},[j])}},BU3w:function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return B});var ne=Z("MNnm"),J="rc-util-key";function P(K){if(K.attachTo)return K.attachTo;var G=document.querySelector("head");return G||document.body}function X(K){var G,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ne.a)())return null;var L=document.createElement("style");if((G=r.csp)===null||G===void 0?void 0:G.nonce){var v;L.nonce=(v=r.csp)===null||v===void 0?void 0:v.nonce}L.innerHTML=K;var m=P(r),p=m.firstChild;return r.prepend&&m.prepend?m.prepend(L):r.prepend&&p?m.insertBefore(L,p):m.appendChild(L),L}var j=new Map;function B(K,G){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},L=P(r);if(!j.has(L)){var v=X("",r),m=v.parentNode;j.set(L,m),m.removeChild(v)}var p=Array.from(j.get(L).children).find(function(u){return u.tagName==="STYLE"&&u[J]===G});if(p){var h,l;if(((h=r.csp)===null||h===void 0?void 0:h.nonce)&&p.nonce!==((l=r.csp)===null||l===void 0?void 0:l.nonce)){var f;p.nonce=(f=r.csp)===null||f===void 0?void 0:f.nonce}return p.innerHTML!==K&&(p.innerHTML=K),p}var o=X(K,r);return o[J]=G,o}},Bd2K:function(nt,xe,Z){(function(ne){ne(Z("VrN/"),Z("osHv"))})(function(ne){ne.defineOption("autoCloseTags",!1,function(r,L,v){if(v!=ne.Init&&v&&r.removeKeyMap("autoCloseTags"),!L)return;var m={name:"autoCloseTags"};(typeof L!="object"||L.whenClosing!==!1)&&(m["'/'"]=function(p){return B(p)}),(typeof L!="object"||L.whenOpening!==!1)&&(m["'>'"]=function(p){return X(p)}),r.addKeyMap(m)});var J=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],P=["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 X(r){if(r.getOption("disableInput"))return ne.Pass;for(var L=r.listSelections(),v=[],m=r.getOption("autoCloseTags"),p=0;p<L.length;p++){if(!L[p].empty())return ne.Pass;var h=L[p].head,l=r.getTokenAt(h),f=ne.innerMode(r.getMode(),l.state),o=f.state,u=f.mode.xmlCurrentTag&&f.mode.xmlCurrentTag(o),a=u&&u.name;if(!a)return ne.Pass;var s=f.mode.configuration=="html",R=typeof m=="object"&&m.dontCloseTags||s&&J,_=typeof m=="object"&&m.indentTags||s&&P;l.end>h.ch&&(a=a.slice(0,a.length-l.end+h.ch));var C=a.toLowerCase();if(!a||l.type=="string"&&(l.end!=h.ch||!/[\"\']/.test(l.string.charAt(l.string.length-1))||l.string.length==1)||l.type=="tag"&&u.close||l.string.indexOf("/")==h.ch-l.start-1||R&&K(R,C)>-1||G(r,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(o)||[],a,h,!0))return ne.Pass;var D=typeof m=="object"&&m.emptyTags;if(D&&K(D,a)>-1){v[p]={text:"/>",newPos:ne.Pos(h.line,h.ch+2)};continue}var O=_&&K(_,C)>-1;v[p]={indent:O,text:">"+(O?`
`:"")+"</"+a+">",newPos:O?ne.Pos(h.line+1,0):ne.Pos(h.line,h.ch+1)}}for(var A=typeof m=="object"&&m.dontIndentOnAutoClose,p=L.length-1;p>=0;p--){var S=v[p];r.replaceRange(S.text,L[p].head,L[p].anchor,"+insert");var T=r.listSelections().slice(0);T[p]={head:S.newPos,anchor:S.newPos},r.setSelections(T),!A&&S.indent&&(r.indentLine(S.newPos.line,null,!0),r.indentLine(S.newPos.line+1,null,!0))}}function j(r,L){for(var v=r.listSelections(),m=[],p=L?"/":"</",h=r.getOption("autoCloseTags"),l=typeof h=="object"&&h.dontIndentOnSlash,f=0;f<v.length;f++){if(!v[f].empty())return ne.Pass;var o=v[f].head,u=r.getTokenAt(o),a=ne.innerMode(r.getMode(),u.state),s=a.state;if(L&&(u.type=="string"||u.string.charAt(0)!="<"||u.start!=o.ch-1))return ne.Pass;var R,_=a.mode.name!="xml"&&r.getMode().name=="htmlmixed";if(_&&a.mode.name=="javascript")R=p+"script";else if(_&&a.mode.name=="css")R=p+"style";else{var C=a.mode.xmlCurrentContext&&a.mode.xmlCurrentContext(s);if(!C||C.length&&G(r,C,C[C.length-1],o))return ne.Pass;R=p+C[C.length-1]}r.getLine(o.line).charAt(u.end)!=">"&&(R+=">"),m[f]=R}if(r.replaceSelections(m),v=r.listSelections(),!l)for(var f=0;f<v.length;f++)(f==v.length-1||v[f].head.line<v[f+1].head.line)&&r.indentLine(v[f].head.line)}function B(r){return r.getOption("disableInput")?ne.Pass:j(r,!0)}ne.commands.closeTag=function(r){return j(r)};function K(r,L){if(r.indexOf)return r.indexOf(L);for(var v=0,m=r.length;v<m;++v)if(r[v]==L)return v;return-1}function G(r,L,v,m,p){if(!ne.scanForClosingTag)return!1;var h=Math.min(r.lastLine()+1,m.line+500),l=ne.scanForClosingTag(r,m,null,h);if(!l||l.tag!=v)return!1;for(var f=p?1:0,o=L.length-1;o>=0&&L[o]==v;o--)++f;m=l.to;for(var o=1;o<f;o++){var u=ne.scanForClosingTag(r,m,null,h);if(!u||u.tag!=v)return!1;m=u.to}return!0}})},BjJ7:function(nt,xe,Z){"use strict";Z.d(xe,"d",function(){return J}),Z.d(xe,"c",function(){return P}),Z.d(xe,"e",function(){return X}),Z.d(xe,"b",function(){return j}),Z.d(xe,"a",function(){return K});var ne=Z("m3rI");function J(G){var r=!0;if(G.length>0){for(var L=0;L<G.length;L++)if(G[L].compile_success==0||!G[L].compile_success){r=!1;break}}else r=!1;return r}function P(G){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",L=[],v=0;v<G.length;v++){var m=G[v],p=r?"".concat(r,"/").concat(m.name):"".concat(m.name);L.push({title:m.name,isLeaf:!(m.type==="tree"),key:p})}return L}function X(G,r,L){for(var v=0;v<G.length;v++){var m=G[v];if(m.key===r){m.children=L;break}m.children&&X(m.children,r,L)}return G}function j(G,r,L){var v;return function(){var m=this,p=arguments,h=function(){v=null,L||G.apply(m,p)},l=L&&!v;clearTimeout(v),v=setTimeout(h,r),l&&G.apply(m,p)}}var B=!0,K=ne.a.API_SERVER},"C+DQ":function(nt,xe,Z){},"C/vA":function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return ne});function ne(J){const P=this;let X=!1,j;return function(){return X||(X=!0,j=J.apply(P,arguments)),j}}},"Cg/j":function(nt,xe,Z){"use strict";Z.d(xe,"b",function(){return ne}),Z.d(xe,"a",function(){return J}),Z.d(xe,"c",function(){return X}),Z.d(xe,"d",function(){return j});var ne;(function(B){B.serviceIds=new Map,B.DI_TARGET="$di$target",B.DI_DEPENDENCIES="$di$dependencies";function K(G){return G[B.DI_DEPENDENCIES]||[]}B.getServiceDependencies=K})(ne||(ne={}));const J=X("instantiationService");function P(B,K,G,r){K[ne.DI_TARGET]===K?K[ne.DI_DEPENDENCIES].push({id:B,index:G,optional:r}):(K[ne.DI_DEPENDENCIES]=[{id:B,index:G,optional:r}],K[ne.DI_TARGET]=K)}function X(B){if(ne.serviceIds.has(B))return ne.serviceIds.get(B);const K=function(G,r,L){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");P(K,G,L,!1)};return K.toString=()=>B,ne.serviceIds.set(B,K),K}function j(B){return function(K,G,r){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");P(B,K,r,!0)}}},DlQD:function(nt,xe,Z){(function(ne,J){nt.exports=J()})(this,function(){"use strict";function ne(Te,me){for(var be=0;be<me.length;be++){var ae=me[be];ae.enumerable=ae.enumerable||!1,ae.configurable=!0,"value"in ae&&(ae.writable=!0),Object.defineProperty(Te,ae.key,ae)}}function J(Te,me,be){return me&&ne(Te.prototype,me),be&&ne(Te,be),Te}function P(Te,me){if(!Te)return;if(typeof Te=="string")return X(Te,me);var be=Object.prototype.toString.call(Te).slice(8,-1);if(be==="Object"&&Te.constructor&&(be=Te.constructor.name),be==="Map"||be==="Set")return Array.from(Te);if(be==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(be))return X(Te,me)}function X(Te,me){(me==null||me>Te.length)&&(me=Te.length);for(var be=0,ae=new Array(me);be<me;be++)ae[be]=Te[be];return ae}function j(Te,me){var be;if(typeof Symbol=="undefined"||Te[Symbol.iterator]==null){if(Array.isArray(Te)||(be=P(Te))||me&&Te&&typeof Te.length=="number"){be&&(Te=be);var ae=0;return function(){return ae>=Te.length?{done:!0}:{done:!1,value:Te[ae++]}}}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 be=Te[Symbol.iterator](),be.next.bind(be)}function B(Te,me){return me={exports:{}},Te(me,me.exports),me.exports}var K=B(function(Te){function me(){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 be(ae){Te.exports.defaults=ae}Te.exports={defaults:me(),getDefaults:me,changeDefaults:be}}),G=K.defaults,r=K.getDefaults,L=K.changeDefaults,v=/[&<>"']/,m=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},f=function(me){return l[me]};function o(Te,me){if(me){if(v.test(Te))return Te.replace(m,f)}else if(p.test(Te))return Te.replace(h,f);return Te}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function a(Te){return Te.replace(u,function(me,be){return be=be.toLowerCase(),be==="colon"?":":be.charAt(0)==="#"?be.charAt(1)==="x"?String.fromCharCode(parseInt(be.substring(2),16)):String.fromCharCode(+be.substring(1)):""})}var s=/(^|[^\[])\^/g;function R(Te,me){Te=Te.source||Te,me=me||"";var be={replace:function(le,de){return de=de.source||de,de=de.replace(s,"$1"),Te=Te.replace(le,de),be},getRegex:function(){return new RegExp(Te,me)}};return be}var _=/[^\w:]/g,C=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(Te,me,be){if(Te){var ae;try{ae=decodeURIComponent(a(be)).replace(_,"").toLowerCase()}catch(le){return null}if(ae.indexOf("javascript:")===0||ae.indexOf("vbscript:")===0||ae.indexOf("data:")===0)return null}me&&!C.test(be)&&(be=c(me,be));try{be=encodeURI(be).replace(/%25/g,"%")}catch(le){return null}return be}var O={},A=/^[^:]+:\/*[^/]*$/,S=/^([^:]+:)[\s\S]*$/,T=/^([^:]+:\/*[^/]*)[\s\S]*$/;function c(Te,me){O[" "+Te]||(A.test(Te)?O[" "+Te]=Te+"/":O[" "+Te]=U(Te,"/",!0)),Te=O[" "+Te];var be=Te.indexOf(":")===-1;return me.substring(0,2)==="//"?be?me:Te.replace(S,"$1")+me:me.charAt(0)==="/"?be?me:Te.replace(T,"$1")+me:Te+me}var w={exec:function(){}};function y(Te){for(var me=1,be,ae;me<arguments.length;me++){be=arguments[me];for(ae in be)Object.prototype.hasOwnProperty.call(be,ae)&&(Te[ae]=be[ae])}return Te}function b(Te,me){var be=Te.replace(/\|/g,function(de,ge,we){for(var Fe=!1,ze=ge;--ze>=0&&we[ze]==="\\";)Fe=!Fe;return Fe?"|":" |"}),ae=be.split(/ \|/),le=0;if(ae.length>me)ae.splice(me);else for(;ae.length<me;)ae.push("");for(;le<ae.length;le++)ae[le]=ae[le].trim().replace(/\\\|/g,"|");return ae}function U(Te,me,be){var ae=Te.length;if(ae===0)return"";for(var le=0;le<ae;){var de=Te.charAt(ae-le-1);if(de===me&&!be)le++;else if(de!==me&&be)le++;else break}return Te.substr(0,ae-le)}function F(Te,me){if(Te.indexOf(me[1])===-1)return-1;for(var be=Te.length,ae=0,le=0;le<be;le++)if(Te[le]==="\\")le++;else if(Te[le]===me[0])ae++;else if(Te[le]===me[1]&&(ae--,ae<0))return le;return-1}function E(Te){Te&&Te.sanitize&&!Te.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 N={escape:o,unescape:a,edit:R,cleanUrl:D,resolveUrl:c,noopTest:w,merge:y,splitCells:b,rtrim:U,findClosingBracket:F,checkSanitizeDeprecation:E},I=K.defaults,g=N.rtrim,H=N.splitCells,$=N.escape,ie=N.findClosingBracket;function oe(Te,me,be){var ae=me.href,le=me.title?$(me.title):null,de=Te[1].replace(/\\([\[\]])/g,"$1");return Te[0].charAt(0)!=="!"?{type:"link",raw:be,href:ae,title:le,text:de}:{type:"image",raw:be,href:ae,title:le,text:$(de)}}function Ce(Te,me){var be=Te.match(/^(\s+)(?:```)/);if(be===null)return me;var ae=be[1];return me.split(`
`).map(function(le){var de=le.match(/^\s+/);if(de===null)return le;var ge=de[0];return ge.length>=ae.length?le.slice(ae.length):le}).join(`
`)}var ve=function(){function Te(be){this.options=be||I}var me=Te.prototype;return me.space=function(ae){var le=this.rules.block.newline.exec(ae);if(le)return le[0].length>1?{type:"space",raw:le[0]}:{raw:`
`}},me.code=function(ae,le){var de=this.rules.block.code.exec(ae);if(de){var ge=le[le.length-1];if(ge&&ge.type==="paragraph")return{raw:de[0],text:de[0].trimRight()};var we=de[0].replace(/^ {4}/gm,"");return{type:"code",raw:de[0],codeBlockStyle:"indented",text:this.options.pedantic?we:g(we,`
`)}}},me.fences=function(ae){var le=this.rules.block.fences.exec(ae);if(le){var de=le[0],ge=Ce(de,le[3]||"");return{type:"code",raw:de,lang:le[2]?le[2].trim():le[2],text:ge}}},me.heading=function(ae){var le=this.rules.block.heading.exec(ae);if(le)return{type:"heading",raw:le[0],depth:le[1].length,text:le[2]}},me.nptable=function(ae){var le=this.rules.block.nptable.exec(ae);if(le){var de={type:"table",header:H(le[1].replace(/^ *| *\| *$/g,"")),align:le[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:le[3]?le[3].replace(/\n$/,"").split(`
`):[],raw:le[0]};if(de.header.length===de.align.length){var ge=de.align.length,we;for(we=0;we<ge;we++)/^ *-+: *$/.test(de.align[we])?de.align[we]="right":/^ *:-+: *$/.test(de.align[we])?de.align[we]="center":/^ *:-+ *$/.test(de.align[we])?de.align[we]="left":de.align[we]=null;for(ge=de.cells.length,we=0;we<ge;we++)de.cells[we]=H(de.cells[we],de.header.length);return de}}},me.hr=function(ae){var le=this.rules.block.hr.exec(ae);if(le)return{type:"hr",raw:le[0]}},me.blockquote=function(ae){var le=this.rules.block.blockquote.exec(ae);if(le){var de=le[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:le[0],text:de}}},me.list=function(ae){var le=this.rules.block.list.exec(ae);if(le){for(var de=le[0],ge=le[2],we=ge.length>1,Fe=ge[ge.length-1]===")",ze={type:"list",raw:de,ordered:we,start:we?+ge.slice(0,-1):"",loose:!1,items:[]},st=le[0].match(this.rules.block.item),mt=!1,ft,wt,St,ct,Ut,Lt,qt,Qt=st.length,It=0;It<Qt;It++)ft=st[It],de=ft,wt=ft.length,ft=ft.replace(/^ *([*+-]|\d+[.)]) */,""),~ft.indexOf(`
`)&&(wt-=ft.length,ft=this.options.pedantic?ft.replace(/^ {1,4}/gm,""):ft.replace(new RegExp("^ {1,"+wt+"}","gm"),"")),It!==Qt-1&&(St=this.rules.block.bullet.exec(st[It+1])[0],(we?St.length===1||!Fe&&St[St.length-1]===")":St.length>1||this.options.smartLists&&St!==ge)&&(ct=st.slice(It+1).join(`
`),ze.raw=ze.raw.substring(0,ze.raw.length-ct.length),It=Qt-1)),Ut=mt||/\n\n(?!\s*$)/.test(ft),It!==Qt-1&&(mt=ft.charAt(ft.length-1)===`
`,Ut||(Ut=mt)),Ut&&(ze.loose=!0),Lt=/^\[[ xX]\] /.test(ft),qt=void 0,Lt&&(qt=ft[1]!==" ",ft=ft.replace(/^\[[ xX]\] +/,"")),ze.items.push({type:"list_item",raw:de,task:Lt,checked:qt,loose:Ut,text:ft});return ze}},me.html=function(ae){var le=this.rules.block.html.exec(ae);if(le)return{type:this.options.sanitize?"paragraph":"html",raw:le[0],pre:!this.options.sanitizer&&(le[1]==="pre"||le[1]==="script"||le[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):$(le[0]):le[0]}},me.def=function(ae){var le=this.rules.block.def.exec(ae);if(le){le[3]&&(le[3]=le[3].substring(1,le[3].length-1));var de=le[1].toLowerCase().replace(/\s+/g," ");return{tag:de,raw:le[0],href:le[2],title:le[3]}}},me.table=function(ae){var le=this.rules.block.table.exec(ae);if(le){var de={type:"table",header:H(le[1].replace(/^ *| *\| *$/g,"")),align:le[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:le[3]?le[3].replace(/\n$/,"").split(`
`):[]};if(de.header.length===de.align.length){de.raw=le[0];var ge=de.align.length,we;for(we=0;we<ge;we++)/^ *-+: *$/.test(de.align[we])?de.align[we]="right":/^ *:-+: *$/.test(de.align[we])?de.align[we]="center":/^ *:-+ *$/.test(de.align[we])?de.align[we]="left":de.align[we]=null;for(ge=de.cells.length,we=0;we<ge;we++)de.cells[we]=H(de.cells[we].replace(/^ *\| *| *\| *$/g,""),de.header.length);return de}}},me.lheading=function(ae){var le=this.rules.block.lheading.exec(ae);if(le)return{type:"heading",raw:le[0],depth:le[2].charAt(0)==="="?1:2,text:le[1]}},me.paragraph=function(ae){var le=this.rules.block.paragraph.exec(ae);if(le)return{type:"paragraph",raw:le[0],text:le[1].charAt(le[1].length-1)===`
`?le[1].slice(0,-1):le[1]}},me.text=function(ae,le){var de=this.rules.block.text.exec(ae);if(de){var ge=le[le.length-1];return ge&&ge.type==="text"?{raw:de[0],text:de[0]}:{type:"text",raw:de[0],text:de[0]}}},me.escape=function(ae){var le=this.rules.inline.escape.exec(ae);if(le)return{type:"escape",raw:le[0],text:$(le[1])}},me.tag=function(ae,le,de){var ge=this.rules.inline.tag.exec(ae);if(ge)return!le&&/^<a /i.test(ge[0])?le=!0:le&&/^<\/a>/i.test(ge[0])&&(le=!1),!de&&/^<(pre|code|kbd|script)(\s|>)/i.test(ge[0])?de=!0:de&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ge[0])&&(de=!1),{type:this.options.sanitize?"text":"html",raw:ge[0],inLink:le,inRawBlock:de,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):$(ge[0]):ge[0]}},me.link=function(ae){var le=this.rules.inline.link.exec(ae);if(le){var de=ie(le[2],"()");if(de>-1){var ge=le[0].indexOf("!")===0?5:4,we=ge+le[1].length+de;le[2]=le[2].substring(0,de),le[0]=le[0].substring(0,we).trim(),le[3]=""}var Fe=le[2],ze="";if(this.options.pedantic){var st=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Fe);st?(Fe=st[1],ze=st[3]):ze=""}else ze=le[3]?le[3].slice(1,-1):"";Fe=Fe.trim().replace(/^<([\s\S]*)>$/,"$1");var mt=oe(le,{href:Fe&&Fe.replace(this.rules.inline._escapes,"$1"),title:ze&&ze.replace(this.rules.inline._escapes,"$1")},le[0]);return mt}},me.reflink=function(ae,le){var de;if((de=this.rules.inline.reflink.exec(ae))||(de=this.rules.inline.nolink.exec(ae))){var ge=(de[2]||de[1]).replace(/\s+/g," ");if(ge=le[ge.toLowerCase()],!ge||!ge.href){var we=de[0].charAt(0);return{type:"text",raw:we,text:we}}var Fe=oe(de,ge,de[0]);return Fe}},me.strong=function(ae,le,de){de===void 0&&(de="");var ge=this.rules.inline.strong.start.exec(ae);if(ge&&(!ge[1]||ge[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){le=le.slice(-1*ae.length);var we=ge[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;we.lastIndex=0;for(var Fe;(ge=we.exec(le))!=null;)if(Fe=this.rules.inline.strong.middle.exec(le.slice(0,ge.index+3)),Fe)return{type:"strong",raw:ae.slice(0,Fe[0].length),text:ae.slice(2,Fe[0].length-2)}}},me.em=function(ae,le,de){de===void 0&&(de="");var ge=this.rules.inline.em.start.exec(ae);if(ge&&(!ge[1]||ge[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){le=le.slice(-1*ae.length);var we=ge[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;we.lastIndex=0;for(var Fe;(ge=we.exec(le))!=null;)if(Fe=this.rules.inline.em.middle.exec(le.slice(0,ge.index+2)),Fe)return{type:"em",raw:ae.slice(0,Fe[0].length),text:ae.slice(1,Fe[0].length-1)}}},me.codespan=function(ae){var le=this.rules.inline.code.exec(ae);if(le){var de=le[2].replace(/\n/g," "),ge=/[^ ]/.test(de),we=de.startsWith(" ")&&de.endsWith(" ");return ge&&we&&(de=de.substring(1,de.length-1)),de=$(de,!0),{type:"codespan",raw:le[0],text:de}}},me.br=function(ae){var le=this.rules.inline.br.exec(ae);if(le)return{type:"br",raw:le[0]}},me.del=function(ae){var le=this.rules.inline.del.exec(ae);if(le)return{type:"del",raw:le[0],text:le[1]}},me.autolink=function(ae,le){var de=this.rules.inline.autolink.exec(ae);if(de){var ge,we;return de[2]==="@"?(ge=$(this.options.mangle?le(de[1]):de[1]),we="mailto:"+ge):(ge=$(de[1]),we=ge),{type:"link",raw:de[0],text:ge,href:we,tokens:[{type:"text",raw:ge,text:ge}]}}},me.url=function(ae,le){var de;if(de=this.rules.inline.url.exec(ae)){var ge,we;if(de[2]==="@")ge=$(this.options.mangle?le(de[0]):de[0]),we="mailto:"+ge;else{var Fe;do Fe=de[0],de[0]=this.rules.inline._backpedal.exec(de[0])[0];while(Fe!==de[0]);ge=$(de[0]),de[1]==="www."?we="http://"+ge:we=ge}return{type:"link",raw:de[0],text:ge,href:we,tokens:[{type:"text",raw:ge,text:ge}]}}},me.inlineText=function(ae,le,de){var ge=this.rules.inline.text.exec(ae);if(ge){var we;return le?we=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):$(ge[0]):ge[0]:we=$(this.options.smartypants?de(ge[0]):ge[0]),{type:"text",raw:ge[0],text:we}}},Te}(),Se=N.noopTest,Ae=N.edit,Oe=N.merge,he={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:Se,table:Se,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};he._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,he._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,he.def=Ae(he.def).replace("label",he._label).replace("title",he._title).getRegex(),he.bullet=/(?:[*+-]|\d{1,9}[.)])/,he.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,he.item=Ae(he.item,"gm").replace(/bull/g,he.bullet).getRegex(),he.list=Ae(he.list).replace(/bull/g,he.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+he.def.source+")").getRegex(),he._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",he._comment=/<!--(?!-?>)[\s\S]*?-->/,he.html=Ae(he.html,"i").replace("comment",he._comment).replace("tag",he._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),he.paragraph=Ae(he._paragraph).replace("hr",he.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",he._tag).getRegex(),he.blockquote=Ae(he.blockquote).replace("paragraph",he.paragraph).getRegex(),he.normal=Oe({},he),he.gfm=Oe({},he.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*|$)"}),he.gfm.nptable=Ae(he.gfm.nptable).replace("hr",he.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",he._tag).getRegex(),he.gfm.table=Ae(he.gfm.table).replace("hr",he.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",he._tag).getRegex(),he.pedantic=Oe({},he.normal,{html:Ae(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",he._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:Se,paragraph:Ae(he.normal._paragraph).replace("hr",he.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",he.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ce={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Se,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:Se,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ce._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ce.punctuation=Ae(ce.punctuation).replace(/punctuation/g,ce._punctuation).getRegex(),ce._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ce._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ce.em.start=Ae(ce.em.start).replace(/punctuation/g,ce._punctuation).getRegex(),ce.em.middle=Ae(ce.em.middle).replace(/punctuation/g,ce._punctuation).replace(/overlapSkip/g,ce._overlapSkip).getRegex(),ce.em.endAst=Ae(ce.em.endAst,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.em.endUnd=Ae(ce.em.endUnd,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.start=Ae(ce.strong.start).replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.middle=Ae(ce.strong.middle).replace(/punctuation/g,ce._punctuation).replace(/blockSkip/g,ce._blockSkip).getRegex(),ce.strong.endAst=Ae(ce.strong.endAst,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.endUnd=Ae(ce.strong.endUnd,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.blockSkip=Ae(ce._blockSkip,"g").getRegex(),ce.overlapSkip=Ae(ce._overlapSkip,"g").getRegex(),ce._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ce._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ce._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])?)+(?![-_])/,ce.autolink=Ae(ce.autolink).replace("scheme",ce._scheme).replace("email",ce._email).getRegex(),ce._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ce.tag=Ae(ce.tag).replace("comment",he._comment).replace("attribute",ce._attribute).getRegex(),ce._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ce._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ce._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ce.link=Ae(ce.link).replace("label",ce._label).replace("href",ce._href).replace("title",ce._title).getRegex(),ce.reflink=Ae(ce.reflink).replace("label",ce._label).getRegex(),ce.reflinkSearch=Ae(ce.reflinkSearch,"g").replace("reflink",ce.reflink).replace("nolink",ce.nolink).getRegex(),ce.normal=Oe({},ce),ce.pedantic=Oe({},ce.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:Ae(/^!?\[(label)\]\((.*?)\)/).replace("label",ce._label).getRegex(),reflink:Ae(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ce._label).getRegex()}),ce.gfm=Oe({},ce.normal,{escape:Ae(ce.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ce.gfm.url=Ae(ce.gfm.url,"i").replace("email",ce.gfm._extended_email).getRegex(),ce.breaks=Oe({},ce.gfm,{br:Ae(ce.br).replace("{2,}","*").getRegex(),text:Ae(ce.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var re={block:he,inline:ce},fe=K.defaults,se=re.block,ke=re.inline;function Ne(Te){return Te.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 Re(Te){var me="",be,ae,le=Te.length;for(be=0;be<le;be++)ae=Te.charCodeAt(be),Math.random()>.5&&(ae="x"+ae.toString(16)),me+="&#"+ae+";";return me}var Pe=function(){function Te(be){this.tokens=[],this.tokens.links=Object.create(null),this.options=be||fe,this.options.tokenizer=this.options.tokenizer||new ve,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ae={block:se.normal,inline:ke.normal};this.options.pedantic?(ae.block=se.pedantic,ae.inline=ke.pedantic):this.options.gfm&&(ae.block=se.gfm,this.options.breaks?ae.inline=ke.breaks:ae.inline=ke.gfm),this.tokenizer.rules=ae}Te.lex=function(ae,le){var de=new Te(le);return de.lex(ae)};var me=Te.prototype;return me.lex=function(ae){return ae=ae.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ae,this.tokens,!0),this.inline(this.tokens),this.tokens},me.blockTokens=function(ae,le,de){le===void 0&&(le=[]),de===void 0&&(de=!0),ae=ae.replace(/^ +$/gm,"");for(var ge,we,Fe,ze;ae;){if(ge=this.tokenizer.space(ae)){ae=ae.substring(ge.raw.length),ge.type&&le.push(ge);continue}if(ge=this.tokenizer.code(ae,le)){ae=ae.substring(ge.raw.length),ge.type?le.push(ge):(ze=le[le.length-1],ze.raw+=`
`+ge.raw,ze.text+=`
`+ge.text);continue}if(ge=this.tokenizer.fences(ae)){ae=ae.substring(ge.raw.length),le.push(ge);continue}if(ge=this.tokenizer.heading(ae)){ae=ae.substring(ge.raw.length),le.push(ge);continue}if(ge=this.tokenizer.nptable(ae)){ae=ae.substring(ge.raw.length),le.push(ge);continue}if(ge=this.tokenizer.hr(ae)){ae=ae.substring(ge.raw.length),le.push(ge);continue}if(ge=this.tokenizer.blockquote(ae)){ae=ae.substring(ge.raw.length),ge.tokens=this.blockTokens(ge.text,[],de),le.push(ge);continue}if(ge=this.tokenizer.list(ae)){for(ae=ae.substring(ge.raw.length),Fe=ge.items.length,we=0;we<Fe;we++)ge.items[we].tokens=this.blockTokens(ge.items[we].text,[],!1);le.push(ge);continue}if(ge=this.tokenizer.html(ae)){ae=ae.substring(ge.raw.length),le.push(ge);continue}if(de&&(ge=this.tokenizer.def(ae))){ae=ae.substring(ge.raw.length),this.tokens.links[ge.tag]||(this.tokens.links[ge.tag]={href:ge.href,title:ge.title});continue}if(ge=this.tokenizer.table(ae)){ae=ae.substring(ge.raw.length),le.push(ge);continue}if(ge=this.tokenizer.lheading(ae)){ae=ae.substring(ge.raw.length),le.push(ge);continue}if(de&&(ge=this.tokenizer.paragraph(ae))){ae=ae.substring(ge.raw.length),le.push(ge);continue}if(ge=this.tokenizer.text(ae,le)){ae=ae.substring(ge.raw.length),ge.type?le.push(ge):(ze=le[le.length-1],ze.raw+=`
`+ge.raw,ze.text+=`
`+ge.text);continue}if(ae){var st="Infinite loop on byte: "+ae.charCodeAt(0);if(this.options.silent){console.error(st);break}else throw new Error(st)}}return le},me.inline=function(ae){var le,de,ge,we,Fe,ze,st=ae.length;for(le=0;le<st;le++){ze=ae[le];switch(ze.type){case"paragraph":case"text":case"heading":{ze.tokens=[],this.inlineTokens(ze.text,ze.tokens);break}case"table":{for(ze.tokens={header:[],cells:[]},we=ze.header.length,de=0;de<we;de++)ze.tokens.header[de]=[],this.inlineTokens(ze.header[de],ze.tokens.header[de]);for(we=ze.cells.length,de=0;de<we;de++)for(Fe=ze.cells[de],ze.tokens.cells[de]=[],ge=0;ge<Fe.length;ge++)ze.tokens.cells[de][ge]=[],this.inlineTokens(Fe[ge],ze.tokens.cells[de][ge]);break}case"blockquote":{this.inline(ze.tokens);break}case"list":{for(we=ze.items.length,de=0;de<we;de++)this.inline(ze.items[de].tokens);break}}}return ae},me.inlineTokens=function(ae,le,de,ge,we){le===void 0&&(le=[]),de===void 0&&(de=!1),ge===void 0&&(ge=!1),we===void 0&&(we="");var Fe,ze=ae,st;if(this.tokens.links){var mt=Object.keys(this.tokens.links);if(mt.length>0)for(;(st=this.tokenizer.rules.inline.reflinkSearch.exec(ze))!=null;)mt.includes(st[0].slice(st[0].lastIndexOf("[")+1,-1))&&(ze=ze.slice(0,st.index)+"["+"a".repeat(st[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(st=this.tokenizer.rules.inline.blockSkip.exec(ze))!=null;)ze=ze.slice(0,st.index)+"["+"a".repeat(st[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ae;){if(Fe=this.tokenizer.escape(ae)){ae=ae.substring(Fe.raw.length),le.push(Fe);continue}if(Fe=this.tokenizer.tag(ae,de,ge)){ae=ae.substring(Fe.raw.length),de=Fe.inLink,ge=Fe.inRawBlock,le.push(Fe);continue}if(Fe=this.tokenizer.link(ae)){ae=ae.substring(Fe.raw.length),Fe.type==="link"&&(Fe.tokens=this.inlineTokens(Fe.text,[],!0,ge)),le.push(Fe);continue}if(Fe=this.tokenizer.reflink(ae,this.tokens.links)){ae=ae.substring(Fe.raw.length),Fe.type==="link"&&(Fe.tokens=this.inlineTokens(Fe.text,[],!0,ge)),le.push(Fe);continue}if(Fe=this.tokenizer.strong(ae,ze,we)){ae=ae.substring(Fe.raw.length),Fe.tokens=this.inlineTokens(Fe.text,[],de,ge),le.push(Fe);continue}if(Fe=this.tokenizer.em(ae,ze,we)){ae=ae.substring(Fe.raw.length),Fe.tokens=this.inlineTokens(Fe.text,[],de,ge),le.push(Fe);continue}if(Fe=this.tokenizer.codespan(ae)){ae=ae.substring(Fe.raw.length),le.push(Fe);continue}if(Fe=this.tokenizer.br(ae)){ae=ae.substring(Fe.raw.length),le.push(Fe);continue}if(Fe=this.tokenizer.del(ae)){ae=ae.substring(Fe.raw.length),Fe.tokens=this.inlineTokens(Fe.text,[],de,ge),le.push(Fe);continue}if(Fe=this.tokenizer.autolink(ae,Re)){ae=ae.substring(Fe.raw.length),le.push(Fe);continue}if(!de&&(Fe=this.tokenizer.url(ae,Re))){ae=ae.substring(Fe.raw.length),le.push(Fe);continue}if(Fe=this.tokenizer.inlineText(ae,ge,Ne)){ae=ae.substring(Fe.raw.length),we=Fe.raw.slice(-1),le.push(Fe);continue}if(ae){var ft="Infinite loop on byte: "+ae.charCodeAt(0);if(this.options.silent){console.error(ft);break}else throw new Error(ft)}}return le},J(Te,null,[{key:"rules",get:function(){return{block:se,inline:ke}}}]),Te}(),je=K.defaults,ue=N.cleanUrl,Ee=N.escape,Le=function(){function Te(be){this.options=be||je}var me=Te.prototype;return me.code=function(ae,le,de){var ge=(le||"").match(/\S*/)[0];if(this.options.highlight){var we=this.options.highlight(ae,ge);we!=null&&we!==ae&&(de=!0,ae=we)}return ge?'<pre><code class="'+this.options.langPrefix+Ee(ge,!0)+'">'+(de?ae:Ee(ae,!0))+`</code></pre>
`:"<pre><code>"+(de?ae:Ee(ae,!0))+`</code></pre>
`},me.blockquote=function(ae){return`<blockquote>
`+ae+`</blockquote>
`},me.html=function(ae){return ae},me.heading=function(ae,le,de,ge){return this.options.headerIds?"<h"+le+' id="'+this.options.headerPrefix+ge.slug(de)+'">'+ae+"</h"+le+`>
`:"<h"+le+">"+ae+"</h"+le+`>
`},me.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},me.list=function(ae,le,de){var ge=le?"ol":"ul",we=le&&de!==1?' start="'+de+'"':"";return"<"+ge+we+`>
`+ae+"</"+ge+`>
`},me.listitem=function(ae){return"<li>"+ae+`</li>
`},me.checkbox=function(ae){return"<input "+(ae?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},me.paragraph=function(ae){return"<p>"+ae+`</p>
`},me.table=function(ae,le){return le&&(le="<tbody>"+le+"</tbody>"),`<table>
<thead>
`+ae+`</thead>
`+le+`</table>
`},me.tablerow=function(ae){return`<tr>
`+ae+`</tr>
`},me.tablecell=function(ae,le){var de=le.header?"th":"td",ge=le.align?"<"+de+' align="'+le.align+'">':"<"+de+">";return ge+ae+"</"+de+`>
`},me.strong=function(ae){return"<strong>"+ae+"</strong>"},me.em=function(ae){return"<em>"+ae+"</em>"},me.codespan=function(ae){return"<code>"+ae+"</code>"},me.br=function(){return this.options.xhtml?"<br/>":"<br>"},me.del=function(ae){return"<del>"+ae+"</del>"},me.link=function(ae,le,de){if(ae=ue(this.options.sanitize,this.options.baseUrl,ae),ae===null)return de;var ge='<a href="'+Ee(ae)+'"';return le&&(ge+=' title="'+le+'"'),ge+=">"+de+"</a>",ge},me.image=function(ae,le,de){if(ae=ue(this.options.sanitize,this.options.baseUrl,ae),ae===null)return de;var ge='<img src="'+ae+'" alt="'+de+'"';return le&&(ge+=' title="'+le+'"'),ge+=this.options.xhtml?"/>":">",ge},me.text=function(ae){return ae},Te}(),Ie=function(){function Te(){}var me=Te.prototype;return me.strong=function(ae){return ae},me.em=function(ae){return ae},me.codespan=function(ae){return ae},me.del=function(ae){return ae},me.html=function(ae){return ae},me.text=function(ae){return ae},me.link=function(ae,le,de){return""+de},me.image=function(ae,le,de){return""+de},me.br=function(){return""},Te}(),Ge=function(){function Te(){this.seen={}}var me=Te.prototype;return me.slug=function(ae){var le=ae.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(le)){var de=le;do this.seen[de]++,le=de+"-"+this.seen[de];while(this.seen.hasOwnProperty(le))}return this.seen[le]=0,le},Te}(),Xe=K.defaults,Je=N.unescape,Qe=function(){function Te(be){this.options=be||Xe,this.options.renderer=this.options.renderer||new Le,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ie,this.slugger=new Ge}Te.parse=function(ae,le){var de=new Te(le);return de.parse(ae)};var me=Te.prototype;return me.parse=function(ae,le){le===void 0&&(le=!0);var de="",ge,we,Fe,ze,st,mt,ft,wt,St,ct,Ut,Lt,qt,Qt,It,Cr,Kr,yt,Lr=ae.length;for(ge=0;ge<Lr;ge++){ct=ae[ge];switch(ct.type){case"space":continue;case"hr":{de+=this.renderer.hr();continue}case"heading":{de+=this.renderer.heading(this.parseInline(ct.tokens),ct.depth,Je(this.parseInline(ct.tokens,this.textRenderer)),this.slugger);continue}case"code":{de+=this.renderer.code(ct.text,ct.lang,ct.escaped);continue}case"table":{for(wt="",ft="",ze=ct.header.length,we=0;we<ze;we++)ft+=this.renderer.tablecell(this.parseInline(ct.tokens.header[we]),{header:!0,align:ct.align[we]});for(wt+=this.renderer.tablerow(ft),St="",ze=ct.cells.length,we=0;we<ze;we++){for(mt=ct.tokens.cells[we],ft="",st=mt.length,Fe=0;Fe<st;Fe++)ft+=this.renderer.tablecell(this.parseInline(mt[Fe]),{header:!1,align:ct.align[Fe]});St+=this.renderer.tablerow(ft)}de+=this.renderer.table(wt,St);continue}case"blockquote":{St=this.parse(ct.tokens),de+=this.renderer.blockquote(St);continue}case"list":{for(Ut=ct.ordered,Lt=ct.start,qt=ct.loose,ze=ct.items.length,St="",we=0;we<ze;we++)It=ct.items[we],Cr=It.checked,Kr=It.task,Qt="",It.task&&(yt=this.renderer.checkbox(Cr),qt?It.tokens.length>0&&It.tokens[0].type==="text"?(It.tokens[0].text=yt+" "+It.tokens[0].text,It.tokens[0].tokens&&It.tokens[0].tokens.length>0&&It.tokens[0].tokens[0].type==="text"&&(It.tokens[0].tokens[0].text=yt+" "+It.tokens[0].tokens[0].text)):It.tokens.unshift({type:"text",text:yt}):Qt+=yt),Qt+=this.parse(It.tokens,qt),St+=this.renderer.listitem(Qt,Kr,Cr);de+=this.renderer.list(St,Ut,Lt);continue}case"html":{de+=this.renderer.html(ct.text);continue}case"paragraph":{de+=this.renderer.paragraph(this.parseInline(ct.tokens));continue}case"text":{for(St=ct.tokens?this.parseInline(ct.tokens):ct.text;ge+1<Lr&&ae[ge+1].type==="text";)ct=ae[++ge],St+=`
`+(ct.tokens?this.parseInline(ct.tokens):ct.text);de+=le?this.renderer.paragraph(St):St;continue}default:{var bt='Token with "'+ct.type+'" type was not found.';if(this.options.silent){console.error(bt);return}else throw new Error(bt)}}}return de},me.parseInline=function(ae,le){le=le||this.renderer;var de="",ge,we,Fe=ae.length;for(ge=0;ge<Fe;ge++){we=ae[ge];switch(we.type){case"escape":{de+=le.text(we.text);break}case"html":{de+=le.html(we.text);break}case"link":{de+=le.link(we.href,we.title,this.parseInline(we.tokens,le));break}case"image":{de+=le.image(we.href,we.title,we.text);break}case"strong":{de+=le.strong(this.parseInline(we.tokens,le));break}case"em":{de+=le.em(this.parseInline(we.tokens,le));break}case"codespan":{de+=le.codespan(we.text);break}case"br":{de+=le.br();break}case"del":{de+=le.del(this.parseInline(we.tokens,le));break}case"text":{de+=le.text(we.text);break}default:{var ze='Token with "'+we.type+'" type was not found.';if(this.options.silent){console.error(ze);return}else throw new Error(ze)}}}return de},Te}(),at=N.merge,qe=N.checkSanitizeDeprecation,tt=N.escape,Be=K.getDefaults,ut=K.changeDefaults,ot=K.defaults;function Ue(Te,me,be){if(typeof Te=="undefined"||Te===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Te!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Te)+", string expected");if(typeof me=="function"&&(be=me,me=null),me=at({},Ue.defaults,me||{}),qe(me),be){var ae=me.highlight,le;try{le=Pe.lex(Te,me)}catch(Fe){return be(Fe)}var de=function(ze){var st;if(!ze)try{st=Qe.parse(le,me)}catch(mt){ze=mt}return me.highlight=ae,ze?be(ze):be(null,st)};if(!ae||ae.length<3)return de();if(delete me.highlight,!le.length)return de();var ge=0;Ue.walkTokens(le,function(Fe){Fe.type==="code"&&(ge++,setTimeout(function(){ae(Fe.text,Fe.lang,function(ze,st){if(ze)return de(ze);st!=null&&st!==Fe.text&&(Fe.text=st,Fe.escaped=!0),ge--,ge===0&&de()})},0))}),ge===0&&de();return}try{var we=Pe.lex(Te,me);return me.walkTokens&&Ue.walkTokens(we,me.walkTokens),Qe.parse(we,me)}catch(Fe){if(Fe.message+=`
Please report this to https://github.com/markedjs/marked.`,me.silent)return"<p>An error occurred:</p><pre>"+tt(Fe.message+"",!0)+"</pre>";throw Fe}}Ue.options=Ue.setOptions=function(Te){return at(Ue.defaults,Te),ut(Ue.defaults),Ue},Ue.getDefaults=Be,Ue.defaults=ot,Ue.use=function(Te){var me=at({},Te);if(Te.renderer&&function(){var ae=Ue.defaults.renderer||new Le,le=function(we){var Fe=ae[we];ae[we]=function(){for(var ze=arguments.length,st=new Array(ze),mt=0;mt<ze;mt++)st[mt]=arguments[mt];var ft=Te.renderer[we].apply(ae,st);return ft===!1&&(ft=Fe.apply(ae,st)),ft}};for(var de in Te.renderer)le(de);me.renderer=ae}(),Te.tokenizer&&function(){var ae=Ue.defaults.tokenizer||new ve,le=function(we){var Fe=ae[we];ae[we]=function(){for(var ze=arguments.length,st=new Array(ze),mt=0;mt<ze;mt++)st[mt]=arguments[mt];var ft=Te.tokenizer[we].apply(ae,st);return ft===!1&&(ft=Fe.apply(ae,st)),ft}};for(var de in Te.tokenizer)le(de);me.tokenizer=ae}(),Te.walkTokens){var be=Ue.defaults.walkTokens;me.walkTokens=function(ae){Te.walkTokens(ae),be&&be(ae)}}Ue.setOptions(me)},Ue.walkTokens=function(Te,me){for(var be=j(Te),ae;!(ae=be()).done;){var le=ae.value;me(le);switch(le.type){case"table":{for(var de=j(le.tokens.header),ge;!(ge=de()).done;){var we=ge.value;Ue.walkTokens(we,me)}for(var Fe=j(le.tokens.cells),ze;!(ze=Fe()).done;)for(var st=ze.value,mt=j(st),ft;!(ft=mt()).done;){var wt=ft.value;Ue.walkTokens(wt,me)}break}case"list":{Ue.walkTokens(le.items,me);break}default:le.tokens&&Ue.walkTokens(le.tokens,me)}}},Ue.Parser=Qe,Ue.parser=Qe.parse,Ue.Renderer=Le,Ue.TextRenderer=Ie,Ue.Lexer=Pe,Ue.lexer=Pe.lex,Ue.Tokenizer=ve,Ue.Slugger=Ge,Ue.parse=Ue;var He=Ue;return He})},ELLl:function(nt,xe,Z){(function(ne){ne(Z("VrN/"))})(function(ne){var J={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},P=ne.Pos;ne.defineOption("autoCloseBrackets",!1,function(l,f,o){o&&o!=ne.Init&&(l.removeKeyMap(j),l.state.closeBrackets=null),f&&(B(X(f,"pairs")),l.state.closeBrackets=f,l.addKeyMap(j))});function X(l,f){return f=="pairs"&&typeof l=="string"?l:typeof l=="object"&&l[f]!=null?l[f]:J[f]}var j={Backspace:r,Enter:L};function B(l){for(var f=0;f<l.length;f++){var o=l.charAt(f),u="'"+o+"'";j[u]||(j[u]=K(o))}}B(J.pairs+"`");function K(l){return function(f){return m(f,l)}}function G(l){var f=l.state.closeBrackets;if(!f||f.override)return f;var o=l.getModeAt(l.getCursor());return o.closeBrackets||f}function r(l){var f=G(l);if(!f||l.getOption("disableInput"))return ne.Pass;for(var o=X(f,"pairs"),u=l.listSelections(),a=0;a<u.length;a++){if(!u[a].empty())return ne.Pass;var s=p(l,u[a].head);if(!s||o.indexOf(s)%2!=0)return ne.Pass}for(var a=u.length-1;a>=0;a--){var R=u[a].head;l.replaceRange("",P(R.line,R.ch-1),P(R.line,R.ch+1),"+delete")}}function L(l){var f=G(l),o=f&&X(f,"explode");if(!o||l.getOption("disableInput"))return ne.Pass;for(var u=l.listSelections(),a=0;a<u.length;a++){if(!u[a].empty())return ne.Pass;var s=p(l,u[a].head);if(!s||o.indexOf(s)%2!=0)return ne.Pass}l.operation(function(){var R=l.lineSeparator()||`
`;l.replaceSelection(R+R,null),l.execCommand("goCharLeft"),u=l.listSelections();for(var _=0;_<u.length;_++){var C=u[_].head.line;l.indentLine(C,null,!0),l.indentLine(C+1,null,!0)}})}function v(l){var f=ne.cmpPos(l.anchor,l.head)>0;return{anchor:new P(l.anchor.line,l.anchor.ch+(f?-1:1)),head:new P(l.head.line,l.head.ch+(f?1:-1))}}function m(l,f){var o=G(l);if(!o||l.getOption("disableInput"))return ne.Pass;var u=X(o,"pairs"),a=u.indexOf(f);if(a==-1)return ne.Pass;for(var s=X(o,"closeBefore"),R=X(o,"triples"),_=u.charAt(a+1)==f,C=l.listSelections(),D=a%2==0,O,A=0;A<C.length;A++){var S=C[A],T=S.head,c,w=l.getRange(T,P(T.line,T.ch+1));if(D&&!S.empty())c="surround";else if((_||!D)&&w==f)_&&h(l,T)?c="both":R.indexOf(f)>=0&&l.getRange(T,P(T.line,T.ch+3))==f+f+f?c="skipThree":c="skip";else if(_&&T.ch>1&&R.indexOf(f)>=0&&l.getRange(P(T.line,T.ch-2),T)==f+f){if(T.ch>2&&/\bstring/.test(l.getTokenTypeAt(P(T.line,T.ch-2))))return ne.Pass;c="addFour"}else if(_){var y=T.ch==0?" ":l.getRange(P(T.line,T.ch-1),T);if(!ne.isWordChar(w)&&y!=f&&!ne.isWordChar(y))c="both";else return ne.Pass}else if(D&&(w.length===0||/\s/.test(w)||s.indexOf(w)>-1))c="both";else return ne.Pass;if(!O)O=c;else if(O!=c)return ne.Pass}var b=a%2?u.charAt(a-1):f,U=a%2?f:u.charAt(a+1);l.operation(function(){if(O=="skip")l.execCommand("goCharRight");else if(O=="skipThree")for(var F=0;F<3;F++)l.execCommand("goCharRight");else if(O=="surround"){for(var E=l.getSelections(),F=0;F<E.length;F++)E[F]=b+E[F]+U;l.replaceSelections(E,"around"),E=l.listSelections().slice();for(var F=0;F<E.length;F++)E[F]=v(E[F]);l.setSelections(E)}else O=="both"?(l.replaceSelection(b+U,null),l.triggerElectric(b+U),l.execCommand("goCharLeft")):O=="addFour"&&(l.replaceSelection(b+b+b+b,"before"),l.execCommand("goCharRight"))})}function p(l,f){var o=l.getRange(P(f.line,f.ch-1),P(f.line,f.ch+1));return o.length==2?o:null}function h(l,f){var o=l.getTokenAt(P(f.line,f.ch+1));return/\bstring/.test(o.type)&&o.start==f.ch&&(f.ch==0||!/\bstring/.test(l.getTokenTypeAt(f)))}})},FWmy:function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return ne});function ne(J,P){if(!J)throw new Error(P?`Assertion failed (${P})`:"Assertion Failed")}},GfqC:function(nt,xe,Z){"use strict";var ne=Z("q1tI"),J=Z.n(ne),P=Z("TSYQ"),X=Z.n(P);function j(N,I){var g="cannot "+N.method+" "+N.action+" "+I.status+"'",H=new Error(g);return H.status=I.status,H.method=N.method,H.url=N.action,H}function B(N){var I=N.responseText||N.response;if(!I)return I;try{return JSON.parse(I)}catch(g){return I}}function K(N){var I=new XMLHttpRequest;N.onProgress&&I.upload&&(I.upload.onprogress=function(ie){ie.total>0&&(ie.percent=ie.loaded/ie.total*100),N.onProgress(ie)});var g=new FormData;N.data&&Object.keys(N.data).forEach(function($){var ie=N.data[$];if(Array.isArray(ie)){ie.forEach(function(oe){g.append($+"[]",oe)});return}g.append($,N.data[$])}),N.file instanceof Blob?g.append(N.filename,N.file,N.file.name):g.append(N.filename,N.file),I.onerror=function(ie){N.onError(ie)},I.onload=function(){return I.status<200||I.status>=300?N.onError(j(N,I),B(I)):N.onSuccess(B(I),I)},I.open(N.method,N.action,!0),N.withCredentials&&"withCredentials"in I&&(I.withCredentials=!0);var H=N.headers||{};return H["X-Requested-With"]!==null&&I.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(H).forEach(function($){H[$]!==null&&I.setRequestHeader($,H[$])}),I.send(g),{abort:function(){I.abort()}}}var G=+new Date,r=0;function L(){return"rc-upload-"+G+"-"+ ++r}function v(N,I){return N.indexOf(I,N.length-I.length)!==-1}var m=function(N,I){if(N&&I){var g=Array.isArray(I)?I:I.split(","),H=N.name||"",$=N.type||"",ie=$.replace(/\/.*$/,"");return g.some(function(oe){var Ce=oe.trim();return Ce.charAt(0)==="."?v(H.toLowerCase(),Ce.toLowerCase()):/\/\*$/.test(Ce)?ie===Ce.replace(/\/.*$/,""):$===Ce})}return!0};function p(N,I){var g=N.createReader(),H=[];function $(){g.readEntries(function(ie){var oe=Array.prototype.slice.apply(ie);H=H.concat(oe);var Ce=!oe.length;Ce?I(H):$()})}$()}var h=function(I,g,H){var $=function ie(oe,Ce){Ce=Ce||"",oe.isFile?oe.file(function(ve){H(ve)&&(oe.fullPath&&!ve.webkitRelativePath&&(Object.defineProperties(ve,{webkitRelativePath:{writable:!0}}),ve.webkitRelativePath=oe.fullPath.replace(/^\//,""),Object.defineProperties(ve,{webkitRelativePath:{writable:!1}})),g([ve]))}):oe.isDirectory&&p(oe,function(ve){ve.forEach(function(Se){ie(Se,""+Ce+oe.name+"/")})})};I.forEach(function(ie){$(ie.webkitGetAsEntry())})},l=h,f=Object.assign||function(N){for(var I=1;I<arguments.length;I++){var g=arguments[I];for(var H in g)Object.prototype.hasOwnProperty.call(g,H)&&(N[H]=g[H])}return N},o=function(){function N(I,g){var H=[],$=!0,ie=!1,oe=void 0;try{for(var Ce=I[Symbol.iterator](),ve;!($=(ve=Ce.next()).done)&&!(H.push(ve.value),g&&H.length===g);$=!0);}catch(Se){ie=!0,oe=Se}finally{try{!$&&Ce.return&&Ce.return()}finally{if(ie)throw oe}}return H}return function(I,g){if(Array.isArray(I))return I;if(Symbol.iterator in Object(I))return N(I,g);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=function(){function N(I,g){for(var H=0;H<g.length;H++){var $=g[H];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(I,$.key,$)}}return function(I,g,H){return g&&N(I.prototype,g),H&&N(I,H),I}}();function a(N,I,g){return I in N?Object.defineProperty(N,I,{value:g,enumerable:!0,configurable:!0,writable:!0}):N[I]=g,N}function s(N,I){var g={};for(var H in N){if(I.indexOf(H)>=0)continue;if(!Object.prototype.hasOwnProperty.call(N,H))continue;g[H]=N[H]}return g}function R(N,I){if(!(N instanceof I))throw new TypeError("Cannot call a class as a function")}function _(N,I){if(!N)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:N}function C(N,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);N.prototype=Object.create(I&&I.prototype,{constructor:{value:N,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(N,I):N.__proto__=I)}var D=function(I){return Object.keys(I).reduce(function(g,H){return(H.substr(0,5)==="data-"||H.substr(0,5)==="aria-"||H==="role")&&(g[H]=I[H]),g},{})},O=function(N){C(I,N);function I(){var g,H,$,ie;R(this,I);for(var oe=arguments.length,Ce=Array(oe),ve=0;ve<oe;ve++)Ce[ve]=arguments[ve];return ie=(H=($=_(this,(g=I.__proto__||Object.getPrototypeOf(I)).call.apply(g,[this].concat(Ce))),$),$.state={uid:L()},$.reqs={},$.onChange=function(Se){var Ae=Se.target.files;$.uploadFiles(Ae),$.reset()},$.onClick=function(Se){var Ae=$.fileInput;if(!Ae)return;var Oe=$.props,he=Oe.children,ce=Oe.onClick;he&&he.type==="button"&&(Ae.parentNode.focus(),Ae.parentNode.querySelector("button").blur()),Ae.click(),ce&&ce(Se)},$.onKeyDown=function(Se){Se.key==="Enter"&&$.onClick()},$.onFileDrop=function(Se){var Ae=$.props.multiple;if(Se.preventDefault(),Se.type==="dragover")return;if($.props.directory)l(Array.prototype.slice.call(Se.dataTransfer.items),$.uploadFiles,function(he){return m(he,$.props.accept)});else{var Oe=Array.prototype.slice.call(Se.dataTransfer.files).filter(function(he){return m(he,$.props.accept)});Ae===!1&&(Oe=Oe.slice(0,1)),$.uploadFiles(Oe)}},$.uploadFiles=function(Se){var Ae=Array.prototype.slice.call(Se);Ae.map(function(Oe){return Oe.uid=L(),Oe}).forEach(function(Oe){$.upload(Oe,Ae)})},$.saveFileInput=function(Se){$.fileInput=Se},H),_($,ie)}return u(I,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(H,$){var ie=this,oe=this.props;if(!oe.beforeUpload)return setTimeout(function(){return ie.post(H)},0);var Ce=oe.beforeUpload(H,$);Ce&&Ce.then?Ce.then(function(ve){var Se=Object.prototype.toString.call(ve);return Se==="[object File]"||Se==="[object Blob]"?ie.post(ve):ie.post(H)}).catch(function(ve){console.log(ve)}):Ce!==!1&&setTimeout(function(){return ie.post(H)},0);return}},{key:"post",value:function(H){var $=this;if(!this._isMounted)return;var ie=this.props,oe=ie.onStart,Ce=ie.onProgress,ve=ie.transformFile,Se=ve===void 0?function(Ae){return Ae}:ve;new Promise(function(Ae){var Oe=ie.action;return typeof Oe=="function"&&(Oe=Oe(H)),Ae(Oe)}).then(function(Ae){var Oe=H.uid,he=ie.customRequest||K,ce=Promise.resolve(Se(H)).then(function(re){var fe=ie.data;return typeof fe=="function"&&(fe=fe(re)),Promise.all([re,fe])}).catch(function(re){console.error(re)});ce.then(function(re){var fe=o(re,2),se=fe[0],ke=fe[1],Ne={action:Ae,filename:ie.name,data:ke,file:se,headers:ie.headers,withCredentials:ie.withCredentials,method:ie.method||"post",onProgress:Ce?function(Re){Ce(Re,H)}:null,onSuccess:function(Pe,je){delete $.reqs[Oe],ie.onSuccess(Pe,H,je)},onError:function(Pe,je){delete $.reqs[Oe],ie.onError(Pe,je,H)}};oe(H),$.reqs[Oe]=he(Ne)})})}},{key:"reset",value:function(){this.setState({uid:L()})}},{key:"abort",value:function(H){var $=this.reqs;if(H){var ie=H;H&&H.uid&&(ie=H.uid),$[ie]&&$[ie].abort&&$[ie].abort(),delete $[ie]}else Object.keys($).forEach(function(oe){$[oe]&&$[oe].abort&&$[oe].abort(),delete $[oe]})}},{key:"render",value:function(){var H,$=this.props,ie=$.component,oe=$.prefixCls,Ce=$.className,ve=$.disabled,Se=$.id,Ae=$.style,Oe=$.multiple,he=$.accept,ce=$.children,re=$.directory,fe=$.openFileDialogOnClick,se=$.onMouseEnter,ke=$.onMouseLeave,Ne=s($,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),Re=X()((H={},a(H,oe,!0),a(H,oe+"-disabled",ve),a(H,Ce,Ce),H)),Pe=ve?{}:{onClick:fe?this.onClick:function(){},onKeyDown:fe?this.onKeyDown:function(){},onMouseEnter:se,onMouseLeave:ke,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return J.a.createElement(ie,f({},Pe,{className:Re,role:"button",style:Ae}),J.a.createElement("input",f({},D(Ne),{id:Se,type:"file",ref:this.saveFileInput,onClick:function(ue){return ue.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:he,directory:re?"directory":null,webkitdirectory:re?"webkitdirectory":null,multiple:Oe,onChange:this.onChange})),ce)}}]),I}(ne.Component),A=O,S=Object.assign||function(N){for(var I=1;I<arguments.length;I++){var g=arguments[I];for(var H in g)Object.prototype.hasOwnProperty.call(g,H)&&(N[H]=g[H])}return N},T=function(){function N(I,g){for(var H=0;H<g.length;H++){var $=g[H];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(I,$.key,$)}}return function(I,g,H){return g&&N(I.prototype,g),H&&N(I,H),I}}();function c(N,I){if(!(N instanceof I))throw new TypeError("Cannot call a class as a function")}function w(N,I){if(!N)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:N}function y(N,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);N.prototype=Object.create(I&&I.prototype,{constructor:{value:N,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(N,I):N.__proto__=I)}function b(){}var U=function(N){y(I,N);function I(){var g,H,$,ie;c(this,I);for(var oe=arguments.length,Ce=Array(oe),ve=0;ve<oe;ve++)Ce[ve]=arguments[ve];return ie=(H=($=w(this,(g=I.__proto__||Object.getPrototypeOf(I)).call.apply(g,[this].concat(Ce))),$),$.saveUploader=function(Se){$.uploader=Se},H),w($,ie)}return T(I,[{key:"abort",value:function(H){this.uploader.abort(H)}},{key:"render",value:function(){return J.a.createElement(A,S({},this.props,{ref:this.saveUploader}))}}]),I}(ne.Component);U.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:b,onError:b,onSuccess:b,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var F=U,E=xe.a=F},HmJG:function(nt,xe,Z){},I98M:function(nt,xe,Z){nt.exports={bg:"bg___t_hxx",flexRow:"flexRow___270qZ",flexJustifyCenter:"flexJustifyCenter___2lHrn",flexAlignEnd:"flexAlignEnd___1fRWo",flexAlignCenter:"flexAlignCenter___294G5",flexColumn:"flexColumn___3XrvP",formWrap:"formWrap___3oELa",titleWrap:"titleWrap___2fHnj",fieldWrap:"fieldWrap___2vew4",mdWrap:"mdWrap___9LUV8",backgroundFa:"backgroundFa___2z4YG",button:"button___3lyyu"}},JYp7:function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return ne});var ne;(function(J){function P(s){return s&&typeof s=="object"&&typeof s[Symbol.iterator]=="function"}J.is=P;const X=Object.freeze([]);function j(){return X}J.empty=j;function*B(s){yield s}J.single=B;function K(s){return s||X}J.from=K;function G(s){return!s||s[Symbol.iterator]().next().done===!0}J.isEmpty=G;function r(s){return s[Symbol.iterator]().next().value}J.first=r;function L(s,R){for(const _ of s)if(R(_))return!0;return!1}J.some=L;function v(s,R){for(const _ of s)if(R(_))return _;return}J.find=v;function*m(s,R){for(const _ of s)R(_)&&(yield _)}J.filter=m;function*p(s,R){let _=0;for(const C of s)yield R(C,_++)}J.map=p;function*h(...s){for(const R of s)for(const _ of R)yield _}J.concat=h;function*l(s){for(const R of s)for(const _ of R)yield _}J.concatNested=l;function f(s,R,_){let C=_;for(const D of s)C=R(C,D);return C}J.reduce=f;function*o(s,R,_=s.length){for(R<0&&(R+=s.length),_<0?_+=s.length:_>s.length&&(_=s.length);R<_;R++)yield s[R]}J.slice=o;function u(s,R=Number.POSITIVE_INFINITY){const _=[];if(R===0)return[_,s];const C=s[Symbol.iterator]();for(let D=0;D<R;D++){const O=C.next();if(O.done)return[_,J.empty()];_.push(O.value)}return[_,{[Symbol.iterator](){return C}}]}J.consume=u;function a(s,R,_=(C,D)=>C===D){const C=s[Symbol.iterator](),D=R[Symbol.iterator]();for(;;){const O=C.next(),A=D.next();if(O.done!==A.done)return!1;if(O.done)return!0;if(!_(O.value,A.value))return!1}}J.equals=a})(ne||(ne={}))},LdHM:function(nt,xe,Z){"use strict";Z.d(xe,"b",function(){return s}),Z.d(xe,"a",function(){return _});var ne=Z("1OyB"),J=Z("vuIU"),P=Z("Ji7U"),X=Z("LK+K"),j=Z("q1tI"),B=Z("rePB"),K=Z("Ff2n"),G=Z("ODXe"),r=Z("4IlW"),L=Z("bX4T"),v=Z("YrtM"),m=Z("TSYQ"),p=Z.n(m),h=Z("+nKL"),l=Z("8OUc"),f=function(H,$){var ie=H.prefixCls,oe=H.id,Ce=H.flattenOptions,ve=H.childrenAsData,Se=H.values,Ae=H.searchValue,Oe=H.multiple,he=H.defaultActiveFirstOption,ce=H.height,re=H.itemHeight,fe=H.notFoundContent,se=H.open,ke=H.menuItemSelectedIcon,Ne=H.virtual,Re=H.onSelect,Pe=H.onToggleOpen,je=H.onActiveValue,ue=H.onScroll,Ee=H.onMouseEnter,Le="".concat(ie,"-item"),Ie=Object(v.a)(function(){return Ce},[se,Ce],function(He,Te){return Te[0]&&He[1]!==Te[1]}),Ge=j.useRef(null),Xe=function(Te){Te.preventDefault()},Je=function(Te){Ge.current&&Ge.current.scrollTo({index:Te})},Qe=function(Te){for(var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,be=Ie.length,ae=0;ae<be;ae+=1){var le=(Te+ae*me+be)%be,de=Ie[le],ge=de.group,we=de.data;if(!ge&&!we.disabled)return le}return-1},at=j.useState(function(){return Qe(0)}),qe=Object(G.a)(at,2),tt=qe[0],Be=qe[1],ut=function(Te){Be(Te);var me=Ie[Te];if(!me){je(null,-1);return}je(me.data.value,Te)};j.useEffect(function(){ut(he!==!1?Qe(0):-1)},[Ie.length,Ae]),j.useEffect(function(){var He=setTimeout(function(){if(!Oe&&se&&Se.size===1){var Te=Array.from(Se)[0],me=Ie.findIndex(function(be){var ae=be.data;return ae.value===Te});ut(me),Je(me)}});return function(){return clearTimeout(He)}},[se]);var ot=function(Te){Te!==void 0&&Re(Te,{selected:!Se.has(Te)}),Oe||Pe(!1)};if(j.useImperativeHandle($,function(){return{onKeyDown:function(Te){var me=Te.which;switch(me){case r.a.UP:case r.a.DOWN:{var be=0;if(me===r.a.UP?be=-1:me===r.a.DOWN&&(be=1),be!==0){var ae=Qe(tt+be,be);Je(ae),ut(ae)}break}case r.a.ENTER:{var le=Ie[tt];le&&!le.data.disabled?ot(le.data.value):ot(void 0),se&&Te.preventDefault();break}case r.a.ESC:Pe(!1)}},onKeyUp:function(){},scrollTo:function(Te){Je(Te)}}}),Ie.length===0)return j.createElement("div",{role:"listbox",id:"".concat(oe,"_list"),className:"".concat(Le,"-empty"),onMouseDown:Xe},fe);function Ue(He){var Te=Ie[He];if(!Te)return null;var me=Te.data||{},be=me.value,ae=me.label,le=me.children,de=Object(L.a)(me,!0),ge=ve?le:ae;return Te?j.createElement("div",Object.assign({"aria-label":typeof ge=="string"?ge:null},de,{key:He,role:"option",id:"".concat(oe,"_list_").concat(He),"aria-selected":Se.has(be)}),be):null}return j.createElement(j.Fragment,null,j.createElement("div",{role:"listbox",id:"".concat(oe,"_list"),style:{height:0,width:0,overflow:"hidden"}},Ue(tt-1),Ue(tt),Ue(tt+1)),j.createElement(h.a,{itemKey:"key",ref:Ge,data:Ie,height:ce,itemHeight:re,fullHeight:!1,onMouseDown:Xe,onScroll:ue,virtual:Ne,onMouseEnter:Ee},function(He,Te){var me,be=He.group,ae=He.groupOption,le=He.data,de=le.label,ge=le.key;if(be)return j.createElement("div",{className:p()(Le,"".concat(Le,"-group"))},de!==void 0?de:ge);var we=le.disabled,Fe=le.value,ze=le.title,st=le.children,mt=le.style,ft=le.className,wt=Object(K.a)(le,["disabled","value","title","children","style","className"]),St=Se.has(Fe),ct="".concat(Le,"-option"),Ut=p()(Le,ct,ft,(me={},Object(B.a)(me,"".concat(ct,"-grouped"),ae),Object(B.a)(me,"".concat(ct,"-active"),tt===Te&&!we),Object(B.a)(me,"".concat(ct,"-disabled"),we),Object(B.a)(me,"".concat(ct,"-selected"),St),me)),Lt=ve?st:de,qt=!ke||typeof ke=="function"||St;return j.createElement("div",Object.assign({},wt,{"aria-selected":St,className:Ut,title:ze,onMouseMove:function(){if(tt===Te||we)return;ut(Te)},onClick:function(){we||ot(Fe)},style:mt}),j.createElement("div",{className:"".concat(ct,"-content")},Lt||Fe),j.isValidElement(ke)||St,qt&&j.createElement(l.a,{className:"".concat(Le,"-option-state"),customizeIcon:ke,customizeIconProps:{isSelected:St}},St?"\u2713":null))}))},o=j.forwardRef(f);o.displayName="OptionList";var u=o,a=function(){return null};a.isSelectOption=!0;var s=a,R=function(){return null};R.isSelectOptGroup=!0;var _=R,C=Z("VTBJ"),D=Z("Zm9Q");function O(g){var H=g.key,$=g.props,ie=$.children,oe=$.value,Ce=Object(K.a)($,["children","value"]);return Object(C.a)({key:H,value:oe!==void 0?oe:H,children:ie},Ce)}function A(g){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(D.a)(g).map(function($,ie){if(!j.isValidElement($)||!$.type)return null;var oe=$.type.isSelectOptGroup,Ce=$.key,ve=$.props,Se=ve.children,Ae=Object(K.a)(ve,["children"]);return H||!oe?O($):Object(C.a)(Object(C.a)({key:"__RC_SELECT_GRP__".concat(Ce===null?ie:Ce,"__"),label:Ce},Ae),{},{options:A(Se)})}).filter(function($){return $})}var S=Z("2Qr1"),T=Z("qNPg"),c=Z("U8pU"),w=Z("Kwbf"),y=Z("WKfj");function b(g){var H=g.mode,$=g.options,ie=g.children,oe=g.backfill,Ce=g.allowClear,ve=g.placeholder,Se=g.getInputElement,Ae=g.showSearch,Oe=g.onSearch,he=g.defaultOpen,ce=g.autoFocus,re=g.labelInValue,fe=g.value,se=g.inputValue,ke=g.optionLabelProp,Ne=H==="multiple"||H==="tags",Re=Ae!==void 0?Ae:Ne||H==="combobox",Pe=$||A(ie);if(Object(w.a)(H!=="tags"||Pe.every(function(Le){return!Le.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),H==="tags"||H==="combobox"){var je=Pe.some(function(Le){return Le.options?Le.options.some(function(Ie){return typeof("value"in Ie?Ie.value:Ie.key)=="number"}):typeof("value"in Le?Le.value:Le.key)=="number"});Object(w.a)(!je,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(w.a)(H!=="combobox"||!ke,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(w.a)(H==="combobox"||!oe,"`backfill` only works with `combobox` mode."),Object(w.a)(H==="combobox"||!Se,"`getInputElement` only work with `combobox` mode."),Object(w.b)(H!=="combobox"||!Se||!Ce||!ve,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Oe&&!Re&&H!=="combobox"&&H!=="tags"&&Object(w.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(w.b)(!he||ce,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),fe!=null){var ue=Object(y.d)(fe);Object(w.a)(!re||ue.every(function(Le){return Object(c.a)(Le)==="object"&&("key"in Le||"value"in Le)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(w.a)(!Ne||Array.isArray(fe),"`value` should be array when `mode` is `multiple` or `tags`")}if(ie){var Ee=null;Object(D.a)(ie).some(function(Le){if(!j.isValidElement(Le)||!Le.type)return!1;var Ie=Le.type;if(Ie.isSelectOption)return!1;if(Ie.isSelectOptGroup){var Ge=Object(D.a)(Le.props.children).every(function(Xe){return!j.isValidElement(Xe)||!Le.type||Xe.type.isSelectOption?!0:(Ee=Xe.type,!1)});return!Ge}return Ee=Ie,!0}),Ee&&Object(w.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ee.displayName||Ee.name||Ee,"`.")),Object(w.a)(se===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var U=b,F=Object(T.a)({prefixCls:"rc-select",components:{optionList:u},convertChildrenToData:A,flattenOptions:S.d,getLabeledValue:S.e,filterOptions:S.b,isValueDisabled:S.g,findValueOption:S.c,warningProps:U,fillOptionsWithMissingValue:S.a}),E=function(g){Object(P.a)($,g);var H=Object(X.a)($);function $(){var ie;return Object(ne.a)(this,$),ie=H.apply(this,arguments),ie.selectRef=j.createRef(),ie.focus=function(){ie.selectRef.current.focus()},ie.blur=function(){ie.selectRef.current.blur()},ie}return Object(J.a)($,[{key:"render",value:function(){return j.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),$}(j.Component);E.Option=s,E.OptGroup=_;var N=E,I=xe.c=N},M8RZ:function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return r});var ne=Z("fWQN"),J=Z("mtLc"),P=Z("yKVA"),X=Z("879j"),j=Z("q1tI"),B=Z.n(j),K=Z("i8i4"),G=Z.n(K),r=function(L){Object(P.a)(m,L);var v=Object(X.a)(m);function m(p){var h;Object(ne.a)(this,m),h=v.call(this,p);var l=window.document;return h.node=l.createElement("div"),l.body.appendChild(h.node),h}return Object(J.a)(m,[{key:"render",value:function(){var h=this.props.children;return Object(K.createPortal)(h,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(B.a.Component)},MI8n:function(nt,xe,Z){"use strict";Z.d(xe,"c",function(){return j}),Z.d(xe,"b",function(){return r}),Z.d(xe,"e",function(){return L}),Z.d(xe,"a",function(){return v}),Z.d(xe,"d",function(){return m}),Z.d(xe,"f",function(){return p});var ne=Z("/cxE"),J=Z("pmY6"),P=Z("24hK"),X=Z("5Y4S"),j;(function(h){h.None=()=>J.a.None;function l(b){return(U,F=null,E)=>{let N=!1,I;return I=b(g=>N?void 0:(I?I.dispose():N=!0,U.call(F,g)),null,E),N&&I.dispose(),I}}h.once=l;function f(b,U){return _((F,E=null,N)=>b(I=>F.call(E,U(I)),null,N))}h.map=f;function o(b,U){return _((F,E=null,N)=>b(I=>{U(I),F.call(E,I)},null,N))}h.forEach=o;function u(b,U){return _((F,E=null,N)=>b(I=>U(I)&&F.call(E,I),null,N))}h.filter=u;function a(b){return b}h.signal=a;function s(...b){return(U,F=null,E)=>Object(J.e)(...b.map(N=>N(I=>U.call(F,I),null,E)))}h.any=s;function R(b,U,F){let E=F;return f(b,N=>(E=U(E,N),E))}h.reduce=R;function _(b){let U;const F=new r({onFirstListenerAdd(){U=b(F.fire,F)},onLastListenerRemove(){U.dispose()}});return F.event}function C(b,U,F=100,E=!1,N){let I,g,H,$=0;const ie=new r({leakWarningThreshold:N,onFirstListenerAdd(){I=b(oe=>{$++,g=U(g,oe),E&&!H&&(ie.fire(g),g=void 0),clearTimeout(H),H=setTimeout(()=>{const Ce=g;g=void 0,H=void 0,(!E||$>1)&&ie.fire(Ce),$=0},F)})},onLastListenerRemove(){I.dispose()}});return ie.event}h.debounce=C;function D(b,U=(F,E)=>F===E){let F=!0,E;return u(b,N=>{const I=F||!U(N,E);return F=!1,E=N,I})}h.latch=D;function O(b,U){return[h.filter(b,U),h.filter(b,F=>!U(F))]}h.split=O;function A(b,U=!1,F=[]){let E=F.slice(),N=b(H=>{E?E.push(H):g.fire(H)});const I=()=>{E&&E.forEach(H=>g.fire(H)),E=null},g=new r({onFirstListenerAdd(){N||(N=b(H=>g.fire(H)))},onFirstListenerDidAdd(){E&&(U?setTimeout(I):I())},onLastListenerRemove(){N&&N.dispose(),N=null}});return g.event}h.buffer=A;class S{constructor(b){this.event=b}map(b){return new S(f(this.event,b))}forEach(b){return new S(o(this.event,b))}filter(b){return new S(u(this.event,b))}reduce(b,U){return new S(R(this.event,b,U))}latch(){return new S(D(this.event))}debounce(b,U=100,F=!1,E){return new S(C(this.event,b,U,F,E))}on(b,U,F){return this.event(b,U,F)}once(b,U,F){return l(this.event)(b,U,F)}}function T(b){return new S(b)}h.chain=T;function c(b,U,F=E=>E){const E=(...H)=>g.fire(F(...H)),N=()=>b.on(U,E),I=()=>b.removeListener(U,E),g=new r({onFirstListenerAdd:N,onLastListenerRemove:I});return g.event}h.fromNodeEventEmitter=c;function w(b,U,F=E=>E){const E=(...H)=>g.fire(F(...H)),N=()=>b.addEventListener(U,E),I=()=>b.removeEventListener(U,E),g=new r({onFirstListenerAdd:N,onLastListenerRemove:I});return g.event}h.fromDOMEventEmitter=w;function y(b){return new Promise(U=>l(b)(U))}h.toPromise=y})(j||(j={}));class B{constructor(h){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${h}_${B._idPool++}`}start(h){this._stopWatch=new X.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}}}B._idPool=0;let K=-1;class G{constructor(h,l=Math.random().toString(18).slice(2,5)){this.customThreshold=h,this.name=l,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(h){let l=K;if(typeof this.customThreshold=="number"&&(l=this.customThreshold),l<=0||h<l)return;this._stacks||(this._stacks=new Map);const f=new Error().stack.split(`
`).slice(3).join(`
`),o=this._stacks.get(f)||0;if(this._stacks.set(f,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=l*.5;let u,a=0;for(const[s,R]of this._stacks)(!u||a<R)&&(u=s,a=R);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(f)||0;this._stacks.set(f,u-1)}}}class r{constructor(h){var l;this._disposed=!1,this._options=h,this._leakageMon=K>0?new G(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((l=this._options)===null||l===void 0?void 0:l._profName)?new B(this._options._profName):void 0}get event(){return this._event||(this._event=(h,l,f)=>{var o;this._listeners||(this._listeners=new P.a);const u=this._listeners.isEmpty();u&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const a=this._listeners.push(l?[h,l]:h);u&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,h,l);const s=(o=this._leakageMon)===null||o===void 0?void 0:o.check(this._listeners.size),R=Object(J.i)(()=>{if(s&&s(),!this._disposed&&(a(),this._options&&this._options.onLastListenerRemove)){const _=this._listeners&&!this._listeners.isEmpty();_||this._options.onLastListenerRemove(this)}});return f instanceof J.b?f.add(R):Array.isArray(f)&&f.push(R),R}),this._event}fire(h){var l,f;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new P.a);for(let o of this._listeners)this._deliveryQueue.push([o,h]);for((l=this._perfMon)===null||l===void 0||l.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[o,u]=this._deliveryQueue.shift();try{typeof o=="function"?o.call(void 0,u):o[0].call(o[1],u)}catch(a){Object(ne.f)(a)}}(f=this._perfMon)===null||f===void 0||f.stop()}}dispose(){var h,l,f,o,u;this._disposed||(this._disposed=!0,(h=this._listeners)===null||h===void 0||h.clear(),(l=this._deliveryQueue)===null||l===void 0||l.clear(),(o=(f=this._options)===null||f===void 0?void 0:f.onLastListenerRemove)===null||o===void 0||o.call(f),(u=this._leakageMon)===null||u===void 0||u.dispose())}}class L extends r{constructor(h){super(h);this._isPaused=0,this._eventQueue=new P.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 v extends L{constructor(h){var l;super(h);this._delay=(l=h.delay)!==null&&l!==void 0?l:100}fire(h){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(h)}}class m{constructor(){this.buffers=[]}wrapEvent(h){return(l,f,o)=>h(u=>{const a=this.buffers[this.buffers.length-1];a?a.push(()=>l.call(f,u)):l.call(f,u)},void 0,o)}bufferEvents(h){const l=[];this.buffers.push(l);const f=h();return this.buffers.pop(),l.forEach(o=>o()),f}}class p{constructor(){this.listening=!1,this.inputEvent=j.None,this.inputEventListener=J.a.None,this.emitter=new r({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(nt,xe,Z){"use strict";(function(ne,J){Z.d(xe,"b",function(){return f}),Z.d(xe,"i",function(){return s}),Z.d(xe,"f",function(){return R}),Z.d(xe,"d",function(){return _}),Z.d(xe,"g",function(){return C}),Z.d(xe,"h",function(){return D}),Z.d(xe,"c",function(){return O}),Z.d(xe,"k",function(){return A}),Z.d(xe,"j",function(){return S}),Z.d(xe,"a",function(){return T}),Z.d(xe,"e",function(){return y});var P;const X="en";let j=!1,B=!1,K=!1,G=!1,r=!1,L=!1,v=!1,m,p=X,h,l;const f=typeof self=="object"?self:typeof ne=="object"?ne:{};let o;typeof f.vscode!="undefined"&&typeof f.vscode.process!="undefined"?o=f.vscode.process:typeof J!="undefined"&&(o=J);const u=typeof((P=o==null?void 0:o.versions)===null||P===void 0?void 0:P.electron)=="string"&&o.type==="renderer";if(typeof navigator=="object"&&!u)l=navigator.userAgent,j=l.indexOf("Windows")>=0,B=l.indexOf("Macintosh")>=0,v=(l.indexOf("Macintosh")>=0||l.indexOf("iPad")>=0||l.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,K=l.indexOf("Linux")>=0,L=!0,m=navigator.language,p=m;else if(typeof o=="object"){j=o.platform==="win32",B=o.platform==="darwin",K=o.platform==="linux",G=K&&!!o.env.SNAP&&!!o.env.SNAP_REVISION,m=X,p=X;const b=o.env.VSCODE_NLS_CONFIG;if(b)try{const U=JSON.parse(b),F=U.availableLanguages["*"];m=U.locale,p=F||X,h=U._translationsConfigFile}catch(U){}r=!0}else console.error("Unable to resolve platform.");let a=0;B?a=1:j?a=3:K&&(a=2);const s=j,R=B,_=K,C=r,D=L,O=v,A=l,S=function(){if(f.setImmediate)return f.setImmediate.bind(f);if(typeof f.postMessage=="function"&&!f.importScripts){let F=[];f.addEventListener("message",N=>{if(N.data&&N.data.vscodeSetImmediateId)for(let I=0,g=F.length;I<g;I++){const H=F[I];if(H.id===N.data.vscodeSetImmediateId){F.splice(I,1),H.callback();return}}});let E=0;return N=>{const I=++E;F.push({id:I,callback:N}),f.postMessage({vscodeSetImmediateId:I},"*")}}if(typeof(o==null?void 0:o.nextTick)=="function")return o.nextTick.bind(o);const U=Promise.resolve();return F=>U.then(F)}(),T=B||v?2:j?1:3;let c=!0,w=!1;function y(){if(!w){w=!0;const b=new Uint8Array(2);b[0]=1,b[1]=2;const U=new Uint16Array(b.buffer);c=U[0]===(2<<8)+1}return c}}).call(this,Z("IyRk"),Z("Q2Ig"))},N0LK:function(nt,xe,Z){"use strict";Z.d(xe,"C",function(){return ne}),Z.d(xe,"v",function(){return P}),Z.d(xe,"s",function(){return X}),Z.d(xe,"t",function(){return j}),Z.d(xe,"U",function(){return B}),Z.d(xe,"J",function(){return K}),Z.d(xe,"O",function(){return G}),Z.d(xe,"p",function(){return r}),Z.d(xe,"T",function(){return L}),Z.d(xe,"q",function(){return v}),Z.d(xe,"N",function(){return m}),Z.d(xe,"M",function(){return p}),Z.d(xe,"Q",function(){return h}),Z.d(xe,"u",function(){return l}),Z.d(xe,"x",function(){return f}),Z.d(xe,"I",function(){return o}),Z.d(xe,"f",function(){return u}),Z.d(xe,"h",function(){return a}),Z.d(xe,"g",function(){return s}),Z.d(xe,"i",function(){return R}),Z.d(xe,"G",function(){return _}),Z.d(xe,"H",function(){return C}),Z.d(xe,"r",function(){return D}),Z.d(xe,"R",function(){return O}),Z.d(xe,"d",function(){return A}),Z.d(xe,"e",function(){return S}),Z.d(xe,"E",function(){return T}),Z.d(xe,"F",function(){return c}),Z.d(xe,"j",function(){return w}),Z.d(xe,"z",function(){return y}),Z.d(xe,"K",function(){return U}),Z.d(xe,"L",function(){return F}),Z.d(xe,"m",function(){return N}),Z.d(xe,"k",function(){return g}),Z.d(xe,"A",function(){return $}),Z.d(xe,"a",function(){return ie}),Z.d(xe,"n",function(){return oe}),Z.d(xe,"l",function(){return Ce}),Z.d(xe,"D",function(){return ve}),Z.d(xe,"B",function(){return Se}),Z.d(xe,"b",function(){return Ae}),Z.d(xe,"S",function(){return Oe}),Z.d(xe,"o",function(){return he}),Z.d(xe,"P",function(){return ce}),Z.d(xe,"w",function(){return re}),Z.d(xe,"c",function(){return fe}),Z.d(xe,"y",function(){return Ne});function ne(ue){return!ue||typeof ue!="string"?!0:ue.trim().length===0}const J=/{(\d+)}/g;function P(ue,...Ee){return Ee.length===0?ue:ue.replace(J,function(Le,Ie){const Ge=parseInt(Ie,10);return isNaN(Ge)||Ge<0||Ge>=Ee.length?Le:Ee[Ge]})}function X(ue){return ue.replace(/[<>&]/g,function(Ee){switch(Ee){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return Ee}})}function j(ue){return ue.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function B(ue,Ee=" "){const Le=K(ue,Ee);return G(Le,Ee)}function K(ue,Ee){if(!ue||!Ee)return ue;const Le=Ee.length;if(Le===0||ue.length===0)return ue;let Ie=0;for(;ue.indexOf(Ee,Ie)===Ie;)Ie=Ie+Le;return ue.substring(Ie)}function G(ue,Ee){if(!ue||!Ee)return ue;const Le=Ee.length,Ie=ue.length;if(Le===0||Ie===0)return ue;let Ge=Ie,Xe=-1;for(;!(Xe=ue.lastIndexOf(Ee,Ge-1),Xe===-1||Xe+Le!==Ge);){if(Xe===0)return"";Ge=Xe}return ue.substring(0,Ge)}function r(ue){return ue.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function L(ue){return ue.replace(/\*/g,"")}function v(ue,Ee,Le={}){if(!ue)throw new Error("Cannot create regex from empty string");Ee||(ue=j(ue)),Le.wholeWord&&(/\B/.test(ue.charAt(0))||(ue="\\b"+ue),/\B/.test(ue.charAt(ue.length-1))||(ue=ue+"\\b"));let Ie="";return Le.global&&(Ie+="g"),Le.matchCase||(Ie+="i"),Le.multiline&&(Ie+="m"),Le.unicode&&(Ie+="u"),new RegExp(ue,Ie)}function m(ue){if(ue.source==="^"||ue.source==="^$"||ue.source==="$"||ue.source==="^\\s*$")return!1;const Ee=ue.exec("");return!!(Ee&&ue.lastIndex===0)}function p(ue){return(ue.global?"g":"")+(ue.ignoreCase?"i":"")+(ue.multiline?"m":"")+(ue.unicode?"u":"")}function h(ue){return ue.split(/\r\n|\r|\n/)}function l(ue){for(let Ee=0,Le=ue.length;Ee<Le;Ee++){const Ie=ue.charCodeAt(Ee);if(Ie!==32&&Ie!==9)return Ee}return-1}function f(ue,Ee=0,Le=ue.length){for(let Ie=Ee;Ie<Le;Ie++){const Ge=ue.charCodeAt(Ie);if(Ge!==32&&Ge!==9)return ue.substring(Ee,Ie)}return ue.substring(Ee,Le)}function o(ue,Ee=ue.length-1){for(let Le=Ee;Le>=0;Le--){const Ie=ue.charCodeAt(Le);if(Ie!==32&&Ie!==9)return Le}return-1}function u(ue,Ee){return ue<Ee?-1:ue>Ee?1:0}function a(ue,Ee,Le=0,Ie=ue.length,Ge=0,Xe=Ee.length){for(;Le<Ie&&Ge<Xe;Le++,Ge++){let at=ue.charCodeAt(Le),qe=Ee.charCodeAt(Ge);if(at<qe)return-1;if(at>qe)return 1}const Je=Ie-Le,Qe=Xe-Ge;return Je<Qe?-1:Je>Qe?1:0}function s(ue,Ee){return R(ue,Ee,0,ue.length,0,Ee.length)}function R(ue,Ee,Le=0,Ie=ue.length,Ge=0,Xe=Ee.length){for(;Le<Ie&&Ge<Xe;Le++,Ge++){let at=ue.charCodeAt(Le),qe=Ee.charCodeAt(Ge);if(at===qe)continue;if(at>=128||qe>=128)return a(ue.toLowerCase(),Ee.toLowerCase(),Le,Ie,Ge,Xe);_(at)&&(at-=32),_(qe)&&(qe-=32);const tt=at-qe;if(tt===0)continue;return tt}const Je=Ie-Le,Qe=Xe-Ge;return Je<Qe?-1:Je>Qe?1:0}function _(ue){return ue>=97&&ue<=122}function C(ue){return ue>=65&&ue<=90}function D(ue,Ee){return ue.length===Ee.length&&R(ue,Ee)===0}function O(ue,Ee){const Le=Ee.length;return Ee.length>ue.length?!1:R(ue,Ee,0,Le)===0}function A(ue,Ee){let Le,Ie=Math.min(ue.length,Ee.length);for(Le=0;Le<Ie;Le++)if(ue.charCodeAt(Le)!==Ee.charCodeAt(Le))return Le;return Ie}function S(ue,Ee){let Le,Ie=Math.min(ue.length,Ee.length);const Ge=ue.length-1,Xe=Ee.length-1;for(Le=0;Le<Ie;Le++)if(ue.charCodeAt(Ge-Le)!==Ee.charCodeAt(Xe-Le))return Le;return Ie}function T(ue){return 55296<=ue&&ue<=56319}function c(ue){return 56320<=ue&&ue<=57343}function w(ue,Ee){return(ue-55296<<10)+(Ee-56320)+65536}function y(ue,Ee,Le){const Ie=ue.charCodeAt(Le);if(T(Ie)&&Le+1<Ee){const Ge=ue.charCodeAt(Le+1);if(c(Ge))return w(Ie,Ge)}return Ie}function b(ue,Ee){const Le=ue.charCodeAt(Ee-1);if(c(Le)&&Ee>1){const Ie=ue.charCodeAt(Ee-2);if(T(Ie))return w(Ie,Le)}return Le}function U(ue,Ee){const Le=se.getInstance(),Ie=Ee,Ge=ue.length,Xe=y(ue,Ge,Ee);Ee+=Xe>=65536?2:1;let Je=Le.getGraphemeBreakType(Xe);for(;Ee<Ge;){const Qe=y(ue,Ge,Ee),at=Le.getGraphemeBreakType(Qe);if(fe(Je,at))break;Ee+=Qe>=65536?2:1,Je=at}return Ee-Ie}function F(ue,Ee){const Le=se.getInstance(),Ie=Ee,Ge=b(ue,Ee);Ee-=Ge>=65536?2:1;let Xe=Le.getGraphemeBreakType(Ge);for(;Ee>0;){const Je=b(ue,Ee),Qe=Le.getGraphemeBreakType(Je);if(fe(Qe,Xe))break;Ee-=Je>=65536?2:1,Xe=Qe}return Ie-Ee}const E=/(?:[\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 N(ue){return E.test(ue)}const I=/(?:[\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 g(ue){return I.test(ue)}const H=/^[\t\n\r\x20-\x7E]*$/;function $(ue){return H.test(ue)}const ie=/[\u2028\u2029]/;function oe(ue){return ie.test(ue)}function Ce(ue){for(let Ee=0,Le=ue.length;Ee<Le;Ee++)if(ve(ue.charCodeAt(Ee)))return!0;return!1}function ve(ue){return ue=+ue,ue>=11904&&ue<=55215||ue>=63744&&ue<=64255||ue>=65281&&ue<=65374}function Se(ue){return ue>=127462&&ue<=127487||ue===8986||ue===8987||ue===9200||ue===9203||ue>=9728&&ue<=10175||ue===11088||ue===11093||ue>=127744&&ue<=128591||ue>=128640&&ue<=128764||ue>=128992&&ue<=129003||ue>=129280&&ue<=129535||ue>=129648&&ue<=129750}const Ae=String.fromCharCode(65279);function Oe(ue){return!!(ue&&ue.length>0&&ue.charCodeAt(0)===65279)}function he(ue,Ee=!1){return ue?(Ee&&(ue=ue.replace(/\\./g,"")),ue.toLowerCase()!==ue):!1}function ce(ue){const Ee=90-65+1;return ue=ue%(2*Ee),ue<Ee?String.fromCharCode(97+ue):String.fromCharCode(65+ue-Ee)}function re(ue){const Ee=se.getInstance();return Ee.getGraphemeBreakType(ue)}function fe(ue,Ee){return ue===0?Ee!==5&&Ee!==7:ue===2&&Ee===3?!1:ue===4||ue===2||ue===3||(Ee===4||Ee===2||Ee===3)?!0:ue===8&&(Ee===8||Ee===9||Ee===11||Ee===12)||((ue===11||ue===9)&&(Ee===9||Ee===10)||((ue===12||ue===10)&&Ee===10||(Ee===5||Ee===13||(Ee===7||(ue===1||ue===13&&Ee===14)))))?!1:!(ue===6&&Ee===6)}class se{constructor(){this._data=ke()}static getInstance(){return se._INSTANCE||(se._INSTANCE=new se),se._INSTANCE}getGraphemeBreakType(ue){if(ue<32)return ue===10?3:ue===13?2:4;if(ue<127)return 0;const Ee=this._data,Le=Ee.length/3;let Ie=1;for(;Ie<=Le;)if(ue<Ee[3*Ie])Ie=2*Ie;else if(ue>Ee[3*Ie+1])Ie=2*Ie+1;else return Ee[3*Ie+2];return 0}}se._INSTANCE=null;function ke(){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 Ne(ue,Ee){if(ue===0)return 0;const Le=Re(ue,Ee);if(Le!==void 0)return Le;const Ie=b(Ee,ue);return ue-=Pe(Ie),ue}function Re(ue,Ee){let Le=b(Ee,ue);for(ue-=Pe(Le);je(Le)||Le===65039||Le===8419;){if(ue===0)return;Le=b(Ee,ue),ue-=Pe(Le)}if(!Se(Le))return;if(ue>=0){const Ie=b(Ee,ue);Ie===8205&&(ue-=Pe(Ie))}return ue}function Pe(ue){return ue>=65536?2:1}function je(ue){return 127995<=ue&&ue<=127999}},Ot1p:function(nt,xe,Z){"use strict";var ne=Z("2qtc"),J=Z("kLXV"),P=Z("rAM+"),X=Z("miYZ"),j=Z("tsqr"),B=Z("9og8"),K=Z("tJVT"),G=Z("jrin"),r=Z("WmNS"),L=Z.n(r),v=Z("q1tI"),m=Z.n(v),p=Z("VrN/"),h=Z.n(p),l=Z("bdgK"),f=Z("p77/"),o=Z("Bd2K"),u=Z("ELLl"),a=Z("19Vz"),s=Z("lZu9"),R=Z("+NIl"),_=Z("kSUc"),C=Z("9Bee"),D=function(we){var Fe=we.value,ze=Fe===void 0?"":Fe,st=we.className,mt=we.showTextOnly,ft=we.showLines,wt=we.style,St=wt===void 0?{}:wt,ct=Object(v.useMemo)(function(){return""},[ze]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:ct}}))},O=Z("0Owb"),A=Z("dejd"),S=Z("C+DQ"),T=Z("1vsH"),c=Z("m3rI"),w=[{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 y(we){var Fe=we.onActionCallback,ze=we.title,st=we.icon,mt=we.actionName,ft=we.className,wt=ft===void 0?"":ft,St=we.children;function ct(){Fe(mt)}return m.a.createElement("a",{title:ze,className:wt,onClick:ct},m.a.createElement("i",{className:"md-iconfont ".concat(st)}),St)}var b=function(we){var Fe=we.watch,ze=we.showNullButton,st=we.onActionCallback,mt=we.fullScreen,ft=we.insertTemp,wt=we.hidetoolBar,St=we.uuid,ct=we.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(T.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(T.F)("_educoder_session"),"&key=").concat(St,"&api=").concat(encodeURIComponent(c.a.PROXY_SERVER)));var Ut=[].concat(w,[{title:"".concat(Fe?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Fe?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!wt&&Ut.map(function(Lt,qt){return m.a.createElement("li",{key:qt},Lt.actionName?m.a.createElement(y,Object(O.a)({},Lt,{onActionCallback:st})):m.a.createElement("span",{className:"v-line"}))}),ze?m.a.createElement("li",null,m.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:st},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ft&&m.a.createElement("li",null,m.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ft),onActionCallback:st},m.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),m.a.createElement("li",{className:"btn-full-screen"},m.a.createElement(y,{icon:"".concat(mt?"icon-shrink":"icon-enlarge"),title:mt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:st})))},U=Z("M8RZ"),F=Z("+L6B"),E=Z("2/Rp"),N=Z("y8nQ"),I=Z("Vl3Y"),g=Z("5NDa"),H=Z("5rEg"),$={labelCol:{span:4},wrapperCol:{span:20}},ie=function(we){var Fe=we.callback,ze=we.onCancel;function st(mt){Fe(mt)}return m.a.createElement(I.a,Object(O.a)({},$,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:st}),m.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(H.a,null)),m.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(H.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(E.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(E.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))},oe=Z("7ahc"),Ce=Z("HmJG"),ve=Z("BjJ7"),Se=I.a.useForm,Ae={width:280,marginRight:10},Oe={labelCol:{span:5},wrapperCol:{span:19}},he=function(we){var Fe=we.callback,ze=we.onCancel,st=Se(),mt=Object(K.a)(st,1),ft=mt[0];function wt(Ut){Fe(Ut)}function St(Ut,Lt){if(Ut.status===-1){j.b.error(Ut.message);return}ft.setFieldsValue({src:"/api/attachments/".concat(Ut.id),type:Lt.type})}function ct(Ut){var Lt=Ut.target.files[0];re(Lt,St)}return m.a.createElement(I.a,Object(O.a)({form:ft},Oe,{className:"upload-image-panel",onFinish:wt}),m.a.createElement(I.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(I.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(H.a,{style:Ae})),m.a.createElement(ce,{onFileChange:ct}))),m.a.createElement(I.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(H.a,{style:{width:264}})),m.a.createElement(I.a.Item,{style:{textAlign:"right"}},m.a.createElement(E.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(E.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))};function ce(we){var Fe=we.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:Fe}))}function re(we,Fe){if(!we)throw new String("\u6CA1\u6709\u6587\u4EF6");var ze=new FormData;ze.append("editormd-image-file",we),ze.append("file_param_name","editormd-image-file"),ze.append("byxhr","true");var st=new window.XMLHttpRequest;st.withCredentials=!0,st.addEventListener("load",function(mt){Fe(JSON.parse(mt.target.responseText),we)},!1),st.addEventListener("error",function(mt){console.error(mt)},!1),st.open("POST","".concat(ve.a,"/api/attachments.json")),st.send(ze)}var fe=Z("giR+"),se=Z("fyUT"),ke=Z("7Kak"),Ne=Z("9yH6"),Re=Ne.a.Group,Pe={margin:"0 8px"},je=function(we){var Fe=we.callback,ze=we.onCancel;function st(mt){Fe(mt)}return m.a.createElement(I.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:st},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:Pe},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:Pe},"\u884C\u6570"),m.a.createElement(I.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(se.a,null)),m.a.createElement("span",{style:Pe},"\u5217\u6570"),m.a.createElement(I.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(se.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:Pe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(I.a.Item,{name:"align"},m.a.createElement(Re,null,m.a.createElement(Ne.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(Ne.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(Ne.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(Ne.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(E.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(E.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))},ue=Z("ErOA"),Ee=Z("7Cbv"),Le="link",Ie="upload-image",Ge="code-block",Xe="add-table",Je="------------",Qe={default:Je,left:":".concat(Je),center:":".concat(Je,":"),right:"".concat(Je,":")},at=Z("9VGf"),qe,tt;function Be(){}var ut=0,ot=1e4,Ue="\u2581",He=`
**\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 Te(we){return/^\d+$/.test(we)?"".concat(we,"px"):we}var me=navigator.platform.toUpperCase().indexOf("MAC")>=0,be=me?"Cmd":"Ctrl",ae=["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"],le=(qe={},Object(G.a)(qe,be+"-B","bold"),Object(G.a)(qe,be+"-I","italic"),qe),de=(tt={},Object(G.a)(tt,Le,"\u6DFB\u52A0\u94FE\u63A5"),Object(G.a)(tt,Ge,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(G.a)(tt,Ie,"\u6DFB\u52A0\u6587\u4EF6"),Object(G.a)(tt,Xe,"\u6DFB\u52A0\u8868\u683C"),tt),ge=xe.a=function(we){var Fe=we.defaultValue,ze=Fe===void 0?"":Fe,st=we.onChange,mt=we.width,ft=mt===void 0?"100%":mt,wt=we.height,St=wt===void 0?400:wt,ct=we.miniToolbar,Ut=ct===void 0?!1:ct,Lt=we.isFocus,qt=Lt===void 0?!1:Lt,Qt=we.watch,It=we.insertTemp,Cr=we.mode,Kr=Cr===void 0?"markdown":Cr,yt=we.id,Lr=yt===void 0?"markdown-editor-id":yt,bt=we.showResizeBar,xt=bt===void 0?!1:bt,Ft=we.noStorage,tr=Ft===void 0?!1:Ft,cr=we.showNullButton,Pt=cr===void 0?!1:cr,dt=we.hidetoolBar,Ur=dt===void 0?!1:dt,Vt=we.fullScreen,Jt=Vt===void 0?!1:Vt,Rt=we.onBlur,lr=we.onCMBeforeChange,Ir=we.onFullScreen,Xr=we.className,$e=Xr===void 0?"":Xr,Ct=we.disablePaste,pi=Ct===void 0?!1:Ct,mi=we.placeholder,gi=mi===void 0?"":mi,vi=we.values,Y=vi===void 0?"":vi,x=Object(v.useState)(null),k=Object(K.a)(x,2),W=k[0],ee=k[1],V=Object(v.useState)(ze),_e=Object(K.a)(V,2),Ke=_e[0],et=_e[1],pt=Object(v.useState)(Qt),Ve=Object(K.a)(pt,2),_t=Ve[0],jt=Ve[1],$t=Object(v.useState)(Jt),jr=Object(K.a)($t,2),Er=jr[0],xr=jr[1],Qr=Object(v.useState)(""),Ii=Object(K.a)(Qr,2),dr=Ii[0],zr=Ii[1],li=Object(v.useState)(0),ui=Object(K.a)(li,2),Hr=ui[0],Di=ui[1],yi=Object(v.useState)(St),Ki=Object(K.a)(yi,2),zi=Ki[0],Zr=Ki[1],$r=Object(v.useState)(!1),bi=Object(K.a)($r,2),cn=bi[0],_i=bi[1],ir=Object(v.useRef)(Object(Ee.a)()),Ht=Object(v.useRef)(!1),yr=Object(v.useRef)(),kt=Object(v.useRef)(),ar=Object(v.useRef)(),Kt=Object(v.useRef)(),ii=Object(v.useRef)(),fr=function(){var gt=Object(B.a)(L.a.mark(function At(){var Et,Dt;return L.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return Yt.next=2,Object(ue.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:ir.current}});case 2:Dt=Yt.sent,Dt!=null&&(Et=Dt.attachments)!==null&&Et!==void 0&&Et.length&&(console.log("cm:",W,kt),Dt.attachments.map(function(Nt){Nt.content_type.indexOf("image")>-1?W.replaceSelection("![,](/api/attachments/".concat(Nt.id,"?type=").concat(Nt.content_type,")")):Nt.content_type.indexOf("video")>-1?W.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Nt.content_type.indexOf("pdf")>-1?W.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Nt.id,"?type=").concat(Nt.content_type,'&disposition=inline" target="_blank">').concat(Nt.name,"</a>")):W.replaceSelection("[".concat(Nt.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Nt.id,"?type=").concat(Nt.content_type,")"))}));case 4:case"end":return Yt.stop()}},At)}));return function(){return gt.apply(this,arguments)}}();Object(v.useEffect)(function(){et(Y),W==null||W.setValue(Y)},[Y]),Object(v.useEffect)(function(){Ir==null||Ir(Er)},[Er]),Object(v.useEffect)(function(){if(kt.current){var gt=h.a.fromTextArea(kt.current,{mode:Kr,lineNumbers:!Ut,lineWrapping:!0,value:ze,autoCloseTags:!0,autoCloseBrackets:!0});qt&&gt.focus();function At(Et,Dt){if(pi){Dt.preventDefault();return}var Bt=Dt.clipboardData;if(Bt){var Yt=Bt.types.toString(),Nt=Bt.items;if(Yt==="Files"||Bt.types.indexOf("Files")>-1){if(Dt.preventDefault(),Kr=="stex")return;try{var ur,Dr=Nt[1];((ur=Nt[0])===null||ur===void 0?void 0:ur.kind)==="file"&&(Dr=Nt[0]);var Mt=Dr.getAsFile(),hi=Mt.name.split(".").pop();re(Mt,function(Wt){if(Wt.id){var kr,Tr,Jr;(Mt==null||((kr=Mt.type)===null||kr===void 0)?void 0:kr.indexOf("image"))>-1?gt.replaceSelection("![,](/api/attachments/".concat(Wt.id,"?type=").concat(Wt.content_type,")")):(Mt==null||((Tr=Mt.type)===null||Tr===void 0)?void 0:Tr.indexOf("video"))>-1?gt.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Wt.id,'"></video>')):(Mt==null||((Jr=Mt.type)===null||Jr===void 0)?void 0:Jr.indexOf("pdf"))>-1?gt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Mt.type,'&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):ae.includes(hi)?gt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Wt.id,'?type=office&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):gt.replaceSelection("[".concat(Mt.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}else(Wt==null?void 0:Wt.status)===401&&(document.location.href="/user/login")})}catch(Wt){j.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return gt.on("paste",At),gt.on("dragleave",function(Et,Dt){ar.current.classList.remove("mouse-hover-md")}),gt.on("dragover",function(Et,Dt){ar.current.classList.add("mouse-hover-md")}),gt.on("drop",function(Et,Dt){ar.current.classList.add("mouse-hover-md");var Bt;if(Bt=Dt.dataTransfer.files,Bt.length>0){Dt.preventDefault(),Dt.stopPropagation();for(var Yt=function(Dr){var Mt=Bt[Dr],hi=Mt.name.split(".").pop();re(Mt,function(Wt){if(Wt.id){var kr,Tr,Jr;(Mt==null||((kr=Mt.type)===null||kr===void 0)?void 0:kr.indexOf("image"))>-1?gt.replaceSelection("![,](/api/attachments/".concat(Wt.id,"?type=").concat(Wt.content_type,")")):(Mt==null||((Tr=Mt.type)===null||Tr===void 0)?void 0:Tr.indexOf("video"))>-1?gt.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Wt.id,'"></video>')):(Mt==null||((Jr=Mt.type)===null||Jr===void 0)?void 0:Jr.indexOf("pdf"))>-1?gt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Mt.type,'&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):ae.includes(hi)?gt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Wt.id,'?type=office&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):gt.replaceSelection("[".concat(Mt.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}else(Wt==null?void 0:Wt.status)===401&&(document.location.href="/user/login")})},Nt=0;Nt<Bt.length;Nt++)Yt(Nt)}}),ee(gt),function(){gt.off("paste",At)}}},[]);var Ar=Object(v.useCallback)(function(){if(ar.current)try{}catch(gt){console.log(gt,"---- to set md editor body height")}},[zi,ar,Er]);Object(v.useEffect)(function(){function gt(){var Et=new l.default(function(Dt){var Bt=Object(P.a)(Dt),Yt;try{for(Bt.s();!(Yt=Bt.n()).done;){var Nt=Yt.value;(Nt.target.offsetHeight>0||Nt.target.offsetWidth>0)&&(Ar(),W.setSize("100%","100%"),W.refresh())}}catch(ur){Bt.e(ur)}finally{Bt.f()}});return Et.observe(kt.current.parentElement),Et}if(W){var At=gt();return function(){At.unobserve(kt.current.parentElement)}}},[W,Ar]),Object(v.useEffect)(function(){if(W){for(var gt=[],At=function(){var Nt=Dt[Et];Bt=Object(K.a)(Nt,2);var ur=Bt[0],Dr=Bt[1],Mt=Object(G.a)({},ur,function(){Vi(Dr)});gt.push(Mt),W.addKeyMap(Mt)},Et=0,Dt=Object.entries(le);Et<Dt.length;Et++){var Bt;At()}return yr.current=setInterval(function(){Ht.current&&fr()},4e3),function(){clearInterval(yr.current);var Yt=Object(P.a)(gt),Nt;try{for(Yt.s();!(Nt=Yt.n()).done;){var ur=Nt.value;W.removeKeyMap(ur)}}catch(Dr){Yt.e(Dr)}finally{Yt.f()}}}},[W]),Object(v.useEffect)(function(){Jt!==Er&&xr(Jt)},[Jt]),Object(at.a)(function(){if(!tr&&Hr>0){var gt=new Date().getTime(),At=window.sessionStorage.getItem(Lr);gt>=Hr+ot&&(!At||At!==Ke)&&(window.sessionStorage.setItem(Lr,Ke),_i(!0))}},ot),Object(v.useEffect)(function(){jt(Qt)},[W,Qt]),Object(v.useEffect)(function(){W&&(qt&&W.focus())},[W,qt]),Object(v.useEffect)(function(){if(_t&&W){var gt=W.getScrollerElement();function At(Et){var Dt=Et.target;if(ii.current){var Bt=Dt.scrollTop/Dt.scrollHeight;ii.current.scrollTop=ii.current.scrollHeight*Bt}}return gt.addEventListener("scroll",At),function(){gt.removeEventListener("scroll",At)}}},[W,_t]),Object(v.useEffect)(function(){if(W&&lr){function gt(At,Et){lr(At,Et)}return W.on("beforeChange",gt),function(){W.off("beforeChange",gt)}}},[W,lr]),Object(v.useEffect)(function(){if(W&&Rt){function gt(){Rt(W.getValue())}return W.on("blur",gt),function(){W.off("blur",gt)}}},[W,Rt]),Object(v.useEffect)(function(){if(W){function gt(At){var Et=At.getValue();et(Et),Di(new Date().getTime()),At.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),st&&st(Et)}return W.on("change",gt),function(){W.off("change",gt)}}},[W,st]),Object(v.useEffect)(function(){W&&(ze==null?(W.setValue(""),et("")):ze!==W.getValue()&&(W.setValue(ze),et(ze),W.setCursor(W.lineCount(),0)))},[W,ze]);var Vi=Object(v.useCallback)(function(gt){var At=W.getCursor(),Et=W.getSelection(),Dt=Et.split(`
`);switch(gt){case"bold":return W.replaceSelection("**"+Et+"**"),Et===""&&W.setCursor(At.line,At.ch+2),W.focus();case"italic":return W.replaceSelection("*"+Et+"*"),Et===""&&W.setCursor(At.line,At.ch+1),W.focus();case"code":return W.replaceSelection("`"+Et+"`"),Et===""&&W.setCursor(At.line,At.ch+1),W.focus();case"inline-latex":return W.replaceSelection("`$$"+Et+"$$`"),Et===""&&W.setCursor(At.line,At.ch+3),W.focus();case"latex":return W.replaceSelection("```latex\n"+Et+"\n```"),W.setCursor(At.line+1,Et.length+1),W.focus();case"line-break":return W.replaceSelection(`<br/>
`),W.focus();case"list-ul":return Et===""?W.replaceSelection("- "+Et):W.replaceSelection(Dt.map(function(Bt){return Bt===""?"":"- ".concat(Bt)}).join(`
`)),W.focus();case"list-ol":return Et===""?W.replaceSelection("1. "+Et):W.replaceSelection(Dt.map(function(Bt,Yt){return Bt===""?"":"".concat(Yt+1,". ").concat(Bt)}).join(`
`)),W.focus();case"add-null-ch":return Et===""&&W.setCursor(At.line,At.ch+1),W.replaceSelection(Ue),W.focus();case"inster-template-1":return Et===""&&W.setCursor(At.line,At.ch),W.replaceSelection(He),W.focus();case"eraser":return W.setValue(""),W.focus();case"trigger-watch":return jt(!_t),W.focus();case"trigger-full-screen":return xr(!Er),W.focus();case Le:zr(Le);return;case Ge:zr(Ge);return;case Ie:zr(Ie);return;case Xe:zr(Xe);return;default:throw new Error}},[W,_t,Er]),Ei=Object(v.useCallback)(function(gt){zr("");switch(dr){case Le:var At=gt.title,Et=gt.link;return W.replaceSelection("[".concat(At,"](").concat(Et,")")),W.focus();case Ge:var Dt=gt.language,Bt=gt.content;return W.replaceSelection(["```"+Dt,Bt,"```"].join(`
`)),W.focus();case Ie:var Yt=gt.src,Nt=gt.alt;return Nt?W.replaceSelection("![ ".concat(Nt," ]( ").concat(Yt,' "').concat(Nt,'" )')):W.replaceSelection("![,](".concat(Yt,")")),W.focus();case Xe:for(var ur=gt.row,Dr=gt.col,Mt=gt.align,hi=`
`,Wt=0;Wt<ur;Wt++){for(var kr=[],Tr=[],Jr=0;Jr<Dr;Jr++)Wt===1&&Tr.push(Qe[Mt]),kr.push(" ");Wt===1&&(hi+="| ".concat(Tr.join(" | "),` |
`)),hi+="| ".concat(kr.join(Dr===1?"":" | "),` |
`)}return W.replaceSelection(hi+`
`),W.focus();default:throw new Error}},[W,dr]),dn=Object(v.useMemo)(function(){switch(dr){case Le:return m.a.createElement(ie,{callback:Ei,onCancel:xi});case Ge:return m.a.createElement(oe.b,{callback:Ei,onCancel:xi});case Ie:return m.a.createElement(he,{callback:Ei,onCancel:xi});case Xe:return m.a.createElement(je,{callback:Ei,onCancel:xi});default:return null}},[dr]);function xi(){zr("")}Object(v.useEffect)(function(){if(Kt.current){var gt=Kt.current,At=!1,Et=0;function Dt(Nt){At=!0,Et=Nt.pageY}function Bt(){At=!1}function Yt(Nt){if(At){var ur=Nt.pageY-Et;ur<0&&(ur=0),ur>300&&(ur=300);var Dr=St+ur+"px";Zr(Dr)}}return gt.addEventListener("mousedown",Dt),document.addEventListener("mousemove",Yt),document.addEventListener("mouseup",Bt),function(){gt.removeEventListener("mousedown",Dt),document.removeEventListener("mousemove",Yt),document.removeEventListener("mouseup",Bt)}}},[W,Kt]),Object(v.useEffect)(function(){Zr(St)},[St]);var ni=Te(ft),fn=Te(zi),qr={width:ni,height:fn},pn=Object(v.useMemo)(function(){if(Hr){var gt=new Date(Hr),At=gt.getHours(),Et=gt.getMinutes(),Dt=gt.getSeconds();return At=At<10?"0"+At:At,Et=Et<10?"0"+Et:Et,Dt=Dt<10?"0"+Dt:Dt,"".concat(At,":").concat(Et,":").concat(Dt)}return 0},[Hr]);function jn(){window.sessionStorage.removeItem(Lr),_i(!1),Di(0)}function ki(){_i(!1),Di(0),W.setValue(window.sessionStorage.getItem(Lr))}function ua(gt,At){var Et=W.getValue();Et=Et.replace(gt,At),et(Et),W==null||W.setValue(Et)}return m.a.createElement(v.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:ar},m.a.createElement("div",{className:"markdown-editor-container ".concat($e," ").concat(_t?"on-preview":""," ").concat(Ut?"mini":""," ").concat(Er?"full-screen":""),style:qr},m.a.createElement(b,{insertTemp:It,watch:_t,fullScreen:Er,showNullButton:Pt,onActionCallback:Vi,hidetoolBar:Ur,uuid:ir.current,setOpenPhones:function(){Ht.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:kt,placeholder:gi})),_t?m.a.createElement("div",{ref:ii,className:"preview-container"},Kr==="stex"&&m.a.createElement(D,{value:Ke}),Kr!=="stex"&&m.a.createElement(C.a,{edit:!0,value:Ke,replaces:ua})):null))),xt?m.a.createElement("a",{ref:Kt,className:"editor-resize"}):null,m.a.createElement(U.a,null,de[dr]?m.a.createElement(J.a,{centered:!0,title:de[dr],visible:!0,onCancel:xi,footer:null,className:"markdown-popup-form"},dn):null))}},SJMd:function(nt,xe){/**
* @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 Z,ne,J,P=!1,X,j;window.PR_SHOULD_USE_CONTINUATION=!0;var B,K;(function(){var G=window,r=["break,continue,do,else,for,if,return,while"],L=[r,"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"],v=[L,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],m=[v,"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"],p=[v,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],h=[v,"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"],l="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",f=[v,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],o="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",u=[r,"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=[r,"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=[r,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=[m,h,p,f,o,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/,C="str",D="kwd",O="com",A="typ",S="lit",T="pun",c="pln",w="tag",y="dec",b="src",U="atn",F="atv",E="nocode",N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function I(Re){for(var Pe=0,je=!1,ue=!1,Ee=0,Le=Re.length;Ee<Le;++Ee){var Ie=Re[Ee];if(Ie.ignoreCase)ue=!0;else if(/[a-z]/i.test(Ie.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){je=!0,ue=!1;break}}var Ge={b:8,t:9,n:10,v:11,f:12,r:13};function Xe(tt){var Be=tt.charCodeAt(0);if(Be!==92)return Be;var ut=tt.charAt(1);return Be=Ge[ut],Be||("0"<=ut&&ut<="7"?parseInt(tt.substring(1),8):ut==="u"||ut==="x"?parseInt(tt.substring(2),16):tt.charCodeAt(1))}function Je(tt){if(tt<32)return(tt<16?"\\x0":"\\x")+tt.toString(16);var Be=String.fromCharCode(tt);return Be==="\\"||Be==="-"||Be==="]"||Be==="^"?"\\"+Be:Be}function Qe(tt){var Be=tt.substring(1,tt.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")),ut=[],ot=Be[0]==="^",Ue=["["];ot&&Ue.push("^");for(var He=ot?1:0,Te=Be.length;He<Te;++He){var me=Be[He];if(/\\[bdsw]/i.test(me))Ue.push(me);else{var be=Xe(me),ae;He+2<Te&&Be[He+1]==="-"?(ae=Xe(Be[He+2]),He+=2):ae=be,ut.push([be,ae]),ae<65||be>122||(ae<65||be>90||ut.push([Math.max(65,be)|32,Math.min(ae,90)|32]),ae<97||be>122||ut.push([Math.max(97,be)&~32,Math.min(ae,122)&~32]))}}ut.sort(function(we,Fe){return we[0]-Fe[0]||Fe[1]-we[1]});for(var le=[],de=[],He=0;He<ut.length;++He){var ge=ut[He];ge[0]<=de[1]+1?de[1]=Math.max(de[1],ge[1]):le.push(de=ge)}for(var He=0;He<le.length;++He){var ge=le[He];Ue.push(Je(ge[0])),ge[1]>ge[0]&&(ge[1]+1>ge[0]&&Ue.push("-"),Ue.push(Je(ge[1])))}return Ue.push("]"),Ue.join("")}function at(tt){for(var Be=tt.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")),ut=Be.length,ot=[],Ue=0,He=0;Ue<ut;++Ue){var Te=Be[Ue];if(Te==="(")++He;else if(Te.charAt(0)==="\\"){var me=+Te.substring(1);me&&(me<=He?ot[me]=-1:Be[Ue]=Je(me))}}for(var Ue=1;Ue<ot.length;++Ue)ot[Ue]===-1&&(ot[Ue]=++Pe);for(var Ue=0,He=0;Ue<ut;++Ue){var Te=Be[Ue];if(Te==="(")++He,ot[He]||(Be[Ue]="(?:");else if(Te.charAt(0)==="\\"){var me=+Te.substring(1);me&&me<=He&&(Be[Ue]="\\"+ot[me])}}for(var Ue=0;Ue<ut;++Ue)Be[Ue]==="^"&&Be[Ue+1]!=="^"&&(Be[Ue]="");if(tt.ignoreCase&&je)for(var Ue=0;Ue<ut;++Ue){var Te=Be[Ue],be=Te.charAt(0);Te.length>=2&&be==="["?Be[Ue]=Qe(Te):be!=="\\"&&(Be[Ue]=Te.replace(/[a-zA-Z]/g,function(de){var ge=de.charCodeAt(0);return"["+String.fromCharCode(ge&~32,ge|32)+"]"}))}return Be.join("")}for(var qe=[],Ee=0,Le=Re.length;Ee<Le;++Ee){var Ie=Re[Ee];if(Ie.global||Ie.multiline)throw new Error(""+Ie);qe.push("(?:"+at(Ie)+")")}return new RegExp(qe.join("|"),ue?"gi":"g")}function g(Re,Pe){var je=/(?:^|\s)nocode(?:\s|$)/,ue=[],Ee=0,Le=[],Ie=0;function Ge(Xe){var Je=Xe.nodeType;if(Je==1){if(je.test(Xe.className))return;for(var Qe=Xe.firstChild;Qe;Qe=Qe.nextSibling)Ge(Qe);var at=Xe.nodeName.toLowerCase();(at==="br"||at==="li")&&(ue[Ie]=`
`,Le[Ie<<1]=Ee++,Le[Ie++<<1|1]=Xe)}else if(Je==3||Je==4){var qe=Xe.nodeValue;qe.length&&(Pe?qe=qe.replace(/\r\n?/g,`
`):qe=qe.replace(/[ \t\r\n]+/g," "),ue[Ie]=qe,Le[Ie<<1]=Ee,Ee+=qe.length,Le[Ie++<<1|1]=Xe)}}return Ge(Re),{sourceCode:ue.join("").replace(/\n$/,""),spans:Le}}function H(Re,Pe,je,ue,Ee){if(!je)return;var Le={sourceNode:Re,pre:1,langExtension:null,numberLines:null,sourceCode:je,spans:null,basePos:Pe,decorations:null};ue(Le),Ee.push.apply(Ee,Le.decorations)}var $=/\S/;function ie(Re){for(var Pe=void 0,je=Re.firstChild;je;je=je.nextSibling){var ue=je.nodeType;Pe=ue===1?Pe?Re:je:ue===3&&$.test(je.nodeValue)?Re:Pe}return Pe===Re?void 0:Pe}function oe(Re,Pe){var je={},ue;(function(){for(var Ie=Re.concat(Pe),Ge=[],Xe={},Je=0,Qe=Ie.length;Je<Qe;++Je){var at=Ie[Je],qe=at[3];if(qe)for(var tt=qe.length;--tt>=0;)je[qe.charAt(tt)]=at;var Be=at[1],ut=""+Be;Xe.hasOwnProperty(ut)||(Ge.push(Be),Xe[ut]=null)}Ge.push(/[\0-\uffff]/),ue=I(Ge)})();var Ee=Pe.length,Le=function(Ie){for(var Ge=Ie.sourceCode,Xe=Ie.basePos,Je=Ie.sourceNode,Qe=[Xe,c],at=0,qe=Ge.match(ue)||[],tt={},Be=0,ut=qe.length;Be<ut;++Be){var ot=qe[Be],Ue=tt[ot],He=void 0,Te;if(typeof Ue=="string")Te=!1;else{var me=je[ot.charAt(0)];if(me)He=ot.match(me[1]),Ue=me[0];else{for(var be=0;be<Ee;++be)if(me=Pe[be],He=ot.match(me[1]),He){Ue=me[0];break}He||(Ue=c)}Te=Ue.length>=5&&Ue.substring(0,5)==="lang-",Te&&!(He&&typeof He[1]=="string")&&(Te=!1,Ue=b),Te||(tt[ot]=Ue)}var ae=at;if(at+=ot.length,!Te)Qe.push(Xe+ae,Ue);else{var le=He[1],de=ot.indexOf(le),ge=de+le.length;He[2]&&(ge=ot.length-He[2].length,de=ge-le.length);var we=Ue.substring(5);H(Je,Xe+ae,ot.substring(0,de),Le,Qe),H(Je,Xe+ae+de,le,ce(we,le),Qe),H(Je,Xe+ae+ge,ot.substring(ge),Le,Qe)}}Ie.decorations=Qe};return Le}function Ce(Re){var Pe=[],je=[];Re.tripleQuotedStrings?Pe.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Re.multiLineStrings?Pe.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Pe.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Re.verbatimStrings&&je.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var ue=Re.hashComments;ue&&(Re.cStyleComments?(ue>1?Pe.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Pe.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),je.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Pe.push([O,/^#[^\r\n]*/,null,"#"])),Re.cStyleComments&&(je.push([O,/^\/\/[^\r\n]*/,null]),je.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ee=Re.regexLiterals;if(Ee){var Le=Ee>1?"":`
\r`,Ie=Le?".":"[\\S\\s]",Ge="/(?=[^/*"+Le+"])(?:[^/\\x5B\\x5C"+Le+"]|\\x5C"+Ie+"|\\x5B(?:[^\\x5C\\x5D"+Le+"]|\\x5C"+Ie+")*(?:\\x5D|$))+/";je.push(["lang-regex",RegExp("^"+N+"("+Ge+")")])}var Xe=Re.types;Xe&&je.push([A,Xe]);var Je=(""+Re.keywords).replace(/^ | $/g,"");Je.length&&je.push([D,new RegExp("^(?:"+Je.replace(/[\s,]+/g,"|")+")\\b"),null]),Pe.push([c,/^\s+/,null,` \r
\xA0`]);var Qe="^.[^\\s\\w.$@'\"`/\\\\]*";return Re.regexLiterals&&(Qe+="(?!s*/)"),je.push([S,/^@[a-z_$][a-z_$@0-9]*/i,null],[A,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[c,/^[a-z_$][a-z_$@0-9]*/i,null],[S,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[c,/^\\[\s\S]?/,null],[T,new RegExp(Qe),null]),oe(Pe,je)}var ve=Ce({keywords:R,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Se(Re,Pe,je){for(var ue=/(?:^|\s)nocode(?:\s|$)/,Ee=/\r\n?|\n/,Le=Re.ownerDocument,Ie=Le.createElement("li");Re.firstChild;)Ie.appendChild(Re.firstChild);var Ge=[Ie];function Xe(Be){var ut=Be.nodeType;if(ut==1&&!ue.test(Be.className))if(Be.nodeName==="br")Je(Be),Be.parentNode&&Be.parentNode.removeChild(Be);else for(var ot=Be.firstChild;ot;ot=ot.nextSibling)Xe(ot);else if((ut==3||ut==4)&&je){var Ue=Be.nodeValue,He=Ue.match(Ee);if(He){var Te=Ue.substring(0,He.index);Be.nodeValue=Te;var me=Ue.substring(He.index+He[0].length);if(me){var be=Be.parentNode;be.insertBefore(Le.createTextNode(me),Be.nextSibling)}Je(Be),Te||Be.parentNode.removeChild(Be)}}}function Je(Be){for(;!Be.nextSibling;)if(Be=Be.parentNode,!Be)return;function ut(He,Te){var me=Te?He.cloneNode(!1):He,be=He.parentNode;if(be){var ae=ut(be,1),le=He.nextSibling;ae.appendChild(me);for(var de=le;de;de=le)le=de.nextSibling,ae.appendChild(de)}return me}for(var ot=ut(Be.nextSibling,0),Ue;(Ue=ot.parentNode)&&Ue.nodeType===1;)ot=Ue;Ge.push(ot)}for(var Qe=0;Qe<Ge.length;++Qe)Xe(Ge[Qe]);Pe===(Pe|0)&&Ge[0].setAttribute("value",Pe);var at=Le.createElement("ol");at.className="linenums";for(var qe=Math.max(0,Pe-1|0)||0,Qe=0,tt=Ge.length;Qe<tt;++Qe)Ie=Ge[Qe],Ie.className="L"+(Qe+qe)%10,Ie.firstChild||Ie.appendChild(Le.createTextNode("\xA0")),at.appendChild(Ie);Re.appendChild(at)}function Ae(Re){var Pe=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Pe=Pe&&+Pe[1]<=8;var je=/\n/g,ue=Re.sourceCode,Ee=ue.length,Le=0,Ie=Re.spans,Ge=Ie.length,Xe=0,Je=Re.decorations,Qe=Je.length,at=0;Je[Qe]=Ee;var qe,tt;for(tt=qe=0;tt<Qe;)Je[tt]!==Je[tt+2]?(Je[qe++]=Je[tt++],Je[qe++]=Je[tt++]):tt+=2;for(Qe=qe,tt=qe=0;tt<Qe;){for(var Be=Je[tt],ut=Je[tt+1],ot=tt+2;ot+2<=Qe&&Je[ot+1]===ut;)ot+=2;Je[qe++]=Be,Je[qe++]=ut,tt=ot}Qe=Je.length=qe;var Ue=Re.sourceNode,He="";Ue&&(He=Ue.style.display,Ue.style.display="none");try{for(var Te=null;Xe<Ge;){var me=Ie[Xe],be=Ie[Xe+2]||Ee,ae=Je[at+2]||Ee,ot=Math.min(be,ae),le=Ie[Xe+1],de;if(le.nodeType!==1&&(de=ue.substring(Le,ot))){Pe&&(de=de.replace(je,"\r")),le.nodeValue=de;var ge=le.ownerDocument,we=ge.createElement("span");we.className=Je[at+1];var Fe=le.parentNode;Fe.replaceChild(we,le),we.appendChild(le),Le<be&&(Ie[Xe+1]=le=ge.createTextNode(ue.substring(ot,be)),Fe.insertBefore(le,we.nextSibling))}Le=ot,Le>=be&&(Xe+=2),Le>=ae&&(at+=2)}}finally{Ue&&(Ue.style.display=He)}}var Oe={};function he(Re,Pe){for(var je=Pe.length;--je>=0;){var ue=Pe[je];Oe.hasOwnProperty(ue)?G.console&&console.warn("cannot override language handler %s",ue):Oe[ue]=Re}}function ce(Re,Pe){return Re&&Oe.hasOwnProperty(Re)||(Re=/^\s*</.test(Pe)?"default-markup":"default-code"),Oe[Re]}he(ve,["default-code"]),he(oe([],[[c,/^[^<?]+/],[y,/^<!\w[^>]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[T,/^(?:<[%?]|[%?]>)/],["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"]),he(oe([[c,/^[\s]+/,null,` \r
`],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[w,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[U,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[T,/^[=<>\/]+/],["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"]),he(oe([],[[F,/^[\s\S]+/]]),["uq.val"]),he(Ce({keywords:m,hashComments:!0,cStyleComments:!0,types:_}),["c","cc","cpp","cxx","cyc","m"]),he(Ce({keywords:"null,true,false"}),["json"]),he(Ce({keywords:h,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:_}),["cs"]),he(Ce({keywords:p,cStyleComments:!0}),["java"]),he(Ce({keywords:s,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),he(Ce({keywords:u,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),he(Ce({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),he(Ce({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),he(Ce({keywords:f,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),he(Ce({keywords:l,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),he(oe([],[[C,/^[\s\S]+/]]),["regex"]);function re(Re){var Pe=Re.langExtension;try{var je=g(Re.sourceNode,Re.pre),ue=je.sourceCode;Re.sourceCode=ue,Re.spans=je.spans,Re.basePos=0,ce(Pe,ue)(Re),Ae(Re)}catch(Ee){G.console&&console.log(Ee&&Ee.stack||Ee)}}function fe(Re,Pe,je){var ue=je||!1,Ee=Pe||null,Le=document.createElement("div");Le.innerHTML="<pre>"+Re+"</pre>",Le=Le.firstChild,ue&&Se(Le,ue,!0);var Ie={langExtension:Ee,numberLines:ue,sourceNode:Le,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return re(Ie),Le.innerHTML}function se(Re,Pe){var je=Pe||document.body,ue=je.ownerDocument||document;function Ee(me){return je.getElementsByTagName(me)}for(var Le=[Ee("pre"),Ee("code"),Ee("xmp")],Ie=[],Ge=0;Ge<Le.length;++Ge)for(var Xe=0,Je=Le[Ge].length;Xe<Je;++Xe)Ie.push(Le[Ge][Xe]);Le=null;var Qe=Date;Qe.now||(Qe={now:function(){return+new Date}});var at=0,qe=/\blang(?:uage)?-([\w.]+)(?!\S)/,tt=/\bprettyprint\b/,Be=/\bprettyprinted\b/,ut=/pre|xmp/i,ot=/^code$/i,Ue=/^(?:pre|code|xmp)$/i,He={};function Te(){for(var me=G.PR_SHOULD_USE_CONTINUATION?Qe.now()+250:Infinity;at<Ie.length&&Qe.now()<me;at++){for(var be=Ie[at],ae=He,le=be;le=le.previousSibling;){var de=le.nodeType,ge=(de===7||de===8)&&le.nodeValue;if(ge?!/^\??prettify\b/.test(ge):de!==3||/\S/.test(le.nodeValue))break;if(ge){ae={},ge.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Qt,It,Cr){ae[It]=Cr});break}}var we=be.className;if((ae!==He||tt.test(we))&&!Be.test(we)){for(var Fe=!1,ze=be.parentNode;ze;ze=ze.parentNode){var st=ze.tagName;if(Ue.test(st)&&ze.className&&tt.test(ze.className)){Fe=!0;break}}if(!Fe){be.className+=" prettyprinted";var mt=ae.lang;if(!mt){mt=we.match(qe);var ft;!mt&&(ft=ie(be))&&ot.test(ft.tagName)&&(mt=ft.className.match(qe)),mt&&(mt=mt[1])}var wt;if(ut.test(be.tagName))wt=1;else{var St=be.currentStyle,ct=ue.defaultView,Ut=St?St.whiteSpace:ct&&ct.getComputedStyle?ct.getComputedStyle(be,null).getPropertyValue("white-space"):0;wt=Ut&&Ut.substring(0,3)==="pre"}var Lt=ae.linenums;(Lt=Lt==="true"||+Lt)||(Lt=we.match(/\blinenums\b(?::(\d+))?/),Lt=Lt?Lt[1]&&Lt[1].length?+Lt[1]:!0:!1),Lt&&Se(be,Lt,wt);var qt={langExtension:mt,sourceNode:be,numberLines:Lt,pre:wt,sourceCode:null,basePos:null,spans:null,decorations:null};re(qt)}}}at<Ie.length?G.setTimeout(Te,250):typeof Re=="function"&&Re()}Te()}var ke=G.PR={createSimpleLexer:oe,registerLangHandler:he,sourceDecorator:Ce,PR_ATTRIB_NAME:U,PR_ATTRIB_VALUE:F,PR_COMMENT:O,PR_DECLARATION:y,PR_KEYWORD:D,PR_LITERAL:S,PR_NOCODE:E,PR_PLAIN:c,PR_PUNCTUATION:T,PR_SOURCE:b,PR_STRING:C,PR_TAG:w,PR_TYPE:A,prettyPrintOne:P?G.prettyPrintOne=fe:B=fe,prettyPrint:K=P?G.prettyPrint=se:K=se},Ne=G.define;typeof Ne=="function"&&Ne.amd&&Ne("google-code-prettify",[],function(){return ke})})()},T8No:function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return K}),Z.d(xe,"e",function(){return G}),Z.d(xe,"c",function(){return T}),Z.d(xe,"b",function(){return c}),Z.d(xe,"d",function(){return w}),Z.d(xe,"f",function(){return U});var ne=Z("MNsG"),J=Z("N0LK"),P=Z("Cg/j");let X=ne.k||"";const j=new Map;j.set("false",!1),j.set("true",!0),j.set("isMac",ne.f),j.set("isLinux",ne.d),j.set("isWindows",ne.i),j.set("isWeb",ne.h),j.set("isMacNative",ne.f&&!ne.h),j.set("isEdge",X.indexOf("Edg/")>=0),j.set("isFirefox",X.indexOf("Firefox")>=0),j.set("isChrome",X.indexOf("Chrome")>=0),j.set("isSafari",X.indexOf("Safari")>=0);const B=Object.prototype.hasOwnProperty;class K{static has(E){return m.create(E)}static equals(E,N){return p.create(E,N)}static regex(E,N){return C.create(E,N)}static not(E){return o.create(E)}static and(...E){return A.create(E,null)}static or(...E){return S.create(E,null,!0)}static deserialize(E,N=!1){return E?this._deserializeOrExpression(E,N):void 0}static _deserializeOrExpression(E,N){let I=E.split("||");return S.create(I.map(g=>this._deserializeAndExpression(g,N)),null,!0)}static _deserializeAndExpression(E,N){let I=E.split("&&");return A.create(I.map(g=>this._deserializeOne(g,N)),null)}static _deserializeOne(E,N){if(E=E.trim(),E.indexOf("!=")>=0){let I=E.split("!=");return f.create(I[0].trim(),this._deserializeValue(I[1],N))}if(E.indexOf("==")>=0){let I=E.split("==");return p.create(I[0].trim(),this._deserializeValue(I[1],N))}if(E.indexOf("=~")>=0){let I=E.split("=~");return C.create(I[0].trim(),this._deserializeRegexValue(I[1],N))}if(E.indexOf(" in ")>=0){let I=E.split(" in ");return h.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(E)){const I=E.split(">=");return s.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(E)){const I=E.split(">");return a.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(E)){const I=E.split("<=");return _.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(E)){const I=E.split("<");return R.create(I[0].trim(),I[1].trim())}return/^\!\s*/.test(E)?o.create(E.substr(1).trim()):m.create(E)}static _deserializeValue(E,N){if(E=E.trim(),E==="true")return!0;if(E==="false")return!1;let I=/^'([^']*)'$/.exec(E);return I?I[1].trim():E}static _deserializeRegexValue(E,N){if(Object(J.C)(E)){if(N)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let I=E.indexOf("/"),g=E.lastIndexOf("/");if(I===g||I<0){if(N)throw new Error(`bad regexp-value '${E}', missing /-enclosure`);return console.warn(`bad regexp-value '${E}', missing /-enclosure`),null}let H=E.slice(I+1,g),$=E[g+1]==="i"?"i":"";try{return new RegExp(H,$)}catch(ie){if(N)throw new Error(`bad regexp-value '${E}', parse error: ${ie}`);return console.warn(`bad regexp-value '${E}', parse error: ${ie}`),null}}}function G(E,N){const I=E?E.substituteConstants():void 0,g=N?N.substituteConstants():void 0;return!I&&!g?!0:!I||!g?!1:I.equals(g)}function r(E,N){return E.cmp(N)}class L{constructor(){this.type=0}cmp(E){return this.type-E.type}equals(E){return E.type===this.type}substituteConstants(){return this}evaluate(E){return!1}serialize(){return"false"}keys(){return[]}negate(){return v.INSTANCE}}L.INSTANCE=new L;class v{constructor(){this.type=1}cmp(E){return this.type-E.type}equals(E){return E.type===this.type}substituteConstants(){return this}evaluate(E){return!0}serialize(){return"true"}keys(){return[]}negate(){return L.INSTANCE}}v.INSTANCE=new v;class m{constructor(E,N){this.key=E,this.negated=N,this.type=2}static create(E,N=null){const I=j.get(E);return typeof I=="boolean"?I?v.INSTANCE:L.INSTANCE:new m(E,N)}cmp(E){return E.type!==this.type?this.type-E.type:y(this.key,E.key)}equals(E){return E.type===this.type?this.key===E.key:!1}substituteConstants(){const E=j.get(this.key);return typeof E=="boolean"?E?v.INSTANCE:L.INSTANCE:this}evaluate(E){return!!E.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this)),this.negated}}class p{constructor(E,N,I){this.key=E,this.value=N,this.negated=I,this.type=4}static create(E,N,I=null){if(typeof N=="boolean")return N?m.create(E,I):o.create(E,I);const g=j.get(E);if(typeof g=="boolean"){const H=g?"true":"false";return N===H?v.INSTANCE:L.INSTANCE}return new p(E,N,I)}cmp(E){return E.type!==this.type?this.type-E.type:b(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){const E=j.get(this.key);if(typeof E=="boolean"){const N=E?"true":"false";return this.value===N?v.INSTANCE:L.INSTANCE}return this}evaluate(E){return E.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this.value,this)),this.negated}}class h{constructor(E,N){this.key=E,this.valueKey=N,this.type=10,this.negated=null}static create(E,N){return new h(E,N)}cmp(E){return E.type!==this.type?this.type-E.type:b(this.key,this.valueKey,E.key,E.valueKey)}equals(E){return E.type===this.type?this.key===E.key&&this.valueKey===E.valueKey:!1}substituteConstants(){return this}evaluate(E){const N=E.getValue(this.valueKey),I=E.getValue(this.key);return Array.isArray(N)?N.indexOf(I)>=0:typeof I=="string"&&typeof N=="object"&&N!==null?B.call(N,I):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=l.create(this)),this.negated}}class l{constructor(E){this._actual=E,this.type=11}static create(E){return new l(E)}cmp(E){return E.type!==this.type?this.type-E.type:this._actual.cmp(E._actual)}equals(E){return E.type===this.type?this._actual.equals(E._actual):!1}substituteConstants(){return this}evaluate(E){return!this._actual.evaluate(E)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class f{constructor(E,N,I){this.key=E,this.value=N,this.negated=I,this.type=5}static create(E,N,I=null){if(typeof N=="boolean")return N?o.create(E,I):m.create(E,I);const g=j.get(E);if(typeof g=="boolean"){const H=g?"true":"false";return N===H?L.INSTANCE:v.INSTANCE}return new f(E,N,I)}cmp(E){return E.type!==this.type?this.type-E.type:b(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){const E=j.get(this.key);if(typeof E=="boolean"){const N=E?"true":"false";return this.value===N?L.INSTANCE:v.INSTANCE}return this}evaluate(E){return E.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 o{constructor(E,N){this.key=E,this.negated=N,this.type=3}static create(E,N=null){const I=j.get(E);return typeof I=="boolean"?I?L.INSTANCE:v.INSTANCE:new o(E,N)}cmp(E){return E.type!==this.type?this.type-E.type:y(this.key,E.key)}equals(E){return E.type===this.type?this.key===E.key:!1}substituteConstants(){const E=j.get(this.key);return typeof E=="boolean"?E?L.INSTANCE:v.INSTANCE:this}evaluate(E){return!E.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this)),this.negated}}function u(E,N){if(typeof E=="string"){const I=parseFloat(E);isNaN(I)||(E=I)}return typeof E=="string"||typeof E=="number"?N(E):L.INSTANCE}class a{constructor(E,N,I){this.key=E,this.value=N,this.negated=I,this.type=12}static create(E,N,I=null){return u(N,g=>new a(E,g,I))}cmp(E){return E.type!==this.type?this.type-E.type:b(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){return this}evaluate(E){return typeof this.value=="string"?!1:parseFloat(E.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(E,N,I){this.key=E,this.value=N,this.negated=I,this.type=13}static create(E,N,I=null){return u(N,g=>new s(E,g,I))}cmp(E){return E.type!==this.type?this.type-E.type:b(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){return this}evaluate(E){return typeof this.value=="string"?!1:parseFloat(E.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=R.create(this.key,this.value,this)),this.negated}}class R{constructor(E,N,I){this.key=E,this.value=N,this.negated=I,this.type=14}static create(E,N,I=null){return u(N,g=>new R(E,g,I))}cmp(E){return E.type!==this.type?this.type-E.type:b(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){return this}evaluate(E){return typeof this.value=="string"?!1:parseFloat(E.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(E,N,I){this.key=E,this.value=N,this.negated=I,this.type=15}static create(E,N,I=null){return u(N,g=>new _(E,g,I))}cmp(E){return E.type!==this.type?this.type-E.type:b(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){return this}evaluate(E){return typeof this.value=="string"?!1:parseFloat(E.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 C{constructor(E,N){this.key=E,this.regexp=N,this.type=7,this.negated=null}static create(E,N){return new C(E,N)}cmp(E){if(E.type!==this.type)return this.type-E.type;if(this.key<E.key)return-1;if(this.key>E.key)return 1;const N=this.regexp?this.regexp.source:"",I=E.regexp?E.regexp.source:"";return N<I?-1:N>I?1:0}equals(E){if(E.type===this.type){const N=this.regexp?this.regexp.source:"",I=E.regexp?E.regexp.source:"";return this.key===E.key&&N===I}return!1}substituteConstants(){return this}evaluate(E){let N=E.getValue(this.key);return this.regexp?this.regexp.test(N):!1}serialize(){const E=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${E}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=D.create(this)),this.negated}}class D{constructor(E){this._actual=E,this.type=8}static create(E){return new D(E)}cmp(E){return E.type!==this.type?this.type-E.type:this._actual.cmp(E._actual)}equals(E){return E.type===this.type?this._actual.equals(E._actual):!1}substituteConstants(){return this}evaluate(E){return!this._actual.evaluate(E)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function O(E){let N=null;for(let I=0,g=E.length;I<g;I++){const H=E[I].substituteConstants();if(E[I]!==H&&N===null){N=[];for(let $=0;$<I;$++)N[$]=E[$]}N!==null&&(N[I]=H)}return N===null?E:N}class A{constructor(E,N){this.expr=E,this.negated=N,this.type=6}static create(E,N){return A._normalizeArr(E,N)}cmp(E){if(E.type!==this.type)return this.type-E.type;if(this.expr.length<E.expr.length)return-1;if(this.expr.length>E.expr.length)return 1;for(let N=0,I=this.expr.length;N<I;N++){const g=r(this.expr[N],E.expr[N]);if(g!==0)return g}return 0}equals(E){if(E.type===this.type){if(this.expr.length!==E.expr.length)return!1;for(let N=0,I=this.expr.length;N<I;N++)if(!this.expr[N].equals(E.expr[N]))return!1;return!0}return!1}substituteConstants(){const E=O(this.expr);return E===this.expr?this:A.create(E,this.negated)}evaluate(E){for(let N=0,I=this.expr.length;N<I;N++)if(!this.expr[N].evaluate(E))return!1;return!0}static _normalizeArr(E,N){const I=[];let g=!1;for(const H of E){if(!H)continue;if(H.type===1){g=!0;continue}if(H.type===0)return L.INSTANCE;if(H.type===6){I.push(...H.expr);continue}I.push(H)}if(I.length===0&&g)return v.INSTANCE;if(I.length===0)return;if(I.length===1)return I[0];I.sort(r);for(let H=1;H<I.length;H++)I[H-1].equals(I[H])&&(I.splice(H,1),H--);if(I.length===1)return I[0];for(;I.length>1;){const H=I[I.length-1];if(H.type!==9)break;I.pop();const $=I.pop(),ie=I.length===0,oe=S.create(H.expr.map(Ce=>A.create([Ce,$],null)),null,ie);oe&&(I.push(oe),I.sort(r))}return I.length===1?I[0]:new A(I,N)}serialize(){return this.expr.map(E=>E.serialize()).join(" && ")}keys(){const E=[];for(let N of this.expr)E.push(...N.keys());return E}negate(){if(!this.negated){const E=[];for(let N of this.expr)E.push(N.negate());this.negated=S.create(E,this,!0)}return this.negated}}class S{constructor(E,N){this.expr=E,this.negated=N,this.type=9}static create(E,N,I){return S._normalizeArr(E,N,I)}cmp(E){if(E.type!==this.type)return this.type-E.type;if(this.expr.length<E.expr.length)return-1;if(this.expr.length>E.expr.length)return 1;for(let N=0,I=this.expr.length;N<I;N++){const g=r(this.expr[N],E.expr[N]);if(g!==0)return g}return 0}equals(E){if(E.type===this.type){if(this.expr.length!==E.expr.length)return!1;for(let N=0,I=this.expr.length;N<I;N++)if(!this.expr[N].equals(E.expr[N]))return!1;return!0}return!1}substituteConstants(){const E=O(this.expr);return E===this.expr?this:S.create(E,this.negated,!1)}evaluate(E){for(let N=0,I=this.expr.length;N<I;N++)if(this.expr[N].evaluate(E))return!0;return!1}static _normalizeArr(E,N,I){let g=[],H=!1;if(E){for(let $=0,ie=E.length;$<ie;$++){const oe=E[$];if(!oe)continue;if(oe.type===0){H=!0;continue}if(oe.type===1)return v.INSTANCE;if(oe.type===9){g=g.concat(oe.expr);continue}g.push(oe)}if(g.length===0&&H)return L.INSTANCE;g.sort(r)}if(g.length===0)return;if(g.length===1)return g[0];for(let $=1;$<g.length;$++)g[$-1].equals(g[$])&&(g.splice($,1),$--);if(g.length===1)return g[0];if(I){for(let $=0;$<g.length;$++)for(let ie=$+1;ie<g.length;ie++)U(g[$],g[ie])&&(g.splice(ie,1),ie--);if(g.length===1)return g[0]}return new S(g,N)}serialize(){return this.expr.map(E=>E.serialize()).join(" || ")}keys(){const E=[];for(let N of this.expr)E.push(...N.keys());return E}negate(){if(!this.negated){let E=[];for(let N of this.expr)E.push(N.negate());for(;E.length>1;){const N=E.shift(),I=E.shift(),g=[];for(const $ of F(N))for(const ie of F(I))g.push(A.create([$,ie],null));const H=E.length===0;E.unshift(S.create(g,null,H))}this.negated=E[0]}return this.negated}}class T extends m{constructor(E,N,I){super(E,null);this._defaultValue=N,typeof I=="object"?T._info.push(Object.assign(Object.assign({},I),{key:E})):I!==!0&&T._info.push({key:E,description:I,type:N!=null?typeof N:void 0})}static all(){return T._info.values()}bindTo(E){return E.createKey(this.key,this._defaultValue)}getValue(E){return E.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(E){return p.create(this.key,E)}}T._info=[];const c=Object(P.c)("contextKeyService"),w="setContext";function y(E,N){return E<N?-1:E>N?1:0}function b(E,N,I,g){return E<I?-1:E>I?1:N<g?-1:N>g?1:0}function U(E,N){if(N.type===6&&E.type!==9&&E.type!==6){for(const H of N.expr)if(E.equals(H))return!0}const I=E.negate(),g=F(I).concat(F(N));g.sort(r);for(let H=0;H<g.length;H++){const $=g[H],ie=$.negate();for(let oe=H+1;oe<g.length;oe++){const Ce=g[oe];if(ie.equals(Ce))return!0}}return!1}function F(E){return E.type===9?E.expr:[E]}},TXwP:function(nt,xe,Z){var ne,J;(function(){var P;(function(){"use strict";var j=[,,function(r){function L(p){this.__parent=p,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=[]}L.prototype.clone_empty=function(){var p=new L(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},L.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},L.prototype.has_match=function(p){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(p))return!0;return!1},L.prototype.set_indent=function(p,h){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},L.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)},L.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},L.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},L.prototype.is_empty=function(){return this.__items.length===0},L.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},L.prototype.push=function(p){this.__items.push(p);var h=p.lastIndexOf(`
`);h!==-1?this.__character_count=p.length-h:this.__character_count+=p.length},L.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},L.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},L.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},L.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},L.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function v(p,h){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),h=h||"",p.indent_level>0&&(h=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}v.prototype.get_indent_size=function(p,h){var l=this.__base_string_length;return h=h||0,p<0&&(l=0),l+=p*this.__indent_size,l+=h,l},v.prototype.get_indent_string=function(p,h){var l=this.__base_string;return h=h||0,p<0&&(p=0,l=""),h+=p*this.__indent_size,this.__ensure_cache(h),l+=this.__cache[h],l},v.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var p=this.__cache.length,h=0,l="";this.__indent_size&&p>=this.__indent_size&&(h=Math.floor(p/this.__indent_size),p-=h*this.__indent_size,l=new Array(h+1).join(this.__indent_string)),p&&(l+=new Array(p+1).join(" ")),this.__cache.push(l)};function m(p,h){this.__indent_cache=new v(p,h),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new L(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(p,h){return this.__indent_cache.get_indent_string(p,h)},m.prototype.get_indent_size=function(p,h){return this.__indent_cache.get_indent_size(p,h)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(p){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 l=this.__lines.join(`
`);return p!==`
`&&(l=l.replace(/[\n]/g,p)),l},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,h){return p=p||0,h=h||0,this.next_line.set_indent(p,h),this.__lines.length>1?(this.current_line.set_indent(p,h),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var h=0;h<p.newlines;h++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.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(" "))},m.prototype.remove_indent=function(p){for(var h=this.__lines.length;p<h;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&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},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(p,h){for(var l=this.__lines.length-2;l>=0;){var f=this.__lines[l];if(f.is_empty())break;if(f.item(0).indexOf(p)!==0&&f.item(-1)!==h){this.__lines.splice(l+1,0,new L(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},r.exports.Output=m},,,,function(r){function L(p,h){this.raw_options=v(p,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"])}L.prototype._get_array=function(p,h){var l=this.raw_options[p],f=h||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(f=l.concat()):typeof l=="string"&&(f=l.split(/[^a-zA-Z0-9_\/\-]+/)),f},L.prototype._get_boolean=function(p,h){var l=this.raw_options[p],f=l===void 0?!!h:!!l;return f},L.prototype._get_characters=function(p,h){var l=this.raw_options[p],f=h||"";return typeof l=="string"&&(f=l.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),f},L.prototype._get_number=function(p,h){var l=this.raw_options[p];h=parseInt(h,10),isNaN(h)&&(h=0);var f=parseInt(l,10);return isNaN(f)&&(f=h),f},L.prototype._get_selection=function(p,h,l){var f=this._get_selection_list(p,h,l);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
`+h+`
You passed in: '`+this.raw_options[p]+"'");return f[0]},L.prototype._get_selection_list=function(p,h,l){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[h[0]],!this._is_valid_selection(l,h))throw new Error("Invalid Default Value!");var f=this._get_array(p,l);if(!this._is_valid_selection(f,h))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
`+h+`
You passed in: '`+this.raw_options[p]+"'");return f},L.prototype._is_valid_selection=function(p,h){return p.length&&h.length&&!p.some(function(l){return h.indexOf(l)===-1})};function v(p,h){var l={};p=m(p);var f;for(f in p)f!==h&&(l[f]=p[f]);if(h&&p[h])for(f in p[h])l[f]=p[h][f];return l}function m(p){var h={},l;for(l in p){var f=l.replace(/-/g,"_");h[f]=p[l]}return h}r.exports.Options=L,r.exports.normalizeOpts=m,r.exports.mergeOpts=v},,function(r){var L=RegExp.prototype.hasOwnProperty("sticky");function v(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position<this.__input_length},v.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},v.prototype.peek=function(m){var p=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(p=this.__input.charAt(m)),p},v.prototype.__match=function(m,p){m.lastIndex=p;var h=m.exec(this.__input);return h&&!(L&&m.sticky)&&(h.index!==p&&(h=null)),h},v.prototype.test=function(m,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(m,p):!1},v.prototype.testChar=function(m,p){var h=this.peek(p);return m.lastIndex=0,h!==null&&m.test(h)},v.prototype.match=function(m){var p=this.__match(m,this.__position);return p?this.__position+=p[0].length:p=null,p},v.prototype.read=function(m,p,h){var l="",f;return m&&(f=this.match(m),f&&(l+=f[0])),p&&(f||!m)&&(l+=this.readUntil(p,h)),l},v.prototype.readUntil=function(m,p){var h="",l=this.__position;m.lastIndex=this.__position;var f=m.exec(this.__input);return f?(l=f.index,p&&(l+=f[0].length)):l=this.__input_length,h=this.__input.substring(this.__position,l),this.__position=l,h},v.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},v.prototype.get_regexp=function(m,p){var h=null,l="g";return p&&L&&(l="y"),typeof m=="string"&&m!==""?h=new RegExp(m,l):m&&(h=new RegExp(m.source,l)),h},v.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(m){var p=this.__position,h=this.readUntilAfter(m);return this.__position=p,h},v.prototype.lookBack=function(m){var p=this.__position-1;return p>=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},r.exports.InputScanner=v},,,,,function(r){function L(v,m){v=typeof v=="string"?v:v.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+m,"g")}L.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(v);p;)m[p[1]]=p[2],p=this.__directive_pattern.exec(v);return m},L.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=L},,function(r,L,v){var m=v(16).Beautifier,p=v(17).Options;function h(l,f){var o=new m(l,f);return o.beautify()}r.exports=h,r.exports.defaultOptions=function(){return new p}},function(r,L,v){var m=v(17).Options,p=v(2).Output,h=v(8).InputScanner,l=v(13).Directives,f=new l(/\/\*/,/\*\//),o=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,a=/\s/,s=/(?:\s|\n)+/g,R=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,_=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function C(D,O){this._source_text=D||"",this._options=new m(O),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"]}C.prototype.eatString=function(D){var O="";for(this._ch=this._input.next();this._ch;){if(O+=this._ch,this._ch==="\\")O+=this._input.next();else if(D.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return O},C.prototype.eatWhitespace=function(D){for(var O=a.test(this._input.peek()),A=0;a.test(this._input.peek());)this._ch=this._input.next(),D&&this._ch===`
`&&((A===0||A<this._options.max_preserve_newlines)&&(A++,this._output.add_new_line(!0)));return O},C.prototype.foundNestedPseudoClass=function(){for(var D=0,O=1,A=this._input.peek(O);A;){if(A==="{")return!0;if(A==="(")D+=1;else if(A===")"){if(D===0)return!1;D-=1}else if(A===";"||A==="}")return!1;O++,A=this._input.peek(O)}return!1},C.prototype.print_string=function(D){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(D)},C.prototype.preserveSingleSpace=function(D){D&&(this._output.space_before_token=!0)},C.prototype.indent=function(){this._indentLevel++},C.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},C.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var D=this._source_text,O=this._options.eol;O==="auto"&&(O=`
`,D&&o.test(D||"")&&(O=D.match(o)[0])),D=D.replace(u,`
`);var A=D.match(/^[\t ]*/)[0];this._output=new p(this._options,A),this._input=new h(D),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var S=0,T=!1,c=!1,w=!1,y=!1,b=!1,U=!1,F=this._ch,E=!1,N,I,g;N=this._input.read(s),I=N!=="",g=F,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),F=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var H=this._input.read(R),$=f.get_directives(H);$&&$.ignore==="start"&&(H+=f.readIgnored(this._input)),this.print_string(H),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(I),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ie=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ie.match(/[ :]$/)&&(ie=this.eatString(": ").replace(/\s$/,""),this.print_string(ie),this._output.space_before_token=!0),ie=ie.replace(/\s$/,""),ie==="extend"?y=!0:ie==="import"&&(b=!0),ie in this.NESTED_AT_RULE?(this._nestedLevel+=1,ie in this.CONDITIONAL_GROUP_RULE&&(w=!0)):!T&&S===0&&ie.indexOf(":")!==-1&&(c=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(I),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")c&&(c=!1,this.outdent()),w?(w=!1,T=this._indentLevel>=this._nestedLevel):T=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&T&&(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)):(g==="("?this._output.space_before_token=!1:g!==","&&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(),g==="{"&&this._output.trim(!0),b=!1,y=!1,c&&(this.outdent(),c=!1),this.print_string(this._ch),T=!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 oe=0;oe<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;oe++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[oe])){E=!0;break}(T||w)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!y&&S===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 Ce=g==='"'||g==="'";this.preserveSingleSpace(Ce||I),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")E=!1,S===0?(c&&(this.outdent(),c=!1),y=!1,b=!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(),S++,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(")")),S&&(S--,this.outdent()));else{var ve=!1;this._input.lookBack("with")&&(ve=!0),this.preserveSingleSpace(I||ve),this.print_string(this._ch),c&&g==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),U=!0):(this.eatWhitespace(),S++,this.indent())}else if(this._ch===")")S&&(S--,this.outdent()),U&&this._input.peek()===";"&&this._options.selector_separator_newline&&(U=!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||U)&&S===0&&!b&&!y?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!c&&S===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(I),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 Se=g==='"'||g==="'";this.preserveSingleSpace(Se||I),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&E&&this._output.add_new_line()}var Ae=this._output.get_code(O);return Ae},r.exports.Beautifier=C},function(r,L,v){var m=v(6).Options;function p(h){m.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 l=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||l;var f=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var o=0;o<f.length;o++)f[o]!=="expand"?this.brace_style="collapse":this.brace_style=f[o]}p.prototype=new m,r.exports.Options=p}],B={};function K(r){var L=B[r];if(L!==void 0)return L.exports;var v=B[r]={exports:{}};return j[r](v,v.exports,K),v.exports}var G=K(15);P=G})();var X=P;!(ne=[],J=function(){return{css_beautify:X}}.apply(xe,ne),J!==void 0&&(nt.exports=J))})()},Vhoy:function(nt,xe,Z){"use strict";Z.d(xe,"d",function(){return X}),Z.d(xe,"e",function(){return j}),Z.d(xe,"c",function(){return B}),Z.d(xe,"b",function(){return K}),Z.d(xe,"a",function(){return G});var ne=Z("MI8n");class J{constructor(){this._icons=new Map,this._onDidRegister=new ne.b}add(r){const L=this._icons.get(r.id);L?r.description?L.description=r.description:console.error(`Duplicate registration of codicon ${r.id}`):(this._icons.set(r.id,r),this._onDidRegister.fire(r))}get(r){return this._icons.get(r)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const P=new J,X=P;function j(r,L){return new K(r,L)}function B(r){return r?r.replace(/\$\((.*?)\)/g,(L,v)=>` ${v} `).trim():""}class K{constructor(r,L,v){this.id=r,this.definition=L,this.description=v,P.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var G;(function(r){r.iconNameSegment="[A-Za-z0-9]+",r.iconNameExpression="[A-Za-z0-9\\-]+",r.iconModifierExpression="~[A-Za-z]+";const L=new RegExp(`^(${r.iconNameExpression})(${r.iconModifierExpression})?$`);function v(h){if(h instanceof K)return["codicon","codicon-"+h.id];const l=L.exec(h.id);if(!l)return v(K.error);let[,f,o]=l;const u=["codicon","codicon-"+f];return o&&u.push("codicon-modifier-"+o.substr(1)),u}r.asClassNameArray=v;function m(h){return v(h).join(" ")}r.asClassName=m;function p(h){return"."+v(h).join(".")}r.asCSSSelector=p})(G||(G={})),function(r){r.add=new r("add",{fontCharacter:"\\ea60"}),r.plus=new r("plus",r.add.definition),r.gistNew=new r("gist-new",r.add.definition),r.repoCreate=new r("repo-create",r.add.definition),r.lightbulb=new r("lightbulb",{fontCharacter:"\\ea61"}),r.lightBulb=new r("light-bulb",{fontCharacter:"\\ea61"}),r.repo=new r("repo",{fontCharacter:"\\ea62"}),r.repoDelete=new r("repo-delete",{fontCharacter:"\\ea62"}),r.gistFork=new r("gist-fork",{fontCharacter:"\\ea63"}),r.repoForked=new r("repo-forked",{fontCharacter:"\\ea63"}),r.gitPullRequest=new r("git-pull-request",{fontCharacter:"\\ea64"}),r.gitPullRequestAbandoned=new r("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),r.recordKeys=new r("record-keys",{fontCharacter:"\\ea65"}),r.keyboard=new r("keyboard",{fontCharacter:"\\ea65"}),r.tag=new r("tag",{fontCharacter:"\\ea66"}),r.tagAdd=new r("tag-add",{fontCharacter:"\\ea66"}),r.tagRemove=new r("tag-remove",{fontCharacter:"\\ea66"}),r.person=new r("person",{fontCharacter:"\\ea67"}),r.personFollow=new r("person-follow",{fontCharacter:"\\ea67"}),r.personOutline=new r("person-outline",{fontCharacter:"\\ea67"}),r.personFilled=new r("person-filled",{fontCharacter:"\\ea67"}),r.gitBranch=new r("git-branch",{fontCharacter:"\\ea68"}),r.gitBranchCreate=new r("git-branch-create",{fontCharacter:"\\ea68"}),r.gitBranchDelete=new r("git-branch-delete",{fontCharacter:"\\ea68"}),r.sourceControl=new r("source-control",{fontCharacter:"\\ea68"}),r.mirror=new r("mirror",{fontCharacter:"\\ea69"}),r.mirrorPublic=new r("mirror-public",{fontCharacter:"\\ea69"}),r.star=new r("star",{fontCharacter:"\\ea6a"}),r.starAdd=new r("star-add",{fontCharacter:"\\ea6a"}),r.starDelete=new r("star-delete",{fontCharacter:"\\ea6a"}),r.starEmpty=new r("star-empty",{fontCharacter:"\\ea6a"}),r.comment=new r("comment",{fontCharacter:"\\ea6b"}),r.commentAdd=new r("comment-add",{fontCharacter:"\\ea6b"}),r.alert=new r("alert",{fontCharacter:"\\ea6c"}),r.warning=new r("warning",{fontCharacter:"\\ea6c"}),r.search=new r("search",{fontCharacter:"\\ea6d"}),r.searchSave=new r("search-save",{fontCharacter:"\\ea6d"}),r.logOut=new r("log-out",{fontCharacter:"\\ea6e"}),r.signOut=new r("sign-out",{fontCharacter:"\\ea6e"}),r.logIn=new r("log-in",{fontCharacter:"\\ea6f"}),r.signIn=new r("sign-in",{fontCharacter:"\\ea6f"}),r.eye=new r("eye",{fontCharacter:"\\ea70"}),r.eyeUnwatch=new r("eye-unwatch",{fontCharacter:"\\ea70"}),r.eyeWatch=new r("eye-watch",{fontCharacter:"\\ea70"}),r.circleFilled=new r("circle-filled",{fontCharacter:"\\ea71"}),r.primitiveDot=new r("primitive-dot",{fontCharacter:"\\ea71"}),r.closeDirty=new r("close-dirty",{fontCharacter:"\\ea71"}),r.debugBreakpoint=new r("debug-breakpoint",{fontCharacter:"\\ea71"}),r.debugBreakpointDisabled=new r("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),r.debugHint=new r("debug-hint",{fontCharacter:"\\ea71"}),r.primitiveSquare=new r("primitive-square",{fontCharacter:"\\ea72"}),r.edit=new r("edit",{fontCharacter:"\\ea73"}),r.pencil=new r("pencil",{fontCharacter:"\\ea73"}),r.info=new r("info",{fontCharacter:"\\ea74"}),r.issueOpened=new r("issue-opened",{fontCharacter:"\\ea74"}),r.gistPrivate=new r("gist-private",{fontCharacter:"\\ea75"}),r.gitForkPrivate=new r("git-fork-private",{fontCharacter:"\\ea75"}),r.lock=new r("lock",{fontCharacter:"\\ea75"}),r.mirrorPrivate=new r("mirror-private",{fontCharacter:"\\ea75"}),r.close=new r("close",{fontCharacter:"\\ea76"}),r.removeClose=new r("remove-close",{fontCharacter:"\\ea76"}),r.x=new r("x",{fontCharacter:"\\ea76"}),r.repoSync=new r("repo-sync",{fontCharacter:"\\ea77"}),r.sync=new r("sync",{fontCharacter:"\\ea77"}),r.clone=new r("clone",{fontCharacter:"\\ea78"}),r.desktopDownload=new r("desktop-download",{fontCharacter:"\\ea78"}),r.beaker=new r("beaker",{fontCharacter:"\\ea79"}),r.microscope=new r("microscope",{fontCharacter:"\\ea79"}),r.vm=new r("vm",{fontCharacter:"\\ea7a"}),r.deviceDesktop=new r("device-desktop",{fontCharacter:"\\ea7a"}),r.file=new r("file",{fontCharacter:"\\ea7b"}),r.fileText=new r("file-text",{fontCharacter:"\\ea7b"}),r.more=new r("more",{fontCharacter:"\\ea7c"}),r.ellipsis=new r("ellipsis",{fontCharacter:"\\ea7c"}),r.kebabHorizontal=new r("kebab-horizontal",{fontCharacter:"\\ea7c"}),r.mailReply=new r("mail-reply",{fontCharacter:"\\ea7d"}),r.reply=new r("reply",{fontCharacter:"\\ea7d"}),r.organization=new r("organization",{fontCharacter:"\\ea7e"}),r.organizationFilled=new r("organization-filled",{fontCharacter:"\\ea7e"}),r.organizationOutline=new r("organization-outline",{fontCharacter:"\\ea7e"}),r.newFile=new r("new-file",{fontCharacter:"\\ea7f"}),r.fileAdd=new r("file-add",{fontCharacter:"\\ea7f"}),r.newFolder=new r("new-folder",{fontCharacter:"\\ea80"}),r.fileDirectoryCreate=new r("file-directory-create",{fontCharacter:"\\ea80"}),r.trash=new r("trash",{fontCharacter:"\\ea81"}),r.trashcan=new r("trashcan",{fontCharacter:"\\ea81"}),r.history=new r("history",{fontCharacter:"\\ea82"}),r.clock=new r("clock",{fontCharacter:"\\ea82"}),r.folder=new r("folder",{fontCharacter:"\\ea83"}),r.fileDirectory=new r("file-directory",{fontCharacter:"\\ea83"}),r.symbolFolder=new r("symbol-folder",{fontCharacter:"\\ea83"}),r.logoGithub=new r("logo-github",{fontCharacter:"\\ea84"}),r.markGithub=new r("mark-github",{fontCharacter:"\\ea84"}),r.github=new r("github",{fontCharacter:"\\ea84"}),r.terminal=new r("terminal",{fontCharacter:"\\ea85"}),r.console=new r("console",{fontCharacter:"\\ea85"}),r.repl=new r("repl",{fontCharacter:"\\ea85"}),r.zap=new r("zap",{fontCharacter:"\\ea86"}),r.symbolEvent=new r("symbol-event",{fontCharacter:"\\ea86"}),r.error=new r("error",{fontCharacter:"\\ea87"}),r.stop=new r("stop",{fontCharacter:"\\ea87"}),r.variable=new r("variable",{fontCharacter:"\\ea88"}),r.symbolVariable=new r("symbol-variable",{fontCharacter:"\\ea88"}),r.array=new r("array",{fontCharacter:"\\ea8a"}),r.symbolArray=new r("symbol-array",{fontCharacter:"\\ea8a"}),r.symbolModule=new r("symbol-module",{fontCharacter:"\\ea8b"}),r.symbolPackage=new r("symbol-package",{fontCharacter:"\\ea8b"}),r.symbolNamespace=new r("symbol-namespace",{fontCharacter:"\\ea8b"}),r.symbolObject=new r("symbol-object",{fontCharacter:"\\ea8b"}),r.symbolMethod=new r("symbol-method",{fontCharacter:"\\ea8c"}),r.symbolFunction=new r("symbol-function",{fontCharacter:"\\ea8c"}),r.symbolConstructor=new r("symbol-constructor",{fontCharacter:"\\ea8c"}),r.symbolBoolean=new r("symbol-boolean",{fontCharacter:"\\ea8f"}),r.symbolNull=new r("symbol-null",{fontCharacter:"\\ea8f"}),r.symbolNumeric=new r("symbol-numeric",{fontCharacter:"\\ea90"}),r.symbolNumber=new r("symbol-number",{fontCharacter:"\\ea90"}),r.symbolStructure=new r("symbol-structure",{fontCharacter:"\\ea91"}),r.symbolStruct=new r("symbol-struct",{fontCharacter:"\\ea91"}),r.symbolParameter=new r("symbol-parameter",{fontCharacter:"\\ea92"}),r.symbolTypeParameter=new r("symbol-type-parameter",{fontCharacter:"\\ea92"}),r.symbolKey=new r("symbol-key",{fontCharacter:"\\ea93"}),r.symbolText=new r("symbol-text",{fontCharacter:"\\ea93"}),r.symbolReference=new r("symbol-reference",{fontCharacter:"\\ea94"}),r.goToFile=new r("go-to-file",{fontCharacter:"\\ea94"}),r.symbolEnum=new r("symbol-enum",{fontCharacter:"\\ea95"}),r.symbolValue=new r("symbol-value",{fontCharacter:"\\ea95"}),r.symbolRuler=new r("symbol-ruler",{fontCharacter:"\\ea96"}),r.symbolUnit=new r("symbol-unit",{fontCharacter:"\\ea96"}),r.activateBreakpoints=new r("activate-breakpoints",{fontCharacter:"\\ea97"}),r.archive=new r("archive",{fontCharacter:"\\ea98"}),r.arrowBoth=new r("arrow-both",{fontCharacter:"\\ea99"}),r.arrowDown=new r("arrow-down",{fontCharacter:"\\ea9a"}),r.arrowLeft=new r("arrow-left",{fontCharacter:"\\ea9b"}),r.arrowRight=new r("arrow-right",{fontCharacter:"\\ea9c"}),r.arrowSmallDown=new r("arrow-small-down",{fontCharacter:"\\ea9d"}),r.arrowSmallLeft=new r("arrow-small-left",{fontCharacter:"\\ea9e"}),r.arrowSmallRight=new r("arrow-small-right",{fontCharacter:"\\ea9f"}),r.arrowSmallUp=new r("arrow-small-up",{fontCharacter:"\\eaa0"}),r.arrowUp=new r("arrow-up",{fontCharacter:"\\eaa1"}),r.bell=new r("bell",{fontCharacter:"\\eaa2"}),r.bold=new r("bold",{fontCharacter:"\\eaa3"}),r.book=new r("book",{fontCharacter:"\\eaa4"}),r.bookmark=new r("bookmark",{fontCharacter:"\\eaa5"}),r.debugBreakpointConditionalUnverified=new r("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),r.debugBreakpointConditional=new r("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),r.debugBreakpointConditionalDisabled=new r("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),r.debugBreakpointDataUnverified=new r("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),r.debugBreakpointData=new r("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),r.debugBreakpointDataDisabled=new r("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),r.debugBreakpointLogUnverified=new r("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),r.debugBreakpointLog=new r("debug-breakpoint-log",{fontCharacter:"\\eaab"}),r.debugBreakpointLogDisabled=new r("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),r.briefcase=new r("briefcase",{fontCharacter:"\\eaac"}),r.broadcast=new r("broadcast",{fontCharacter:"\\eaad"}),r.browser=new r("browser",{fontCharacter:"\\eaae"}),r.bug=new r("bug",{fontCharacter:"\\eaaf"}),r.calendar=new r("calendar",{fontCharacter:"\\eab0"}),r.caseSensitive=new r("case-sensitive",{fontCharacter:"\\eab1"}),r.check=new r("check",{fontCharacter:"\\eab2"}),r.checklist=new r("checklist",{fontCharacter:"\\eab3"}),r.chevronDown=new r("chevron-down",{fontCharacter:"\\eab4"}),r.dropDownButton=new r("drop-down-button",r.chevronDown.definition),r.chevronLeft=new r("chevron-left",{fontCharacter:"\\eab5"}),r.chevronRight=new r("chevron-right",{fontCharacter:"\\eab6"}),r.chevronUp=new r("chevron-up",{fontCharacter:"\\eab7"}),r.chromeClose=new r("chrome-close",{fontCharacter:"\\eab8"}),r.chromeMaximize=new r("chrome-maximize",{fontCharacter:"\\eab9"}),r.chromeMinimize=new r("chrome-minimize",{fontCharacter:"\\eaba"}),r.chromeRestore=new r("chrome-restore",{fontCharacter:"\\eabb"}),r.circleOutline=new r("circle-outline",{fontCharacter:"\\eabc"}),r.debugBreakpointUnverified=new r("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),r.circleSlash=new r("circle-slash",{fontCharacter:"\\eabd"}),r.circuitBoard=new r("circuit-board",{fontCharacter:"\\eabe"}),r.clearAll=new r("clear-all",{fontCharacter:"\\eabf"}),r.clippy=new r("clippy",{fontCharacter:"\\eac0"}),r.closeAll=new r("close-all",{fontCharacter:"\\eac1"}),r.cloudDownload=new r("cloud-download",{fontCharacter:"\\eac2"}),r.cloudUpload=new r("cloud-upload",{fontCharacter:"\\eac3"}),r.code=new r("code",{fontCharacter:"\\eac4"}),r.collapseAll=new r("collapse-all",{fontCharacter:"\\eac5"}),r.colorMode=new r("color-mode",{fontCharacter:"\\eac6"}),r.commentDiscussion=new r("comment-discussion",{fontCharacter:"\\eac7"}),r.compareChanges=new r("compare-changes",{fontCharacter:"\\eafd"}),r.creditCard=new r("credit-card",{fontCharacter:"\\eac9"}),r.dash=new r("dash",{fontCharacter:"\\eacc"}),r.dashboard=new r("dashboard",{fontCharacter:"\\eacd"}),r.database=new r("database",{fontCharacter:"\\eace"}),r.debugContinue=new r("debug-continue",{fontCharacter:"\\eacf"}),r.debugDisconnect=new r("debug-disconnect",{fontCharacter:"\\ead0"}),r.debugPause=new r("debug-pause",{fontCharacter:"\\ead1"}),r.debugRestart=new r("debug-restart",{fontCharacter:"\\ead2"}),r.debugStart=new r("debug-start",{fontCharacter:"\\ead3"}),r.debugStepInto=new r("debug-step-into",{fontCharacter:"\\ead4"}),r.debugStepOut=new r("debug-step-out",{fontCharacter:"\\ead5"}),r.debugStepOver=new r("debug-step-over",{fontCharacter:"\\ead6"}),r.debugStop=new r("debug-stop",{fontCharacter:"\\ead7"}),r.debug=new r("debug",{fontCharacter:"\\ead8"}),r.deviceCameraVideo=new r("device-camera-video",{fontCharacter:"\\ead9"}),r.deviceCamera=new r("device-camera",{fontCharacter:"\\eada"}),r.deviceMobile=new r("device-mobile",{fontCharacter:"\\eadb"}),r.diffAdded=new r("diff-added",{fontCharacter:"\\eadc"}),r.diffIgnored=new r("diff-ignored",{fontCharacter:"\\eadd"}),r.diffModified=new r("diff-modified",{fontCharacter:"\\eade"}),r.diffRemoved=new r("diff-removed",{fontCharacter:"\\eadf"}),r.diffRenamed=new r("diff-renamed",{fontCharacter:"\\eae0"}),r.diff=new r("diff",{fontCharacter:"\\eae1"}),r.discard=new r("discard",{fontCharacter:"\\eae2"}),r.editorLayout=new r("editor-layout",{fontCharacter:"\\eae3"}),r.emptyWindow=new r("empty-window",{fontCharacter:"\\eae4"}),r.exclude=new r("exclude",{fontCharacter:"\\eae5"}),r.extensions=new r("extensions",{fontCharacter:"\\eae6"}),r.eyeClosed=new r("eye-closed",{fontCharacter:"\\eae7"}),r.fileBinary=new r("file-binary",{fontCharacter:"\\eae8"}),r.fileCode=new r("file-code",{fontCharacter:"\\eae9"}),r.fileMedia=new r("file-media",{fontCharacter:"\\eaea"}),r.filePdf=new r("file-pdf",{fontCharacter:"\\eaeb"}),r.fileSubmodule=new r("file-submodule",{fontCharacter:"\\eaec"}),r.fileSymlinkDirectory=new r("file-symlink-directory",{fontCharacter:"\\eaed"}),r.fileSymlinkFile=new r("file-symlink-file",{fontCharacter:"\\eaee"}),r.fileZip=new r("file-zip",{fontCharacter:"\\eaef"}),r.files=new r("files",{fontCharacter:"\\eaf0"}),r.filter=new r("filter",{fontCharacter:"\\eaf1"}),r.flame=new r("flame",{fontCharacter:"\\eaf2"}),r.foldDown=new r("fold-down",{fontCharacter:"\\eaf3"}),r.foldUp=new r("fold-up",{fontCharacter:"\\eaf4"}),r.fold=new r("fold",{fontCharacter:"\\eaf5"}),r.folderActive=new r("folder-active",{fontCharacter:"\\eaf6"}),r.folderOpened=new r("folder-opened",{fontCharacter:"\\eaf7"}),r.gear=new r("gear",{fontCharacter:"\\eaf8"}),r.gift=new r("gift",{fontCharacter:"\\eaf9"}),r.gistSecret=new r("gist-secret",{fontCharacter:"\\eafa"}),r.gist=new r("gist",{fontCharacter:"\\eafb"}),r.gitCommit=new r("git-commit",{fontCharacter:"\\eafc"}),r.gitCompare=new r("git-compare",{fontCharacter:"\\eafd"}),r.gitMerge=new r("git-merge",{fontCharacter:"\\eafe"}),r.githubAction=new r("github-action",{fontCharacter:"\\eaff"}),r.githubAlt=new r("github-alt",{fontCharacter:"\\eb00"}),r.globe=new r("globe",{fontCharacter:"\\eb01"}),r.grabber=new r("grabber",{fontCharacter:"\\eb02"}),r.graph=new r("graph",{fontCharacter:"\\eb03"}),r.gripper=new r("gripper",{fontCharacter:"\\eb04"}),r.heart=new r("heart",{fontCharacter:"\\eb05"}),r.home=new r("home",{fontCharacter:"\\eb06"}),r.horizontalRule=new r("horizontal-rule",{fontCharacter:"\\eb07"}),r.hubot=new r("hubot",{fontCharacter:"\\eb08"}),r.inbox=new r("inbox",{fontCharacter:"\\eb09"}),r.issueClosed=new r("issue-closed",{fontCharacter:"\\eba4"}),r.issueReopened=new r("issue-reopened",{fontCharacter:"\\eb0b"}),r.issues=new r("issues",{fontCharacter:"\\eb0c"}),r.italic=new r("italic",{fontCharacter:"\\eb0d"}),r.jersey=new r("jersey",{fontCharacter:"\\eb0e"}),r.json=new r("json",{fontCharacter:"\\eb0f"}),r.kebabVertical=new r("kebab-vertical",{fontCharacter:"\\eb10"}),r.key=new r("key",{fontCharacter:"\\eb11"}),r.law=new r("law",{fontCharacter:"\\eb12"}),r.lightbulbAutofix=new r("lightbulb-autofix",{fontCharacter:"\\eb13"}),r.linkExternal=new r("link-external",{fontCharacter:"\\eb14"}),r.link=new r("link",{fontCharacter:"\\eb15"}),r.listOrdered=new r("list-ordered",{fontCharacter:"\\eb16"}),r.listUnordered=new r("list-unordered",{fontCharacter:"\\eb17"}),r.liveShare=new r("live-share",{fontCharacter:"\\eb18"}),r.loading=new r("loading",{fontCharacter:"\\eb19"}),r.location=new r("location",{fontCharacter:"\\eb1a"}),r.mailRead=new r("mail-read",{fontCharacter:"\\eb1b"}),r.mail=new r("mail",{fontCharacter:"\\eb1c"}),r.markdown=new r("markdown",{fontCharacter:"\\eb1d"}),r.megaphone=new r("megaphone",{fontCharacter:"\\eb1e"}),r.mention=new r("mention",{fontCharacter:"\\eb1f"}),r.milestone=new r("milestone",{fontCharacter:"\\eb20"}),r.mortarBoard=new r("mortar-board",{fontCharacter:"\\eb21"}),r.move=new r("move",{fontCharacter:"\\eb22"}),r.multipleWindows=new r("multiple-windows",{fontCharacter:"\\eb23"}),r.mute=new r("mute",{fontCharacter:"\\eb24"}),r.noNewline=new r("no-newline",{fontCharacter:"\\eb25"}),r.note=new r("note",{fontCharacter:"\\eb26"}),r.octoface=new r("octoface",{fontCharacter:"\\eb27"}),r.openPreview=new r("open-preview",{fontCharacter:"\\eb28"}),r.package_=new r("package",{fontCharacter:"\\eb29"}),r.paintcan=new r("paintcan",{fontCharacter:"\\eb2a"}),r.pin=new r("pin",{fontCharacter:"\\eb2b"}),r.play=new r("play",{fontCharacter:"\\eb2c"}),r.run=new r("run",{fontCharacter:"\\eb2c"}),r.plug=new r("plug",{fontCharacter:"\\eb2d"}),r.preserveCase=new r("preserve-case",{fontCharacter:"\\eb2e"}),r.preview=new r("preview",{fontCharacter:"\\eb2f"}),r.project=new r("project",{fontCharacter:"\\eb30"}),r.pulse=new r("pulse",{fontCharacter:"\\eb31"}),r.question=new r("question",{fontCharacter:"\\eb32"}),r.quote=new r("quote",{fontCharacter:"\\eb33"}),r.radioTower=new r("radio-tower",{fontCharacter:"\\eb34"}),r.reactions=new r("reactions",{fontCharacter:"\\eb35"}),r.references=new r("references",{fontCharacter:"\\eb36"}),r.refresh=new r("refresh",{fontCharacter:"\\eb37"}),r.regex=new r("regex",{fontCharacter:"\\eb38"}),r.remoteExplorer=new r("remote-explorer",{fontCharacter:"\\eb39"}),r.remote=new r("remote",{fontCharacter:"\\eb3a"}),r.remove=new r("remove",{fontCharacter:"\\eb3b"}),r.replaceAll=new r("replace-all",{fontCharacter:"\\eb3c"}),r.replace=new r("replace",{fontCharacter:"\\eb3d"}),r.repoClone=new r("repo-clone",{fontCharacter:"\\eb3e"}),r.repoForcePush=new r("repo-force-push",{fontCharacter:"\\eb3f"}),r.repoPull=new r("repo-pull",{fontCharacter:"\\eb40"}),r.repoPush=new r("repo-push",{fontCharacter:"\\eb41"}),r.report=new r("report",{fontCharacter:"\\eb42"}),r.requestChanges=new r("request-changes",{fontCharacter:"\\eb43"}),r.rocket=new r("rocket",{fontCharacter:"\\eb44"}),r.rootFolderOpened=new r("root-folder-opened",{fontCharacter:"\\eb45"}),r.rootFolder=new r("root-folder",{fontCharacter:"\\eb46"}),r.rss=new r("rss",{fontCharacter:"\\eb47"}),r.ruby=new r("ruby",{fontCharacter:"\\eb48"}),r.saveAll=new r("save-all",{fontCharacter:"\\eb49"}),r.saveAs=new r("save-as",{fontCharacter:"\\eb4a"}),r.save=new r("save",{fontCharacter:"\\eb4b"}),r.screenFull=new r("screen-full",{fontCharacter:"\\eb4c"}),r.screenNormal=new r("screen-normal",{fontCharacter:"\\eb4d"}),r.searchStop=new r("search-stop",{fontCharacter:"\\eb4e"}),r.server=new r("server",{fontCharacter:"\\eb50"}),r.settingsGear=new r("settings-gear",{fontCharacter:"\\eb51"}),r.settings=new r("settings",{fontCharacter:"\\eb52"}),r.shield=new r("shield",{fontCharacter:"\\eb53"}),r.smiley=new r("smiley",{fontCharacter:"\\eb54"}),r.sortPrecedence=new r("sort-precedence",{fontCharacter:"\\eb55"}),r.splitHorizontal=new r("split-horizontal",{fontCharacter:"\\eb56"}),r.splitVertical=new r("split-vertical",{fontCharacter:"\\eb57"}),r.squirrel=new r("squirrel",{fontCharacter:"\\eb58"}),r.starFull=new r("star-full",{fontCharacter:"\\eb59"}),r.starHalf=new r("star-half",{fontCharacter:"\\eb5a"}),r.symbolClass=new r("symbol-class",{fontCharacter:"\\eb5b"}),r.symbolColor=new r("symbol-color",{fontCharacter:"\\eb5c"}),r.symbolConstant=new r("symbol-constant",{fontCharacter:"\\eb5d"}),r.symbolEnumMember=new r("symbol-enum-member",{fontCharacter:"\\eb5e"}),r.symbolField=new r("symbol-field",{fontCharacter:"\\eb5f"}),r.symbolFile=new r("symbol-file",{fontCharacter:"\\eb60"}),r.symbolInterface=new r("symbol-interface",{fontCharacter:"\\eb61"}),r.symbolKeyword=new r("symbol-keyword",{fontCharacter:"\\eb62"}),r.symbolMisc=new r("symbol-misc",{fontCharacter:"\\eb63"}),r.symbolOperator=new r("symbol-operator",{fontCharacter:"\\eb64"}),r.symbolProperty=new r("symbol-property",{fontCharacter:"\\eb65"}),r.wrench=new r("wrench",{fontCharacter:"\\eb65"}),r.wrenchSubaction=new r("wrench-subaction",{fontCharacter:"\\eb65"}),r.symbolSnippet=new r("symbol-snippet",{fontCharacter:"\\eb66"}),r.tasklist=new r("tasklist",{fontCharacter:"\\eb67"}),r.telescope=new r("telescope",{fontCharacter:"\\eb68"}),r.textSize=new r("text-size",{fontCharacter:"\\eb69"}),r.threeBars=new r("three-bars",{fontCharacter:"\\eb6a"}),r.thumbsdown=new r("thumbsdown",{fontCharacter:"\\eb6b"}),r.thumbsup=new r("thumbsup",{fontCharacter:"\\eb6c"}),r.tools=new r("tools",{fontCharacter:"\\eb6d"}),r.triangleDown=new r("triangle-down",{fontCharacter:"\\eb6e"}),r.triangleLeft=new r("triangle-left",{fontCharacter:"\\eb6f"}),r.triangleRight=new r("triangle-right",{fontCharacter:"\\eb70"}),r.triangleUp=new r("triangle-up",{fontCharacter:"\\eb71"}),r.twitter=new r("twitter",{fontCharacter:"\\eb72"}),r.unfold=new r("unfold",{fontCharacter:"\\eb73"}),r.unlock=new r("unlock",{fontCharacter:"\\eb74"}),r.unmute=new r("unmute",{fontCharacter:"\\eb75"}),r.unverified=new r("unverified",{fontCharacter:"\\eb76"}),r.verified=new r("verified",{fontCharacter:"\\eb77"}),r.versions=new r("versions",{fontCharacter:"\\eb78"}),r.vmActive=new r("vm-active",{fontCharacter:"\\eb79"}),r.vmOutline=new r("vm-outline",{fontCharacter:"\\eb7a"}),r.vmRunning=new r("vm-running",{fontCharacter:"\\eb7b"}),r.watch=new r("watch",{fontCharacter:"\\eb7c"}),r.whitespace=new r("whitespace",{fontCharacter:"\\eb7d"}),r.wholeWord=new r("whole-word",{fontCharacter:"\\eb7e"}),r.window=new r("window",{fontCharacter:"\\eb7f"}),r.wordWrap=new r("word-wrap",{fontCharacter:"\\eb80"}),r.zoomIn=new r("zoom-in",{fontCharacter:"\\eb81"}),r.zoomOut=new r("zoom-out",{fontCharacter:"\\eb82"}),r.listFilter=new r("list-filter",{fontCharacter:"\\eb83"}),r.listFlat=new r("list-flat",{fontCharacter:"\\eb84"}),r.listSelection=new r("list-selection",{fontCharacter:"\\eb85"}),r.selection=new r("selection",{fontCharacter:"\\eb85"}),r.listTree=new r("list-tree",{fontCharacter:"\\eb86"}),r.debugBreakpointFunctionUnverified=new r("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),r.debugBreakpointFunction=new r("debug-breakpoint-function",{fontCharacter:"\\eb88"}),r.debugBreakpointFunctionDisabled=new r("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),r.debugStackframeActive=new r("debug-stackframe-active",{fontCharacter:"\\eb89"}),r.debugStackframeDot=new r("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),r.debugStackframe=new r("debug-stackframe",{fontCharacter:"\\eb8b"}),r.debugStackframeFocused=new r("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),r.debugBreakpointUnsupported=new r("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),r.symbolString=new r("symbol-string",{fontCharacter:"\\eb8d"}),r.debugReverseContinue=new r("debug-reverse-continue",{fontCharacter:"\\eb8e"}),r.debugStepBack=new r("debug-step-back",{fontCharacter:"\\eb8f"}),r.debugRestartFrame=new r("debug-restart-frame",{fontCharacter:"\\eb90"}),r.callIncoming=new r("call-incoming",{fontCharacter:"\\eb92"}),r.callOutgoing=new r("call-outgoing",{fontCharacter:"\\eb93"}),r.menu=new r("menu",{fontCharacter:"\\eb94"}),r.expandAll=new r("expand-all",{fontCharacter:"\\eb95"}),r.feedback=new r("feedback",{fontCharacter:"\\eb96"}),r.groupByRefType=new r("group-by-ref-type",{fontCharacter:"\\eb97"}),r.ungroupByRefType=new r("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),r.account=new r("account",{fontCharacter:"\\eb99"}),r.bellDot=new r("bell-dot",{fontCharacter:"\\eb9a"}),r.debugConsole=new r("debug-console",{fontCharacter:"\\eb9b"}),r.library=new r("library",{fontCharacter:"\\eb9c"}),r.output=new r("output",{fontCharacter:"\\eb9d"}),r.runAll=new r("run-all",{fontCharacter:"\\eb9e"}),r.syncIgnored=new r("sync-ignored",{fontCharacter:"\\eb9f"}),r.pinned=new r("pinned",{fontCharacter:"\\eba0"}),r.githubInverted=new r("github-inverted",{fontCharacter:"\\eba1"}),r.debugAlt=new r("debug-alt",{fontCharacter:"\\eb91"}),r.serverProcess=new r("server-process",{fontCharacter:"\\eba2"}),r.serverEnvironment=new r("server-environment",{fontCharacter:"\\eba3"}),r.pass=new r("pass",{fontCharacter:"\\eba4"}),r.stopCircle=new r("stop-circle",{fontCharacter:"\\eba5"}),r.playCircle=new r("play-circle",{fontCharacter:"\\eba6"}),r.record=new r("record",{fontCharacter:"\\eba7"}),r.debugAltSmall=new r("debug-alt-small",{fontCharacter:"\\eba8"}),r.vmConnect=new r("vm-connect",{fontCharacter:"\\eba9"}),r.cloud=new r("cloud",{fontCharacter:"\\ebaa"}),r.merge=new r("merge",{fontCharacter:"\\ebab"}),r.exportIcon=new r("export",{fontCharacter:"\\ebac"}),r.graphLeft=new r("graph-left",{fontCharacter:"\\ebad"}),r.magnet=new r("magnet",{fontCharacter:"\\ebae"}),r.notebook=new r("notebook",{fontCharacter:"\\ebaf"}),r.redo=new r("redo",{fontCharacter:"\\ebb0"}),r.checkAll=new r("check-all",{fontCharacter:"\\ebb1"}),r.pinnedDirty=new r("pinned-dirty",{fontCharacter:"\\ebb2"}),r.passFilled=new r("pass-filled",{fontCharacter:"\\ebb3"}),r.circleLargeFilled=new r("circle-large-filled",{fontCharacter:"\\ebb4"}),r.circleLargeOutline=new r("circle-large-outline",{fontCharacter:"\\ebb5"}),r.combine=new r("combine",{fontCharacter:"\\ebb6"}),r.gather=new r("gather",{fontCharacter:"\\ebb6"}),r.table=new r("table",{fontCharacter:"\\ebb7"}),r.variableGroup=new r("variable-group",{fontCharacter:"\\ebb8"}),r.typeHierarchy=new r("type-hierarchy",{fontCharacter:"\\ebb9"}),r.typeHierarchySub=new r("type-hierarchy-sub",{fontCharacter:"\\ebba"}),r.typeHierarchySuper=new r("type-hierarchy-super",{fontCharacter:"\\ebbb"}),r.gitPullRequestCreate=new r("git-pull-request-create",{fontCharacter:"\\ebbc"}),r.runAbove=new r("run-above",{fontCharacter:"\\ebbd"}),r.runBelow=new r("run-below",{fontCharacter:"\\ebbe"}),r.notebookTemplate=new r("notebook-template",{fontCharacter:"\\ebbf"}),r.debugRerun=new r("debug-rerun",{fontCharacter:"\\ebc0"}),r.workspaceTrusted=new r("workspace-trusted",{fontCharacter:"\\ebc1"}),r.workspaceUntrusted=new r("workspace-untrusted",{fontCharacter:"\\ebc2"}),r.workspaceUnspecified=new r("workspace-unspecified",{fontCharacter:"\\ebc3"}),r.terminalCmd=new r("terminal-cmd",{fontCharacter:"\\ebc4"}),r.terminalDebian=new r("terminal-debian",{fontCharacter:"\\ebc5"}),r.terminalLinux=new r("terminal-linux",{fontCharacter:"\\ebc6"}),r.terminalPowershell=new r("terminal-powershell",{fontCharacter:"\\ebc7"}),r.terminalTmux=new r("terminal-tmux",{fontCharacter:"\\ebc8"}),r.terminalUbuntu=new r("terminal-ubuntu",{fontCharacter:"\\ebc9"}),r.terminalBash=new r("terminal-bash",{fontCharacter:"\\ebca"}),r.arrowSwap=new r("arrow-swap",{fontCharacter:"\\ebcb"}),r.copy=new r("copy",{fontCharacter:"\\ebcc"}),r.personAdd=new r("person-add",{fontCharacter:"\\ebcd"}),r.filterFilled=new r("filter-filled",{fontCharacter:"\\ebce"}),r.wand=new r("wand",{fontCharacter:"\\ebcf"}),r.debugLineByLine=new r("debug-line-by-line",{fontCharacter:"\\ebd0"}),r.inspect=new r("inspect",{fontCharacter:"\\ebd1"}),r.layers=new r("layers",{fontCharacter:"\\ebd2"}),r.layersDot=new r("layers-dot",{fontCharacter:"\\ebd3"}),r.layersActive=new r("layers-active",{fontCharacter:"\\ebd4"}),r.compass=new r("compass",{fontCharacter:"\\ebd5"}),r.compassDot=new r("compass-dot",{fontCharacter:"\\ebd6"}),r.compassActive=new r("compass-active",{fontCharacter:"\\ebd7"}),r.azure=new r("azure",{fontCharacter:"\\ebd8"}),r.issueDraft=new r("issue-draft",{fontCharacter:"\\ebd9"}),r.gitPullRequestClosed=new r("git-pull-request-closed",{fontCharacter:"\\ebda"}),r.gitPullRequestDraft=new r("git-pull-request-draft",{fontCharacter:"\\ebdb"}),r.debugAll=new r("debug-all",{fontCharacter:"\\ebdc"}),r.debugCoverage=new r("debug-coverage",{fontCharacter:"\\ebdd"}),r.runErrors=new r("run-errors",{fontCharacter:"\\ebde"}),r.folderLibrary=new r("folder-library",{fontCharacter:"\\ebdf"}),r.debugContinueSmall=new r("debug-continue-small",{fontCharacter:"\\ebe0"}),r.beakerStop=new r("beaker-stop",{fontCharacter:"\\ebe1"}),r.graphLine=new r("graph-line",{fontCharacter:"\\ebe2"}),r.graphScatter=new r("graph-scatter",{fontCharacter:"\\ebe3"}),r.pieChart=new r("pie-chart",{fontCharacter:"\\ebe4"}),r.bracket=new r("bracket",r.json.definition),r.bracketDot=new r("bracket-dot",{fontCharacter:"\\ebe5"}),r.bracketError=new r("bracket-error",{fontCharacter:"\\ebe6"}),r.lockSmall=new r("lock-small",{fontCharacter:"\\ebe7"}),r.azureDevops=new r("azure-devops",{fontCharacter:"\\ebe8"}),r.verifiedFilled=new r("verified-filled",{fontCharacter:"\\ebe9"})}(K||(K={}))},"VrN/":function(nt,xe,Z){(function(ne,J){nt.exports=J()})(this,function(){"use strict";var ne=navigator.userAgent,J=navigator.platform,P=/gecko\/\d/i.test(ne),X=/MSIE \d/.test(ne),j=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ne),B=/Edge\/(\d+)/.exec(ne),K=X||j||B,G=K&&(X?document.documentMode||6:+(B||j)[1]),r=!B&&/WebKit\//.test(ne),L=r&&/Qt\/\d+\.\d+/.test(ne),v=!B&&/Chrome\//.test(ne),m=/Opera\//.test(ne),p=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ne),l=/PhantomJS/.test(ne),f=!B&&/AppleWebKit/.test(ne)&&/Mobile\/\w+/.test(ne),o=/Android/.test(ne),u=f||o||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ne),a=f||/Mac/.test(J),s=/\bCrOS\b/.test(ne),R=/win/i.test(J),_=m&&ne.match(/Version\/(\d*\.\d*)/);_&&(_=Number(_[1])),_&&_>=15&&(m=!1,r=!0);var C=a&&(L||m&&(_==null||_<12.11)),D=P||K&&G>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var A=function(e,t){var n=e.className,i=O(t).exec(n);if(i){var d=n.slice(i.index+i[0].length);e.className=n.slice(0,i.index)+(d?i[1]+d:"")}};function S(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function T(e,t){return S(e).appendChild(t)}function c(e,t,n,i){var d=document.createElement(e);if(n&&(d.className=n),i&&(d.style.cssText=i),typeof t=="string")d.appendChild(document.createTextNode(t));else if(t)for(var M=0;M<t.length;++M)d.appendChild(t[M]);return d}function w(e,t,n,i){var d=c(e,t,n,i);return d.setAttribute("role","presentation"),d}var y;document.createRange?y=function(e,t,n,i){var d=document.createRange();return d.setEnd(i||e,n),d.setStart(e,t),d}:y=function(e,t,n){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(d){return i}return i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",t),i};function b(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 U(){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 F(e,t){var n=e.className;O(t).test(n)||(e.className+=(n?" ":"")+t)}function E(e,t){for(var n=e.split(" "),i=0;i<n.length;i++)n[i]&&!O(n[i]).test(t)&&(t+=" "+n[i]);return t}var N=function(e){e.select()};f?N=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:K&&(N=function(e){try{e.select()}catch(t){}});function I(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function g(e,t,n){t||(t={});for(var i in e)e.hasOwnProperty(i)&&(n!==!1||!t.hasOwnProperty(i))&&(t[i]=e[i]);return t}function H(e,t,n,i,d){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var M=i||0,z=d||0;;){var Q=e.indexOf(" ",M);if(Q<0||Q>=t)return z+(t-M);z+=Q-M,z+=n-z%n,M=Q+1}}var $=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};$.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},$.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function ie(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var oe=50,Ce={toString:function(){return"CodeMirror.Pass"}},ve={scroll:!1},Se={origin:"*mouse"},Ae={origin:"+move"};function Oe(e,t,n){for(var i=0,d=0;;){var M=e.indexOf(" ",i);M==-1&&(M=e.length);var z=M-i;if(M==e.length||d+z>=t)return i+Math.min(z,t-d);if(d+=M-i,d+=n-d%n,i=M+1,d>=t)return i}}var he=[""];function ce(e){for(;he.length<=e;)he.push(re(he)+" ");return he[e]}function re(e){return e[e.length-1]}function fe(e,t){for(var n=[],i=0;i<e.length;i++)n[i]=t(e[i],i);return n}function se(e,t,n){for(var i=0,d=n(t);i<e.length&&n(e[i])<=d;)i++;e.splice(i,0,t)}function ke(){}function Ne(e,t){var n;return Object.create?n=Object.create(e):(ke.prototype=e,n=new ke),t&&g(t,n),n}var Re=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Pe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Re.test(e))}function je(e,t){return t?t.source.indexOf("\\w")>-1&&Pe(e)?!0:t.test(e):Pe(e)}function ue(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ee=/[\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 Le(e){return e.charCodeAt(0)>=768&&Ee.test(e)}function Ie(e,t,n){for(;(n<0?t>0:t<e.length)&&Le(e.charAt(t));)t+=n;return t}function Ge(e,t,n){for(var i=t>n?-1:1;;){if(t==n)return t;var d=(t+n)/2,M=i<0?Math.ceil(d):Math.floor(d);if(M==t)return e(M)?t:n;e(M)?n=M:t=M+i}}function Xe(e,t,n,i){if(!e)return i(t,n,"ltr",0);for(var d=!1,M=0;M<e.length;++M){var z=e[M];(z.from<n&&z.to>t||t==n&&z.to==t)&&(i(Math.max(z.from,t),Math.min(z.to,n),z.level==1?"rtl":"ltr",M),d=!0)}d||i(t,n,"ltr")}var Je=null;function Qe(e,t,n){var i;Je=null;for(var d=0;d<e.length;++d){var M=e[d];if(M.from<t&&M.to>t)return d;M.to==t&&(M.from!=M.to&&n=="before"?i=d:Je=d),M.from==t&&(M.from!=M.to&&n!="before"?i=d:Je=d)}return i!=null?i:Je}var at=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(te){return te<=247?e.charAt(te):1424<=te&&te<=1524?"R":1536<=te&&te<=1785?t.charAt(te-1536):1774<=te&&te<=2220?"r":8192<=te&&te<=8203?"w":te==8204?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,d=/[stwN]/,M=/[LRr]/,z=/[Lb1n]/,Q=/[1n]/;function q(te,pe,ye){this.level=te,this.from=pe,this.to=ye}return function(te,pe){var ye=pe=="ltr"?"L":"R";if(te.length==0||pe=="ltr"&&!i.test(te))return!1;for(var Me=te.length,De=[],We=0;We<Me;++We)De.push(n(te.charCodeAt(We)));for(var Ye=0,Ze=ye;Ye<Me;++Ye){var rt=De[Ye];rt=="m"?De[Ye]=Ze:Ze=rt}for(var lt=0,it=ye;lt<Me;++lt){var ht=De[lt];ht=="1"&&it=="r"?De[lt]="n":M.test(ht)&&(it=ht,ht=="r"&&(De[lt]="R"))}for(var Tt=1,vt=De[0];Tt<Me-1;++Tt){var Ot=De[Tt];Ot=="+"&&vt=="1"&&De[Tt+1]=="1"?De[Tt]="1":Ot==","&&vt==De[Tt+1]&&(vt=="1"||vt=="n")&&(De[Tt]=vt),vt=Ot}for(var Xt=0;Xt<Me;++Xt){var gr=De[Xt];if(gr==",")De[Xt]="N";else if(gr=="%"){var er=void 0;for(er=Xt+1;er<Me&&De[er]=="%";++er);for(var Gr=Xt&&De[Xt-1]=="!"||er<Me&&De[er]=="1"?"1":"N",Nr=Xt;Nr<er;++Nr)De[Nr]=Gr;Xt=er-1}}for(var sr=0,Fr=ye;sr<Me;++sr){var _r=De[sr];Fr=="L"&&_r=="1"?De[sr]="L":M.test(_r)&&(Fr=_r)}for(var hr=0;hr<Me;++hr)if(d.test(De[hr])){var or=void 0;for(or=hr+1;or<Me&&d.test(De[or]);++or);for(var rr=(hr?De[hr-1]:ye)=="L",Br=(or<Me?De[or]:ye)=="L",un=rr==Br?rr?"L":"R":ye,Li=hr;Li<or;++Li)De[Li]=un;hr=or-1}for(var Sr=[],oi,vr=0;vr<Me;)if(z.test(De[vr])){var Va=vr;for(++vr;vr<Me&&z.test(De[vr]);++vr);Sr.push(new q(0,Va,vr))}else{var fi=vr,Wi=Sr.length,Gi=pe=="rtl"?1:0;for(++vr;vr<Me&&De[vr]!="L";++vr);for(var Or=fi;Or<vr;)if(Q.test(De[Or])){fi<Or&&(Sr.splice(Wi,0,new q(1,fi,Or)),Wi+=Gi);var hn=Or;for(++Or;Or<vr&&Q.test(De[Or]);++Or);Sr.splice(Wi,0,new q(2,hn,Or)),Wi+=Gi,fi=Or}else++Or;fi<vr&&Sr.splice(Wi,0,new q(1,fi,vr))}return pe=="ltr"&&(Sr[0].level==1&&(oi=te.match(/^\s+/))&&(Sr[0].from=oi[0].length,Sr.unshift(new q(0,0,oi[0].length))),re(Sr).level==1&&(oi=te.match(/\s+$/))&&(re(Sr).to-=oi[0].length,Sr.push(new q(0,Me-oi[0].length,Me)))),pe=="rtl"?Sr.reverse():Sr}}();function qe(e,t){var n=e.order;return n==null&&(n=e.order=at(e.text,t)),n}var tt=[],Be=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var i=e._handlers||(e._handlers={});i[t]=(i[t]||tt).concat(n)}};function ut(e,t){return e._handlers&&e._handlers[t]||tt}function ot(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var i=e._handlers,d=i&&i[t];if(d){var M=ie(d,n);M>-1&&(i[t]=d.slice(0,M).concat(d.slice(M+1)))}}}function Ue(e,t){var n=ut(e,t);if(!n.length)return;for(var i=Array.prototype.slice.call(arguments,2),d=0;d<n.length;++d)n[d].apply(null,i)}function He(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ue(e,n||t.type,e,t),de(t)||t.codemirrorIgnore}function Te(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)ie(n,t[i])==-1&&n.push(t[i])}function me(e,t){return ut(e,t).length>0}function be(e){e.prototype.on=function(t,n){Be(this,t,n)},e.prototype.off=function(t,n){ot(this,t,n)}}function ae(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function le(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function de(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ge(e){ae(e),le(e)}function we(e){return e.target||e.srcElement}function Fe(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 ze=function(){if(K&&G<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),st;function mt(e){if(st==null){var t=c("span","\u200B");T(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(st=t.offsetWidth<=1&&t.offsetHeight>2&&!(K&&G<8))}var n=st?c("span","\u200B"):c("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var ft;function wt(e){if(ft!=null)return ft;var t=T(e,document.createTextNode("A\u062EA")),n=y(t,0,1).getBoundingClientRect(),i=y(t,1,2).getBoundingClientRect();return S(e),!n||n.left==n.right?!1:ft=i.right-n.right<3}var St=`
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],i=e.length;t<=i;){var d=e.indexOf(`
`,t);d==-1&&(d=e.length);var M=e.slice(t,e.charAt(d-1)=="\r"?d-1:d),z=M.indexOf("\r");z!=-1?(n.push(M.slice(0,z)),t+=z+1):(n.push(M),t=d+1)}return n}:function(e){return e.split(/\r\n?|\n/)},ct=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(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ut=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Lt=null;function qt(e){if(Lt!=null)return Lt;var t=T(e,c("span","x")),n=t.getBoundingClientRect(),i=y(t,0,1).getBoundingClientRect();return Lt=Math.abs(n.left-i.left)>1}var Qt={},It={};function Cr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Qt[e]=t}function Kr(e,t){It[e]=t}function yt(e){if(typeof e=="string"&&It.hasOwnProperty(e))e=It[e];else if(e&&typeof e.name=="string"&&It.hasOwnProperty(e.name)){var t=It[e.name];typeof t=="string"&&(t={name:t}),e=Ne(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return yt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return yt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Lr(e,t){t=yt(t);var n=Qt[t.name];if(!n)return Lr(e,"text/plain");var i=n(e,t);if(bt.hasOwnProperty(t.name)){var d=bt[t.name];for(var M in d){if(!d.hasOwnProperty(M))continue;i.hasOwnProperty(M)&&(i["_"+M]=i[M]),i[M]=d[M]}}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var z in t.modeProps)i[z]=t.modeProps[z];return i}var bt={};function xt(e,t){var n=bt.hasOwnProperty(e)?bt[e]:bt[e]={};g(t,n)}function Ft(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var i in t){var d=t[i];d instanceof Array&&(d=d.concat([])),n[i]=d}return n}function tr(e,t){for(var n;e.innerMode&&!(n=e.innerMode(t),!n||n.mode==e);)t=n.state,e=n.mode;return n||{mode:e,state:t}}function cr(e,t,n){return e.startState?e.startState(t,n):!0}var Pt=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Pt.prototype.eol=function(){return this.pos>=this.string.length},Pt.prototype.sol=function(){return this.pos==this.lineStart},Pt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Pt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Pt.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},Pt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Pt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Pt.prototype.skipToEnd=function(){this.pos=this.string.length},Pt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Pt.prototype.backUp=function(e){this.pos-=e},Pt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=H(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},Pt.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},Pt.prototype.match=function(e,t,n){if(typeof e=="string"){var i=function(z){return n?z.toLowerCase():z},d=this.string.substr(this.pos,e.length);if(i(d)==i(e))return t!==!1&&(this.pos+=e.length),!0}else{var M=this.string.slice(this.pos).match(e);return M&&M.index>0?null:(M&&t!==!1&&(this.pos+=M[0].length),M)}},Pt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Pt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Pt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Pt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function dt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var i=0;;++i){var d=n.children[i],M=d.chunkSize();if(t<M){n=d;break}t-=M}return n.lines[t]}function Ur(e,t,n){var i=[],d=t.line;return e.iter(t.line,n.line+1,function(M){var z=M.text;d==n.line&&(z=z.slice(0,n.ch)),d==t.line&&(z=z.slice(t.ch)),i.push(z),++d}),i}function Vt(e,t,n){var i=[];return e.iter(t,n,function(d){i.push(d.text)}),i}function Jt(e,t){var n=t-e.height;if(n)for(var i=e;i;i=i.parent)i.height+=n}function Rt(e){if(e.parent==null)return null;for(var t=e.parent,n=ie(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var d=0;!(i.children[d]==t);++d)n+=i.children[d].chunkSize();return n+t.first}function lr(e,t){var n=e.first;e:do{for(var i=0;i<e.children.length;++i){var d=e.children[i],M=d.height;if(t<M){e=d;continue e}t-=M,n+=d.chunkSize()}return n}while(!e.lines);for(var z=0;z<e.lines.length;++z){var Q=e.lines[z],q=Q.height;if(t<q)break;t-=q}return n+z}function Ir(e,t){return t>=e.first&&t<e.first+e.size}function Xr(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function $e(e,t,n){if(n===void 0&&(n=null),!(this instanceof $e))return new $e(e,t,n);this.line=e,this.ch=t,this.sticky=n}function Ct(e,t){return e.line-t.line||e.ch-t.ch}function pi(e,t){return e.sticky==t.sticky&&Ct(e,t)==0}function mi(e){return $e(e.line,e.ch)}function gi(e,t){return Ct(e,t)<0?t:e}function vi(e,t){return Ct(e,t)<0?e:t}function Y(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function x(e,t){if(t.line<e.first)return $e(e.first,0);var n=e.first+e.size-1;return t.line>n?$e(n,dt(e,n).text.length):k(t,dt(e,t.line).text.length)}function k(e,t){var n=e.ch;return n==null||n>t?$e(e.line,t):n<0?$e(e.line,0):e}function W(e,t){for(var n=[],i=0;i<t.length;i++)n[i]=x(e,t[i]);return n}var ee=function(e,t){this.state=e,this.lookAhead=t},V=function(e,t,n,i){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};V.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},V.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}},V.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},V.fromSaved=function(e,t,n){return t instanceof ee?new V(e,Ft(e.mode,t.state),n,t.lookAhead):new V(e,Ft(e.mode,t),n)},V.prototype.save=function(e){var t=e!==!1?Ft(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ee(t,this.maxLookAhead):t};function _e(e,t,n,i){var d=[e.state.modeGen],M={};Er(e,t.text,e.doc.mode,n,function(te,pe){return d.push(te,pe)},M,i);for(var z=n.state,Q=function(te){n.baseTokens=d;var pe=e.state.overlays[te],ye=1,Me=0;n.state=!0,Er(e,t.text,pe.mode,n,function(De,We){for(var Ye=ye;Me<De;){var Ze=d[ye];Ze>De&&d.splice(ye,1,De,d[ye+1],Ze),ye+=2,Me=Math.min(De,Ze)}if(!We)return;if(pe.opaque)d.splice(Ye,ye-Ye,De,"overlay "+We),ye=Ye+2;else for(;Ye<ye;Ye+=2){var rt=d[Ye+1];d[Ye+1]=(rt?rt+" ":"")+"overlay "+We}},M),n.state=z,n.baseTokens=null,n.baseTokenPos=1},q=0;q<e.state.overlays.length;++q)Q(q);return{styles:d,classes:M.bgClass||M.textClass?M:null}}function Ke(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var i=et(e,Rt(t)),d=t.text.length>e.options.maxHighlightLength&&Ft(e.doc.mode,i.state),M=_e(e,t,i);d&&(i.state=d),t.stateAfter=i.save(!d),t.styles=M.styles,M.classes?t.styleClasses=M.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function et(e,t,n){var i=e.doc,d=e.display;if(!i.mode.startState)return new V(i,!0,t);var M=xr(e,t,n),z=M>i.first&&dt(i,M-1).stateAfter,Q=z?V.fromSaved(i,z,M):new V(i,cr(i.mode),M);return i.iter(M,t,function(q){pt(e,q.text,Q);var te=Q.line;q.stateAfter=te==t-1||te%5==0||te>=d.viewFrom&&te<d.viewTo?Q.save():null,Q.nextLine()}),n&&(i.modeFrontier=Q.line),Q}function pt(e,t,n,i){var d=e.doc.mode,M=new Pt(t,e.options.tabSize,n);for(M.start=M.pos=i||0,t==""&&Ve(d,n.state);!M.eol();)_t(d,M,n.state),M.start=M.pos}function Ve(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var n=tr(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}function _t(e,t,n,i){for(var d=0;d<10;d++){i&&(i[0]=tr(e,n).mode);var M=e.token(t,n);if(t.pos>t.start)return M}throw new Error("Mode "+e.name+" failed to advance stream.")}var jt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function $t(e,t,n,i){var d=e.doc,M=d.mode,z;t=x(d,t);var Q=dt(d,t.line),q=et(e,t.line,n),te=new Pt(Q.text,e.options.tabSize,q),pe;for(i&&(pe=[]);(i||te.pos<t.ch)&&!te.eol();)te.start=te.pos,z=_t(M,te,q.state),i&&pe.push(new jt(te,z,Ft(d.mode,q.state)));return i?pe:new jt(te,z,q.state)}function jr(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var i=n[1]?"bgClass":"textClass";t[i]==null?t[i]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[i])||(t[i]+=" "+n[2])}return e}function Er(e,t,n,i,d,M,z){var Q=n.flattenSpans;Q==null&&(Q=e.options.flattenSpans);var q=0,te=null,pe=new Pt(t,e.options.tabSize,i),ye,Me=e.options.addModeClass&&[null];for(t==""&&jr(Ve(n,i.state),M);!pe.eol();){if(pe.pos>e.options.maxHighlightLength?(Q=!1,z&&pt(e,t,i,pe.pos),pe.pos=t.length,ye=null):ye=jr(_t(n,pe,i.state,Me),M),Me){var De=Me[0].name;De&&(ye="m-"+(ye?De+" "+ye:De))}if(!Q||te!=ye){for(;q<pe.start;)q=Math.min(pe.start,q+5e3),d(q,te);te=ye}pe.start=pe.pos}for(;q<pe.pos;){var We=Math.min(pe.pos,q+5e3);d(We,te),q=We}}function xr(e,t,n){for(var i,d,M=e.doc,z=n?-1:t-(e.doc.mode.innerMode?1e3:100),Q=t;Q>z;--Q){if(Q<=M.first)return M.first;var q=dt(M,Q-1),te=q.stateAfter;if(te&&(!n||Q+(te instanceof ee?te.lookAhead:0)<=M.modeFrontier))return Q;var pe=H(q.text,null,e.options.tabSize);(d==null||i>pe)&&(d=Q-1,i=pe)}return d}function Qr(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var n=e.first,i=t-1;i>n;i--){var d=dt(e,i).stateAfter;if(d&&(!(d instanceof ee)||i+d.lookAhead<t)){n=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}var Ii=!1,dr=!1;function zr(){Ii=!0}function li(){dr=!0}function ui(e,t,n){this.marker=e,this.from=t,this.to=n}function Hr(e,t){if(e)for(var n=0;n<e.length;++n){var i=e[n];if(i.marker==t)return i}}function Di(e,t){for(var n,i=0;i<e.length;++i)e[i]!=t&&(n||(n=[])).push(e[i]);return n}function yi(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Ki(e,t,n){var i;if(e)for(var d=0;d<e.length;++d){var M=e[d],z=M.marker,Q=M.from==null||(z.inclusiveLeft?M.from<=t:M.from<t);if(Q||M.from==t&&z.type=="bookmark"&&(!n||!M.marker.insertLeft)){var q=M.to==null||(z.inclusiveRight?M.to>=t:M.to>t);(i||(i=[])).push(new ui(z,M.from,q?null:M.to))}}return i}function zi(e,t,n){var i;if(e)for(var d=0;d<e.length;++d){var M=e[d],z=M.marker,Q=M.to==null||(z.inclusiveRight?M.to>=t:M.to>t);if(Q||M.from==t&&z.type=="bookmark"&&(!n||M.marker.insertLeft)){var q=M.from==null||(z.inclusiveLeft?M.from<=t:M.from<t);(i||(i=[])).push(new ui(z,q?null:M.from-t,M.to==null?null:M.to-t))}}return i}function Zr(e,t){if(t.full)return null;var n=Ir(e,t.from.line)&&dt(e,t.from.line).markedSpans,i=Ir(e,t.to.line)&&dt(e,t.to.line).markedSpans;if(!n&&!i)return null;var d=t.from.ch,M=t.to.ch,z=Ct(t.from,t.to)==0,Q=Ki(n,d,z),q=zi(i,M,z),te=t.text.length==1,pe=re(t.text).length+(te?d:0);if(Q)for(var ye=0;ye<Q.length;++ye){var Me=Q[ye];if(Me.to==null){var De=Hr(q,Me.marker);De?te&&(Me.to=De.to==null?null:De.to+pe):Me.to=d}}if(q)for(var We=0;We<q.length;++We){var Ye=q[We];if(Ye.to!=null&&(Ye.to+=pe),Ye.from==null){var Ze=Hr(Q,Ye.marker);Ze||(Ye.from=pe,te&&(Q||(Q=[])).push(Ye))}else Ye.from+=pe,te&&(Q||(Q=[])).push(Ye)}Q&&(Q=$r(Q)),q&&q!=Q&&(q=$r(q));var rt=[Q];if(!te){var lt=t.text.length-2,it;if(lt>0&&Q)for(var ht=0;ht<Q.length;++ht)Q[ht].to==null&&(it||(it=[])).push(new ui(Q[ht].marker,null,null));for(var Tt=0;Tt<lt;++Tt)rt.push(it);rt.push(q)}return rt}function $r(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function bi(e,t,n){var i=null;if(e.iter(t.line,n.line+1,function(De){if(De.markedSpans)for(var We=0;We<De.markedSpans.length;++We){var Ye=De.markedSpans[We].marker;Ye.readOnly&&(!i||ie(i,Ye)==-1)&&(i||(i=[])).push(Ye)}}),!i)return null;for(var d=[{from:t,to:n}],M=0;M<i.length;++M)for(var z=i[M],Q=z.find(0),q=0;q<d.length;++q){var te=d[q];if(Ct(te.to,Q.from)<0||Ct(te.from,Q.to)>0)continue;var pe=[q,1],ye=Ct(te.from,Q.from),Me=Ct(te.to,Q.to);(ye<0||!z.inclusiveLeft&&!ye)&&pe.push({from:te.from,to:Q.from}),(Me>0||!z.inclusiveRight&&!Me)&&pe.push({from:Q.to,to:te.to}),d.splice.apply(d,pe),q+=pe.length-3}return d}function cn(e){var t=e.markedSpans;if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}function _i(e,t){if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}function ir(e){return e.inclusiveLeft?-1:0}function Ht(e){return e.inclusiveRight?1:0}function yr(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var i=e.find(),d=t.find(),M=Ct(i.from,d.from)||ir(e)-ir(t);if(M)return-M;var z=Ct(i.to,d.to)||Ht(e)-Ht(t);return z||t.id-e.id}function kt(e,t){var n=dr&&e.markedSpans,i;if(n)for(var d=void 0,M=0;M<n.length;++M)d=n[M],d.marker.collapsed&&(t?d.from:d.to)==null&&(!i||yr(i,d.marker)<0)&&(i=d.marker);return i}function ar(e){return kt(e,!0)}function Kt(e){return kt(e,!1)}function ii(e,t){var n=dr&&e.markedSpans,i;if(n)for(var d=0;d<n.length;++d){var M=n[d];M.marker.collapsed&&(M.from==null||M.from<t)&&(M.to==null||M.to>t)&&(!i||yr(i,M.marker)<0)&&(i=M.marker)}return i}function fr(e,t,n,i,d){var M=dt(e,t),z=dr&&M.markedSpans;if(z)for(var Q=0;Q<z.length;++Q){var q=z[Q];if(!q.marker.collapsed)continue;var te=q.marker.find(0),pe=Ct(te.from,n)||ir(q.marker)-ir(d),ye=Ct(te.to,i)||Ht(q.marker)-Ht(d);if(pe>=0&&ye<=0||pe<=0&&ye>=0)continue;if(pe<=0&&(q.marker.inclusiveRight&&d.inclusiveLeft?Ct(te.to,n)>=0:Ct(te.to,n)>0)||pe>=0&&(q.marker.inclusiveRight&&d.inclusiveLeft?Ct(te.from,i)<=0:Ct(te.from,i)<0))return!0}}function Ar(e){for(var t;t=ar(e);)e=t.find(-1,!0).line;return e}function Vi(e){for(var t;t=Kt(e);)e=t.find(1,!0).line;return e}function Ei(e){for(var t,n;t=Kt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function dn(e,t){var n=dt(e,t),i=Ar(n);return n==i?t:Rt(i)}function xi(e,t){if(t>e.lastLine())return t;var n=dt(e,t),i;if(!ni(e,n))return t;for(;i=Kt(n);)n=i.find(1,!0).line;return Rt(n)+1}function ni(e,t){var n=dr&&t.markedSpans;if(n)for(var i=void 0,d=0;d<n.length;++d){if(i=n[d],!i.marker.collapsed)continue;if(i.from==null)return!0;if(i.marker.widgetNode)continue;if(i.from==0&&i.marker.inclusiveLeft&&fn(e,t,i))return!0}}function fn(e,t,n){if(n.to==null){var i=n.marker.find(1,!0);return fn(e,i.line,Hr(i.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var d=void 0,M=0;M<t.markedSpans.length;++M)if(d=t.markedSpans[M],d.marker.collapsed&&!d.marker.widgetNode&&d.from==n.to&&(d.to==null||d.to!=n.from)&&(d.marker.inclusiveLeft||n.marker.inclusiveRight)&&fn(e,t,d))return!0}function qr(e){e=Ar(e);for(var t=0,n=e.parent,i=0;i<n.lines.length;++i){var d=n.lines[i];if(d==e)break;t+=d.height}for(var M=n.parent;M;n=M,M=n.parent)for(var z=0;z<M.children.length;++z){var Q=M.children[z];if(Q==n)break;t+=Q.height}return t}function pn(e){if(e.height==0)return 0;for(var t=e.text.length,n,i=e;n=ar(i);){var d=n.find(0,!0);i=d.from.line,t+=d.from.ch-d.to.ch}for(i=e;n=Kt(i);){var M=n.find(0,!0);t-=i.text.length-M.from.ch,i=M.to.line,t+=i.text.length-M.to.ch}return t}function jn(e){var t=e.display,n=e.doc;t.maxLine=dt(n,n.first),t.maxLineLength=pn(t.maxLine),t.maxLineChanged=!0,n.iter(function(i){var d=pn(i);d>t.maxLineLength&&(t.maxLineLength=d,t.maxLine=i)})}var ki=function(e,t,n){this.text=e,_i(this,t),this.height=n?n(this):1};ki.prototype.lineNo=function(){return Rt(this)},be(ki);function ua(e,t,n,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),cn(e),_i(e,n);var d=i?i(e):1;d!=e.height&&Jt(e,d)}function gt(e){e.parent=null,cn(e)}var At={},Et={};function Dt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Et:At;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Bt(e,t){var n=w("span",null,null,r?"padding-right: .1px":null),i={pre:w("pre",[n],"CodeMirror-line"),content:n,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 M=d?t.rest[d-1]:t.line,z=void 0;i.pos=0,i.addToken=Nt,wt(e.display.measure)&&(z=qe(M,e.doc.direction))&&(i.addToken=Dr(i.addToken,z)),i.map=[];var Q=t!=e.display.externalMeasured&&Rt(M);hi(M,i,Ke(e,M,Q)),M.styleClasses&&(M.styleClasses.bgClass&&(i.bgClass=E(M.styleClasses.bgClass,i.bgClass||"")),M.styleClasses.textClass&&(i.textClass=E(M.styleClasses.textClass,i.textClass||""))),i.map.length==0&&i.map.push(0,0,i.content.appendChild(mt(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(r){var q=i.content.lastChild;(/\bcm-tab\b/.test(q.className)||q.querySelector&&q.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return Ue(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=E(i.pre.className,i.textClass||"")),i}function Yt(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 Nt(e,t,n,i,d,M,z){if(!t)return;var Q=e.splitSpaces?ur(t,e.trailingSpace):t,q=e.cm.state.specialChars,te=!1,pe;if(!q.test(t))e.col+=t.length,pe=document.createTextNode(Q),e.map.push(e.pos,e.pos+t.length,pe),K&&G<9&&(te=!0),e.pos+=t.length;else{pe=document.createDocumentFragment();for(var ye=0;;){q.lastIndex=ye;var Me=q.exec(t),De=Me?Me.index-ye:t.length-ye;if(De){var We=document.createTextNode(Q.slice(ye,ye+De));K&&G<9?pe.appendChild(c("span",[We])):pe.appendChild(We),e.map.push(e.pos,e.pos+De,We),e.col+=De,e.pos+=De}if(!Me)break;ye+=De+1;var Ye=void 0;if(Me[0]==" "){var Ze=e.cm.options.tabSize,rt=Ze-e.col%Ze;Ye=pe.appendChild(c("span",ce(rt),"cm-tab")),Ye.setAttribute("role","presentation"),Ye.setAttribute("cm-text"," "),e.col+=rt}else Me[0]=="\r"||Me[0]==`
`?(Ye=pe.appendChild(c("span",Me[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ye.setAttribute("cm-text",Me[0]),e.col+=1):(Ye=e.cm.options.specialCharPlaceholder(Me[0]),Ye.setAttribute("cm-text",Me[0]),K&&G<9?pe.appendChild(c("span",[Ye])):pe.appendChild(Ye),e.col+=1);e.map.push(e.pos,e.pos+1,Ye),e.pos++}}if(e.trailingSpace=Q.charCodeAt(t.length-1)==32,n||i||d||te||M||z){var lt=n||"";i&&(lt+=i),d&&(lt+=d);var it=c("span",[pe],lt,M);if(z)for(var ht in z)z.hasOwnProperty(ht)&&ht!="style"&&ht!="class"&&it.setAttribute(ht,z[ht]);return e.content.appendChild(it)}e.content.appendChild(pe)}function ur(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,i="",d=0;d<e.length;d++){var M=e.charAt(d);M==" "&&n&&(d==e.length-1||e.charCodeAt(d+1)==32)&&(M="\xA0"),i+=M,n=M==" "}return i}function Dr(e,t){return function(n,i,d,M,z,Q,q){d=d?d+" cm-force-border":"cm-force-border";for(var te=n.pos,pe=te+i.length;;){for(var ye=void 0,Me=0;Me<t.length&&!(ye=t[Me],ye.to>te&&ye.from<=te);Me++);if(ye.to>=pe)return e(n,i,d,M,z,Q,q);e(n,i.slice(0,ye.to-te),d,M,null,Q,q),M=null,i=i.slice(ye.to-te),te=ye.to}}}function Mt(e,t,n,i){var d=!i&&n.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",n.id)),d&&(e.cm.display.input.setUneditable(d),e.content.appendChild(d)),e.pos+=t,e.trailingSpace=!1}function hi(e,t,n){var i=e.markedSpans,d=e.text,M=0;if(!i){for(var z=1;z<n.length;z+=2)t.addToken(t,d.slice(M,M=n[z]),Dt(n[z+1],t.cm.options));return}for(var Q=d.length,q=0,te=1,pe="",ye,Me,De=0,We,Ye,Ze,rt,lt;;){if(De==q){We=Ye=Ze=Me="",lt=null,rt=null,De=Infinity;for(var it=[],ht=void 0,Tt=0;Tt<i.length;++Tt){var vt=i[Tt],Ot=vt.marker;if(Ot.type=="bookmark"&&vt.from==q&&Ot.widgetNode)it.push(Ot);else if(vt.from<=q&&(vt.to==null||vt.to>q||Ot.collapsed&&vt.to==q&&vt.from==q)){if(vt.to!=null&&vt.to!=q&&De>vt.to&&(De=vt.to,Ye=""),Ot.className&&(We+=" "+Ot.className),Ot.css&&(Me=(Me?Me+";":"")+Ot.css),Ot.startStyle&&vt.from==q&&(Ze+=" "+Ot.startStyle),Ot.endStyle&&vt.to==De&&(ht||(ht=[])).push(Ot.endStyle,vt.to),Ot.title&&((lt||(lt={})).title=Ot.title),Ot.attributes)for(var Xt in Ot.attributes)(lt||(lt={}))[Xt]=Ot.attributes[Xt];Ot.collapsed&&(!rt||yr(rt.marker,Ot)<0)&&(rt=vt)}else vt.from>q&&De>vt.from&&(De=vt.from)}if(ht)for(var gr=0;gr<ht.length;gr+=2)ht[gr+1]==De&&(Ye+=" "+ht[gr]);if(!rt||rt.from==q)for(var er=0;er<it.length;++er)Mt(t,0,it[er]);if(rt&&(rt.from||0)==q){if(Mt(t,(rt.to==null?Q+1:rt.to)-q,rt.marker,rt.from==null),rt.to==null)return;rt.to==q&&(rt=!1)}}if(q>=Q)break;for(var Gr=Math.min(Q,De);;){if(pe){var Nr=q+pe.length;if(!rt){var sr=Nr>Gr?pe.slice(0,Gr-q):pe;t.addToken(t,sr,ye?ye+We:We,Ze,q+sr.length==De?Ye:"",Me,lt)}if(Nr>=Gr){pe=pe.slice(Gr-q),q=Gr;break}q=Nr,Ze=""}pe=d.slice(M,M=n[te++]),ye=Dt(n[te++],t.cm.options)}}}function Wt(e,t,n){this.line=t,this.rest=Ei(t),this.size=this.rest?Rt(re(this.rest))-n+1:1,this.node=this.text=null,this.hidden=ni(e,t)}function kr(e,t,n){for(var i=[],d,M=t;M<n;M=d){var z=new Wt(e.doc,dt(e.doc,M),M);d=M+z.size,i.push(z)}return i}var Tr=null;function Jr(e){Tr?Tr.ops.push(e):e.ownsGroup=Tr={ops:[e],delayedCallbacks:[]}}function Lo(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].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(n<t.length)}function Io(e,t){var n=e.ownsGroup;if(!n)return;try{Lo(n)}finally{Tr=null,t(n)}}var mn=null;function br(e,t){var n=ut(e,t);if(!n.length)return;var i=Array.prototype.slice.call(arguments,2),d;Tr?d=Tr.delayedCallbacks:mn?d=mn:(d=mn=[],setTimeout(Do,0));for(var M=function(Q){d.push(function(){return n[Q].apply(null,i)})},z=0;z<n.length;++z)M(z)}function Do(){var e=mn;mn=null;for(var t=0;t<e.length;++t)e[t]()}function Xa(e,t,n,i){for(var d=0;d<t.changes.length;d++){var M=t.changes[d];M=="text"?Mo(e,t):M=="gutter"?Ja(e,t,n,i):M=="class"?ha(e,t):M=="widget"&&Po(e,t,i)}t.changes=null}function gn(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),K&&G<8&&(e.node.style.zIndex=2)),e.node}function ko(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var i=gn(t);t.background=i.insertBefore(c("div",null,n),i.firstChild),e.display.input.setUneditable(t.background)}}function $a(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Bt(e,t)}function Mo(e,t){var n=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)):n&&(t.text.className=n)}function ha(e,t){ko(e,t),t.line.wrapClass?gn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Ja(e,t,n,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=gn(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 M=t.line.gutterMarkers;if(e.options.lineNumbers||M){var z=gn(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),z.insertBefore(Q,t.text),t.line.gutterClass&&(Q.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!M||!M["CodeMirror-linenumbers"])&&(t.lineNumber=Q.appendChild(c("div",Xr(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),M)for(var q=0;q<e.display.gutterSpecs.length;++q){var te=e.display.gutterSpecs[q].className,pe=M.hasOwnProperty(te)&&M[te];pe&&Q.appendChild(c("div",[pe],"CodeMirror-gutter-elt","left: "+i.gutterLeft[te]+"px; width: "+i.gutterWidth[te]+"px"))}}}function Po(e,t,n){t.alignable&&(t.alignable=null);for(var i=O("CodeMirror-linewidget"),d=t.node.firstChild,M=void 0;d;d=M)M=d.nextSibling,i.test(d.className)&&t.node.removeChild(d);Qa(e,t,n)}function No(e,t,n,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,n,i),Qa(e,t,i),t.node}function Qa(e,t,n){if(Za(e,t.line,t,n,!0),t.rest)for(var i=0;i<t.rest.length;i++)Za(e,t.rest[i],t,n,!1)}function Za(e,t,n,i,d){if(!t.widgets)return;for(var M=gn(n),z=0,Q=t.widgets;z<Q.length;++z){var q=Q[z],te=c("div",[q.node],"CodeMirror-linewidget"+(q.className?" "+q.className:""));q.handleMouseEvents||te.setAttribute("cm-ignore-events","true"),Fo(q,te,n,i),e.display.input.setUneditable(te),d&&q.above?M.insertBefore(te,n.gutter||n.text):M.appendChild(te),br(q,"redraw")}}function Fo(e,t,n,i){if(e.noHScroll){(n.alignable||(n.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 vn(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!b(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),T(t.display.measure,c("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function ci(e,t){for(var n=we(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function Hn(e){return e.lineSpace.offsetTop}function ca(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function qa(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=T(e.measure,c("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(i.left)&&!isNaN(i.right)&&(e.cachedPaddingH=i),i}function ai(e){return oe-e.display.nativeBarWidth}function Mi(e){return e.display.scroller.clientWidth-ai(e)-e.display.barWidth}function da(e){return e.display.scroller.clientHeight-ai(e)-e.display.barHeight}function Bo(e,t,n){var i=e.options.lineWrapping,d=i&&Mi(e);if(!t.measure.heights||i&&t.measure.width!=d){var M=t.measure.heights=[];if(i){t.measure.width=d;for(var z=t.text.firstChild.getClientRects(),Q=0;Q<z.length-1;Q++){var q=z[Q],te=z[Q+1];Math.abs(q.bottom-te.bottom)>2&&M.push((q.bottom+te.top)/2-n.top)}}M.push(n.bottom-n.top)}}function es(e,t,n){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(Rt(e.rest[d])>n)return{map:e.measure.maps[d],cache:e.measure.caches[d],before:!0}}function Uo(e,t){t=Ar(t);var n=Rt(t),i=e.display.externalMeasured=new Wt(e.doc,t,n);i.lineN=n;var d=i.built=Bt(e,i);return i.text=d.pre,T(e.display.lineMeasure,d.pre),i}function ts(e,t,n,i){return si(e,Yi(e,t),n,i)}function fa(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Fi(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Yi(e,t){var n=Rt(t),i=fa(e,n);i&&!i.text?i=null:i&&i.changes&&(Xa(e,i,n,ba(e)),e.curOp.forceUpdate=!0),i||(i=Uo(e,t));var d=es(i,t,n);return{line:t,view:i,rect:null,map:d.map,cache:d.cache,before:d.before,hasHeights:!1}}function si(e,t,n,i,d){t.before&&(n=-1);var M=n+(i||""),z;return t.cache.hasOwnProperty(M)?z=t.cache[M]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Bo(e,t.view,t.rect),t.hasHeights=!0),z=Ho(e,t,n,i),z.bogus||(t.cache[M]=z)),{left:z.left,right:z.right,top:d?z.rtop:z.top,bottom:d?z.rbottom:z.bottom}}var rs={left:0,right:0,top:0,bottom:0};function is(e,t,n){for(var i,d,M,z,Q,q,te=0;te<e.length;te+=3)if(Q=e[te],q=e[te+1],t<Q?(d=0,M=1,z="left"):t<q?(d=t-Q,M=d+1):(te==e.length-3||t==q&&e[te+3]>t)&&(M=q-Q,d=M-1,t>=q&&(z="right")),d!=null){if(i=e[te+2],Q==q&&n==(i.insertLeft?"left":"right")&&(z=n),n=="left"&&d==0)for(;te&&e[te-2]==e[te-3]&&e[te-1].insertLeft;)i=e[(te-=3)+2],z="left";if(n=="right"&&d==q-Q)for(;te<e.length-3&&e[te+3]==e[te+4]&&!e[te+5].insertLeft;)i=e[(te+=3)+2],z="right";break}return{node:i,start:d,end:M,collapse:z,coverStart:Q,coverEnd:q}}function jo(e,t){var n=rs;if(t=="left")for(var i=0;i<e.length&&!((n=e[i]).left!=n.right);i++);else for(var d=e.length-1;d>=0&&!((n=e[d]).left!=n.right);d--);return n}function Ho(e,t,n,i){var d=is(t.map,n,i),M=d.node,z=d.start,Q=d.end,q=d.collapse,te;if(M.nodeType==3){for(var pe=0;pe<4;pe++){for(;z&&Le(t.line.text.charAt(d.coverStart+z));)--z;for(;d.coverStart+Q<d.coverEnd&&Le(t.line.text.charAt(d.coverStart+Q));)++Q;if(K&&G<9&&z==0&&Q==d.coverEnd-d.coverStart?te=M.parentNode.getBoundingClientRect():te=jo(y(M,z,Q).getClientRects(),i),te.left||te.right||z==0)break;Q=z,z=z-1,q="right"}K&&G<11&&(te=Wo(e.display.measure,te))}else{z>0&&(q=i="right");var ye;e.options.lineWrapping&&(ye=M.getClientRects()).length>1?te=ye[i=="right"?ye.length-1:0]:te=M.getBoundingClientRect()}if(K&&G<9&&!z&&(!te||!te.left&&!te.right)){var Me=M.parentNode.getClientRects()[0];Me?te={left:Me.left,right:Me.left+$i(e.display),top:Me.top,bottom:Me.bottom}:te=rs}for(var De=te.top-t.rect.top,We=te.bottom-t.rect.top,Ye=(De+We)/2,Ze=t.view.measure.heights,rt=0;rt<Ze.length-1&&!(Ye<Ze[rt]);rt++);var lt=rt?Ze[rt-1]:0,it=Ze[rt],ht={left:(q=="right"?te.right:te.left)-t.rect.left,right:(q=="left"?te.left:te.right)-t.rect.left,top:lt,bottom:it};return!te.left&&!te.right&&(ht.bogus=!0),e.options.singleCursorHeightPerLine||(ht.rtop=De,ht.rbottom=We),ht}function Wo(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!qt(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*i,bottom:t.bottom*i}}function ns(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,S(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ns(e.display.view[t])}function yn(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 v&&o?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function os(){return v&&o?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function pa(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=vn(e.widgets[n]));return t}function Wn(e,t,n,i,d){if(!d){var M=pa(t);n.top+=M,n.bottom+=M}if(i=="line")return n;i||(i="local");var z=qr(t);if(i=="local"?z+=Hn(e.display):z-=e.display.viewOffset,i=="page"||i=="window"){var Q=e.display.lineSpace.getBoundingClientRect();z+=Q.top+(i=="window"?0:os());var q=Q.left+(i=="window"?0:ss());n.left+=q,n.right+=q}return n.top+=z,n.bottom+=z,n}function ls(e,t,n){if(n=="div")return t;var i=t.left,d=t.top;if(n=="page")i-=ss(),d-=os();else if(n=="local"||!n){var M=e.display.sizer.getBoundingClientRect();i+=M.left,d+=M.top}var z=e.display.lineSpace.getBoundingClientRect();return{left:i-z.left,top:d-z.top}}function ma(e,t,n,i,d){return i||(i=dt(e.doc,t.line)),Wn(e,i,ts(e,i,t.ch,d),n)}function ei(e,t,n,i,d,M){i=i||dt(e.doc,t.line),d||(d=Yi(e,i));function z(We,Ye){var Ze=si(e,d,We,Ye?"right":"left",M);return Ye?Ze.left=Ze.right:Ze.right=Ze.left,Wn(e,i,Ze,n)}var Q=qe(i,e.doc.direction),q=t.ch,te=t.sticky;if(q>=i.text.length?(q=i.text.length,te="before"):q<=0&&(q=0,te="after"),!Q)return z(te=="before"?q-1:q,te=="before");function pe(We,Ye,Ze){var rt=Q[Ye],lt=rt.level==1;return z(Ze?We-1:We,lt!=Ze)}var ye=Qe(Q,q,te),Me=Je,De=pe(q,ye,te=="before");return Me!=null&&(De.other=pe(q,Me,te!="before")),De}function us(e,t){var n=0;t=x(e.doc,t),e.options.lineWrapping||(n=$i(e.display)*t.ch);var i=dt(e.doc,t.line),d=qr(i)+Hn(e.display);return{left:n,right:n,top:d,bottom:d+i.height}}function ga(e,t,n,i,d){var M=$e(e,t,n);return M.xRel=d,i&&(M.outside=i),M}function va(e,t,n){var i=e.doc;if(n+=e.display.viewOffset,n<0)return ga(i.first,0,null,-1,-1);var d=lr(i,n),M=i.first+i.size-1;if(d>M)return ga(i.first+i.size-1,dt(i,M).text.length,null,1,1);t<0&&(t=0);for(var z=dt(i,d);;){var Q=Go(e,z,d,t,n),q=ii(z,Q.ch+(Q.xRel>0||Q.outside>0?1:0));if(!q)return Q;var te=q.find(1);if(te.line==d)return te;z=dt(i,d=te.line)}}function hs(e,t,n,i){i-=pa(t);var d=t.text.length,M=Ge(function(z){return si(e,n,z-1).bottom<=i},d,0);return d=Ge(function(z){return si(e,n,z).top>i},M,d),{begin:M,end:d}}function cs(e,t,n,i){n||(n=Yi(e,t));var d=Wn(e,t,si(e,n,i),"line").top;return hs(e,t,n,d)}function ya(e,t,n,i){return e.bottom<=n?!1:e.top>n?!0:(i?e.left:e.right)>t}function Go(e,t,n,i,d){d-=qr(t);var M=Yi(e,t),z=pa(t),Q=0,q=t.text.length,te=!0,pe=qe(t,e.doc.direction);if(pe){var ye=(e.options.lineWrapping?zo:Ko)(e,t,n,M,pe,i,d);te=ye.level!=1,Q=te?ye.from:ye.to-1,q=te?ye.to:ye.from-1}var Me=null,De=null,We=Ge(function(Tt){var vt=si(e,M,Tt);return vt.top+=z,vt.bottom+=z,ya(vt,i,d,!1)?(vt.top<=d&&vt.left<=i&&(Me=Tt,De=vt),!0):!1},Q,q),Ye,Ze,rt=!1;if(De){var lt=i-De.left<De.right-i,it=lt==te;We=Me+(it?0:1),Ze=it?"after":"before",Ye=lt?De.left:De.right}else{!te&&(We==q||We==Q)&&We++,Ze=We==0?"after":We==t.text.length?"before":si(e,M,We-(te?1:0)).bottom+z<=d==te?"after":"before";var ht=ei(e,$e(n,We,Ze),"line",t,M);Ye=ht.left,rt=d<ht.top?-1:d>=ht.bottom?1:0}return We=Ie(t.text,We,1),ga(n,We,Ze,rt,i-Ye)}function Ko(e,t,n,i,d,M,z){var Q=Ge(function(ye){var Me=d[ye],De=Me.level!=1;return ya(ei(e,$e(n,De?Me.to:Me.from,De?"before":"after"),"line",t,i),M,z,!0)},0,d.length-1),q=d[Q];if(Q>0){var te=q.level!=1,pe=ei(e,$e(n,te?q.from:q.to,te?"after":"before"),"line",t,i);ya(pe,M,z,!0)&&pe.top>z&&(q=d[Q-1])}return q}function zo(e,t,n,i,d,M,z){var Q=hs(e,t,i,z),q=Q.begin,te=Q.end;/\s/.test(t.text.charAt(te-1))&&te--;for(var pe=null,ye=null,Me=0;Me<d.length;Me++){var De=d[Me];if(De.from>=te||De.to<=q)continue;var We=De.level!=1,Ye=si(e,i,We?Math.min(te,De.to)-1:Math.max(q,De.from)).right,Ze=Ye<M?M-Ye+1e9:Ye-M;(!pe||ye>Ze)&&(pe=De,ye=Ze)}return pe||(pe=d[d.length-1]),pe.from<q&&(pe={from:q,to:pe.to,level:pe.level}),pe.to>te&&(pe={from:pe.from,to:te,level:pe.level}),pe}var Pi;function Xi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Pi==null){Pi=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Pi.appendChild(document.createTextNode("x")),Pi.appendChild(c("br"));Pi.appendChild(document.createTextNode("x"))}T(e.measure,Pi);var n=Pi.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),S(e.measure),n||1}function $i(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),n=c("pre",[t],"CodeMirror-line-like");T(e.measure,n);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,n={},i={},d=t.gutters.clientLeft,M=t.gutters.firstChild,z=0;M;M=M.nextSibling,++z){var Q=e.display.gutterSpecs[z].className;n[Q]=M.offsetLeft+M.clientLeft+d,i[Q]=M.clientWidth}return{fixedPos:_a(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function _a(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ds(e){var t=Xi(e.display),n=e.options.lineWrapping,i=n&&Math.max(5,e.display.scroller.clientWidth/$i(e.display)-3);return function(d){if(ni(e.doc,d))return 0;var M=0;if(d.widgets)for(var z=0;z<d.widgets.length;z++)d.widgets[z].height&&(M+=d.widgets[z].height);return n?M+(Math.ceil(d.text.length/i)||1)*t:M+t}}function Ea(e){var t=e.doc,n=ds(e);t.iter(function(i){var d=n(i);d!=i.height&&Jt(i,d)})}function Ni(e,t,n,i){var d=e.display;if(!n&&we(t).getAttribute("cm-not-content")=="true")return null;var M,z,Q=d.lineSpace.getBoundingClientRect();try{M=t.clientX-Q.left,z=t.clientY-Q.top}catch(ye){return null}var q=va(e,M,z),te;if(i&&q.xRel>0&&(te=dt(e.doc,q.line).text).length==q.ch){var pe=H(te,te.length,e.options.tabSize)-te.length;q=$e(q.line,Math.max(0,Math.round((M-qa(e.display).left)/$i(e.display))-pe))}return q}function Fi(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,i=0;i<n.length;i++)if(t-=n[i].size,t<0)return i}function Mr(e,t,n,i){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),i||(i=0);var d=e.display;if(i&&n<d.viewTo&&(d.updateLineNumbers==null||d.updateLineNumbers>t)&&(d.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=d.viewTo)dr&&dn(e.doc,t)<d.viewTo&&wi(e);else if(n<=d.viewFrom)dr&&xi(e.doc,n+i)>d.viewFrom?wi(e):(d.viewFrom+=i,d.viewTo+=i);else if(t<=d.viewFrom&&n>=d.viewTo)wi(e);else if(t<=d.viewFrom){var M=Gn(e,n,n+i,1);M?(d.view=d.view.slice(M.index),d.viewFrom=M.lineN,d.viewTo+=i):wi(e)}else if(n>=d.viewTo){var z=Gn(e,t,t,-1);z?(d.view=d.view.slice(0,z.index),d.viewTo=z.lineN):wi(e)}else{var Q=Gn(e,t,t,-1),q=Gn(e,n,n+i,1);Q&&q?(d.view=d.view.slice(0,Q.index).concat(kr(e,Q.lineN,q.lineN)).concat(d.view.slice(q.index)),d.viewTo+=i):wi(e)}var te=d.externalMeasured;te&&(n<te.lineN?te.lineN+=i:t<te.lineN+te.size&&(d.externalMeasured=null))}function Ti(e,t,n){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 M=i.view[Fi(e,t)];if(M.node==null)return;var z=M.changes||(M.changes=[]);ie(z,n)==-1&&z.push(n)}function wi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gn(e,t,n,i){var d=Fi(e,t),M,z=e.display.view;if(!dr||n==e.doc.first+e.doc.size)return{index:d,lineN:n};for(var Q=e.display.viewFrom,q=0;q<d;q++)Q+=z[q].size;if(Q!=t){if(i>0){if(d==z.length-1)return null;M=Q+z[d].size-t,d++}else M=Q-t;t+=M,n+=M}for(;dn(e.doc,n)!=n;){if(d==(i<0?0:z.length-1))return null;n+=i*z[d-(i<0?1:0)].size,d+=i}return{index:d,lineN:n}}function Vo(e,t,n){var i=e.display,d=i.view;d.length==0||t>=i.viewTo||n<=i.viewFrom?(i.view=kr(e,t,n),i.viewFrom=t):(i.viewFrom>t?i.view=kr(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(Fi(e,t))),i.viewFrom=t,i.viewTo<n?i.view=i.view.concat(kr(e,i.viewTo,n)):i.viewTo>n&&(i.view=i.view.slice(0,Fi(e,n)))),i.viewTo=n}function fs(e){for(var t=e.display.view,n=0,i=0;i<t.length;i++){var d=t[i];!d.hidden&&(!d.node||d.changes)&&++n}return n}function bn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ps(e,t){t===void 0&&(t=!0);for(var n=e.doc,i={},d=i.cursors=document.createDocumentFragment(),M=i.selection=document.createDocumentFragment(),z=0;z<n.sel.ranges.length;z++){if(!t&&z==n.sel.primIndex)continue;var Q=n.sel.ranges[z];if(Q.from().line>=e.display.viewTo||Q.to().line<e.display.viewFrom)continue;var q=Q.empty();(q||e.options.showCursorWhenSelecting)&&ms(e,Q.head,d),q||Yo(e,Q,M)}return i}function ms(e,t,n){var i=ei(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),d=n.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 M=n.appendChild(c("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));M.style.display="",M.style.left=i.other.left+"px",M.style.top=i.other.top+"px",M.style.height=(i.other.bottom-i.other.top)*.85+"px"}}function Kn(e,t){return e.top-t.top||e.left-t.left}function Yo(e,t,n){var i=e.display,d=e.doc,M=document.createDocumentFragment(),z=qa(e.display),Q=z.left,q=Math.max(i.sizerWidth,Mi(e)-i.sizer.offsetLeft)-z.right,te=d.direction=="ltr";function pe(it,ht,Tt,vt){ht<0&&(ht=0),ht=Math.round(ht),vt=Math.round(vt),M.appendChild(c("div",null,"CodeMirror-selected","position: absolute; left: "+it+`px;
top: `+ht+"px; width: "+(Tt==null?q-it:Tt)+`px;
height: `+(vt-ht)+"px"))}function ye(it,ht,Tt){var vt=dt(d,it),Ot=vt.text.length,Xt,gr;function er(sr,Fr){return ma(e,$e(it,sr),"div",vt,Fr)}function Gr(sr,Fr,_r){var hr=cs(e,vt,null,sr),or=Fr=="ltr"==(_r=="after")?"left":"right",rr=_r=="after"?hr.begin:hr.end-(/\s/.test(vt.text.charAt(hr.end-1))?2:1);return er(rr,or)[or]}var Nr=qe(vt,d.direction);return Xe(Nr,ht||0,Tt==null?Ot:Tt,function(sr,Fr,_r,hr){var or=_r=="ltr",rr=er(sr,or?"left":"right"),Br=er(Fr-1,or?"right":"left"),un=ht==null&&sr==0,Li=Tt==null&&Fr==Ot,Sr=hr==0,oi=!Nr||hr==Nr.length-1;if(Br.top-rr.top<=3){var vr=(te?un:Li)&&Sr,Va=(te?Li:un)&&oi,fi=vr?Q:(or?rr:Br).left,Wi=Va?q:(or?Br:rr).right;pe(fi,rr.top,Wi-fi,rr.bottom)}else{var Gi,Or,hn,Ya;or?(Gi=te&&un&&Sr?Q:rr.left,Or=te?q:Gr(sr,_r,"before"),hn=te?Q:Gr(Fr,_r,"after"),Ya=te&&Li&&oi?q:Br.right):(Gi=te?Gr(sr,_r,"before"):Q,Or=!te&&un&&Sr?q:rr.right,hn=!te&&Li&&oi?Q:Br.left,Ya=te?Gr(Fr,_r,"after"):q),pe(Gi,rr.top,Or-Gi,rr.bottom),rr.bottom<Br.top&&pe(Q,rr.bottom,null,Br.top),pe(hn,Br.top,Ya-hn,Br.bottom)}(!Xt||Kn(rr,Xt)<0)&&(Xt=rr),Kn(Br,Xt)<0&&(Xt=Br),(!gr||Kn(rr,gr)<0)&&(gr=rr),Kn(Br,gr)<0&&(gr=Br)}),{start:Xt,end:gr}}var Me=t.from(),De=t.to();if(Me.line==De.line)ye(Me.line,Me.ch,De.ch);else{var We=dt(d,Me.line),Ye=dt(d,De.line),Ze=Ar(We)==Ar(Ye),rt=ye(Me.line,Me.ch,Ze?We.text.length+1:null).end,lt=ye(De.line,Ze?0:null,De.ch).start;Ze&&(rt.top<lt.top-2?(pe(rt.right,rt.top,null,rt.bottom),pe(Q,lt.top,lt.left,lt.bottom)):pe(rt.right,rt.top,lt.left-rt.right,rt.bottom)),rt.bottom<lt.top&&pe(Q,rt.bottom,null,lt.top)}n.appendChild(M)}function xa(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ji(e),t.cursorDiv.style.visibility=(n=!n)?"":"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,Ji(e))},100)}function Ta(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ue(e,"focus",e,t),e.state.focused=!0,F(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),r&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),xa(e)}function Ji(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ue(e,"blur",e,t),e.state.focused=!1,A(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function zn(e){for(var t=e.display,n=t.lineDiv.offsetTop,i=0;i<t.view.length;i++){var d=t.view[i],M=e.options.lineWrapping,z=void 0,Q=0;if(d.hidden)continue;if(K&&G<8){var q=d.node.offsetTop+d.node.offsetHeight;z=q-n,n=q}else{var te=d.node.getBoundingClientRect();z=te.bottom-te.top,!M&&d.text.firstChild&&(Q=d.text.firstChild.getBoundingClientRect().right-te.left-1)}var pe=d.line.height-z;if((pe>.005||pe<-.005)&&(Jt(d.line,z),ys(d.line),d.rest))for(var ye=0;ye<d.rest.length;ye++)ys(d.rest[ye]);if(Q>e.display.sizerWidth){var Me=Math.ceil(Q/$i(e.display));Me>e.display.maxLineLength&&(e.display.maxLineLength=Me,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 n=e.widgets[t],i=n.node.parentNode;i&&(n.height=i.offsetHeight)}}function Vn(e,t,n){var i=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;i=Math.floor(i-Hn(e));var d=n&&n.bottom!=null?n.bottom:i+e.wrapper.clientHeight,M=lr(t,i),z=lr(t,d);if(n&&n.ensure){var Q=n.ensure.from.line,q=n.ensure.to.line;Q<M?(M=Q,z=lr(t,qr(dt(t,Q))+e.wrapper.clientHeight)):Math.min(q,t.lastLine())>=z&&(M=lr(t,qr(dt(t,q))-e.wrapper.clientHeight),z=q)}return{from:M,to:Math.max(z,M+1)}}function Xo(e,t){if(He(e,"scrollCursorIntoView"))return;var n=e.display,i=n.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&&!l){var M=c("div","\u200B",null,`position: absolute;
top: `+(t.top-n.viewOffset-Hn(e.display))+`px;
height: `+(t.bottom-t.top+ai(e)+n.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(M),M.scrollIntoView(d),e.display.lineSpace.removeChild(M)}}function $o(e,t,n,i){i==null&&(i=0);var d;!e.options.lineWrapping&&t==n&&(t=t.ch?$e(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,n=t.sticky=="before"?$e(t.line,t.ch+1,"before"):t);for(var M=0;M<5;M++){var z=!1,Q=ei(e,t),q=!n||n==t?Q:ei(e,n);d={left:Math.min(Q.left,q.left),top:Math.min(Q.top,q.top)-i,right:Math.max(Q.left,q.left),bottom:Math.max(Q.bottom,q.bottom)+i};var te=wa(e,d),pe=e.doc.scrollTop,ye=e.doc.scrollLeft;if(te.scrollTop!=null&&(En(e,te.scrollTop),Math.abs(e.doc.scrollTop-pe)>1&&(z=!0)),te.scrollLeft!=null&&(Bi(e,te.scrollLeft),Math.abs(e.doc.scrollLeft-ye)>1&&(z=!0)),!z)break}return d}function Jo(e,t){var n=wa(e,t);n.scrollTop!=null&&En(e,n.scrollTop),n.scrollLeft!=null&&Bi(e,n.scrollLeft)}function wa(e,t){var n=e.display,i=Xi(e.display);t.top<0&&(t.top=0);var d=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,M=da(e),z={};t.bottom-t.top>M&&(t.bottom=t.top+M);var Q=e.doc.height+ca(n),q=t.top<i,te=t.bottom>Q-i;if(t.top<d)z.scrollTop=q?0:t.top;else if(t.bottom>d+M){var pe=Math.min(t.top,(te?Q:t.bottom)-M);pe!=d&&(z.scrollTop=pe)}var ye=e.options.fixedGutter?0:n.gutters.offsetWidth,Me=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-ye,De=Mi(e)-n.gutters.offsetWidth,We=t.right-t.left>De;return We&&(t.right=t.left+De),t.left<10?z.scrollLeft=0:t.left<Me?z.scrollLeft=Math.max(0,t.left+ye-(We?0:10)):t.right>De+Me-3&&(z.scrollLeft=t.right+(We?0:10)-De),z}function Sa(e,t){if(t==null)return;Yn(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Qi(e){Yn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function _n(e,t,n){(t!=null||n!=null)&&Yn(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Qo(e,t){Yn(e),e.curOp.scrollToPos=t}function Yn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=us(e,t.from),i=us(e,t.to);bs(e,n,i,t.margin)}}function bs(e,t,n,i){var d=wa(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-i,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+i});_n(e,d.scrollLeft,d.scrollTop)}function En(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;P||Aa(e,{top:t}),_s(e,t,!0),P&&Aa(e),wn(e,100)}function _s(e,t,n){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!n)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Bi(e,t,n,i){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?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 xn(e){var t=e.display,n=t.gutters.offsetWidth,i=Math.round(e.doc.height+ca(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?n:0,docHeight:i,scrollHeight:i+ai(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Ui=function(e,t,n){this.cm=n;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),Be(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),Be(d,"scroll",function(){d.clientWidth&&t(d.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,K&&G<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ui.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(n){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=n?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var M=e.viewWidth-e.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+M)+"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:n?i:0,bottom:t?i:0}},Ui.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ui.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ui.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 $,this.disableVert=new $},Ui.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto";function i(){var d=e.getBoundingClientRect(),M=n=="vert"?document.elementFromPoint(d.right-1,(d.top+d.bottom)/2):document.elementFromPoint((d.right+d.left)/2,d.bottom-1);M!=e?e.style.pointerEvents="none":t.set(1e3,i)}t.set(1e3,i)},Ui.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Tn=function(){};Tn.prototype.update=function(){return{bottom:0,right:0}},Tn.prototype.setScrollLeft=function(){},Tn.prototype.setScrollTop=function(){},Tn.prototype.clear=function(){};function Zi(e,t){t||(t=xn(e));var n=e.display.barWidth,i=e.display.barHeight;Es(e,t);for(var d=0;d<4&&n!=e.display.barWidth||i!=e.display.barHeight;d++)n!=e.display.barWidth&&e.options.lineWrapping&&zn(e),Es(e,xn(e)),n=e.display.barWidth,i=e.display.barHeight}function Es(e,t){var n=e.display,i=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var xs={native:Ui,null:Tn};function Ts(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&A(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),Be(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Bi(e,t):En(e,t)},e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}var Zo=0;function ji(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},Jr(e.curOp)}function Hi(e){var t=e.curOp;t&&Io(t,function(n){for(var i=0;i<n.ops.length;i++)n.ops[i].cm.curOp=null;qo(n)})}function qo(e){for(var t=e.ops,n=0;n<t.length;n++)el(t[n]);for(var i=0;i<t.length;i++)tl(t[i]);for(var d=0;d<t.length;d++)rl(t[d]);for(var M=0;M<t.length;M++)il(t[M]);for(var z=0;z<t.length;z++)nl(t[z])}function el(e){var t=e.cm,n=t.display;sl(t),e.updateMaxLine&&jn(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Xn(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ca(e.cm,e.update)}function rl(e){var t=e.cm,n=t.display;e.updatedDisplay&&zn(t),e.barMeasure=xn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ts(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+ai(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Mi(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.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&&Bi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==U();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Zi(t,e.barMeasure),e.updatedDisplay&&Oa(t,e.barMeasure),e.selectionChanged&&xa(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&gs(e.cm)}function nl(e){var t=e.cm,n=t.display,i=t.doc;if(e.updatedDisplay&&ws(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&_s(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Bi(t,e.scrollLeft,!0,!0),e.scrollToPos){var d=$o(t,x(i,e.scrollToPos.from),x(i,e.scrollToPos.to),e.scrollToPos.margin);Xo(t,d)}var M=e.maybeHiddenMarkers,z=e.maybeUnhiddenMarkers;if(M)for(var Q=0;Q<M.length;++Q)M[Q].lines.length||Ue(M[Q],"hide");if(z)for(var q=0;q<z.length;++q)z[q].lines.length&&Ue(z[q],"unhide");n.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ue(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Wr(e,t){if(e.curOp)return t();ji(e);try{return t()}finally{Hi(e)}}function pr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);ji(e);try{return t.apply(e,arguments)}finally{Hi(e)}}}function Rr(e){return function(){if(this.curOp)return e.apply(this,arguments);ji(this);try{return e.apply(this,arguments)}finally{Hi(this)}}}function mr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);ji(t);try{return e.apply(this,arguments)}finally{Hi(t)}}}function wn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,I(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var n=+new Date+e.options.workTime,i=et(e,t.highlightFrontier),d=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),function(M){if(i.line>=e.display.viewFrom){var z=M.styles,Q=M.text.length>e.options.maxHighlightLength?Ft(t.mode,i.state):null,q=_e(e,M,i,!0);Q&&(i.state=Q),M.styles=q.styles;var te=M.styleClasses,pe=q.classes;pe?M.styleClasses=pe:te&&(M.styleClasses=null);for(var ye=!z||z.length!=M.styles.length||te!=pe&&(!te||!pe||te.bgClass!=pe.bgClass||te.textClass!=pe.textClass),Me=0;!ye&&Me<z.length;++Me)ye=z[Me]!=M.styles[Me];ye&&d.push(i.line),M.stateAfter=i.save(),i.nextLine()}else M.text.length<=e.options.maxHighlightLength&&pt(e,M.text,i),M.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>n)return wn(e,e.options.workDelay),!0}),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),d.length&&Wr(e,function(){for(var M=0;M<d.length;M++)Ti(e,d[M],"text")})}var Xn=function(e,t,n){var i=e.display;this.viewport=t,this.visible=Vn(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Mi(e),this.force=n,this.dims=ba(e),this.events=[]};Xn.prototype.signal=function(e,t){me(e,t)&&this.events.push(arguments)},Xn.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ue.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=ai(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=ai(e)+"px",t.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var t=U();if(!t||!b(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&b(e.display.lineDiv,i.anchorNode)&&(n.anchorNode=i.anchorNode,n.anchorOffset=i.anchorOffset,n.focusNode=i.focusNode,n.focusOffset=i.focusOffset)}return n}function ll(e){if(!e||!e.activeElt||e.activeElt==U())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&b(document.body,e.anchorNode)&&b(document.body,e.focusNode)){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function Ca(e,t){var n=e.display,i=e.doc;if(t.editorIsHidden)return wi(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&fs(e)==0)return!1;Cs(e)&&(wi(e),t.dims=ba(e));var d=i.first+i.size,M=Math.max(t.visible.from-e.options.viewportMargin,i.first),z=Math.min(d,t.visible.to+e.options.viewportMargin);n.viewFrom<M&&M-n.viewFrom<20&&(M=Math.max(i.first,n.viewFrom)),n.viewTo>z&&n.viewTo-z<20&&(z=Math.min(d,n.viewTo)),dr&&(M=dn(e.doc,M),z=xi(e.doc,z));var Q=M!=n.viewFrom||z!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Vo(e,M,z),n.viewOffset=qr(dt(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var q=fs(e);if(!Q&&q==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var te=ol(e);return q>4&&(n.lineDiv.style.display="none"),ul(e,n.updateLineNumbers,t.dims),q>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,ll(te),S(n.cursorDiv),S(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,Q&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,wn(e,400)),n.updateLineNumbers=null,!0}function ws(e,t){for(var n=t.viewport,i=!0;;i=!1){if(!i||!e.options.lineWrapping||t.oldDisplayWidth==Mi(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+ca(e.display)-da(e),n.top)}),t.visible=Vn(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else i&&(t.visible=Vn(e.display,e.doc,n));if(!Ca(e,t))break;zn(e);var d=xn(e);bn(e),Zi(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 n=new Xn(e,t);if(Ca(e,n)){zn(e),ws(e,n);var i=xn(e);bn(e),Zi(e,i),Oa(e,i),n.finish()}}function ul(e,t,n){var i=e.display,d=e.options.lineNumbers,M=i.lineDiv,z=M.firstChild;function Q(We){var Ye=We.nextSibling;return r&&a&&e.display.currentWheelTarget==We?We.style.display="none":We.parentNode.removeChild(We),Ye}for(var q=i.view,te=i.viewFrom,pe=0;pe<q.length;pe++){var ye=q[pe];if(!ye.hidden)if(!ye.node||ye.node.parentNode!=M){var Me=No(e,ye,te,n);M.insertBefore(Me,z)}else{for(;z!=ye.node;)z=Q(z);var De=d&&t!=null&&t<=te&&ye.lineNumber;ye.changes&&(ie(ye.changes,"gutter")>-1&&(De=!1),Xa(e,ye,te,n)),De&&(S(ye.lineNumber),ye.lineNumber.appendChild(document.createTextNode(Xr(e.options,te)))),z=ye.node.nextSibling}te+=ye.size}for(;z;)z=Q(z)}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+ai(e)+"px"}function Ss(e){var t=e.display,n=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,M=i+"px",z=0;z<n.length;z++)if(!n[z].hidden){e.options.fixedGutter&&(n[z].gutter&&(n[z].gutter.style.left=M),n[z].gutterBackground&&(n[z].gutterBackground.style.left=M));var Q=n[z].alignable;if(Q)for(var q=0;q<Q.length;q++)Q[q].style.left=M}e.options.fixedGutter&&(t.gutters.style.left=i+d+"px")}function Cs(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=Xr(e.options,t.first+t.size-1),i=e.display;if(n.length!=i.lineNumChars){var d=i.measure.appendChild(c("div",[c("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),M=d.firstChild.offsetWidth,z=d.offsetWidth-M;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(M,i.lineGutter.offsetWidth-z)+1,i.lineNumWidth=i.lineNumInnerWidth+z,i.lineNumChars=i.lineNumInnerWidth?n.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Ra(e.display),!0}return!1}function La(e,t){for(var n=[],i=!1,d=0;d<e.length;d++){var M=e[d],z=null;if(typeof M!="string"&&(z=M.style,M=M.className),M=="CodeMirror-linenumbers")if(t)i=!0;else continue;n.push({className:M,style:z})}return t&&!i&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function As(e){var t=e.gutters,n=e.gutterSpecs;S(t),e.lineGutter=null;for(var i=0;i<n.length;++i){var d=n[i],M=d.className,z=d.style,Q=t.appendChild(c("div",null,"CodeMirror-gutter "+M));z&&(Q.style.cssText=z),M=="CodeMirror-linenumbers"&&(e.lineGutter=Q,Q.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Ra(e)}function Sn(e){As(e.display),Mr(e),Ss(e)}function hl(e,t,n,i){var d=this;this.input=n,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=w("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=w("div",[d.measure,d.lineMeasure,d.selectionDiv,d.cursorDiv,d.lineDiv],null,"position: relative; outline: none");var M=w("div",[d.lineSpace],"CodeMirror-lines");d.mover=c("div",[M],null,"position: relative"),d.sizer=c("div",[d.mover],"CodeMirror-sizer"),d.sizerWidth=null,d.heightForcer=c("div",null,null,"position: absolute; height: "+oe+"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"),K&&G<8&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),!r&&!(P&&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),n.init(d)}var $n=0,Vr=null;K?Vr=-.53:P?Vr=15:v?Vr=-.7:p&&(Vr=-1/3);function Rs(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function cl(e){var t=Rs(e);return t.x*=Vr,t.y*=Vr,t}function Os(e,t){var n=Rs(t),i=n.x,d=n.y,M=e.display,z=M.scroller,Q=z.scrollWidth>z.clientWidth,q=z.scrollHeight>z.clientHeight;if(!(i&&Q||d&&q))return;if(d&&a&&r){e:for(var te=t.target,pe=M.view;te!=z;te=te.parentNode)for(var ye=0;ye<pe.length;ye++)if(pe[ye].node==te){e.display.currentWheelTarget=te;break e}}if(i&&!P&&!m&&Vr!=null){d&&q&&En(e,Math.max(0,z.scrollTop+d*Vr)),Bi(e,Math.max(0,z.scrollLeft+i*Vr)),(!d||d&&q)&&ae(t),M.wheelStartX=null;return}if(d&&Vr!=null){var Me=d*Vr,De=e.doc.scrollTop,We=De+M.wrapper.clientHeight;Me<0?De=Math.max(0,De+Me-50):We=Math.min(e.doc.height,We+Me+50),Aa(e,{top:De,bottom:We})}$n<20&&(M.wheelStartX==null?(M.wheelStartX=z.scrollLeft,M.wheelStartY=z.scrollTop,M.wheelDX=i,M.wheelDY=d,setTimeout(function(){if(M.wheelStartX==null)return;var Ye=z.scrollLeft-M.wheelStartX,Ze=z.scrollTop-M.wheelStartY,rt=Ze&&M.wheelDY&&Ze/M.wheelDY||Ye&&M.wheelDX&&Ye/M.wheelDX;if(M.wheelStartX=M.wheelStartY=null,!rt)return;Vr=(Vr*$n+rt)/($n+1),++$n},200)):(M.wheelDX+=i,M.wheelDY+=d))}var Yr=function(e,t){this.ranges=e,this.primIndex=t};Yr.prototype.primary=function(){return this.ranges[this.primIndex]},Yr.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],i=e.ranges[t];if(!pi(n.anchor,i.anchor)||!pi(n.head,i.head))return!1}return!0},Yr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Gt(mi(this.ranges[t].anchor),mi(this.ranges[t].head));return new Yr(e,this.primIndex)},Yr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Yr.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var i=this.ranges[n];if(Ct(t,i.from())>=0&&Ct(e,i.to())<=0)return n}return-1};var Gt=function(e,t){this.anchor=e,this.head=t};Gt.prototype.from=function(){return vi(this.anchor,this.head)},Gt.prototype.to=function(){return gi(this.anchor,this.head)},Gt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ti(e,t,n){var i=e&&e.options.selectionsMayTouch,d=t[n];t.sort(function(Me,De){return Ct(Me.from(),De.from())}),n=ie(t,d);for(var M=1;M<t.length;M++){var z=t[M],Q=t[M-1],q=Ct(Q.to(),z.from());if(i&&!z.empty()?q>0:q>=0){var te=vi(Q.from(),z.from()),pe=gi(Q.to(),z.to()),ye=Q.empty()?z.from()==z.head:Q.from()==Q.head;M<=n&&--n,t.splice(--M,2,new Gt(ye?pe:te,ye?te:pe))}}return new Yr(t,n)}function Si(e,t){return new Yr([new Gt(e,t||e)],0)}function Ci(e){return e.text?$e(e.from.line+e.text.length-1,re(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ls(e,t){if(Ct(e,t.from)<0)return e;if(Ct(e,t.to)<=0)return Ci(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=Ci(t).ch-t.to.ch),$e(n,i)}function Ia(e,t){for(var n=[],i=0;i<e.sel.ranges.length;i++){var d=e.sel.ranges[i];n.push(new Gt(Ls(d.anchor,t),Ls(d.head,t)))}return ti(e.cm,n,e.sel.primIndex)}function Is(e,t,n){return e.line==t.line?$e(n.line,e.ch-t.ch+n.ch):$e(n.line+(e.line-t.line),e.ch)}function dl(e,t,n){for(var i=[],d=$e(e.first,0),M=d,z=0;z<t.length;z++){var Q=t[z],q=Is(Q.from,d,M),te=Is(Ci(Q),d,M);if(d=Q.to,M=te,n=="around"){var pe=e.sel.ranges[z],ye=Ct(pe.head,pe.anchor)<0;i[z]=new Gt(ye?te:q,ye?q:te)}else i[z]=new Gt(q,q)}return new Yr(i,e.sel.primIndex)}function Da(e){e.doc.mode=Lr(e.options,e.doc.modeOption),Cn(e)}function Cn(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,wn(e,100),e.state.modeGen++,e.curOp&&Mr(e)}function Ds(e,t){return t.from.ch==0&&t.to.ch==0&&re(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ka(e,t,n,i){function d(lt){return n?n[lt]:null}function M(lt,it,ht){ua(lt,it,ht,i),br(lt,"change",lt,t)}function z(lt,it){for(var ht=[],Tt=lt;Tt<it;++Tt)ht.push(new ki(te[Tt],d(Tt),i));return ht}var Q=t.from,q=t.to,te=t.text,pe=dt(e,Q.line),ye=dt(e,q.line),Me=re(te),De=d(te.length-1),We=q.line-Q.line;if(t.full)e.insert(0,z(0,te.length)),e.remove(te.length,e.size-te.length);else if(Ds(e,t)){var Ye=z(0,te.length-1);M(ye,ye.text,De),We&&e.remove(Q.line,We),Ye.length&&e.insert(Q.line,Ye)}else if(pe==ye)if(te.length==1)M(pe,pe.text.slice(0,Q.ch)+Me+pe.text.slice(q.ch),De);else{var Ze=z(1,te.length-1);Ze.push(new ki(Me+pe.text.slice(q.ch),De,i)),M(pe,pe.text.slice(0,Q.ch)+te[0],d(0)),e.insert(Q.line+1,Ze)}else if(te.length==1)M(pe,pe.text.slice(0,Q.ch)+te[0]+ye.text.slice(q.ch),d(0)),e.remove(Q.line+1,We);else{M(pe,pe.text.slice(0,Q.ch)+te[0],d(0)),M(ye,Me+ye.text.slice(q.ch),De);var rt=z(1,te.length-1);We>1&&e.remove(Q.line+1,We-1),e.insert(Q.line+1,rt)}br(e,"change",e,t)}function Ai(e,t,n){function i(d,M,z){if(d.linked)for(var Q=0;Q<d.linked.length;++Q){var q=d.linked[Q];if(q.doc==M)continue;var te=z&&q.sharedHist;if(n&&!te)continue;t(q.doc,te),i(q.doc,d,te)}}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||jn(e),e.options.mode=t.modeOption,Mr(e)}function Ms(e){(e.doc.direction=="rtl"?F:A)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Wr(e,function(){Ms(e),Mr(e)})}function Jn(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 n={from:mi(t.from),to:Ci(t),text:Ur(e,t.from,t.to)};return Fs(e,n,t.from.line,t.to.line+1),Ai(e,function(i){return Fs(i,n,t.from.line,t.to.line+1)},!0),n}function Ps(e){for(;e.length;){var t=re(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ps(e.done),re(e.done);if(e.done.length&&!re(e.done).ranges)return re(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),re(e.done)}function Ns(e,t,n,i){var d=e.history;d.undone.length=0;var M=+new Date,z,Q;if((d.lastOp==i||d.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&d.lastModTime>M-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(z=pl(d,d.lastOp==i)))Q=re(z.changes),Ct(t.from,t.to)==0&&Ct(t.from,Q.to)==0?Q.to=Ci(t):z.changes.push(Ma(e,t));else{var q=re(d.done);for((!q||!q.ranges)&&Qn(e.sel,d.done),z={changes:[Ma(e,t)],generation:d.generation},d.done.push(z);d.done.length>d.undoDepth;)d.done.shift(),d.done[0].ranges||d.done.shift()}d.done.push(n),d.generation=++d.maxGeneration,d.lastModTime=d.lastSelTime=M,d.lastOp=d.lastSelOp=i,d.lastOrigin=d.lastSelOrigin=t.origin,Q||Ue(e,"historyAdded")}function ml(e,t,n,i){var d=t.charAt(0);return d=="*"||d=="+"&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,n,i){var d=e.history,M=i&&i.origin;n==d.lastSelOp||M&&d.lastSelOrigin==M&&(d.lastModTime==d.lastSelTime&&d.lastOrigin==M||ml(e,M,re(d.done),t))?d.done[d.done.length-1]=t:Qn(t,d.done),d.lastSelTime=+new Date,d.lastSelOrigin=M,d.lastSelOp=n,i&&i.clearRedo!==!1&&Ps(d.undone)}function Qn(e,t){var n=re(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Fs(e,t,n,i){var d=t["spans_"+e.id],M=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,i),function(z){z.markedSpans&&((d||(d=t["spans_"+e.id]={}))[M]=z.markedSpans),++M})}function vl(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function yl(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var i=[],d=0;d<t.text.length;++d)i.push(vl(n[d]));return i}function Bs(e,t){var n=yl(e,t),i=Zr(e,t);if(!n)return i;if(!i)return n;for(var d=0;d<n.length;++d){var M=n[d],z=i[d];if(M&&z){e:for(var Q=0;Q<z.length;++Q){for(var q=z[Q],te=0;te<M.length;++te)if(M[te].marker==q.marker)continue e;M.push(q)}}else z&&(n[d]=z)}return n}function qi(e,t,n){for(var i=[],d=0;d<e.length;++d){var M=e[d];if(M.ranges){i.push(n?Yr.prototype.deepCopy.call(M):M);continue}var z=M.changes,Q=[];i.push({changes:Q});for(var q=0;q<z.length;++q){var te=z[q],pe=void 0;if(Q.push({from:te.from,to:te.to,text:te.text}),t)for(var ye in te)(pe=ye.match(/^spans_(\d+)$/))&&(ie(t,Number(pe[1]))>-1&&(re(Q)[ye]=te[ye],delete te[ye]))}}return i}function Pa(e,t,n,i){if(i){var d=e.anchor;if(n){var M=Ct(t,d)<0;M!=Ct(n,d)<0?(d=t,t=n):M!=Ct(t,n)<0&&(t=n)}return new Gt(d,t)}else return new Gt(n||t,t)}function Zn(e,t,n,i,d){d==null&&(d=e.cm&&(e.cm.display.shift||e.extend)),wr(e,new Yr([Pa(e.sel.primary(),t,n,d)],0),i)}function Us(e,t,n){for(var i=[],d=e.cm&&(e.cm.display.shift||e.extend),M=0;M<e.sel.ranges.length;M++)i[M]=Pa(e.sel.ranges[M],t[M],null,d);var z=ti(e.cm,i,e.sel.primIndex);wr(e,z,n)}function Na(e,t,n,i){var d=e.sel.ranges.slice(0);d[t]=n,wr(e,ti(e.cm,d,e.sel.primIndex),i)}function js(e,t,n,i){wr(e,Si(t,n),i)}function bl(e,t,n){var i={ranges:t.ranges,update:function(d){this.ranges=[];for(var M=0;M<d.length;M++)this.ranges[M]=new Gt(x(e,d[M].anchor),x(e,d[M].head))},origin:n&&n.origin};return Ue(e,"beforeSelectionChange",e,i),e.cm&&Ue(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=t.ranges?ti(e.cm,i.ranges,i.ranges.length-1):t}function Hs(e,t,n){var i=e.history.done,d=re(i);d&&d.ranges?(i[i.length-1]=t,qn(e,t,n)):wr(e,t,n)}function wr(e,t,n){qn(e,t,n),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function qn(e,t,n){(me(e,"beforeSelectionChange")||e.cm&&me(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,n));var i=n&&n.bias||(Ct(t.primary().head,e.sel.primary().head)<0?-1:1);Ws(e,Ks(e,t,i,!0)),!(n&&n.scroll===!1)&&e.cm&&Qi(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,Te(e.cm)),br(e,"cursorActivity",e)}function Gs(e){Ws(e,Ks(e,e.sel,null,!1))}function Ks(e,t,n,i){for(var d,M=0;M<t.ranges.length;M++){var z=t.ranges[M],Q=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[M],q=ea(e,z.anchor,Q&&Q.anchor,n,i),te=ea(e,z.head,Q&&Q.head,n,i);(d||q!=z.anchor||te!=z.head)&&(d||(d=t.ranges.slice(0,M)),d[M]=new Gt(q,te))}return d?ti(e.cm,d,t.primIndex):t}function en(e,t,n,i,d){var M=dt(e,t.line);if(M.markedSpans)for(var z=0;z<M.markedSpans.length;++z){var Q=M.markedSpans[z],q=Q.marker,te="selectLeft"in q?!q.selectLeft:q.inclusiveLeft,pe="selectRight"in q?!q.selectRight:q.inclusiveRight;if((Q.from==null||(te?Q.from<=t.ch:Q.from<t.ch))&&(Q.to==null||(pe?Q.to>=t.ch:Q.to>t.ch))){if(d&&(Ue(q,"beforeCursorEnter"),q.explicitlyCleared))if(M.markedSpans){--z;continue}else break;if(!q.atomic)continue;if(n){var ye=q.find(i<0?1:-1),Me=void 0;if((i<0?pe:te)&&(ye=zs(e,ye,-i,ye&&ye.line==t.line?M:null)),ye&&ye.line==t.line&&(Me=Ct(ye,n))&&(i<0?Me<0:Me>0))return en(e,ye,t,i,d)}var De=q.find(i<0?-1:1);return(i<0?te:pe)&&(De=zs(e,De,i,De.line==t.line?M:null)),De?en(e,De,t,i,d):null}}return t}function ea(e,t,n,i,d){var M=i||1,z=en(e,t,n,M,d)||!d&&en(e,t,n,M,!0)||en(e,t,n,-M,d)||!d&&en(e,t,n,-M,!0);return z||(e.cantEdit=!0,$e(e.first,0))}function zs(e,t,n,i){return n<0&&t.ch==0?t.line>e.first?x(e,$e(t.line-1)):null:n>0&&t.ch==(i||dt(e,t.line)).text.length?t.line<e.first+e.size-1?$e(t.line+1,0):null:new $e(t.line,t.ch+n)}function Vs(e){e.setSelection($e(e.firstLine(),0),$e(e.lastLine()),ve)}function Ys(e,t,n){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=!0}};return n&&(i.update=function(d,M,z,Q){d&&(i.from=x(e,d)),M&&(i.to=x(e,M)),z&&(i.text=z),Q!==void 0&&(i.origin=Q)}),Ue(e,"beforeChange",e,i),e.cm&&Ue(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 tn(e,t,n){if(e.cm){if(!e.cm.curOp)return pr(e.cm,tn)(e,t,n);if(e.cm.state.suppressEdits)return}if((me(e,"beforeChange")||e.cm&&me(e.cm,"beforeChange"))&&(t=Ys(e,t,!0),!t))return;var i=Ii&&!n&&bi(e,t.from,t.to);if(i)for(var d=i.length-1;d>=0;--d)Xs(e,{from:i[d].from,to:i[d].to,text:d?[""]:t.text,origin:t.origin});else Xs(e,t)}function Xs(e,t){if(t.text.length==1&&t.text[0]==""&&Ct(t.from,t.to)==0)return;var n=Ia(e,t);Ns(e,t,n,e.cm?e.cm.curOp.id:NaN),An(e,t,n,Zr(e,t));var i=[];Ai(e,function(d,M){!M&&ie(i,d.history)==-1&&(Zs(d.history,t),i.push(d.history)),An(d,t,null,Zr(d,t))})}function ta(e,t,n){var i=e.cm&&e.cm.state.suppressEdits;if(i&&!n)return;for(var d=e.history,M,z=e.sel,Q=t=="undo"?d.done:d.undone,q=t=="undo"?d.undone:d.done,te=0;te<Q.length&&!(M=Q[te],n?M.ranges&&!M.equals(e.sel):!M.ranges);te++);if(te==Q.length)return;for(d.lastOrigin=d.lastSelOrigin=null;;)if(M=Q.pop(),M.ranges){if(Qn(M,q),n&&!M.equals(e.sel)){wr(e,M,{clearRedo:!1});return}z=M}else if(i){Q.push(M);return}else break;var pe=[];Qn(z,q),q.push({changes:pe,generation:d.generation}),d.generation=M.generation||++d.maxGeneration;for(var ye=me(e,"beforeChange")||e.cm&&me(e.cm,"beforeChange"),Me=function(Ye){var Ze=M.changes[Ye];if(Ze.origin=t,ye&&!Ys(e,Ze,!1))return Q.length=0,{};pe.push(Ma(e,Ze));var rt=Ye?Ia(e,Ze):re(Q);An(e,Ze,rt,Bs(e,Ze)),!Ye&&e.cm&&e.cm.scrollIntoView({from:Ze.from,to:Ci(Ze)});var lt=[];Ai(e,function(it,ht){!ht&&ie(lt,it.history)==-1&&(Zs(it.history,Ze),lt.push(it.history)),An(it,Ze,null,Bs(it,Ze))})},De=M.changes.length-1;De>=0;--De){var We=Me(De);if(We)return We.v}}function $s(e,t){if(t==0)return;if(e.first+=t,e.sel=new Yr(fe(e.sel.ranges,function(d){return new Gt($e(d.anchor.line+t,d.anchor.ch),$e(d.head.line+t,d.head.ch))}),e.sel.primIndex),e.cm){Mr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,i=n.viewFrom;i<n.viewTo;i++)Ti(e.cm,i,"gutter")}}function An(e,t,n,i){if(e.cm&&!e.cm.curOp)return pr(e.cm,An)(e,t,n,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:$e(e.first,0),to:$e(t.to.line+d,t.to.ch),text:[re(t.text)],origin:t.origin}}var M=e.lastLine();t.to.line>M&&(t={from:t.from,to:$e(M,dt(e,M).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ur(e,t.from,t.to),n||(n=Ia(e,t)),e.cm?_l(e.cm,t,i):ka(e,t,i),qn(e,n,ve),e.cantEdit&&ea(e,$e(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,n){var i=e.doc,d=e.display,M=t.from,z=t.to,Q=!1,q=M.line;e.options.lineWrapping||(q=Rt(Ar(dt(i,M.line))),i.iter(q,z.line+1,function(De){if(De==d.maxLine)return Q=!0,!0})),i.sel.contains(t.from,t.to)>-1&&Te(e),ka(i,t,n,ds(e)),e.options.lineWrapping||(i.iter(q,M.line+t.text.length,function(De){var We=pn(De);We>d.maxLineLength&&(d.maxLine=De,d.maxLineLength=We,d.maxLineChanged=!0,Q=!1)}),Q&&(e.curOp.updateMaxLine=!0)),Qr(i,M.line),wn(e,400);var te=t.text.length-(z.line-M.line)-1;t.full?Mr(e):M.line==z.line&&t.text.length==1&&!Ds(e.doc,t)?Ti(e,M.line,"text"):Mr(e,M.line,z.line+1,te);var pe=me(e,"changes"),ye=me(e,"change");if(ye||pe){var Me={from:M,to:z,text:t.text,removed:t.removed,origin:t.origin};ye&&br(e,"change",e,Me),pe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Me)}e.display.selForContextMenu=null}function rn(e,t,n,i,d){var M;i||(i=n),Ct(i,n)<0&&(M=[i,n],n=M[0],i=M[1]),typeof t=="string"&&(t=e.splitLines(t)),tn(e,{from:n,to:i,text:t,origin:d})}function Js(e,t,n,i){n<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function Qs(e,t,n,i){for(var d=0;d<e.length;++d){var M=e[d],z=!0;if(M.ranges){M.copied||(M=e[d]=M.deepCopy(),M.copied=!0);for(var Q=0;Q<M.ranges.length;Q++)Js(M.ranges[Q].anchor,t,n,i),Js(M.ranges[Q].head,t,n,i);continue}for(var q=0;q<M.changes.length;++q){var te=M.changes[q];if(n<te.from.line)te.from=$e(te.from.line+i,te.from.ch),te.to=$e(te.to.line+i,te.to.ch);else if(t<=te.to.line){z=!1;break}}z||(e.splice(0,d+1),d=0)}}function Zs(e,t){var n=t.from.line,i=t.to.line,d=t.text.length-(i-n)-1;Qs(e.done,n,i,d),Qs(e.undone,n,i,d)}function Rn(e,t,n,i){var d=t,M=t;return typeof t=="number"?M=dt(e,Y(e,t)):d=Rt(t),d==null?null:(i(M,d)&&e.cm&&Ti(e.cm,d,n),M)}function On(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}On.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,i=e+t;n<i;++n){var d=this.lines[n];this.height-=d.height,gt(d),br(d,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,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,n){for(var i=e+t;e<i;++e)if(n(this.lines[e]))return!0}};function Ln(e){this.children=e;for(var t=0,n=0,i=0;i<e.length;++i){var d=e[i];t+=d.chunkSize(),n+=d.height,d.parent=this}this.size=t,this.height=n,this.parent=null}Ln.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var i=this.children[n],d=i.chunkSize();if(e<d){var M=Math.min(t,d-e),z=i.height;if(i.removeInner(e,M),this.height-=z-i.height,d==M&&(this.children.splice(n--,1),i.parent=null),(t-=M)==0)break;e=0}else e-=d}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof On))){var Q=[];this.collapse(Q),this.children=[new On(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,n){this.size+=t.length,this.height+=n;for(var i=0;i<this.children.length;++i){var d=this.children[i],M=d.chunkSize();if(e<=M){if(d.insertInner(e,t,n),d.lines&&d.lines.length>50){for(var z=d.lines.length%25+25,Q=z;Q<d.lines.length;){var q=new On(d.lines.slice(Q,Q+=25));d.height-=q.height,this.children.splice(++i,0,q),q.parent=this}d.lines=d.lines.slice(0,z),this.maybeSpill()}break}e-=M}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Ln(t);if(e.parent){e.size-=n.size,e.height-=n.height;var d=ie(e.parent.children,e);e.parent.children.splice(d+1,0,n)}else{var i=new Ln(e.children);i.parent=e,e.children=[i,n],e=i}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,n){for(var i=0;i<this.children.length;++i){var d=this.children[i],M=d.chunkSize();if(e<M){var z=Math.min(t,M-e);if(d.iterN(e,z,n))return!0;if((t-=z)==0)break;e=0}else e-=M}}};var In=function(e,t,n){if(n)for(var i in n)n.hasOwnProperty(i)&&(this[i]=n[i]);this.doc=e,this.node=t};In.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,i=Rt(n);if(i==null||!t)return;for(var d=0;d<t.length;++d)t[d]==this&&t.splice(d--,1);t.length||(n.widgets=null);var M=vn(this);Jt(n,Math.max(0,n.height-M)),e&&(Wr(e,function(){qs(e,n,-M),Ti(e,i,"widget")}),br(e,"lineWidgetCleared",e,this,i))},In.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,i=this.line;this.height=null;var d=vn(this)-t;if(!d)return;ni(this.doc,i)||Jt(i,i.height+d),n&&Wr(n,function(){n.curOp.forceUpdate=!0,qs(n,i,d),br(n,"lineWidgetChanged",n,e,Rt(i))})},be(In);function qs(e,t,n){qr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Sa(e,n)}function El(e,t,n,i){var d=new In(e,n,i),M=e.cm;return M&&d.noHScroll&&(M.display.alignWidgets=!0),Rn(e,t,"widget",function(z){var Q=z.widgets||(z.widgets=[]);if(d.insertAt==null?Q.push(d):Q.splice(Math.min(Q.length-1,Math.max(0,d.insertAt)),0,d),d.line=z,M&&!ni(e,z)){var q=qr(z)<e.scrollTop;Jt(z,z.height+vn(d)),q&&Sa(M,d.height),M.curOp.forceUpdate=!0}return!0}),M&&br(M,"lineWidgetAdded",M,d,typeof t=="number"?t:Rt(t)),d}var eo=0,Ri=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++eo};Ri.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&ji(e),me(this,"clear")){var n=this.find();n&&br(this,"clear",n.from,n.to)}for(var i=null,d=null,M=0;M<this.lines.length;++M){var z=this.lines[M],Q=Hr(z.markedSpans,this);e&&!this.collapsed?Ti(e,Rt(z),"text"):e&&(Q.to!=null&&(d=Rt(z)),Q.from!=null&&(i=Rt(z))),z.markedSpans=Di(z.markedSpans,Q),Q.from==null&&this.collapsed&&!ni(this.doc,z)&&e&&Jt(z,Xi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var q=0;q<this.lines.length;++q){var te=Ar(this.lines[q]),pe=pn(te);pe>e.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=pe,e.display.maxLineChanged=!0)}i!=null&&e&&this.collapsed&&Mr(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&&br(e,"markerCleared",e,this,i,d),t&&Hi(e),this.parent&&this.parent.clear()},Ri.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,i,d=0;d<this.lines.length;++d){var M=this.lines[d],z=Hr(M.markedSpans,this);if(z.from!=null&&(n=$e(t?M:Rt(M),z.from),e==-1))return n;if(z.to!=null&&(i=$e(t?M:Rt(M),z.to),e==1))return i}return n&&{from:n,to:i}},Ri.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,i=this.doc.cm;if(!t||!i)return;Wr(i,function(){var d=t.line,M=Rt(t.line),z=fa(i,M);if(z&&(ns(z),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!ni(n.doc,d)&&n.height!=null){var Q=n.height;n.height=null;var q=vn(n)-Q;q&&Jt(d,d.height+q)}br(i,"markerChanged",i,e)})},Ri.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ie(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ri.prototype.detachLine=function(e){if(this.lines.splice(ie(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},be(Ri);function nn(e,t,n,i,d){if(i&&i.shared)return xl(e,t,n,i,d);if(e.cm&&!e.cm.curOp)return pr(e.cm,nn)(e,t,n,i,d);var M=new Ri(e,d),z=Ct(t,n);if(i&&g(i,M,!1),z>0||z==0&&M.clearWhenEmpty!==!1)return M;if(M.replacedWith&&(M.collapsed=!0,M.widgetNode=w("span",[M.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||M.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(M.widgetNode.insertLeft=!0)),M.collapsed){if(fr(e,t.line,t,n,M)||t.line!=n.line&&fr(e,n.line,t,n,M))throw new Error("Inserting collapsed marker partially overlapping an existing one");li()}M.addToHistory&&Ns(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var Q=t.line,q=e.cm,te;if(e.iter(Q,n.line+1,function(ye){q&&M.collapsed&&!q.options.lineWrapping&&Ar(ye)==q.display.maxLine&&(te=!0),M.collapsed&&Q!=t.line&&Jt(ye,0),yi(ye,new ui(M,Q==t.line?t.ch:null,Q==n.line?n.ch:null)),++Q}),M.collapsed&&e.iter(t.line,n.line+1,function(ye){ni(e,ye)&&Jt(ye,0)}),M.clearOnEnter&&Be(M,"beforeCursorEnter",function(){return M.clear()}),M.readOnly&&(zr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),M.collapsed&&(M.id=++eo,M.atomic=!0),q){if(te&&(q.curOp.updateMaxLine=!0),M.collapsed)Mr(q,t.line,n.line+1);else if(M.className||M.startStyle||M.endStyle||M.css||M.attributes||M.title)for(var pe=t.line;pe<=n.line;pe++)Ti(q,pe,"text");M.atomic&&Gs(q.doc),br(q,"markerAdded",q,M)}return M}var Dn=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};Dn.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();br(this,"clear")},Dn.prototype.find=function(e,t){return this.primary.find(e,t)},be(Dn);function xl(e,t,n,i,d){i=g(i),i.shared=!1;var M=[nn(e,t,n,i,d)],z=M[0],Q=i.widgetNode;return Ai(e,function(q){Q&&(i.widgetNode=Q.cloneNode(!0)),M.push(nn(q,x(q,t),x(q,n),i,d));for(var te=0;te<q.linked.length;++te)if(q.linked[te].isParent)return;z=re(M)}),new Dn(M,z)}function to(e){return e.findMarks($e(e.first,0),e.clipPos($e(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var n=0;n<t.length;n++){var i=t[n],d=i.find(),M=e.clipPos(d.from),z=e.clipPos(d.to);if(Ct(M,z)){var Q=nn(e,M,z,i.primary,i.primary.type);i.markers.push(Q),Q.parent=i}}}function wl(e){for(var t=function(i){var d=e[i],M=[d.primary.doc];Ai(d.primary.doc,function(q){return M.push(q)});for(var z=0;z<d.markers.length;z++){var Q=d.markers[z];ie(M,Q.doc)==-1&&(Q.parent=null,d.markers.splice(z--,1))}},n=0;n<e.length;n++)t(n)}var Sl=0,Pr=function(e,t,n,i,d){if(!(this instanceof Pr))return new Pr(e,t,n,i,d);n==null&&(n=0),Ln.call(this,[new On([new ki("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var M=$e(n,0);this.sel=Si(M),this.history=new Jn(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:M,to:M,text:e}),wr(this,Si(M),ve)};Pr.prototype=Ne(Ln.prototype,{constructor:Pr,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,i=0;i<t.length;++i)n+=t[i].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Vt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:mr(function(e){var t=$e(this.first,0),n=this.first+this.size-1;tn(this,{from:t,to:$e(n,dt(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&_n(this.cm,0,0),wr(this,Si(t),ve)}),replaceRange:function(e,t,n,i){t=x(this,t),n=n?x(this,n):t,rn(this,e,t,n,i)},getRange:function(e,t,n){var i=Ur(this,x(this,e),x(this,t));return n===!1?i:i.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Ir(this,e))return dt(this,e)},getLineNumber:function(e){return Rt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=dt(this,e)),Ar(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return x(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:mr(function(e,t,n){js(this,x(this,typeof e=="number"?$e(e,t||0):e),null,n)}),setSelection:mr(function(e,t,n){js(this,x(this,e),x(this,t||e),n)}),extendSelection:mr(function(e,t,n){Zn(this,x(this,e),t&&x(this,t),n)}),extendSelections:mr(function(e,t){Us(this,W(this,e),t)}),extendSelectionsBy:mr(function(e,t){var n=fe(this.sel.ranges,e);Us(this,W(this,n),t)}),setSelections:mr(function(e,t,n){if(!e.length)return;for(var i=[],d=0;d<e.length;d++)i[d]=new Gt(x(this,e[d].anchor),x(this,e[d].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),wr(this,ti(this.cm,i,t),n)}),addSelection:mr(function(e,t,n){var i=this.sel.ranges.slice(0);i.push(new Gt(x(this,e),x(this,t||e))),wr(this,ti(this.cm,i,i.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,i=0;i<t.length;i++){var d=Ur(this,t[i].from(),t[i].to());n=n?n.concat(d):d}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,i=0;i<n.length;i++){var d=Ur(this,n[i].from(),n[i].to());e!==!1&&(d=d.join(e||this.lineSeparator())),t[i]=d}return t},replaceSelection:function(e,t,n){for(var i=[],d=0;d<this.sel.ranges.length;d++)i[d]=e;this.replaceSelections(i,t,n||"+input")},replaceSelections:mr(function(e,t,n){for(var i=[],d=this.sel,M=0;M<d.ranges.length;M++){var z=d.ranges[M];i[M]={from:z.from(),to:z.to(),text:this.splitLines(e[M]),origin:n}}for(var Q=t&&t!="end"&&dl(this,i,t),q=i.length-1;q>=0;q--)tn(this,i[q]);Q?Hs(this,Q):this.cm&&Qi(this.cm)}),undo:mr(function(){ta(this,"undo")}),redo:mr(function(){ta(this,"redo")}),undoSelection:mr(function(){ta(this,"undo",!0)}),redoSelection:mr(function(){ta(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=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||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Jn(this.history.maxGeneration),Ai(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:qi(this.history.done),undone:qi(this.history.undone)}},setHistory:function(e){var t=this.history=new Jn(this.history.maxGeneration);t.done=qi(e.done.slice(0),null,!0),t.undone=qi(e.undone.slice(0),null,!0)},setGutterMarker:mr(function(e,t,n){return Rn(this,e,"gutter",function(i){var d=i.gutterMarkers||(i.gutterMarkers={});return d[t]=n,!n&&ue(d)&&(i.gutterMarkers=null),!0})}),clearGutter:mr(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&Rn(t,n,"gutter",function(){return n.gutterMarkers[e]=null,ue(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Ir(this,e))return null;if(t=e,e=dt(this,e),!e)return null}else if(t=Rt(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:mr(function(e,t,n){return Rn(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]=n;else{if(O(n).test(i[d]))return!1;i[d]+=" "+n}return!0})}),removeLineClass:mr(function(e,t,n){return Rn(this,e,t=="gutter"?"gutter":"class",function(i){var d=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",M=i[d];if(M)if(n==null)i[d]=null;else{var z=M.match(O(n));if(!z)return!1;var Q=z.index+z[0].length;i[d]=M.slice(0,z.index)+(!z.index||Q==M.length?"":" ")+M.slice(Q)||null}else return!1;return!0})}),addLineWidget:mr(function(e,t,n){return El(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return nn(this,x(this,e),x(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=x(this,e),nn(this,e,e,n,"bookmark")},findMarksAt:function(e){e=x(this,e);var t=[],n=dt(this,e.line).markedSpans;if(n)for(var i=0;i<n.length;++i){var d=n[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,n){e=x(this,e),t=x(this,t);var i=[],d=e.line;return this.iter(e.line,t.line+1,function(M){var z=M.markedSpans;if(z)for(var Q=0;Q<z.length;Q++){var q=z[Q];!(q.to!=null&&d==e.line&&e.ch>=q.to||q.from==null&&d!=e.line||q.from!=null&&d==t.line&&q.from>=t.ch)&&(!n||n(q.marker))&&i.push(q.marker.parent||q.marker)}++d}),i},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var i=0;i<n.length;++i)n[i].from!=null&&e.push(n[i].marker)}),e},posFromIndex:function(e){var t,n=this.first,i=this.lineSeparator().length;return this.iter(function(d){var M=d.text.length+i;if(M>e)return t=e,!0;e-=M,++n}),x(this,$e(n,t))},indexFromPos:function(e){e=x(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(i){t+=i.text.length+n}),t},copy:function(e){var t=new Pr(Vt(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,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var i=new Pr(Vt(this,t,n),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 Zt&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(to(this));break}if(e.history==this.history){var i=[e.id];Ai(e,function(d){return i.push(d.id)},!0),e.history=new Jn(null),e.history.done=qi(this.history.done,i),e.history.undone=qi(this.history.undone,i)}},iterLinkedDocs:function(e){Ai(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):St(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:mr(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)})}),Pr.prototype.eachLine=Pr.prototype.iter;var ro=0;function Cl(e){var t=this;if(io(t),He(t,e)||ci(t.display,e))return;ae(e),K&&(ro=+new Date);var n=Ni(t,e,!0),i=e.dataTransfer.files;if(!n||t.isReadOnly())return;if(i&&i.length&&window.FileReader&&window.File)for(var d=i.length,M=Array(d),z=0,Q=function(){++z==d&&pr(t,function(){n=x(t.doc,n);var De={from:n,to:n,text:t.doc.splitLines(M.filter(function(We){return We!=null}).join(t.doc.lineSeparator())),origin:"paste"};tn(t.doc,De),Hs(t.doc,Si(x(t.doc,n),x(t.doc,Ci(De))))})()},q=function(De,We){if(t.options.allowDropFileTypes&&ie(t.options.allowDropFileTypes,De.type)==-1){Q();return}var Ye=new FileReader;Ye.onerror=function(){return Q()},Ye.onload=function(){var Ze=Ye.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ze)){Q();return}M[We]=Ze,Q()},Ye.readAsText(De)},te=0;te<i.length;te++)q(i[te],te);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var pe=e.dataTransfer.getData("Text");if(pe){var ye;if(t.state.draggingText&&!t.state.draggingText.copy&&(ye=t.listSelections()),qn(t.doc,Si(n,n)),ye)for(var Me=0;Me<ye.length;++Me)rn(t.doc,"",ye[Me].anchor,ye[Me].head,"drag");t.replaceSelection(pe,"around","paste"),t.display.input.focus()}}catch(De){}}}function Al(e,t){if(K&&(!e.state.draggingText||+new Date-ro<100)){ge(t);return}if(He(e,t)||ci(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p){var n=c("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",m&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),m&&n.parentNode.removeChild(n)}}function Rl(e,t){var n=Ni(e,t);if(!n)return;var i=document.createDocumentFragment();ms(e,n,i),e.display.dragCursor||(e.display.dragCursor=c("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),T(e.display.dragCursor,i)}function io(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function no(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),n=[],i=0;i<t.length;i++){var d=t[i].CodeMirror;d&&n.push(d)}n.length&&n[0].operation(function(){for(var M=0;M<n.length;M++)e(n[M])})}var ao=!1;function Ol(){if(ao)return;Ll(),ao=!0}function Ll(){var e;Be(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,no(Il)},100))}),Be(window,"blur",function(){return no(Ji)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Oi={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"},kn=0;kn<10;kn++)Oi[kn+48]=Oi[kn+96]=String(kn);for(var ra=65;ra<=90;ra++)Oi[ra]=String.fromCharCode(ra);for(var Mn=1;Mn<=12;Mn++)Oi[Mn+111]=Oi[Mn+63235]="F"+Mn;var di={};di.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"},di.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"},di.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"},di.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"]},di.default=a?di.macDefault:di.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,i,d,M,z=0;z<t.length-1;z++){var Q=t[z];if(/^(cmd|meta|m)$/i.test(Q))M=!0;else if(/^a(lt)?$/i.test(Q))n=!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 n&&(e="Alt-"+e),i&&(e="Ctrl-"+e),M&&(e="Cmd-"+e),d&&(e="Shift-"+e),e}function kl(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var i=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(i=="..."){delete e[n];continue}for(var d=fe(n.split(" "),Dl),M=0;M<d.length;M++){var z=void 0,Q=void 0;M==d.length-1?(Q=d.join(" "),z=i):(Q=d.slice(0,M+1).join(" "),z="...");var q=t[Q];if(!q)t[Q]=z;else if(q!=z)throw new Error("Inconsistent bindings for "+Q)}delete e[n]}for(var te in t)e[te]=t[te];return e}function an(e,t,n,i){t=ia(t);var d=t.call?t.call(e,i):t[e];if(d===!1)return"nothing";if(d==="...")return"multi";if(d!=null&&n(d))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return an(e,t.fallthrough,n,i);for(var M=0;M<t.fallthrough.length;M++){var z=an(e,t.fallthrough[M],n,i);if(z)return z}}}function so(e){var t=typeof e=="string"?e:Oi[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function oo(e,t,n){var i=e;return t.altKey&&i!="Alt"&&(e="Alt-"+e),(C?t.metaKey:t.ctrlKey)&&i!="Ctrl"&&(e="Ctrl-"+e),(C?t.ctrlKey:t.metaKey)&&i!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&i!="Shift"&&(e="Shift-"+e),e}function lo(e,t){if(m&&e.keyCode==34&&e.char)return!1;var n=Oi[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),oo(n,e,t))}function ia(e){return typeof e=="string"?di[e]:e}function sn(e,t){for(var n=e.doc.sel.ranges,i=[],d=0;d<n.length;d++){for(var M=t(n[d]);i.length&&Ct(M.from,re(i).to)<=0;){var z=i.pop();if(Ct(z.from,M.from)<0){M.from=z.from;break}}i.push(M)}Wr(e,function(){for(var Q=i.length-1;Q>=0;Q--)rn(e.doc,"",i[Q].from,i[Q].to,"+delete");Qi(e)})}function Fa(e,t,n){var i=Ie(e.text,t+n,n);return i<0||i>e.text.length?null:i}function Ba(e,t,n){var i=Fa(e,t.ch,n);return i==null?null:new $e(t.line,i,n<0?"after":"before")}function Ua(e,t,n,i,d){if(e){t.doc.direction=="rtl"&&(d=-d);var M=qe(n,t.doc.direction);if(M){var z=d<0?re(M):M[0],Q=d<0==(z.level==1),q=Q?"after":"before",te;if(z.level>0||t.doc.direction=="rtl"){var pe=Yi(t,n);te=d<0?n.text.length-1:0;var ye=si(t,pe,te).top;te=Ge(function(Me){return si(t,pe,Me).top==ye},d<0==(z.level==1)?z.from:z.to-1,te),q=="before"&&(te=Fa(n,te,1))}else te=d<0?z.to:z.from;return new $e(i,te,q)}}return new $e(i,d<0?n.text.length:0,d<0?"before":"after")}function Ml(e,t,n,i){var d=qe(t,e.doc.direction);if(!d)return Ba(t,n,i);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var M=Qe(d,n.ch,n.sticky),z=d[M];if(e.doc.direction=="ltr"&&z.level%2==0&&(i>0?z.to>n.ch:z.from<n.ch))return Ba(t,n,i);var Q=function(rt,lt){return Fa(t,rt instanceof $e?rt.ch:rt,lt)},q,te=function(rt){return e.options.lineWrapping?(q=q||Yi(e,t),cs(e,t,q,rt)):{begin:0,end:t.text.length}},pe=te(n.sticky=="before"?Q(n,-1):n.ch);if(e.doc.direction=="rtl"||z.level==1){var ye=z.level==1==i<0,Me=Q(n,ye?1:-1);if(Me!=null&&(ye?Me<=z.to&&Me<=pe.end:Me>=z.from&&Me>=pe.begin)){var De=ye?"before":"after";return new $e(n.line,Me,De)}}var We=function(rt,lt,it){for(var ht=function(Xt,gr){return gr?new $e(n.line,Q(Xt,1),"before"):new $e(n.line,Xt,"after")};rt>=0&&rt<d.length;rt+=lt){var Tt=d[rt],vt=lt>0==(Tt.level!=1),Ot=vt?it.begin:Q(it.end,-1);if(Tt.from<=Ot&&Ot<Tt.to)return ht(Ot,vt);if(Ot=vt?Tt.from:Q(Tt.to,-1),it.begin<=Ot&&Ot<it.end)return ht(Ot,vt)}},Ye=We(M+i,i,pe);if(Ye)return Ye;var Ze=i>0?pe.end:Q(pe.begin,-1);return Ze!=null&&!(i>0&&Ze==t.text.length)&&(Ye=We(i>0?0:d.length-1,i,te(Ze)),Ye)?Ye:null}var Pn={selectAll:Vs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ve)},killLine:function(e){return sn(e,function(t){if(t.empty()){var n=dt(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:$e(t.head.line+1,0)}:{from:t.head,to:$e(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return sn(e,function(t){return{from:$e(t.from().line,0),to:x(e.doc,$e(t.to().line+1,0))}})},delLineLeft:function(e){return sn(e,function(t){return{from:$e(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return sn(e,function(t){var n=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:n},"div");return{from:i,to:t.from()}})},delWrappedLineRight:function(e){return sn(e,function(t){var n=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"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($e(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection($e(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 n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},Ae)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},Ae)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:n},"div");return i.ch<e.getLine(i.line).search(/\S/)?ho(e,t.head):i},Ae)},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=[],n=e.listSelections(),i=e.options.tabSize,d=0;d<n.length;d++){var M=n[d].from(),z=H(e.getLine(M.line),M.ch,i);t.push(ce(i-z%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Wr(e,function(){for(var t=e.listSelections(),n=[],i=0;i<t.length;i++){if(!t[i].empty())continue;var d=t[i].head,M=dt(e.doc,d.line).text;if(M){if(d.ch==M.length&&(d=new $e(d.line,d.ch-1)),d.ch>0)d=new $e(d.line,d.ch+1),e.replaceRange(M.charAt(d.ch-1)+M.charAt(d.ch-2),$e(d.line,d.ch-2),d,"+transpose");else if(d.line>e.doc.first){var z=dt(e.doc,d.line-1).text;z&&(d=new $e(d.line,1),e.replaceRange(M.charAt(0)+e.doc.lineSeparator()+z.charAt(z.length-1),$e(d.line-1,z.length-1),d,"+transpose"))}}n.push(new Gt(d,d))}e.setSelections(n)})},newlineAndIndent:function(e){return Wr(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var i=0;i<t.length;i++)e.indentLine(t[i].from().line,null,!0);Qi(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function uo(e,t){var n=dt(e.doc,t),i=Ar(n);return i!=n&&(t=Rt(i)),Ua(!0,e,i,t,1)}function Pl(e,t){var n=dt(e.doc,t),i=Vi(n);return i!=n&&(t=Rt(i)),Ua(!0,e,n,t,-1)}function ho(e,t){var n=uo(e,t.line),i=dt(e.doc,n.line),d=qe(i,e.doc.direction);if(!d||d[0].level==0){var M=Math.max(n.ch,i.text.search(/\S/)),z=t.line==n.line&&t.ch<=M&&t.ch;return $e(n.line,z?0:M,n.sticky)}return n}function na(e,t,n){if(typeof t=="string"&&(t=Pn[t],!t))return!1;e.display.input.ensurePolled();var i=e.display.shift,d=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),d=t(e)!=Ce}finally{e.display.shift=i,e.state.suppressEdits=!1}return d}function Nl(e,t,n){for(var i=0;i<e.state.keyMaps.length;i++){var d=an(t,e.state.keyMaps[i],n,e);if(d)return d}return e.options.extraKeys&&an(t,e.options.extraKeys,n,e)||an(t,e.options.keyMap,n,e)}var Fl=new $;function Nn(e,t,n,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,n,i))return!0}return co(e,t,n,i)}function co(e,t,n,i){var d=Nl(e,t,i);return d=="multi"&&(e.state.keySeq=t),d=="handled"&&br(e,"keyHandled",e,t,n),(d=="handled"||d=="multi")&&(ae(n),xa(e)),!!d}function fo(e,t){var n=lo(t,!0);return n?t.shiftKey&&!e.state.keySeq?Nn(e,"Shift-"+n,t,function(i){return na(e,i,!0)})||Nn(e,n,t,function(i){if(typeof i=="string"?/^go[A-Z]/.test(i):i.motion)return na(e,i)}):Nn(e,n,t,function(i){return na(e,i)}):!1}function Bl(e,t,n){return Nn(e,"'"+n+"'",t,function(i){return na(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=U(),He(t,e))return;K&&G<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var i=fo(t,e);m&&(ja=i?n:null,!i&&n==88&&!Ut&&(a?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),P&&!a&&!i&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Ul(t)}function Ul(e){var t=e.display.lineDiv;F(t,"CodeMirror-crosshair");function n(i){(i.keyCode==18||!i.altKey)&&(A(t,"CodeMirror-crosshair"),ot(document,"keyup",n),ot(document,"mouseover",n))}Be(document,"keyup",n),Be(document,"mouseover",n)}function mo(e){e.keyCode==16&&(this.doc.sel.shift=!1),He(this,e)}function go(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(ci(t.display,e)||He(t,e)||e.ctrlKey&&!e.altKey||a&&e.metaKey)return;var n=e.keyCode,i=e.charCode;if(m&&n==ja){ja=null,ae(e);return}if(m&&(!e.which||e.which<10)&&fo(t,e))return;var d=String.fromCharCode(i==null?n:i);if(d=="\b")return;if(Bl(t,e,d))return;t.display.input.onKeyPress(e)}var jl=400,Ha=function(e,t,n){this.time=e,this.pos=t,this.button=n};Ha.prototype.compare=function(e,t,n){return this.time+jl>e&&Ct(t,this.pos)==0&&n==this.button};var Fn,Bn;function Hl(e,t){var n=+new Date;return Bn&&Bn.compare(n,e,t)?(Fn=Bn=null,"triple"):Fn&&Fn.compare(n,e,t)?(Bn=new Ha(n,e,t),Fn=null,"double"):(Fn=new Ha(n,e,t),Bn=null,"single")}function vo(e){var t=this,n=t.display;if(He(t,e)||n.activeTouch&&n.input.supportsTouch())return;if(n.input.ensurePolled(),n.shift=e.shiftKey,ci(n,e)){r||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(Wa(t,e))return;var i=Ni(t,e),d=Fe(e),M=i?Hl(i,d):"single";if(window.focus(),d==1&&t.state.selectingText&&t.state.selectingText(e),i&&Wl(t,d,i,M,e))return;d==1?i?Kl(t,i,M,e):we(e)==n.scroller&&ae(e):d==2?(i&&Zn(t.doc,i),setTimeout(function(){return n.input.focus()},20)):d==3&&(D?t.display.input.onContextMenu(e):vs(t))}function Wl(e,t,n,i,d){var M="Click";return i=="double"?M="Double"+M:i=="triple"&&(M="Triple"+M),M=(t==1?"Left":t==2?"Middle":"Right")+M,Nn(e,oo(M,d),d,function(z){if(typeof z=="string"&&(z=Pn[z]),!z)return!1;var Q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Q=z(e,n)!=Ce}finally{e.state.suppressEdits=!1}return Q})}function Gl(e,t,n){var i=e.getOption("configureMouse"),d=i?i(e,t,n):{};if(d.unit==null){var M=s?n.shiftKey&&n.metaKey:n.altKey;d.unit=M?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(d.extend==null||e.doc.extend)&&(d.extend=e.doc.extend||n.shiftKey),d.addNew==null&&(d.addNew=a?n.metaKey:n.ctrlKey),d.moveOnDrag==null&&(d.moveOnDrag=!(a?n.altKey:n.ctrlKey)),d}function Kl(e,t,n,i){K?setTimeout(I(gs,e),0):e.curOp.focus=U();var d=Gl(e,n,i),M=e.doc.sel,z;e.options.dragDrop&&ze&&!e.isReadOnly()&&n=="single"&&(z=M.contains(t))>-1&&(Ct((z=M.ranges[z]).from(),t)<0||t.xRel>0)&&(Ct(z.to(),t)>0||t.xRel<0)?zl(e,i,t,d):Vl(e,i,t,d)}function zl(e,t,n,i){var d=e.display,M=!1,z=pr(e,function(te){r&&(d.scroller.draggable=!1),e.state.draggingText=!1,ot(d.wrapper.ownerDocument,"mouseup",z),ot(d.wrapper.ownerDocument,"mousemove",Q),ot(d.scroller,"dragstart",q),ot(d.scroller,"drop",z),M||(ae(te),i.addNew||Zn(e.doc,n,null,null,i.extend),r&&!p||K&&G==9?setTimeout(function(){d.wrapper.ownerDocument.body.focus({preventScroll:!0}),d.input.focus()},20):d.input.focus())}),Q=function(te){M=M||Math.abs(t.clientX-te.clientX)+Math.abs(t.clientY-te.clientY)>=10},q=function(){return M=!0};r&&(d.scroller.draggable=!0),e.state.draggingText=z,z.copy=!i.moveOnDrag,d.scroller.dragDrop&&d.scroller.dragDrop(),Be(d.wrapper.ownerDocument,"mouseup",z),Be(d.wrapper.ownerDocument,"mousemove",Q),Be(d.scroller,"dragstart",q),Be(d.scroller,"drop",z),vs(e),setTimeout(function(){return d.input.focus()},20)}function yo(e,t,n){if(n=="char")return new Gt(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Gt($e(t.line,0),x(e.doc,$e(t.line+1,0)));var i=n(e,t);return new Gt(i.from,i.to)}function Vl(e,t,n,i){var d=e.display,M=e.doc;ae(t);var z,Q,q=M.sel,te=q.ranges;if(i.addNew&&!i.extend?(Q=M.sel.contains(n),Q>-1?z=te[Q]:z=new Gt(n,n)):(z=M.sel.primary(),Q=M.sel.primIndex),i.unit=="rectangle")i.addNew||(z=new Gt(n,n)),n=Ni(e,t,!0,!0),Q=-1;else{var pe=yo(e,n,i.unit);i.extend?z=Pa(z,pe.anchor,pe.head,i.extend):z=pe}i.addNew?Q==-1?(Q=te.length,wr(M,ti(e,te.concat([z]),Q),{scroll:!1,origin:"*mouse"})):te.length>1&&te[Q].empty()&&i.unit=="char"&&!i.extend?(wr(M,ti(e,te.slice(0,Q).concat(te.slice(Q+1)),0),{scroll:!1,origin:"*mouse"}),q=M.sel):Na(M,Q,z,Se):(Q=0,wr(M,new Yr([z],0),Se),q=M.sel);var ye=n;function Me(it){if(Ct(ye,it)==0)return;if(ye=it,i.unit=="rectangle"){for(var ht=[],Tt=e.options.tabSize,vt=H(dt(M,n.line).text,n.ch,Tt),Ot=H(dt(M,it.line).text,it.ch,Tt),Xt=Math.min(vt,Ot),gr=Math.max(vt,Ot),er=Math.min(n.line,it.line),Gr=Math.min(e.lastLine(),Math.max(n.line,it.line));er<=Gr;er++){var Nr=dt(M,er).text,sr=Oe(Nr,Xt,Tt);Xt==gr?ht.push(new Gt($e(er,sr),$e(er,sr))):Nr.length>sr&&ht.push(new Gt($e(er,sr),$e(er,Oe(Nr,gr,Tt))))}ht.length||ht.push(new Gt(n,n)),wr(M,ti(e,q.ranges.slice(0,Q).concat(ht),Q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(it)}else{var Fr=z,_r=yo(e,it,i.unit),hr=Fr.anchor,or;Ct(_r.anchor,hr)>0?(or=_r.head,hr=vi(Fr.from(),_r.anchor)):(or=_r.anchor,hr=gi(Fr.to(),_r.head));var rr=q.ranges.slice(0);rr[Q]=Yl(e,new Gt(x(M,hr),or)),wr(M,ti(e,rr,Q),Se)}}var De=d.wrapper.getBoundingClientRect(),We=0;function Ye(it){var ht=++We,Tt=Ni(e,it,!0,i.unit=="rectangle");if(!Tt)return;if(Ct(Tt,ye)!=0){e.curOp.focus=U(),Me(Tt);var vt=Vn(d,M);(Tt.line>=vt.to||Tt.line<vt.from)&&setTimeout(pr(e,function(){We==ht&&Ye(it)}),150)}else{var Ot=it.clientY<De.top?-20:it.clientY>De.bottom?20:0;Ot&&setTimeout(pr(e,function(){if(We!=ht)return;d.scroller.scrollTop+=Ot,Ye(it)}),50)}}function Ze(it){e.state.selectingText=!1,We=Infinity,it&&(ae(it),d.input.focus()),ot(d.wrapper.ownerDocument,"mousemove",rt),ot(d.wrapper.ownerDocument,"mouseup",lt),M.history.lastSelOrigin=null}var rt=pr(e,function(it){it.buttons===0||!Fe(it)?Ze(it):Ye(it)}),lt=pr(e,Ze);e.state.selectingText=lt,Be(d.wrapper.ownerDocument,"mousemove",rt),Be(d.wrapper.ownerDocument,"mouseup",lt)}function Yl(e,t){var n=t.anchor,i=t.head,d=dt(e.doc,n.line);if(Ct(n,i)==0&&n.sticky==i.sticky)return t;var M=qe(d);if(!M)return t;var z=Qe(M,n.ch,n.sticky),Q=M[z];if(Q.from!=n.ch&&Q.to!=n.ch)return t;var q=z+(Q.from==n.ch==(Q.level!=1)?0:1);if(q==0||q==M.length)return t;var te;if(i.line!=n.line)te=(i.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var pe=Qe(M,i.ch,i.sticky),ye=pe-z||(i.ch-n.ch)*(Q.level==1?-1:1);pe==q-1||pe==q?te=ye<0:te=ye>0}var Me=M[q+(te?-1:0)],De=te==(Me.level==1),We=De?Me.from:Me.to,Ye=De?"after":"before";return n.ch==We&&n.sticky==Ye?t:new Gt(new $e(n.line,We,Ye),i)}function bo(e,t,n,i){var d,M;if(t.touches)d=t.touches[0].clientX,M=t.touches[0].clientY;else try{d=t.clientX,M=t.clientY}catch(Me){return!1}if(d>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&ae(t);var z=e.display,Q=z.lineDiv.getBoundingClientRect();if(M>Q.bottom||!me(e,n))return de(t);M-=Q.top-z.viewOffset;for(var q=0;q<e.display.gutterSpecs.length;++q){var te=z.gutters.childNodes[q];if(te&&te.getBoundingClientRect().right>=d){var pe=lr(e.doc,M),ye=e.display.gutterSpecs[q];return Ue(e,n,e,pe,ye.className,t),de(t)}}}function Wa(e,t){return bo(e,t,"gutterClick",!0)}function _o(e,t){if(ci(e.display,t)||Xl(e,t))return;if(He(e,t,"contextmenu"))return;D||e.display.input.onContextMenu(t)}function Xl(e,t){return me(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-"),yn(e)}var on={toString:function(){return"CodeMirror.Init"}},xo={},aa={};function $l(e){var t=e.optionHandlers;function n(i,d,M,z){e.defaults[i]=d,M&&(t[i]=z?function(Q,q,te){te!=on&&M(Q,q,te)}:M)}e.defineOption=n,e.Init=on,n("value","",function(i,d){return i.setValue(d)},!0),n("mode",null,function(i,d){i.doc.modeOption=d,Da(i)},!0),n("indentUnit",2,Da,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(i){Cn(i),yn(i),Mr(i)},!0),n("lineSeparator",null,function(i,d){if(i.doc.lineSep=d,!d)return;var M=[],z=i.doc.first;i.doc.iter(function(q){for(var te=0;;){var pe=q.text.indexOf(d,te);if(pe==-1)break;te=pe+d.length,M.push($e(z,pe))}z++});for(var Q=M.length-1;Q>=0;Q--)rn(i.doc,d,M[Q],$e(M[Q].line,M[Q].ch+d.length))}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(i,d,M){i.state.specialChars=new RegExp(d.source+(d.test(" ")?"":"| "),"g"),M!=on&&i.refresh()}),n("specialCharPlaceholder",Yt,function(i){return i.refresh()},!0),n("electricChars",!0),n("inputStyle",u?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(i,d){return i.getInputField().spellcheck=d},!0),n("autocorrect",!1,function(i,d){return i.getInputField().autocorrect=d},!0),n("autocapitalize",!1,function(i,d){return i.getInputField().autocapitalize=d},!0),n("rtlMoveVisually",!R),n("wholeLineUpdateBefore",!0),n("theme","default",function(i){Eo(i),Sn(i)},!0),n("keyMap","default",function(i,d,M){var z=ia(d),Q=M!=on&&ia(M);Q&&Q.detach&&Q.detach(i,z),z.attach&&z.attach(i,Q||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ql,!0),n("gutters",[],function(i,d){i.display.gutterSpecs=La(d,i.options.lineNumbers),Sn(i)},!0),n("fixedGutter",!0,function(i,d){i.display.gutters.style.left=d?_a(i.display)+"px":"0",i.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(i){return Zi(i)},!0),n("scrollbarStyle","native",function(i){Ts(i),Zi(i),i.display.scrollbars.setScrollTop(i.doc.scrollTop),i.display.scrollbars.setScrollLeft(i.doc.scrollLeft)},!0),n("lineNumbers",!1,function(i,d){i.display.gutterSpecs=La(i.options.gutters,d),Sn(i)},!0),n("firstLineNumber",1,Sn,!0),n("lineNumberFormatter",function(i){return i},Sn,!0),n("showCursorWhenSelecting",!1,bn,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(i,d){d=="nocursor"&&(Ji(i),i.display.input.blur()),i.display.input.readOnlyChanged(d)}),n("screenReaderLabel",null,function(i,d){d=d===""?null:d,i.display.input.screenReaderLabelChanged(d)}),n("disableInput",!1,function(i,d){d||i.display.input.reset()},!0),n("dragDrop",!0,Jl),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,bn,!0),n("singleCursorHeightPerLine",!0,bn,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Cn,!0),n("addModeClass",!1,Cn,!0),n("pollInterval",100),n("undoDepth",200,function(i,d){return i.doc.history.undoDepth=d}),n("historyEventDelay",1250),n("viewportMargin",10,function(i){return i.refresh()},!0),n("maxHighlightLength",1e4,Cn,!0),n("moveInputWithCursor",!0,function(i,d){d||i.display.input.resetPosition()}),n("tabindex",null,function(i,d){return i.display.input.getField().tabIndex=d||""}),n("autofocus",null),n("direction","ltr",function(i,d){return i.doc.setDirection(d)},!0),n("phrases",null)}function Jl(e,t,n){var i=n&&n!=on;if(!t!=!i){var d=e.display.dragFunctions,M=t?Be:ot;M(e.display.scroller,"dragstart",d.start),M(e.display.scroller,"dragenter",d.enter),M(e.display.scroller,"dragover",d.over),M(e.display.scroller,"dragleave",d.leave),M(e.display.scroller,"drop",d.drop)}}function Ql(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(A(e.display.wrapper,"CodeMirror-wrap"),jn(e)),Ea(e),Mr(e),yn(e),setTimeout(function(){return Zi(e)},100)}function Zt(e,t){var n=this;if(!(this instanceof Zt))return new Zt(e,t);this.options=t=t?g(t):{},g(xo,t,!1);var i=t.value;typeof i=="string"?i=new Pr(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var d=new Zt.inputStyles[t.inputStyle](this),M=this.display=new hl(e,i,d,t);M.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 $,keySeq:null,specialChars:null},t.autofocus&&!u&&M.input.focus(),K&&G<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Zl(this),Ol(),ji(this),this.curOp.forceUpdate=!0,ks(this,i),t.autofocus&&!u||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Ta(n)},20):Ji(this);for(var z in aa)aa.hasOwnProperty(z)&&aa[z](this,t[z],on);Cs(this),t.finishInit&&t.finishInit(this);for(var Q=0;Q<Ga.length;++Q)Ga[Q](this);Hi(this),r&&t.lineWrapping&&getComputedStyle(M.lineDiv).textRendering=="optimizelegibility"&&(M.lineDiv.style.textRendering="auto")}Zt.defaults=xo,Zt.optionHandlers=aa;function Zl(e){var t=e.display;Be(t.scroller,"mousedown",pr(e,vo)),K&&G<11?Be(t.scroller,"dblclick",pr(e,function(q){if(He(e,q))return;var te=Ni(e,q);if(!te||Wa(e,q)||ci(e.display,q))return;ae(q);var pe=e.findWordAt(te);Zn(e.doc,pe.anchor,pe.head)})):Be(t.scroller,"dblclick",function(q){return He(e,q)||ae(q)}),Be(t.scroller,"contextmenu",function(q){return _o(e,q)}),Be(t.input.getField(),"contextmenu",function(q){t.scroller.contains(q.target)||_o(e,q)});var n,i={end:0};function d(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),i=t.activeTouch,i.end=+new Date)}function M(q){if(q.touches.length!=1)return!1;var te=q.touches[0];return te.radiusX<=1&&te.radiusY<=1}function z(q,te){if(te.left==null)return!0;var pe=te.left-q.left,ye=te.top-q.top;return pe*pe+ye*ye>20*20}Be(t.scroller,"touchstart",function(q){if(!He(e,q)&&!M(q)&&!Wa(e,q)){t.input.ensurePolled(),clearTimeout(n);var te=+new Date;t.activeTouch={start:te,moved:!1,prev:te-i.end<=300?i:null},q.touches.length==1&&(t.activeTouch.left=q.touches[0].pageX,t.activeTouch.top=q.touches[0].pageY)}}),Be(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Be(t.scroller,"touchend",function(q){var te=t.activeTouch;if(te&&!ci(t,q)&&te.left!=null&&!te.moved&&new Date-te.start<300){var pe=e.coordsChar(t.activeTouch,"page"),ye;!te.prev||z(te,te.prev)?ye=new Gt(pe,pe):!te.prev.prev||z(te,te.prev.prev)?ye=e.findWordAt(pe):ye=new Gt($e(pe.line,0),x(e.doc,$e(pe.line+1,0))),e.setSelection(ye.anchor,ye.head),e.focus(),ae(q)}d()}),Be(t.scroller,"touchcancel",d),Be(t.scroller,"scroll",function(){t.scroller.clientHeight&&(En(e,t.scroller.scrollTop),Bi(e,t.scroller.scrollLeft,!0),Ue(e,"scroll",e))}),Be(t.scroller,"mousewheel",function(q){return Os(e,q)}),Be(t.scroller,"DOMMouseScroll",function(q){return Os(e,q)}),Be(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(q){He(e,q)||ge(q)},over:function(q){He(e,q)||(Rl(e,q),ge(q))},start:function(q){return Al(e,q)},drop:pr(e,Cl),leave:function(q){He(e,q)||io(e)}};var Q=t.input.getField();Be(Q,"keyup",function(q){return mo.call(e,q)}),Be(Q,"keydown",pr(e,po)),Be(Q,"keypress",pr(e,go)),Be(Q,"focus",function(q){return Ta(e,q)}),Be(Q,"blur",function(q){return Ji(e,q)})}var Ga=[];Zt.defineInitHook=function(e){return Ga.push(e)};function Un(e,t,n,i){var d=e.doc,M;n==null&&(n="add"),n=="smart"&&(d.mode.indent?M=et(e,t).state:n="prev");var z=e.options.tabSize,Q=dt(d,t),q=H(Q.text,null,z);Q.stateAfter&&(Q.stateAfter=null);var te=Q.text.match(/^\s*/)[0],pe;if(!i&&!/\S/.test(Q.text))pe=0,n="not";else if(n=="smart"&&(pe=d.mode.indent(M,Q.text.slice(te.length),Q.text),pe==Ce||pe>150)){if(!i)return;n="prev"}n=="prev"?t>d.first?pe=H(dt(d,t-1).text,null,z):pe=0:n=="add"?pe=q+e.options.indentUnit:n=="subtract"?pe=q-e.options.indentUnit:typeof n=="number"&&(pe=q+n),pe=Math.max(0,pe);var ye="",Me=0;if(e.options.indentWithTabs)for(var De=Math.floor(pe/z);De;--De)Me+=z,ye+=" ";if(Me<pe&&(ye+=ce(pe-Me)),ye!=te)return rn(d,ye,$e(t,0),$e(t,te.length),"+input"),Q.stateAfter=null,!0;for(var We=0;We<d.sel.ranges.length;We++){var Ye=d.sel.ranges[We];if(Ye.head.line==t&&Ye.head.ch<te.length){var Ze=$e(t,te.length);Na(d,We,new Gt(Ze,Ze));break}}}var ri=null;function sa(e){ri=e}function Ka(e,t,n,i,d){var M=e.doc;e.display.shift=!1,i||(i=M.sel);var z=+new Date-200,Q=d=="paste"||e.state.pasteIncoming>z,q=St(t),te=null;if(Q&&i.ranges.length>1)if(ri&&ri.text.join(`
`)==t){if(i.ranges.length%ri.text.length==0){te=[];for(var pe=0;pe<ri.text.length;pe++)te.push(M.splitLines(ri.text[pe]))}}else q.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(te=fe(q,function(rt){return[rt]}));for(var ye=e.curOp.updateInput,Me=i.ranges.length-1;Me>=0;Me--){var De=i.ranges[Me],We=De.from(),Ye=De.to();De.empty()&&(n&&n>0?We=$e(We.line,We.ch-n):e.state.overwrite&&!Q?Ye=$e(Ye.line,Math.min(dt(M,Ye.line).text.length,Ye.ch+re(q).length)):Q&&ri&&ri.lineWise&&ri.text.join(`
`)==q.join(`
`)&&(We=Ye=$e(We.line,0)));var Ze={from:We,to:Ye,text:te?te[Me%te.length]:q,origin:d||(Q?"paste":e.state.cutIncoming>z?"cut":"+input")};tn(e.doc,Ze),br(e,"inputRead",e,Ze)}t&&!Q&&wo(e,t),Qi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=ye),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function To(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Wr(t,function(){return Ka(t,n,0,null,"paste")}),!0}function wo(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var n=e.doc.sel,i=n.ranges.length-1;i>=0;i--){var d=n.ranges[i];if(d.head.ch>100||i&&n.ranges[i-1].head.line==d.head.line)continue;var M=e.getModeAt(d.head),z=!1;if(M.electricChars){for(var Q=0;Q<M.electricChars.length;Q++)if(t.indexOf(M.electricChars.charAt(Q))>-1){z=Un(e,d.head.line,"smart");break}}else M.electricInput&&(M.electricInput.test(dt(e.doc,d.head.line).text.slice(0,d.head.ch))&&(z=Un(e,d.head.line,"smart")));z&&br(e,"electricInput",e,d.head.line)}}function So(e){for(var t=[],n=[],i=0;i<e.doc.sel.ranges.length;i++){var d=e.doc.sel.ranges[i].head.line,M={anchor:$e(d,0),head:$e(d+1,0)};n.push(M),t.push(e.getRange(M.anchor,M.head))}return{text:t,ranges:n}}function Co(e,t,n,i){e.setAttribute("autocorrect",n?"":"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 r?e.style.width="1000px":e.setAttribute("wrap","off"),f&&(e.style.border="1px solid black"),Co(e),t}function ql(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(i,d){var M=this.options,z=M[i];if(M[i]==d&&i!="mode")return;M[i]=d,t.hasOwnProperty(i)&&pr(this,t[i])(this,d,z),Ue(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"](ia(i))},removeKeyMap:function(i){for(var d=this.state.keyMaps,M=0;M<d.length;++M)if(d[M]==i||d[M].name==i)return d.splice(M,1),!0},addOverlay:Rr(function(i,d){var M=i.token?i:e.getMode(this.options,i);if(M.startState)throw new Error("Overlays may not be stateful.");se(this.state.overlays,{mode:M,modeSpec:i,opaque:d&&d.opaque,priority:d&&d.priority||0},function(z){return z.priority}),this.state.modeGen++,Mr(this)}),removeOverlay:Rr(function(i){for(var d=this.state.overlays,M=0;M<d.length;++M){var z=d[M].modeSpec;if(z==i||typeof i=="string"&&z.name==i){d.splice(M,1),this.state.modeGen++,Mr(this);return}}}),indentLine:Rr(function(i,d,M){typeof d!="string"&&typeof d!="number"&&(d==null?d=this.options.smartIndent?"smart":"prev":d=d?"add":"subtract"),Ir(this.doc,i)&&Un(this,i,d,M)}),indentSelection:Rr(function(i){for(var d=this.doc.sel.ranges,M=-1,z=0;z<d.length;z++){var Q=d[z];if(Q.empty())Q.head.line>M&&(Un(this,Q.head.line,i,!0),M=Q.head.line,z==this.doc.sel.primIndex&&Qi(this));else{var q=Q.from(),te=Q.to(),pe=Math.max(M,q.line);M=Math.min(this.lastLine(),te.line-(te.ch?0:1))+1;for(var ye=pe;ye<M;++ye)Un(this,ye,i);var Me=this.doc.sel.ranges;q.ch==0&&d.length==Me.length&&Me[z].from().ch>0&&Na(this.doc,z,new Gt(q,Me[z].to()),ve)}}}),getTokenAt:function(i,d){return $t(this,i,d)},getLineTokens:function(i,d){return $t(this,$e(i),d,!0)},getTokenTypeAt:function(i){i=x(this.doc,i);var d=Ke(this,dt(this.doc,i.line)),M=0,z=(d.length-1)/2,Q=i.ch,q;if(Q==0)q=d[2];else for(;;){var te=M+z>>1;if((te?d[te*2-1]:0)>=Q)z=te;else if(d[te*2+1]<Q)M=te+1;else{q=d[te*2+2];break}}var pe=q?q.indexOf("overlay "):-1;return pe<0?q:pe==0?null:q.slice(0,pe-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 M=[];if(!n.hasOwnProperty(d))return M;var z=n[d],Q=this.getModeAt(i);if(typeof Q[d]=="string")z[Q[d]]&&M.push(z[Q[d]]);else if(Q[d])for(var q=0;q<Q[d].length;q++){var te=z[Q[d][q]];te&&M.push(te)}else Q.helperType&&z[Q.helperType]?M.push(z[Q.helperType]):z[Q.name]&&M.push(z[Q.name]);for(var pe=0;pe<z._global.length;pe++){var ye=z._global[pe];ye.pred(Q,this)&&ie(M,ye.val)==-1&&M.push(ye.val)}return M},getStateAfter:function(i,d){var M=this.doc;return i=Y(M,i==null?M.first+M.size-1:i),et(this,i+1,d).state},cursorCoords:function(i,d){var M,z=this.doc.sel.primary();return i==null?M=z.head:typeof i=="object"?M=x(this.doc,i):M=i?z.from():z.to(),ei(this,M,d||"page")},charCoords:function(i,d){return ma(this,x(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,lr(this.doc,i+this.display.viewOffset)},heightAtLine:function(i,d,M){var z=!1,Q;if(typeof i=="number"){var q=this.doc.first+this.doc.size-1;i<this.doc.first?i=this.doc.first:i>q&&(i=q,z=!0),Q=dt(this.doc,i)}else Q=i;return Wn(this,Q,{top:0,left:0},d||"page",M||z).top+(z?this.doc.height-qr(Q):0)},defaultTextHeight:function(){return Xi(this.display)},defaultCharWidth:function(){return $i(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(i,d,M,z,Q){var q=this.display;i=ei(this,x(this.doc,i));var te=i.bottom,pe=i.left;if(d.style.position="absolute",d.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(d),q.sizer.appendChild(d),z=="over")te=i.top;else if(z=="above"||z=="near"){var ye=Math.max(q.wrapper.clientHeight,this.doc.height),Me=Math.max(q.sizer.clientWidth,q.lineSpace.clientWidth);(z=="above"||i.bottom+d.offsetHeight>ye)&&i.top>d.offsetHeight?te=i.top-d.offsetHeight:i.bottom+d.offsetHeight<=ye&&(te=i.bottom),pe+d.offsetWidth>Me&&(pe=Me-d.offsetWidth)}d.style.top=te+"px",d.style.left=d.style.right="",Q=="right"?(pe=q.sizer.clientWidth-d.offsetWidth,d.style.right="0px"):(Q=="left"?pe=0:Q=="middle"&&(pe=(q.sizer.clientWidth-d.offsetWidth)/2),d.style.left=pe+"px"),M&&Jo(this,{left:pe,top:te,right:pe+d.offsetWidth,bottom:te+d.offsetHeight})},triggerOnKeyDown:Rr(po),triggerOnKeyPress:Rr(go),triggerOnKeyUp:mo,triggerOnMouseDown:Rr(vo),execCommand:function(i){if(Pn.hasOwnProperty(i))return Pn[i].call(null,this)},triggerElectric:Rr(function(i){wo(this,i)}),findPosH:function(i,d,M,z){var Q=1;d<0&&(Q=-1,d=-d);for(var q=x(this.doc,i),te=0;te<d&&!(q=za(this.doc,q,Q,M,z),q.hitSide);++te);return q},moveH:Rr(function(i,d){var M=this;this.extendSelectionsBy(function(z){return M.display.shift||M.doc.extend||z.empty()?za(M.doc,z.head,i,d,M.options.rtlMoveVisually):i<0?z.from():z.to()},Ae)}),deleteH:Rr(function(i,d){var M=this.doc.sel,z=this.doc;M.somethingSelected()?z.replaceSelection("",null,"+delete"):sn(this,function(Q){var q=za(z,Q.head,i,d,!1);return i<0?{from:q,to:Q.head}:{from:Q.head,to:q}})}),findPosV:function(i,d,M,z){var Q=1,q=z;d<0&&(Q=-1,d=-d);for(var te=x(this.doc,i),pe=0;pe<d;++pe){var ye=ei(this,te,"div");if(q==null?q=ye.left:ye.left=q,te=Ro(this,ye,Q,M),te.hitSide)break}return te},moveV:Rr(function(i,d){var M=this,z=this.doc,Q=[],q=!this.display.shift&&!z.extend&&z.sel.somethingSelected();if(z.extendSelectionsBy(function(pe){if(q)return i<0?pe.from():pe.to();var ye=ei(M,pe.head,"div");pe.goalColumn!=null&&(ye.left=pe.goalColumn),Q.push(ye.left);var Me=Ro(M,ye,i,d);return d=="page"&&pe==z.sel.primary()&&Sa(M,ma(M,Me,"div").top-ye.top),Me},Ae),Q.length)for(var te=0;te<z.sel.ranges.length;te++)z.sel.ranges[te].goalColumn=Q[te]}),findWordAt:function(i){var d=this.doc,M=dt(d,i.line).text,z=i.ch,Q=i.ch;if(M){var q=this.getHelper(i,"wordChars");(i.sticky=="before"||Q==M.length)&&z?--z:++Q;for(var te=M.charAt(z),pe=je(te,q)?function(ye){return je(ye,q)}:/\s/.test(te)?function(ye){return/\s/.test(ye)}:function(ye){return!/\s/.test(ye)&&!je(ye)};z>0&&pe(M.charAt(z-1));)--z;for(;Q<M.length&&pe(M.charAt(Q));)++Q}return new Gt($e(i.line,z),$e(i.line,Q))},toggleOverwrite:function(i){if(i!=null&&i==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?F(this.display.cursorDiv,"CodeMirror-overwrite"):A(this.display.cursorDiv,"CodeMirror-overwrite"),Ue(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==U()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Rr(function(i,d){_n(this,i,d)}),getScrollInfo:function(){var i=this.display.scroller;return{left:i.scrollLeft,top:i.scrollTop,height:i.scrollHeight-ai(this)-this.display.barHeight,width:i.scrollWidth-ai(this)-this.display.barWidth,clientHeight:da(this),clientWidth:Mi(this)}},scrollIntoView:Rr(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:$e(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:Rr(function(i,d){var M=this,z=function(q){return typeof q=="number"||/^\d+$/.test(String(q))?q+"px":q};i!=null&&(this.display.wrapper.style.width=z(i)),d!=null&&(this.display.wrapper.style.height=z(d)),this.options.lineWrapping&&as(this);var Q=this.display.viewFrom;this.doc.iter(Q,this.display.viewTo,function(q){if(q.widgets){for(var te=0;te<q.widgets.length;te++)if(q.widgets[te].noHScroll){Ti(M,Q,"widget");break}}++Q}),this.curOp.forceUpdate=!0,Ue(this,"refresh",this)}),operation:function(i){return Wr(this,i)},startOperation:function(){return ji(this)},endOperation:function(){return Hi(this)},refresh:Rr(function(){var i=this.display.cachedTextHeight;Mr(this),this.curOp.forceUpdate=!0,yn(this),_n(this,this.doc.scrollLeft,this.doc.scrollTop),Ra(this.display),(i==null||Math.abs(i-Xi(this.display))>.5||this.options.lineWrapping)&&Ea(this),Ue(this,"refresh",this)}),swapDoc:Rr(function(i){var d=this.doc;return d.cm=null,this.state.selectingText&&this.state.selectingText(),ks(this,i),yn(this),this.display.input.reset(),_n(this,i.scrollLeft,i.scrollTop),this.curOp.forceScroll=!0,br(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}},be(e),e.registerHelper=function(i,d,M){n.hasOwnProperty(i)||(n[i]=e[i]={_global:[]}),n[i][d]=M},e.registerGlobalHelper=function(i,d,M,z){e.registerHelper(i,d,z),n[i]._global.push({pred:M,val:z})}}function za(e,t,n,i,d){var M=t,z=n,Q=dt(e,t.line),q=d&&e.direction=="rtl"?-n:n;function te(){var lt=t.line+q;return lt<e.first||lt>=e.first+e.size?!1:(t=new $e(lt,t.ch,t.sticky),Q=dt(e,lt))}function pe(lt){var it;if(i=="codepoint"){var ht=Q.text.charCodeAt(t.ch+(i>0?0:-1));isNaN(ht)?it=null:it=new $e(t.line,Math.max(0,Math.min(Q.text.length,t.ch+n*(ht>=55296&&ht<56320?2:1))),-n)}else d?it=Ml(e.cm,Q,t,n):it=Ba(Q,t,n);if(it==null)if(!lt&&te())t=Ua(d,e.cm,Q,t.line,q);else return!1;else t=it;return!0}if(i=="char"||i=="codepoint")pe();else if(i=="column")pe(!0);else if(i=="word"||i=="group")for(var ye=null,Me=i=="group",De=e.cm&&e.cm.getHelper(t,"wordChars"),We=!0;!(n<0&&!pe(!We));We=!1){var Ye=Q.text.charAt(t.ch)||`
`,Ze=je(Ye,De)?"w":Me&&Ye==`
`?"n":!Me||/\s/.test(Ye)?null:"p";if(Me&&!We&&!Ze&&(Ze="s"),ye&&ye!=Ze){n<0&&(n=1,pe(),t.sticky="after");break}if(Ze&&(ye=Ze),n>0&&!pe(!We))break}var rt=ea(e,t,M,z,!0);return pi(M,rt)&&(rt.hitSide=!0),rt}function Ro(e,t,n,i){var d=e.doc,M=t.left,z;if(i=="page"){var Q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),q=Math.max(Q-.5*Xi(e.display),3);z=(n>0?t.bottom:t.top)+n*q}else i=="line"&&(z=n>0?t.bottom+3:t.top-3);for(var te;!(te=va(e,M,z),!te.outside);){if(n<0?z<=0:z>=d.height){te.hitSide=!0;break}z+=n*5}return te}var zt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new $,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};zt.prototype.init=function(e){var t=this,n=this,i=n.cm,d=n.div=e.lineDiv;Co(d,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function M(Q){for(var q=Q.target;q;q=q.parentNode){if(q==d)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(q.className))break}return!1}Be(d,"paste",function(Q){if(!M(Q)||He(i,Q)||To(Q,i))return;G<=11&&setTimeout(pr(i,function(){return t.updateFromDOM()}),20)}),Be(d,"compositionstart",function(Q){t.composing={data:Q.data,done:!1}}),Be(d,"compositionupdate",function(Q){t.composing||(t.composing={data:Q.data,done:!1})}),Be(d,"compositionend",function(Q){t.composing&&(Q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Be(d,"touchstart",function(){return n.forceCompositionEnd()}),Be(d,"input",function(){t.composing||t.readFromDOMSoon()});function z(Q){if(!M(Q)||He(i,Q))return;if(i.somethingSelected())sa({lineWise:!1,text:i.getSelections()}),Q.type=="cut"&&i.replaceSelection("",null,"cut");else if(i.options.lineWiseCopyCut){var q=So(i);sa({lineWise:!0,text:q.text}),Q.type=="cut"&&i.operation(function(){i.setSelections(q.ranges,0,ve),i.replaceSelection("",null,"cut")})}else return;if(Q.clipboardData){Q.clipboardData.clearData();var te=ri.text.join(`
`);if(Q.clipboardData.setData("Text",te),Q.clipboardData.getData("Text")==te){Q.preventDefault();return}}var pe=Ao(),ye=pe.firstChild;i.display.lineSpace.insertBefore(pe,i.display.lineSpace.firstChild),ye.value=ri.text.join(`
`);var Me=document.activeElement;N(ye),setTimeout(function(){i.display.lineSpace.removeChild(pe),Me.focus(),Me==d&&n.showPrimarySelection()},50)}Be(d,"copy",z),Be(d,"cut",z)},zt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},zt.prototype.prepareSelection=function(){var e=ps(this.cm,!1);return e.focus=document.activeElement==this.div,e},zt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},zt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},zt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),i=n.from(),d=n.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||d.line<t.display.viewFrom){e.removeAllRanges();return}var M=oa(t,e.anchorNode,e.anchorOffset),z=oa(t,e.focusNode,e.focusOffset);if(M&&!M.bad&&z&&!z.bad&&Ct(vi(M,z),i)==0&&Ct(gi(M,z),d)==0)return;var Q=t.display.view,q=i.line>=t.display.viewFrom&&Oo(t,i)||{node:Q[0].measure.map[2],offset:0},te=d.line<t.display.viewTo&&Oo(t,d);if(!te){var pe=Q[Q.length-1].measure,ye=pe.maps?pe.maps[pe.maps.length-1]:pe.map;te={node:ye[ye.length-1],offset:ye[ye.length-2]-ye[ye.length-3]}}if(!q||!te){e.removeAllRanges();return}var Me=e.rangeCount&&e.getRangeAt(0),De;try{De=y(q.node,q.offset,te.offset,te.node)}catch(We){}De&&(!P&&t.state.focused?(e.collapse(q.node,q.offset),De.collapsed||(e.removeAllRanges(),e.addRange(De))):(e.removeAllRanges(),e.addRange(De)),Me&&e.anchorNode==null?e.addRange(Me):P&&this.startGracePeriod()),this.rememberSelection()},zt.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)},zt.prototype.showMultipleSelections=function(e){T(this.cm.display.cursorDiv,e.cursors),T(this.cm.display.selectionDiv,e.selection)},zt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},zt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return b(this.div,t)},zt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},zt.prototype.blur=function(){this.div.blur()},zt.prototype.getField=function(){return this.div},zt.prototype.supportsTouch=function(){return!0},zt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Wr(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)},zt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},zt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(o&&v&&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 n=oa(t,e.anchorNode,e.anchorOffset),i=oa(t,e.focusNode,e.focusOffset);n&&i&&Wr(t,function(){wr(t.doc,Si(n,i),ve),(n.bad||i.bad)&&(t.curOp.selectionChanged=!0)})},zt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),i=n.from(),d=n.to();if(i.ch==0&&i.line>e.firstLine()&&(i=$e(i.line-1,dt(e.doc,i.line-1).length)),d.ch==dt(e.doc,d.line).text.length&&d.line<e.lastLine()&&(d=$e(d.line+1,0)),i.line<t.viewFrom||d.line>t.viewTo-1)return!1;var M,z,Q;i.line==t.viewFrom||(M=Fi(e,i.line))==0?(z=Rt(t.view[0].line),Q=t.view[0].node):(z=Rt(t.view[M].line),Q=t.view[M-1].node.nextSibling);var q=Fi(e,d.line),te,pe;if(q==t.view.length-1?(te=t.viewTo-1,pe=t.lineDiv.lastChild):(te=Rt(t.view[q+1].line)-1,pe=t.view[q+1].node.previousSibling),!Q)return!1;for(var ye=e.doc.splitLines(tu(e,Q,pe,z,te)),Me=Ur(e.doc,$e(z,0),$e(te,dt(e.doc,te).text.length));ye.length>1&&Me.length>1;)if(re(ye)==re(Me))ye.pop(),Me.pop(),te--;else if(ye[0]==Me[0])ye.shift(),Me.shift(),z++;else break;for(var De=0,We=0,Ye=ye[0],Ze=Me[0],rt=Math.min(Ye.length,Ze.length);De<rt&&Ye.charCodeAt(De)==Ze.charCodeAt(De);)++De;for(var lt=re(ye),it=re(Me),ht=Math.min(lt.length-(ye.length==1?De:0),it.length-(Me.length==1?De:0));We<ht&&lt.charCodeAt(lt.length-We-1)==it.charCodeAt(it.length-We-1);)++We;if(ye.length==1&&Me.length==1&&z==i.line)for(;De&&De>i.ch&&lt.charCodeAt(lt.length-We-1)==it.charCodeAt(it.length-We-1);)De--,We++;ye[ye.length-1]=lt.slice(0,lt.length-We).replace(/^\u200b+/,""),ye[0]=ye[0].slice(De).replace(/\u200b+$/,"");var Tt=$e(z,De),vt=$e(te,Me.length?re(Me).length-We:0);if(ye.length>1||ye[0]||Ct(Tt,vt))return rn(e.doc,ye,Tt,vt,"+input"),!0},zt.prototype.ensurePolled=function(){this.forceCompositionEnd()},zt.prototype.reset=function(){this.forceCompositionEnd()},zt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},zt.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)},zt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Wr(this.cm,function(){return Mr(e.cm)})},zt.prototype.setUneditable=function(e){e.contentEditable="false"},zt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||pr(this.cm,Ka)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},zt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},zt.prototype.onContextMenu=function(){},zt.prototype.resetPosition=function(){},zt.prototype.needsContentAttribute=!0;function Oo(e,t){var n=fa(e,t.line);if(!n||n.hidden)return null;var i=dt(e.doc,t.line),d=es(n,i,t.line),M=qe(i,e.doc.direction),z="left";if(M){var Q=Qe(M,t.ch);z=Q%2?"right":"left"}var q=is(d.map,t.ch,z);return q.offset=q.collapse=="right"?q.end:q.start,q}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function ln(e,t){return t&&(e.bad=!0),e}function tu(e,t,n,i,d){var M="",z=!1,Q=e.doc.lineSeparator(),q=!1;function te(De){return function(We){return We.id==De}}function pe(){z&&(M+=Q,q&&(M+=Q),z=q=!1)}function ye(De){De&&(pe(),M+=De)}function Me(De){if(De.nodeType==1){var We=De.getAttribute("cm-text");if(We){ye(We);return}var Ye=De.getAttribute("cm-marker"),Ze;if(Ye){var rt=e.findMarks($e(i,0),$e(d+1,0),te(+Ye));rt.length&&(Ze=rt[0].find(0))&&ye(Ur(e.doc,Ze.from,Ze.to).join(Q));return}if(De.getAttribute("contenteditable")=="false")return;var lt=/^(pre|div|p|li|table|br)$/i.test(De.nodeName);if(!/^br$/i.test(De.nodeName)&&De.textContent.length==0)return;lt&&pe();for(var it=0;it<De.childNodes.length;it++)Me(De.childNodes[it]);/^(pre|p)$/i.test(De.nodeName)&&(q=!0),lt&&(z=!0)}else De.nodeType==3&&ye(De.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Me(t),t==n);)t=t.nextSibling,q=!1;return M}function oa(e,t,n){var i;if(t==e.display.lineDiv){if(i=e.display.lineDiv.childNodes[n],!i)return ln(e.clipPos($e(e.display.viewTo-1)),!0);t=null,n=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 M=e.display.view[d];if(M.node==i)return ru(M,t,n)}}function ru(e,t,n){var i=e.text.firstChild,d=!1;if(!t||!b(i,t))return ln($e(Rt(e.line),0),!0);if(t==i&&(d=!0,t=i.childNodes[n],n=0,!t)){var M=e.rest?re(e.rest):e.line;return ln($e(Rt(M),M.text.length),d)}var z=t.nodeType==3?t:null,Q=t;for(!z&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(z=t.firstChild,n&&(n=z.nodeValue.length));Q.parentNode!=i;)Q=Q.parentNode;var q=e.measure,te=q.maps;function pe(Ze,rt,lt){for(var it=-1;it<(te?te.length:0);it++)for(var ht=it<0?q.map:te[it],Tt=0;Tt<ht.length;Tt+=3){var vt=ht[Tt+2];if(vt==Ze||vt==rt){var Ot=Rt(it<0?e.line:e.rest[it]),Xt=ht[Tt]+lt;return(lt<0||vt!=Ze)&&(Xt=ht[Tt+(lt?1:0)]),$e(Ot,Xt)}}}var ye=pe(z,Q,n);if(ye)return ln(ye,d);for(var Me=Q.nextSibling,De=z?z.nodeValue.length-n:0;Me;Me=Me.nextSibling){if(ye=pe(Me,Me.firstChild,0),ye)return ln($e(ye.line,ye.ch-De),d);De+=Me.textContent.length}for(var We=Q.previousSibling,Ye=n;We;We=We.previousSibling){if(ye=pe(We,We.firstChild,-1),ye)return ln($e(ye.line,ye.ch+Ye),d);Ye+=We.textContent.length}}var nr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new $,this.hasSelection=!1,this.composing=null};nr.prototype.init=function(e){var t=this,n=this,i=this.cm;this.createField(e);var d=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),f&&(d.style.width="0px"),Be(d,"input",function(){K&&G>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),Be(d,"paste",function(z){if(He(i,z)||To(z,i))return;i.state.pasteIncoming=+new Date,n.fastPoll()});function M(z){if(He(i,z))return;if(i.somethingSelected())sa({lineWise:!1,text:i.getSelections()});else if(i.options.lineWiseCopyCut){var Q=So(i);sa({lineWise:!0,text:Q.text}),z.type=="cut"?i.setSelections(Q.ranges,null,ve):(n.prevInput="",d.value=Q.text.join(`
`),N(d))}else return;z.type=="cut"&&(i.state.cutIncoming=+new Date)}Be(d,"cut",M),Be(d,"copy",M),Be(e.scroller,"paste",function(z){if(ci(e,z)||He(i,z))return;if(!d.dispatchEvent){i.state.pasteIncoming=+new Date,n.focus();return}var Q=new Event("paste");Q.clipboardData=z.clipboardData,d.dispatchEvent(Q)}),Be(e.lineSpace,"selectstart",function(z){ci(e,z)||ae(z)}),Be(d,"compositionstart",function(){var z=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:z,range:i.markText(z,i.getCursor("to"),{className:"CodeMirror-composing"})}}),Be(d,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},nr.prototype.createField=function(e){this.wrapper=Ao(),this.textarea=this.wrapper.firstChild},nr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},nr.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,i=ps(e);if(e.options.moveInputWithCursor){var d=ei(e,n.sel.primary().head,"div"),M=t.wrapper.getBoundingClientRect(),z=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,d.top+z.top-M.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,d.left+z.left-M.left))}return i},nr.prototype.showSelection=function(e){var t=this.cm,n=t.display;T(n.cursorDiv,e.cursors),T(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},nr.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&N(this.textarea),K&&G>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",K&&G>=9&&(this.hasSelection=null))},nr.prototype.getField=function(){return this.textarea},nr.prototype.supportsTouch=function(){return!1},nr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!u||U()!=this.textarea))try{this.textarea.focus()}catch(e){}},nr.prototype.blur=function(){this.textarea.blur()},nr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},nr.prototype.receivedFocus=function(){this.slowPoll()},nr.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()})},nr.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var i=t.poll();!i&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},nr.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||ct(n)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var d=n.value;if(d==i&&!t.somethingSelected())return!1;if(K&&G>=9&&this.hasSelection===d||a&&/[\uf700-\uf7ff]/.test(d))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var M=d.charCodeAt(0);if(M==8203&&!i&&(i="\u200B"),M==8666)return this.reset(),this.cm.execCommand("undo")}for(var z=0,Q=Math.min(i.length,d.length);z<Q&&i.charCodeAt(z)==d.charCodeAt(z);)++z;return Wr(t,function(){Ka(t,d.slice(z),i.length-z,null,e.composing?"*compose":null),d.length>1e3||d.indexOf(`
`)>-1?n.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},nr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},nr.prototype.onKeyPress=function(){K&&G>=9&&(this.hasSelection=null),this.fastPoll()},nr.prototype.onContextMenu=function(e){var t=this,n=t.cm,i=n.display,d=t.textarea;t.contextMenuPending&&t.contextMenuPending();var M=Ni(n,e),z=i.scroller.scrollTop;if(!M||m)return;var Q=n.options.resetSelectionOnContextMenu;Q&&n.doc.sel.contains(M)==-1&&pr(n,wr)(n.doc,Si(M),ve);var q=d.style.cssText,te=t.wrapper.style.cssText,pe=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",d.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-pe.top-5)+"px; left: "+(e.clientX-pe.left-5)+`px;
z-index: 1000; background: `+(K?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ye;r&&(ye=window.scrollY),i.input.focus(),r&&window.scrollTo(null,ye),i.input.reset(),n.somethingSelected()||(d.value=t.prevInput=" "),t.contextMenuPending=De,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll);function Me(){if(d.selectionStart!=null){var Ye=n.somethingSelected(),Ze="\u200B"+(Ye?d.value:"");d.value="\u21DA",d.value=Ze,t.prevInput=Ye?"":"\u200B",d.selectionStart=1,d.selectionEnd=Ze.length,i.selForContextMenu=n.doc.sel}}function De(){if(t.contextMenuPending!=De)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=te,d.style.cssText=q,K&&G<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=z),d.selectionStart!=null){(!K||K&&G<9)&&Me();var Ye=0,Ze=function(){i.selForContextMenu==n.doc.sel&&d.selectionStart==0&&d.selectionEnd>0&&t.prevInput=="\u200B"?pr(n,Vs)(n):Ye++<10?i.detectingSelectAll=setTimeout(Ze,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(Ze,200)}}if(K&&G>=9&&Me(),D){ge(e);var We=function(){ot(window,"mouseup",We),setTimeout(De,20)};Be(window,"mouseup",We)}else setTimeout(De,50)},nr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},nr.prototype.setUneditable=function(){},nr.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?g(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 n=U();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function i(){e.value=Q.getValue()}var d;if(e.form&&(Be(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var M=e.form;d=M.submit;try{var z=M.submit=function(){i(),M.submit=d,M.submit(),M.submit=z}}catch(q){}}t.finishInit=function(q){q.save=i,q.getTextArea=function(){return e},q.toTextArea=function(){q.toTextArea=isNaN,i(),e.parentNode.removeChild(q.getWrapperElement()),e.style.display="",e.form&&(ot(e.form,"submit",i),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=d))}},e.style.display="none";var Q=Zt(function(q){return e.parentNode.insertBefore(q,e.nextSibling)},t);return Q}function nu(e){e.off=ot,e.on=Be,e.wheelEventPixels=cl,e.Doc=Pr,e.splitLines=St,e.countColumn=H,e.findColumn=Oe,e.isWordChar=Pe,e.Pass=Ce,e.signal=Ue,e.Line=ki,e.changeEnd=Ci,e.scrollbarModel=xs,e.Pos=$e,e.cmpPos=Ct,e.modes=Qt,e.mimeModes=It,e.resolveMode=yt,e.getMode=Lr,e.modeExtensions=bt,e.extendMode=xt,e.copyState=Ft,e.startState=cr,e.innerMode=tr,e.commands=Pn,e.keyMap=di,e.keyName=lo,e.isModifierKey=so,e.lookupKey=an,e.normalizeKeyMap=kl,e.StringStream=Pt,e.SharedTextMarker=Dn,e.TextMarker=Ri,e.LineWidget=In,e.e_preventDefault=ae,e.e_stopPropagation=le,e.e_stop=ge,e.addClass=F,e.contains=b,e.rmClass=A,e.keyNames=Oi}$l(Zt),ql(Zt);var au="iter insert remove copy getEditor constructor".split(" ");for(var la in Pr.prototype)Pr.prototype.hasOwnProperty(la)&&ie(au,la)<0&&(Zt.prototype[la]=function(e){return function(){return e.apply(this.doc,arguments)}}(Pr.prototype[la]));return be(Pr),Zt.inputStyles={textarea:nr,contenteditable:zt},Zt.defineMode=function(e){!Zt.defaults.mode&&e!="null"&&(Zt.defaults.mode=e),Cr.apply(this,arguments)},Zt.defineMIME=Kr,Zt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Zt.defineMIME("text/plain","null"),Zt.defineExtension=function(e,t){Zt.prototype[e]=t},Zt.defineDocExtension=function(e,t){Pr.prototype[e]=t},Zt.fromTextArea=iu,nu(Zt),Zt.version="5.58.2",Zt})},Y1PL:function(nt,xe,Z){"use strict";Z.r(xe),Z.d(xe,"ResizableTextArea",function(){return ie});var ne=Z("wx14"),J=Z("1OyB"),P=Z("vuIU"),X=Z("Ji7U"),j=Z("LK+K"),B=Z("q1tI"),K=Z("VTBJ"),G=Z("rePB"),r=Z("Zm9Q"),L=Z("Kwbf"),v=Z("c+Xe"),m=Z("m+aA"),p=Z("bdgK"),h=new Map;function l(ve){ve.forEach(function(Se){var Ae,Oe=Se.target;(Ae=h.get(Oe))===null||Ae===void 0||Ae.forEach(function(he){return he(Oe)})})}var f=new p.default(l),o=null,u=null;function a(ve,Se){h.has(ve)||(h.set(ve,new Set),f.observe(ve)),h.get(ve).add(Se)}function s(ve,Se){h.has(ve)&&(h.get(ve).delete(Se),h.get(ve).size||(f.unobserve(ve),h.delete(ve)))}var R=function(ve){Object(X.a)(Ae,ve);var Se=Object(j.a)(Ae);function Ae(){return Object(J.a)(this,Ae),Se.apply(this,arguments)}return Object(P.a)(Ae,[{key:"render",value:function(){return this.props.children}}]),Ae}(B.Component),_=B.createContext(null);function C(ve){var Se=ve.children,Ae=ve.onBatchResize,Oe=B.useRef(0),he=B.useRef([]),ce=B.useContext(_),re=B.useCallback(function(fe,se,ke){Oe.current+=1;var Ne=Oe.current;he.current.push({size:fe,element:se,data:ke}),Promise.resolve().then(function(){Ne===Oe.current&&(Ae==null||Ae(he.current),he.current=[])}),ce==null||ce(fe,se,ke)},[Ae,ce]);return B.createElement(_.Provider,{value:re},Se)}function D(ve){var Se=ve.children,Ae=ve.disabled,Oe=B.useRef(null),he=B.useRef(null),ce=B.useContext(_),re=B.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),fe=B.isValidElement(Se)&&Object(v.c)(Se),se=fe?Se.ref:null,ke=B.useMemo(function(){return Object(v.a)(se,Oe)},[se,Oe]),Ne=B.useRef(ve);Ne.current=ve;var Re=B.useCallback(function(Pe){var je=Ne.current,ue=je.onResize,Ee=je.data,Le=Pe.getBoundingClientRect(),Ie=Le.width,Ge=Le.height,Xe=Pe.offsetWidth,Je=Pe.offsetHeight,Qe=Math.floor(Ie),at=Math.floor(Ge);if(re.current.width!==Qe||re.current.height!==at||re.current.offsetWidth!==Xe||re.current.offsetHeight!==Je){var qe={width:Qe,height:at,offsetWidth:Xe,offsetHeight:Je};re.current=qe;var tt=Xe===Math.round(Ie)?Ie:Xe,Be=Je===Math.round(Ge)?Ge:Je,ut=Object(K.a)(Object(K.a)({},qe),{},{offsetWidth:tt,offsetHeight:Be});ce==null||ce(ut,Pe,Ee),ue&&Promise.resolve().then(function(){ue(ut,Pe)})}},[]);return B.useEffect(function(){var Pe=Object(m.a)(Oe.current)||Object(m.a)(he.current);return Pe&&!Ae&&a(Pe,Re),function(){return s(Pe,Re)}},[Oe.current,Ae]),B.createElement(R,{ref:he},fe?B.cloneElement(Se,{ref:ke}):Se)}var O="rc-observer-key";function A(ve){var Se=ve.children,Ae=Object(r.a)(Se);return Ae.map(function(Oe,he){var ce=(Oe==null?void 0:Oe.key)||"".concat(O,"-").concat(he);return B.createElement(D,Object(ne.a)({},ve,{key:ce}),Oe)})}A.Collection=C;var S=A,T=Z("bT9E"),c=Z("TSYQ"),w=Z.n(c),y=`
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
`,b=["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"],U={},F;function E(ve){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ae=ve.getAttribute("id")||ve.getAttribute("data-reactid")||ve.getAttribute("name");if(Se&&U[Ae])return U[Ae];var Oe=window.getComputedStyle(ve),he=Oe.getPropertyValue("box-sizing")||Oe.getPropertyValue("-moz-box-sizing")||Oe.getPropertyValue("-webkit-box-sizing"),ce=parseFloat(Oe.getPropertyValue("padding-bottom"))+parseFloat(Oe.getPropertyValue("padding-top")),re=parseFloat(Oe.getPropertyValue("border-bottom-width"))+parseFloat(Oe.getPropertyValue("border-top-width")),fe=b.map(function(ke){return"".concat(ke,":").concat(Oe.getPropertyValue(ke))}).join(";"),se={sizingStyle:fe,paddingSize:ce,borderSize:re,boxSizing:he};return Se&&Ae&&(U[Ae]=se),se}function N(ve){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Oe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;F||(F=document.createElement("textarea"),F.setAttribute("tab-index","-1"),F.setAttribute("aria-hidden","true"),document.body.appendChild(F)),ve.getAttribute("wrap")?F.setAttribute("wrap",ve.getAttribute("wrap")):F.removeAttribute("wrap");var he=E(ve,Se),ce=he.paddingSize,re=he.borderSize,fe=he.boxSizing,se=he.sizingStyle;F.setAttribute("style","".concat(se,";").concat(y)),F.value=ve.value||ve.placeholder||"";var ke=Number.MIN_SAFE_INTEGER,Ne=Number.MAX_SAFE_INTEGER,Re=F.scrollHeight,Pe;if(fe==="border-box"?Re+=re:fe==="content-box"&&(Re-=ce),Ae!==null||Oe!==null){F.value=" ";var je=F.scrollHeight-ce;Ae!==null&&(ke=je*Ae,fe==="border-box"&&(ke=ke+ce+re),Re=Math.max(ke,Re)),Oe!==null&&(Ne=je*Oe,fe==="border-box"&&(Ne=Ne+ce+re),Pe=Re>Ne?"":"hidden",Re=Math.min(Ne,Re))}return{height:Re,minHeight:ke,maxHeight:Ne,overflowY:Pe,resize:"none"}}var I=Z("Gytx"),g=Z.n(I),H;(function(ve){ve[ve.NONE=0]="NONE",ve[ve.RESIZING=1]="RESIZING",ve[ve.RESIZED=2]="RESIZED"})(H||(H={}));var $=function(ve){Object(X.a)(Ae,ve);var Se=Object(j.a)(Ae);function Ae(Oe){var he;return Object(J.a)(this,Ae),he=Se.call(this,Oe),he.nextFrameActionId=void 0,he.resizeFrameId=void 0,he.textArea=void 0,he.saveTextArea=function(ce){he.textArea=ce},he.handleResize=function(ce){var re=he.state.resizeStatus,fe=he.props,se=fe.autoSize,ke=fe.onResize;if(re!==H.NONE)return;typeof ke=="function"&&ke(ce),se&&he.resizeOnNextFrame()},he.resizeOnNextFrame=function(){cancelAnimationFrame(he.nextFrameActionId),he.nextFrameActionId=requestAnimationFrame(he.resizeTextarea)},he.resizeTextarea=function(){var ce=he.props.autoSize;if(!ce||!he.textArea)return;var re=ce.minRows,fe=ce.maxRows,se=N(he.textArea,!1,re,fe);he.setState({textareaStyles:se,resizeStatus:H.RESIZING},function(){cancelAnimationFrame(he.resizeFrameId),he.resizeFrameId=requestAnimationFrame(function(){he.setState({resizeStatus:H.RESIZED},function(){he.resizeFrameId=requestAnimationFrame(function(){he.setState({resizeStatus:H.NONE}),he.fixFirefoxAutoScroll()})})})})},he.renderTextArea=function(){var ce=he.props,re=ce.prefixCls,fe=re===void 0?"rc-textarea":re,se=ce.autoSize,ke=ce.onResize,Ne=ce.className,Re=ce.disabled,Pe=he.state,je=Pe.textareaStyles,ue=Pe.resizeStatus,Ee=Object(T.a)(he.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Le=w()(fe,Ne,Object(G.a)({},"".concat(fe,"-disabled"),Re));"value"in Ee&&(Ee.value=Ee.value||"");var Ie=Object(K.a)(Object(K.a)(Object(K.a)({},he.props.style),je),ue===H.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return B.createElement(S,{onResize:he.handleResize,disabled:!(se||ke)},B.createElement("textarea",Object(ne.a)({},Ee,{className:Le,style:Ie,ref:he.saveTextArea})))},he.state={textareaStyles:{},resizeStatus:H.NONE},he}return Object(P.a)(Ae,[{key:"componentDidUpdate",value:function(he){(he.value!==this.props.value||!g()(he.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 he=this.textArea.selectionStart,ce=this.textArea.selectionEnd;this.textArea.setSelectionRange(he,ce)}}catch(re){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ae}(B.Component),ie=$,oe=function(ve){Object(X.a)(Ae,ve);var Se=Object(j.a)(Ae);function Ae(Oe){var he;Object(J.a)(this,Ae),he=Se.call(this,Oe),he.resizableTextArea=void 0,he.focus=function(){he.resizableTextArea.textArea.focus()},he.saveTextArea=function(re){he.resizableTextArea=re},he.handleChange=function(re){var fe=he.props.onChange;he.setValue(re.target.value,function(){he.resizableTextArea.resizeTextarea()}),fe&&fe(re)},he.handleKeyDown=function(re){var fe=he.props,se=fe.onPressEnter,ke=fe.onKeyDown;re.keyCode===13&&se&&se(re),ke&&ke(re)};var ce=typeof Oe.value=="undefined"||Oe.value===null?Oe.defaultValue:Oe.value;return he.state={value:ce},he}return Object(P.a)(Ae,[{key:"setValue",value:function(he,ce){"value"in this.props||this.setState({value:he},ce)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return B.createElement(ie,Object(ne.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(he){return"value"in he?{value:he.value}:null}}]),Ae}(B.Component),Ce=xe.default=oe},ZW9T:function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return I});var ne=Z("k1fw"),J=Z("oBTY"),P=Z("miYZ"),X=Z("tsqr"),j=Z("rAM+"),B=Z("tJVT"),K=Z("PpiC"),G=Z("q1tI"),r=Z.n(G),L=Z("bdgK"),v=Z("9og8"),m=Z("WmNS"),p=Z.n(m),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"]},l={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"]},f={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(`
`)}]},o={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=Z("5VLF"),a=Z.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"]}},R=function(H,$){return $.map(function(ie){return{label:ie,kind:H.languages.CompletionItemKind.Keyword,insertText:ie}})},_=function(H){return Object.keys(s.tables).map(function($){return{label:$,kind:H.languages.CompletionItemKind.Variable,insertText:$}})},C=function(H,$){var ie=s.tables[H];return ie?ie.map(function(oe){return{label:oe,kind:$.languages.CompletionItemKind.Field,insertText:oe}}):[]};function D(g,H,$,ie,oe){var Ce=H.getWordUntilPosition($),ve={startLineNumber:$.lineNumber,endLineNumber:$.lineNumber,startColumn:Ce.startColumn,endColumn:Ce.endColumn},Se=ie.map(function(Ae){return{label:Ae,kind:g.languages.CompletionItemKind.Keyword,insertText:Ae,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ve}});return oe.map(function(Ae){Se.push(Object(ne.a)(Object(ne.a)({},Ae),{},{range:ve}))}),Se}var O=function(g){s.languages.map(function(oe){return g.languages.registerDocumentFormattingEditProvider(oe,{provideDocumentFormattingEdits:function(ve,Se,Ae){return Object(v.a)(p.a.mark(function Oe(){var he;return p.a.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return he=a()(ve.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}),re.abrupt("return",[{range:ve.getFullModelRange(),text:he}]);case 2:case"end":return re.stop()}},Oe)}))()}}),oe});var H=f.quickKey.map(function(oe){return{label:oe.label,kind:g.languages.CompletionItemKind.Method,insertText:oe.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),$=o.quickKey.map(function(oe){return{label:oe.label,kind:g.languages.CompletionItemKind.Method,insertText:oe.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ie=l.quickKey.map(function(oe){return{label:oe.label,kind:g.languages.CompletionItemKind.Method,insertText:oe.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}});g.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Ce,ve){var Se=Ce.getWordUntilPosition(ve),Ae={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:Se.startColumn,endColumn:Se.endColumn},Oe=Ce.getLineContent(ve.lineNumber).substring(Se.startColumn-2,Se.endColumn);return{suggestions:[].concat(Object(J.a)(f.keywords.map(function(he){return{label:he,kind:g.languages.CompletionItemKind.Function,documentation:he,insertText:he,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})),Object(J.a)(f.quickKey.map(function(he){return{label:he.label,kind:g.languages.CompletionItemKind.Function,documentation:he.content,insertText:Oe.startsWith("#")?he.content.replace(/#/,""):he.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})))}}}),g.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Ce,ve){var Se=Ce.getWordUntilPosition(ve),Ae={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:Se.startColumn,endColumn:Se.endColumn};return{suggestions:Object(J.a)(h.keywords.map(function(Oe){return{label:Oe,kind:g.languages.CompletionItemKind.Function,documentation:Oe,insertText:Oe,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}}))}}}),g.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Ce,ve){var Se=Ce.getWordUntilPosition(ve),Ae={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:Se.startColumn,endColumn:Se.endColumn},Oe=Ce.getLineContent(ve.lineNumber).substring(Se.startColumn-2,Se.endColumn);return{suggestions:[].concat(Object(J.a)(l.keywords.map(function(he){return{label:he,kind:g.languages.CompletionItemKind.Function,documentation:he,insertText:he,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})),Object(J.a)(l.quickKey.map(function(he){return{label:he.label,kind:g.languages.CompletionItemKind.Function,documentation:he.content,insertText:Oe.startsWith("#")?he.content.replace(/#/,""):he.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})))}}}),g.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Ce,ve){var Se=Ce.getWordUntilPosition(ve),Ae={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:Se.startColumn,endColumn:Se.endColumn},Oe=Ce.getLineContent(ve.lineNumber).substring(Se.startColumn-2,Se.endColumn);return{suggestions:[].concat(Object(J.a)(o.keywords.map(function(he){return{label:he,kind:g.languages.CompletionItemKind.Function,documentation:he,insertText:he,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})),Object(J.a)(o.quickKey.map(function(he){return{label:he.label,kind:g.languages.CompletionItemKind.Function,documentation:he.content,insertText:Oe.startsWith("#")?he.content.replace(/#/,""):he.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})))}}})},A="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",S=Z("fjLI"),T=Z("LvDl"),c=Z("+ua5");function w(g){return/^\d+$/.test(g)?"".concat(g,"px"):g}function y(){}var b=!1,U={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function F(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],H=g;if(Array.isArray(g)){for(var $=0;$<g.length;$++){var ie=U[g[$]];if(ie)return ie}return H[0]}return U[H]||H}var E=null,N=xe.b=function(g){var H=g.width,$=H===void 0?"100%":H,ie=g.height,oe=ie===void 0?"100%":ie,Ce=g.value,ve=g.language,Se=ve===void 0?"javascript":ve,Ae=g.style,Oe=Ae===void 0?{}:Ae,he=g.options,ce=he===void 0?{}:he,re=g.overrideServices,fe=re===void 0?{}:re,se=g.theme,ke=se===void 0?"vs-dark":se,Ne=g.onEditBlur,Re=g.onSave,Pe=g.autoHeight,je=Pe===void 0?!1:Pe,ue=g.forbidCopy,Ee=ue===void 0?!1:ue,Le=g.onChange,Ie=Le===void 0?y:Le,Ge=g.editorDidMount,Xe=Ge===void 0?y:Ge,Je=g.onFocus,Qe=Je===void 0?y:Je,at=g.filename,qe=at===void 0?"educoder.txt":at,tt=g.errorLine,Be=g.errorContent,ut=Be===void 0?"":Be,ot=Object(K.a)(g,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Ue=Object(G.useRef)(),He=Object(G.useRef)({}),Te=Object(G.useRef)(),me=Object(G.useRef)(),be=Object(G.useRef)(!1),ae=Object(G.useRef)(),le=Object(G.useState)(!1),de=Object(B.a)(le,2),ge=de[0],we=de[1];function Fe(){var bt;return Ue.current&&(bt=new L.default(function(xt){var Ft=Object(j.a)(xt),tr;try{for(Ft.s();!(tr=Ft.n()).done;){var cr=tr.value;(cr.target.offsetHeight>0||cr.target.offsetWidth>0)&&He.current.instance.layout()}}catch(Pt){Ft.e(Pt)}finally{Ft.f()}}),bt.observe(Ue.current)),bt}function ze(){X.b.warn(decodeURIComponent(A))}var st=function(){var xt=He.current.instance;if(Ce!=null&&xt&&ge){var Ft=xt.getModel();Ft&&Ce!==Ft.getValue()&&(b=!0,Ft.setValue(Ce),xt.layout(),b=!1)}};Object(G.useEffect)(function(){me.current&&clearTimeout(me.current),me.current=setTimeout(function(){st()},500)},[Ce,ge,He.current]),Object(G.useEffect)(function(){if(tt&&He.current&&He.current.instance){var bt=He.current.instance;bt.changeViewZones(function(Ft){var tr=document.createElement("div");tr.style.padding="10px 20px",tr.style.width="calc(100% - 20px)",tr.className="my-error-line-wrp",tr.innerHTML=ut,Ft.addZone({afterLineNumber:tt||11,heightInLines:3,domNode:tr})});var xt={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}};bt.addOverlayWidget(xt),bt.revealPositionInCenter({lineNumber:20,column:1})}},[tt,He.current,ge]);function mt(){var bt=He.current.instance;if(bt){var xt=bt.getSelection(),Ft=He.current.pastePos||{},tr=new E.Range(Ft.startLineNumber||xt.endLineNumber,Ft.startColumn||xt.endColumn,Ft.endLineNumber||xt.endLineNumber,Ft.endColumn||xt.endColumn);setTimeout(function(){bt.executeEdits("",[{range:tr,text:""}])},300)}}function ft(bt){(window.navigator.platform.match("Mac")?bt.metaKey:bt.ctrlKey)&&bt.keyCode==83&&(bt.preventDefault(),Re())}var wt=function(){if(je&&He.current.instance){var xt=He.current.instance.getContentHeight();yt(xt<oe?oe:xt)}else yt(oe)};function St(bt){var xt=document.createEvent("MouseEvents");xt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),bt.dispatchEvent(xt)}function ct(bt,xt){var Ft=window.URL||window.webkitURL||window,tr=new Blob([xt]),cr=document.createElementNS("http://www.w3.org/1999/xhtml","a");cr.href=Ft.createObjectURL(tr),cr.download=bt,St(cr)}Object(G.useEffect)(function(){wt()},[wt]),Object(G.useEffect)(function(){Ue.current&&!ge&&Promise.all([Z.e(16),Z.e(28)]).then(Z.t.bind(null,"M/lh",7)).then(function(bt){try{E=bt,He.current.instance=E.editor.create(Ue.current,{value:Ce,language:F(Se),theme:ke,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},fe);var xt=He.current.instance,Ft=S.d._menuItems,tr=Object(J.a)(Ft).find(function(Vt){return Vt[0]._debugName=="EditorContext"}),cr=tr[1],Pt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],dt=function(Jt,Rt){var lr=Jt._first;do{var Ir,Xr,$e=Rt.includes((Ir=lr.element)===null||Ir===void 0||((Xr=Ir.command)===null||Xr===void 0)?void 0:Xr.id);$e&&Jt._remove(lr)}while(lr=lr.next)};if(Xe(xt,E),setTimeout(function(){wt(),He.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){ct(qe||"educoder.txt",xt.getValue())}}),xt.getDomNode().addEventListener("input",function(){Te.current.autoFormat&&xt.getAction("editor.action.formatDocument").run()})},500),He.current.subscription=xt.onDidChangeModelContent(function(Vt){be.current?clearTimeout(ae.current):(wt(),Ie(xt.getValue(),Vt)),ae.current=setTimeout(function(){be.current=!1},500)}),window.Monaco||O(E,F(Se)),Ee&&(dt(cr,Pt),Ue.current.classList.add("noCopyPaste"),xt.onKeyDown(function(Vt){var Jt=Vt.keyCode,Rt=Vt.ctrlKey,lr=Vt.metaKey;(Jt===33||Jt===52)&&(lr||Rt)&&(ze(),Vt.preventDefault())})),window.Monaco=E,Ne&&xt.onDidBlurEditorWidget(function(){Ne(xt.getValue())}),Qe&&xt.onDidFocusEditorText(function(){Qe(xt.getValue())}),Ee){xt.addCommand(E.KeyMod.CtrlCmd|E.KeyCode.KEY_V,function(){return ze(),null}),xt.onDidPaste(function(Vt){He.current.pastePos=Vt});try{window.addEventListener("paste",mt)}catch(Vt){}}var Ur=Fe();return we(!0),function(){var Vt=He.current.instance;Vt.dispose();var Jt=Vt.getModel();Jt&&Jt.dispose(),He.current.subscription&&He.current.subscription.dispose(),Ee&&window.removeEventListener("paste",mt),Ur.unobserve(Ue.current)}}catch(Vt){}})},[]),Object(G.useEffect)(function(){var bt=He.current.instance;if(bt&&ge)return document.addEventListener("keydown",ft,!1),function(){document.removeEventListener("keydown",ft)}},[Re,ge]),Object(G.useEffect)(function(){var bt=He.current.instance;if(bt&&ge){var xt=F(Se);E.editor.setModelLanguage(bt.getModel(),xt),console.log("language:",Se,bt.getModel(),xt)}},[Se,ge]),Object(G.useEffect)(function(){var bt=He.current.instance;bt&&ge&&E.editor.setTheme(ke)},[ke,ge]),Object(G.useEffect)(function(){var bt=He.current.instance;Te.current=ce,bt&&ge&&(bt.updateOptions(Object(ne.a)({},ce)),setTimeout(function(){bt.getModel().updateOptions(Object(ne.a)({},ce))},200))},[JSON.stringify(ce),ge]),Object(G.useEffect)(function(){var bt=He.current.instance;bt&&ge&&bt.layout()},[$,oe,ge]);var Ut=Object(G.useState)(w($)),Lt=Object(B.a)(Ut,2),qt=Lt[0],Qt=Lt[1],It=Object(G.useState)(w(oe)),Cr=Object(B.a)(It,2),Kr=Cr[0],yt=Cr[1],Lr=Object(ne.a)(Object(ne.a)({},Oe),{},{width:qt,height:Kr});return r.a.createElement("div",{className:"my-monaco-editor",ref:Ue,style:Lr})};function I(g){var H=g.width,$=H===void 0?"100%":H,ie=g.height,oe=ie===void 0?"100%":ie,Ce=g.original,ve=g.modified,Se=g.language,Ae=g.options,Oe=Ae===void 0?{}:Ae,he=Object(G.useRef)(),ce=Object(G.useState)(null),re=Object(B.a)(ce,2),fe=re[0],se=re[1];function ke(je){var ue;return he.current&&(ue=new L.default(function(Ee){var Le=Object(j.a)(Ee),Ie;try{for(Le.s();!(Ie=Le.n()).done;){var Ge=Ie.value;(Ge.target.offsetHeight>0||Ge.target.offsetWidth>0)&&je.layout()}}catch(Xe){Le.e(Xe)}finally{Le.f()}}),ue.observe(he.current)),ue}Object(G.useEffect)(function(){he.current&&Promise.all([Z.e(16),Z.e(28)]).then(Z.t.bind(null,"M/lh",7)).then(function(je){E=je;var ue=E.editor.createDiffEditor(he.current,Object(ne.a)(Object(ne.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},Oe),{},{wordWrap:!0}));se(ue);var Ee=ke(ue);return function(){ue.dispose();var Le=ue.getModel();Le&&Le.dispose(),Ee.unobserve(he.current)}})},[]),Object(G.useEffect)(function(){fe&&fe.setModel({original:E.editor.createModel(Ce,Se),modified:E.editor.createModel(ve,Se)})},[Ce,ve,Se,fe]);var Ne=w($),Re=w(oe),Pe={width:Ne,height:Re};return r.a.createElement("div",{className:"my-diff-editor",ref:he,style:Pe})}},ZpRC:function(nt,xe,Z){"use strict";function ne(v){return typeof v=="object"&&v!=null&&v.nodeType===1}function J(v,m){return(!m||v!=="hidden")&&v!=="visible"&&v!=="clip"}function P(v,m){if(v.clientHeight<v.scrollHeight||v.clientWidth<v.scrollWidth){var p=getComputedStyle(v,null);return J(p.overflowY,m)||J(p.overflowX,m)||function(h){var l=function(f){if(!f.ownerDocument||!f.ownerDocument.defaultView)return null;try{return f.ownerDocument.defaultView.frameElement}catch(o){return null}}(h);return!!l&&(l.clientHeight<h.scrollHeight||l.clientWidth<h.scrollWidth)}(v)}return!1}function X(v,m,p,h,l,f,o,u){return f<v&&o>m||f>v&&o<m?0:f<=v&&u<=p||o>=m&&u>=p?f-v-h:o>m&&u<p||f<v&&u>p?o-m+l:0}var j=function(v,m){var p=window,h=m.scrollMode,l=m.block,f=m.inline,o=m.boundary,u=m.skipOverflowHiddenElements,a=typeof o=="function"?o:function(je){return je!==o};if(!ne(v))throw new TypeError("Invalid target");for(var s=document.scrollingElement||document.documentElement,R=[],_=v;ne(_)&&a(_);){if((_=_.parentElement)===s){R.push(_);break}_!=null&&_===document.body&&P(_)&&!P(document.documentElement)||_!=null&&P(_,u)&&R.push(_)}for(var C=p.visualViewport?p.visualViewport.width:innerWidth,D=p.visualViewport?p.visualViewport.height:innerHeight,O=window.scrollX||pageXOffset,A=window.scrollY||pageYOffset,S=v.getBoundingClientRect(),T=S.height,c=S.width,w=S.top,y=S.right,b=S.bottom,U=S.left,F=l==="start"||l==="nearest"?w:l==="end"?b:w+T/2,E=f==="center"?U+c/2:f==="end"?y:U,N=[],I=0;I<R.length;I++){var g=R[I],H=g.getBoundingClientRect(),$=H.height,ie=H.width,oe=H.top,Ce=H.right,ve=H.bottom,Se=H.left;if(h==="if-needed"&&w>=0&&U>=0&&b<=D&&y<=C&&w>=oe&&b<=ve&&U>=Se&&y<=Ce)return N;var Ae=getComputedStyle(g),Oe=parseInt(Ae.borderLeftWidth,10),he=parseInt(Ae.borderTopWidth,10),ce=parseInt(Ae.borderRightWidth,10),re=parseInt(Ae.borderBottomWidth,10),fe=0,se=0,ke="offsetWidth"in g?g.offsetWidth-g.clientWidth-Oe-ce:0,Ne="offsetHeight"in g?g.offsetHeight-g.clientHeight-he-re:0;if(s===g)fe=l==="start"?F:l==="end"?F-D:l==="nearest"?X(A,A+D,D,he,re,A+F,A+F+T,T):F-D/2,se=f==="start"?E:f==="center"?E-C/2:f==="end"?E-C:X(O,O+C,C,Oe,ce,O+E,O+E+c,c),fe=Math.max(0,fe+A),se=Math.max(0,se+O);else{fe=l==="start"?F-oe-he:l==="end"?F-ve+re+Ne:l==="nearest"?X(oe,ve,$,he,re+Ne,F,F+T,T):F-(oe+$/2)+Ne/2,se=f==="start"?E-Se-Oe:f==="center"?E-(Se+ie/2)+ke/2:f==="end"?E-Ce+ce+ke:X(Se,Ce,ie,Oe,ce+ke,E,E+c,c);var Re=g.scrollLeft,Pe=g.scrollTop;F+=Pe-(fe=Math.max(0,Math.min(Pe+fe,g.scrollHeight-$+Ne))),E+=Re-(se=Math.max(0,Math.min(Re+se,g.scrollWidth-ie+ke)))}N.push({el:g,top:fe,left:se})}return N};function B(v){return v===Object(v)&&Object.keys(v).length!==0}function K(v,m){m===void 0&&(m="auto");var p="scrollBehavior"in document.body.style;v.forEach(function(h){var l=h.el,f=h.top,o=h.left;l.scroll&&p?l.scroll({top:f,left:o,behavior:m}):(l.scrollTop=f,l.scrollLeft=o)})}function G(v){return v===!1?{block:"end",inline:"nearest"}:B(v)?v:{block:"start",inline:"nearest"}}function r(v,m){var p=!v.ownerDocument.documentElement.contains(v);if(B(m)&&typeof m.behavior=="function")return m.behavior(p?[]:j(v,m));if(p)return;var h=G(m);return K(j(v,h),h.behavior)}var L=xe.a=r},Zss7:function(nt,xe,Z){var ne;(function(J){var P=/^\s+/,X=/\s+$/,j=0,B=J.round,K=J.min,G=J.max,r=J.random;function L(re,fe){if(re=re||"",fe=fe||{},re instanceof L)return re;if(!(this instanceof L))return new L(re,fe);var se=v(re);this._originalInput=re,this._r=se.r,this._g=se.g,this._b=se.b,this._a=se.a,this._roundA=B(100*this._a)/100,this._format=fe.format||se.format,this._gradientType=fe.gradientType,this._r<1&&(this._r=B(this._r)),this._g<1&&(this._g=B(this._g)),this._b<1&&(this._b=B(this._b)),this._ok=se.ok,this._tc_id=j++}L.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var re=this.toRgb();return(re.r*299+re.g*587+re.b*114)/1e3},getLuminance:function(){var re=this.toRgb(),fe,se,ke,Ne,Re,Pe;return fe=re.r/255,se=re.g/255,ke=re.b/255,fe<=.03928?Ne=fe/12.92:Ne=J.pow((fe+.055)/1.055,2.4),se<=.03928?Re=se/12.92:Re=J.pow((se+.055)/1.055,2.4),ke<=.03928?Pe=ke/12.92:Pe=J.pow((ke+.055)/1.055,2.4),.2126*Ne+.7152*Re+.0722*Pe},setAlpha:function(re){return this._a=N(re),this._roundA=B(100*this._a)/100,this},toHsv:function(){var re=l(this._r,this._g,this._b);return{h:re.h*360,s:re.s,v:re.v,a:this._a}},toHsvString:function(){var re=l(this._r,this._g,this._b),fe=B(re.h*360),se=B(re.s*100),ke=B(re.v*100);return this._a==1?"hsv("+fe+", "+se+"%, "+ke+"%)":"hsva("+fe+", "+se+"%, "+ke+"%, "+this._roundA+")"},toHsl:function(){var re=p(this._r,this._g,this._b);return{h:re.h*360,s:re.s,l:re.l,a:this._a}},toHslString:function(){var re=p(this._r,this._g,this._b),fe=B(re.h*360),se=B(re.s*100),ke=B(re.l*100);return this._a==1?"hsl("+fe+", "+se+"%, "+ke+"%)":"hsla("+fe+", "+se+"%, "+ke+"%, "+this._roundA+")"},toHex:function(re){return o(this._r,this._g,this._b,re)},toHexString:function(re){return"#"+this.toHex(re)},toHex8:function(re){return u(this._r,this._g,this._b,this._a,re)},toHex8String:function(re){return"#"+this.toHex8(re)},toRgb:function(){return{r:B(this._r),g:B(this._g),b:B(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+B(this._r)+", "+B(this._g)+", "+B(this._b)+")":"rgba("+B(this._r)+", "+B(this._g)+", "+B(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:B(I(this._r,255)*100)+"%",g:B(I(this._g,255)*100)+"%",b:B(I(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+B(I(this._r,255)*100)+"%, "+B(I(this._g,255)*100)+"%, "+B(I(this._b,255)*100)+"%)":"rgba("+B(I(this._r,255)*100)+"%, "+B(I(this._g,255)*100)+"%, "+B(I(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:F[o(this._r,this._g,this._b,!0)]||!1},toFilter:function(re){var fe="#"+a(this._r,this._g,this._b,this._a),se=fe,ke=this._gradientType?"GradientType = 1, ":"";if(re){var Ne=L(re);se="#"+a(Ne._r,Ne._g,Ne._b,Ne._a)}return"progid:DXImageTransform.Microsoft.gradient("+ke+"startColorstr="+fe+",endColorstr="+se+")"},toString:function(re){var fe=!!re;re=re||this._format;var se=!1,ke=this._a<1&&this._a>=0,Ne=!fe&&ke&&(re==="hex"||re==="hex6"||re==="hex3"||re==="hex4"||re==="hex8"||re==="name");return Ne?re==="name"&&this._a===0?this.toName():this.toRgbString():(re==="rgb"&&(se=this.toRgbString()),re==="prgb"&&(se=this.toPercentageRgbString()),(re==="hex"||re==="hex6")&&(se=this.toHexString()),re==="hex3"&&(se=this.toHexString(!0)),re==="hex4"&&(se=this.toHex8String(!0)),re==="hex8"&&(se=this.toHex8String()),re==="name"&&(se=this.toName()),re==="hsl"&&(se=this.toHslString()),re==="hsv"&&(se=this.toHsvString()),se||this.toHexString())},clone:function(){return L(this.toString())},_applyModification:function(re,fe){var se=re.apply(null,[this].concat([].slice.call(fe)));return this._r=se._r,this._g=se._g,this._b=se._b,this.setAlpha(se._a),this},lighten:function(){return this._applyModification(C,arguments)},brighten:function(){return this._applyModification(D,arguments)},darken:function(){return this._applyModification(O,arguments)},desaturate:function(){return this._applyModification(s,arguments)},saturate:function(){return this._applyModification(R,arguments)},greyscale:function(){return this._applyModification(_,arguments)},spin:function(){return this._applyModification(A,arguments)},_applyCombination:function(re,fe){return re.apply(null,[this].concat([].slice.call(fe)))},analogous:function(){return this._applyCombination(y,arguments)},complement:function(){return this._applyCombination(S,arguments)},monochromatic:function(){return this._applyCombination(b,arguments)},splitcomplement:function(){return this._applyCombination(w,arguments)},triad:function(){return this._applyCombination(T,arguments)},tetrad:function(){return this._applyCombination(c,arguments)}},L.fromRatio=function(re,fe){if(typeof re=="object"){var se={};for(var ke in re)re.hasOwnProperty(ke)&&(ke==="a"?se[ke]=re[ke]:se[ke]=Ce(re[ke]));re=se}return L(re,fe)};function v(re){var fe={r:0,g:0,b:0},se=1,ke=null,Ne=null,Re=null,Pe=!1,je=!1;return typeof re=="string"&&(re=he(re)),typeof re=="object"&&(Oe(re.r)&&Oe(re.g)&&Oe(re.b)?(fe=m(re.r,re.g,re.b),Pe=!0,je=String(re.r).substr(-1)==="%"?"prgb":"rgb"):Oe(re.h)&&Oe(re.s)&&Oe(re.v)?(ke=Ce(re.s),Ne=Ce(re.v),fe=f(re.h,ke,Ne),Pe=!0,je="hsv"):Oe(re.h)&&Oe(re.s)&&Oe(re.l)&&(ke=Ce(re.s),Re=Ce(re.l),fe=h(re.h,ke,Re),Pe=!0,je="hsl"),re.hasOwnProperty("a")&&(se=re.a)),se=N(se),{ok:Pe,format:re.format||je,r:K(255,G(fe.r,0)),g:K(255,G(fe.g,0)),b:K(255,G(fe.b,0)),a:se}}function m(re,fe,se){return{r:I(re,255)*255,g:I(fe,255)*255,b:I(se,255)*255}}function p(re,fe,se){re=I(re,255),fe=I(fe,255),se=I(se,255);var ke=G(re,fe,se),Ne=K(re,fe,se),Re,Pe,je=(ke+Ne)/2;if(ke==Ne)Re=Pe=0;else{var ue=ke-Ne;Pe=je>.5?ue/(2-ke-Ne):ue/(ke+Ne);switch(ke){case re:Re=(fe-se)/ue+(fe<se?6:0);break;case fe:Re=(se-re)/ue+2;break;case se:Re=(re-fe)/ue+4;break}Re/=6}return{h:Re,s:Pe,l:je}}function h(re,fe,se){var ke,Ne,Re;re=I(re,360),fe=I(fe,100),se=I(se,100);function Pe(Ee,Le,Ie){return Ie<0&&(Ie+=1),Ie>1&&(Ie-=1),Ie<1/6?Ee+(Le-Ee)*6*Ie:Ie<1/2?Le:Ie<2/3?Ee+(Le-Ee)*(2/3-Ie)*6:Ee}if(fe===0)ke=Ne=Re=se;else{var je=se<.5?se*(1+fe):se+fe-se*fe,ue=2*se-je;ke=Pe(ue,je,re+1/3),Ne=Pe(ue,je,re),Re=Pe(ue,je,re-1/3)}return{r:ke*255,g:Ne*255,b:Re*255}}function l(re,fe,se){re=I(re,255),fe=I(fe,255),se=I(se,255);var ke=G(re,fe,se),Ne=K(re,fe,se),Re,Pe,je=ke,ue=ke-Ne;if(Pe=ke===0?0:ue/ke,ke==Ne)Re=0;else{switch(ke){case re:Re=(fe-se)/ue+(fe<se?6:0);break;case fe:Re=(se-re)/ue+2;break;case se:Re=(re-fe)/ue+4;break}Re/=6}return{h:Re,s:Pe,v:je}}function f(re,fe,se){re=I(re,360)*6,fe=I(fe,100),se=I(se,100);var ke=J.floor(re),Ne=re-ke,Re=se*(1-fe),Pe=se*(1-Ne*fe),je=se*(1-(1-Ne)*fe),ue=ke%6,Ee=[se,Pe,Re,Re,je,se][ue],Le=[je,se,se,Pe,Re,Re][ue],Ie=[Re,Re,je,se,se,Pe][ue];return{r:Ee*255,g:Le*255,b:Ie*255}}function o(re,fe,se,ke){var Ne=[oe(B(re).toString(16)),oe(B(fe).toString(16)),oe(B(se).toString(16))];return ke&&Ne[0].charAt(0)==Ne[0].charAt(1)&&Ne[1].charAt(0)==Ne[1].charAt(1)&&Ne[2].charAt(0)==Ne[2].charAt(1)?Ne[0].charAt(0)+Ne[1].charAt(0)+Ne[2].charAt(0):Ne.join("")}function u(re,fe,se,ke,Ne){var Re=[oe(B(re).toString(16)),oe(B(fe).toString(16)),oe(B(se).toString(16)),oe(ve(ke))];return Ne&&Re[0].charAt(0)==Re[0].charAt(1)&&Re[1].charAt(0)==Re[1].charAt(1)&&Re[2].charAt(0)==Re[2].charAt(1)&&Re[3].charAt(0)==Re[3].charAt(1)?Re[0].charAt(0)+Re[1].charAt(0)+Re[2].charAt(0)+Re[3].charAt(0):Re.join("")}function a(re,fe,se,ke){var Ne=[oe(ve(ke)),oe(B(re).toString(16)),oe(B(fe).toString(16)),oe(B(se).toString(16))];return Ne.join("")}L.equals=function(re,fe){return!re||!fe?!1:L(re).toRgbString()==L(fe).toRgbString()},L.random=function(){return L.fromRatio({r:r(),g:r(),b:r()})};function s(re,fe){fe=fe===0?0:fe||10;var se=L(re).toHsl();return se.s-=fe/100,se.s=g(se.s),L(se)}function R(re,fe){fe=fe===0?0:fe||10;var se=L(re).toHsl();return se.s+=fe/100,se.s=g(se.s),L(se)}function _(re){return L(re).desaturate(100)}function C(re,fe){fe=fe===0?0:fe||10;var se=L(re).toHsl();return se.l+=fe/100,se.l=g(se.l),L(se)}function D(re,fe){fe=fe===0?0:fe||10;var se=L(re).toRgb();return se.r=G(0,K(255,se.r-B(255*-(fe/100)))),se.g=G(0,K(255,se.g-B(255*-(fe/100)))),se.b=G(0,K(255,se.b-B(255*-(fe/100)))),L(se)}function O(re,fe){fe=fe===0?0:fe||10;var se=L(re).toHsl();return se.l-=fe/100,se.l=g(se.l),L(se)}function A(re,fe){var se=L(re).toHsl(),ke=(se.h+fe)%360;return se.h=ke<0?360+ke:ke,L(se)}function S(re){var fe=L(re).toHsl();return fe.h=(fe.h+180)%360,L(fe)}function T(re){var fe=L(re).toHsl(),se=fe.h;return[L(re),L({h:(se+120)%360,s:fe.s,l:fe.l}),L({h:(se+240)%360,s:fe.s,l:fe.l})]}function c(re){var fe=L(re).toHsl(),se=fe.h;return[L(re),L({h:(se+90)%360,s:fe.s,l:fe.l}),L({h:(se+180)%360,s:fe.s,l:fe.l}),L({h:(se+270)%360,s:fe.s,l:fe.l})]}function w(re){var fe=L(re).toHsl(),se=fe.h;return[L(re),L({h:(se+72)%360,s:fe.s,l:fe.l}),L({h:(se+216)%360,s:fe.s,l:fe.l})]}function y(re,fe,se){fe=fe||6,se=se||30;var ke=L(re).toHsl(),Ne=360/se,Re=[L(re)];for(ke.h=(ke.h-(Ne*fe>>1)+720)%360;--fe;)ke.h=(ke.h+Ne)%360,Re.push(L(ke));return Re}function b(re,fe){fe=fe||6;for(var se=L(re).toHsv(),ke=se.h,Ne=se.s,Re=se.v,Pe=[],je=1/fe;fe--;)Pe.push(L({h:ke,s:Ne,v:Re})),Re=(Re+je)%1;return Pe}L.mix=function(re,fe,se){se=se===0?0:se||50;var ke=L(re).toRgb(),Ne=L(fe).toRgb(),Re=se/100,Pe={r:(Ne.r-ke.r)*Re+ke.r,g:(Ne.g-ke.g)*Re+ke.g,b:(Ne.b-ke.b)*Re+ke.b,a:(Ne.a-ke.a)*Re+ke.a};return L(Pe)},L.readability=function(re,fe){var se=L(re),ke=L(fe);return(J.max(se.getLuminance(),ke.getLuminance())+.05)/(J.min(se.getLuminance(),ke.getLuminance())+.05)},L.isReadable=function(re,fe,se){var ke=L.readability(re,fe),Ne,Re;Re=!1,Ne=ce(se);switch(Ne.level+Ne.size){case"AAsmall":case"AAAlarge":Re=ke>=4.5;break;case"AAlarge":Re=ke>=3;break;case"AAAsmall":Re=ke>=7;break}return Re},L.mostReadable=function(re,fe,se){var ke=null,Ne=0,Re,Pe,je,ue;se=se||{},Pe=se.includeFallbackColors,je=se.level,ue=se.size;for(var Ee=0;Ee<fe.length;Ee++)Re=L.readability(re,fe[Ee]),Re>Ne&&(Ne=Re,ke=L(fe[Ee]));return L.isReadable(re,ke,{level:je,size:ue})||!Pe?ke:(se.includeFallbackColors=!1,L.mostReadable(re,["#fff","#000"],se))};var U=L.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},F=L.hexNames=E(U);function E(re){var fe={};for(var se in re)re.hasOwnProperty(se)&&(fe[re[se]]=se);return fe}function N(re){return re=parseFloat(re),(isNaN(re)||re<0||re>1)&&(re=1),re}function I(re,fe){$(re)&&(re="100%");var se=ie(re);return re=K(fe,G(0,parseFloat(re))),se&&(re=parseInt(re*fe,10)/100),J.abs(re-fe)<1e-6?1:re%fe/parseFloat(fe)}function g(re){return K(1,G(0,re))}function H(re){return parseInt(re,16)}function $(re){return typeof re=="string"&&re.indexOf(".")!=-1&&parseFloat(re)===1}function ie(re){return typeof re=="string"&&re.indexOf("%")!=-1}function oe(re){return re.length==1?"0"+re:""+re}function Ce(re){return re<=1&&(re=re*100+"%"),re}function ve(re){return J.round(parseFloat(re)*255).toString(16)}function Se(re){return H(re)/255}var Ae=function(){var re="[-\\+]?\\d+%?",fe="[-\\+]?\\d*\\.\\d+%?",se="(?:"+fe+")|(?:"+re+")",ke="[\\s|\\(]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")\\s*\\)?",Ne="[\\s|\\(]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")\\s*\\)?";return{CSS_UNIT:new RegExp(se),rgb:new RegExp("rgb"+ke),rgba:new RegExp("rgba"+Ne),hsl:new RegExp("hsl"+ke),hsla:new RegExp("hsla"+Ne),hsv:new RegExp("hsv"+ke),hsva:new RegExp("hsva"+Ne),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Oe(re){return!!Ae.CSS_UNIT.exec(re)}function he(re){re=re.replace(P,"").replace(X,"").toLowerCase();var fe=!1;if(U[re])re=U[re],fe=!0;else if(re=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var se;return(se=Ae.rgb.exec(re))?{r:se[1],g:se[2],b:se[3]}:(se=Ae.rgba.exec(re))?{r:se[1],g:se[2],b:se[3],a:se[4]}:(se=Ae.hsl.exec(re))?{h:se[1],s:se[2],l:se[3]}:(se=Ae.hsla.exec(re))?{h:se[1],s:se[2],l:se[3],a:se[4]}:(se=Ae.hsv.exec(re))?{h:se[1],s:se[2],v:se[3]}:(se=Ae.hsva.exec(re))?{h:se[1],s:se[2],v:se[3],a:se[4]}:(se=Ae.hex8.exec(re))?{r:H(se[1]),g:H(se[2]),b:H(se[3]),a:Se(se[4]),format:fe?"name":"hex8"}:(se=Ae.hex6.exec(re))?{r:H(se[1]),g:H(se[2]),b:H(se[3]),format:fe?"name":"hex"}:(se=Ae.hex4.exec(re))?{r:H(se[1]+""+se[1]),g:H(se[2]+""+se[2]),b:H(se[3]+""+se[3]),a:Se(se[4]+""+se[4]),format:fe?"name":"hex8"}:(se=Ae.hex3.exec(re))?{r:H(se[1]+""+se[1]),g:H(se[2]+""+se[2]),b:H(se[3]+""+se[3]),format:fe?"name":"hex"}:!1}function ce(re){var fe,se;return re=re||{level:"AA",size:"small"},fe=(re.level||"AA").toUpperCase(),se=(re.size||"small").toLowerCase(),fe!=="AA"&&fe!=="AAA"&&(fe="AA"),se!=="small"&&se!=="large"&&(se="small"),{level:fe,size:se}}nt.exports?nt.exports=L:!(ne=function(){return L}.call(xe,Z,xe,nt),ne!==void 0&&(nt.exports=ne))})(Math)},bT9E:function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return J});var ne=Z("VTBJ");function J(P,X){var j=Object(ne.a)({},P);return Array.isArray(X)&&X.forEach(function(B){delete j[B]}),j}},c5Ni:function(nt,xe,Z){},dejd:function(nt,xe,Z){},dmUQ:function(nt,xe,Z){"use strict";var ne=Z("Ff2n"),J=Z("rePB"),P=Z("1OyB"),X=Z("vuIU"),j=Z("Ji7U"),B=Z("md7G"),K=Z("foSv"),G=Z("q1tI"),r=Z.n(G),L=Z("TSYQ"),v=Z.n(L),m=Z("4IlW");function p(T,c){var w=Object.keys(T);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(T);c&&(y=y.filter(function(b){return Object.getOwnPropertyDescriptor(T,b).enumerable})),w.push.apply(w,y)}return w}function h(T){for(var c=1;c<arguments.length;c++){var w=arguments[c]!=null?arguments[c]:{};c%2?p(Object(w),!0).forEach(function(y){Object(J.a)(T,y,w[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(w)):p(Object(w)).forEach(function(y){Object.defineProperty(T,y,Object.getOwnPropertyDescriptor(w,y))})}return T}function l(T){var c=f();return function(){var y=Object(K.a)(T),b;if(c){var U=Object(K.a)(this).constructor;b=Reflect.construct(y,arguments,U)}else b=y.apply(this,arguments);return Object(B.a)(this,b)}}function f(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(T){return!1}}function o(){}function u(T){T.preventDefault()}var a=function(c){return c.replace(/[^\w.-]+/g,"")},s=200,R=600,_=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,C=function(c){return c!=null},D=function(c,w){return w===c||typeof w=="number"&&typeof c=="number"&&isNaN(w)&&isNaN(c)},O=function(T){Object(j.a)(w,T);var c=l(w);function w(y){var b;Object(P.a)(this,w),b=c.call(this,y),b.onKeyDown=function(E){var N=b.props,I=N.onKeyDown,g=N.onPressEnter;if(E.keyCode===m.a.UP){var H=b.getRatio(E);b.up(E,H,null),b.stop()}else if(E.keyCode===m.a.DOWN){var $=b.getRatio(E);b.down(E,$,null),b.stop()}else E.keyCode===m.a.ENTER&&g&&g(E);if(b.recordCursorPosition(),b.lastKeyCode=E.keyCode,I){for(var ie=arguments.length,oe=new Array(ie>1?ie-1:0),Ce=1;Ce<ie;Ce++)oe[Ce-1]=arguments[Ce];I.apply(void 0,[E].concat(oe))}},b.onKeyUp=function(E){var N=b.props.onKeyUp;if(b.stop(),b.recordCursorPosition(),N){for(var I=arguments.length,g=new Array(I>1?I-1:0),H=1;H<I;H++)g[H-1]=arguments[H];N.apply(void 0,[E].concat(g))}},b.onChange=function(E){var N=b.props.onChange;b.state.focused&&(b.inputting=!0),b.rawInput=b.props.parser(b.getValueFromEvent(E)),b.setState({inputValue:b.rawInput}),N(b.toNumber(b.rawInput))},b.onMouseUp=function(){var E=b.props.onMouseUp;b.recordCursorPosition(),E&&E.apply(void 0,arguments)},b.onFocus=function(){var E;b.setState({focused:!0}),(E=b.props).onFocus.apply(E,arguments)},b.onBlur=function(){var E=b.props.onBlur;b.inputting=!1,b.setState({focused:!1});var N=b.getCurrentValidValue(b.state.inputValue),I=b.setValue(N,o);if(E){var g=b.input.value,H=b.getInputDisplayValue({focus:!1,value:I});b.input.value=H&&Number(H),E.apply(void 0,arguments),b.input.value=g}},b.getRatio=function(E){var N=1;return E.metaKey||E.ctrlKey?N=.1:E.shiftKey&&(N=10),N},b.getFullNum=function(E){return isNaN(E)?E:/e/i.test(String(E))?Number(E).toFixed(18).replace(/\.?0+$/,""):E},b.getPrecision=function(E){if(C(b.props.precision))return b.props.precision;var N=String(E);if(N.indexOf("e-")>=0)return parseInt(N.slice(N.indexOf("e-")+2),10);var I=0;return N.indexOf(".")>=0&&(I=N.length-N.indexOf(".")-1),I},b.getInputDisplayValue=function(E){var N=E||b.state,I=N.focused,g=N.inputValue,H=N.value,$;I?$=g:$=b.toPrecisionAsStep(H),$==null&&($="");var ie=b.formatWrapper($);return C(b.props.decimalSeparator)&&(ie=ie.toString().replace(".",b.props.decimalSeparator)),ie},b.recordCursorPosition=function(){try{b.cursorStart=b.input.selectionStart,b.cursorEnd=b.input.selectionEnd,b.currentValue=b.input.value,b.cursorBefore=b.input.value.substring(0,b.cursorStart),b.cursorAfter=b.input.value.substring(b.cursorEnd)}catch(E){}},b.restoreByAfter=function(E){if(E===void 0)return!1;var N=b.input.value,I=N.lastIndexOf(E);if(I===-1)return!1;var g=b.cursorBefore.length;return b.lastKeyCode===m.a.DELETE&&b.cursorBefore.charAt(g-1)===E[0]?(b.fixCaret(g,g),!0):I+E.length===N.length?(b.fixCaret(I,I),!0):!1},b.partRestoreByAfter=function(E){return E===void 0?!1:Array.prototype.some.call(E,function(N,I){var g=E.substring(I);return b.restoreByAfter(g)})},b.isNotCompleteNumber=function(E){return isNaN(E)||E===""||E===null||E&&E.toString().indexOf(".")===E.toString().length-1},b.stop=function(){b.autoStepTimer&&clearTimeout(b.autoStepTimer)},b.down=function(E,N,I){b.pressingUpOrDown=!0,b.step("down",E,N,I)},b.up=function(E,N,I){b.pressingUpOrDown=!0,b.step("up",E,N,I)},b.saveInput=function(E){b.input=E};var U=y.value;U===void 0&&(U=y.defaultValue),b.state={focused:y.autoFocus};var F=b.getValidValue(b.toNumber(U));return b.state=h(h({},b.state),{},{inputValue:b.toPrecisionAsStep(F),value:F}),b}return Object(X.a)(w,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(b){var U=this.props,F=U.value,E=U.onChange,N=U.max,I=U.min,g=this.state.focused;if(b){if(!D(b.value,F)||!D(b.max,N)||!D(b.min,I)){var H=g?F:this.getValidValue(F),$;this.pressingUpOrDown?$=H:this.inputting?$=this.rawInput:$=this.toPrecisionAsStep(H),this.setState({value:H,inputValue:$})}var ie="value"in this.props?F:this.state.value;"max"in this.props&&b.max!==N&&typeof ie=="number"&&ie>N&&E&&E(N),"min"in this.props&&b.min!==I&&typeof ie=="number"&&ie<I&&E&&E(I)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var oe=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===m.a.BACKSPACE?oe=this.cursorStart-1:this.lastKeyCode===m.a.DELETE&&(oe=this.cursorStart):oe=this.input.value.length,this.fixCaret(oe,oe)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case m.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case m.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Ce){}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(b){var U=b;return U===""?U="":this.isNotCompleteNumber(parseFloat(U))?U=this.state.value:U=this.getValidValue(U),this.toNumber(U)}},{key:"getValueFromEvent",value:function(b){var U=b.target.value.trim().replace(/。/g,".");return C(this.props.decimalSeparator)&&(U=U.replace(this.props.decimalSeparator,".")),U}},{key:"getValidValue",value:function(b){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,E=parseFloat(b);return isNaN(E)?b:(E<U&&(E=U),E>F&&(E=F),E)}},{key:"setValue",value:function(b,U){var F=this.props.precision,E=this.isNotCompleteNumber(parseFloat(b))?null:parseFloat(b),N=this.state.value,I=N===void 0?null:N,g=this.state.inputValue,H=g===void 0?null:g,$=typeof E=="number"?E.toFixed(F):"".concat(E),ie=E!==I||$!=="".concat(H);return"value"in this.props?(H=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:H},U)):this.setState({value:E,inputValue:this.toPrecisionAsStep(b)},U),ie&&this.props.onChange(E),E}},{key:"getMaxPrecision",value:function(b){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.props,E=F.precision,N=F.step;if(C(E))return E;var I=this.getPrecision(U),g=this.getPrecision(N),H=this.getPrecision(b);return b?Math.max(H,I+g):I+g}},{key:"getPrecisionFactor",value:function(b){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.getMaxPrecision(b,U);return Math.pow(10,F)}},{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(b){return this.props.formatter?this.props.formatter(b):b}},{key:"toPrecisionAsStep",value:function(b){if(this.isNotCompleteNumber(b)||b==="")return b;var U=Math.abs(this.getMaxPrecision(b));return isNaN(U)?b.toString():Number(b).toFixed(U)}},{key:"toNumber",value:function(b){var U=this.props.precision,F=this.state.focused,E=b&&b.length>16&&F;return this.isNotCompleteNumber(b)||E?b:C(U)?Math.round(b*Math.pow(10,U))/Math.pow(10,U):Number(b)}},{key:"upStep",value:function(b,U){var F=this.props.step,E=this.getPrecisionFactor(b,U),N=Math.abs(this.getMaxPrecision(b,U)),I=((E*b+E*F*U)/E).toFixed(N);return this.toNumber(I)}},{key:"downStep",value:function(b,U){var F=this.props.step,E=this.getPrecisionFactor(b,U),N=Math.abs(this.getMaxPrecision(b,U)),I=((E*b-E*F*U)/E).toFixed(N);return this.toNumber(I)}},{key:"step",value:function(b,U){var F=this,E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,N=arguments.length>3?arguments[3]:void 0;this.stop(),U&&(U.persist(),U.preventDefault());var I=this.props;if(I.disabled)return;var g=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(g))return;var H=this["".concat(b,"Step")](g,E),$=H>I.max||H<I.min;if(H>I.max?H=I.max:H<I.min&&(H=I.min),this.setValue(H,null),this.setState({focused:!0},function(){F.pressingUpOrDown=!1}),$)return;this.autoStepTimer=setTimeout(function(){F[b](U,E,!0)},N?s:R)}},{key:"fixCaret",value:function(b,U){if(b===void 0||U===void 0||!this.input||!this.input.value)return;try{var F=this.input.selectionStart,E=this.input.selectionEnd;(b!==F||U!==E)&&this.input.setSelectionRange(b,U)}catch(N){}}},{key:"render",value:function(){var b,U=this.props,F=U.prefixCls,E=U.disabled,N=U.readOnly,I=U.useTouch,g=U.autoComplete,H=U.upHandler,$=U.downHandler,ie=U.className,oe=U.max,Ce=U.min,ve=U.style,Se=U.title,Ae=U.onMouseEnter,Oe=U.onMouseLeave,he=U.onMouseOver,ce=U.onMouseOut,re=U.required,fe=U.onClick,se=U.tabIndex,ke=U.type,Ne=U.placeholder,Re=U.id,Pe=U.inputMode,je=U.pattern,ue=U.step,Ee=U.maxLength,Le=U.autoFocus,Ie=U.name,Ge=U.onPaste,Xe=U.onInput,Je=Object(ne.a)(U,["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"]),Qe=this.state,at=Qe.value,qe=Qe.focused,tt=v()(F,(b={},Object(J.a)(b,ie,!!ie),Object(J.a)(b,"".concat(F,"-disabled"),E),Object(J.a)(b,"".concat(F,"-focused"),qe),b)),Be={};Object.keys(Je).forEach(function(ge){(ge.substr(0,5)==="data-"||ge.substr(0,5)==="aria-"||ge==="role")&&(Be[ge]=Je[ge])});var ut=!N&&!E,ot=this.getInputDisplayValue(null),Ue=(at||at===0)&&(isNaN(at)||Number(at)>=oe),He=(at||at===0)&&(isNaN(at)||Number(at)<=Ce),Te=Ue||E||N,me=He||E||N,be=v()("".concat(F,"-handler"),"".concat(F,"-handler-up"),Object(J.a)({},"".concat(F,"-handler-up-disabled"),Te)),ae=v()("".concat(F,"-handler"),"".concat(F,"-handler-down"),Object(J.a)({},"".concat(F,"-handler-down-disabled"),me)),le=I?{onTouchStart:Te?o:this.up,onTouchEnd:this.stop}:{onMouseDown:Te?o:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},de=I?{onTouchStart:me?o:this.down,onTouchEnd:this.stop}:{onMouseDown:me?o:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return r.a.createElement("div",{className:tt,style:ve,title:Se,onMouseEnter:Ae,onMouseLeave:Oe,onMouseOver:he,onMouseOut:ce,onFocus:function(){return null},onBlur:function(){return null}},r.a.createElement("div",{className:"".concat(F,"-handler-wrap")},r.a.createElement("span",Object.assign({unselectable:"on"},le,{role:"button","aria-label":"Increase Value","aria-disabled":Te,className:be}),H||r.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-up-inner"),onClick:u})),r.a.createElement("span",Object.assign({unselectable:"on"},de,{role:"button","aria-label":"Decrease Value","aria-disabled":me,className:ae}),$||r.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-down-inner"),onClick:u}))),r.a.createElement("div",{className:"".concat(F,"-input-wrap")},r.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ce,"aria-valuemax":oe,"aria-valuenow":at,required:re,type:ke,placeholder:Ne,onPaste:Ge,onClick:fe,onMouseUp:this.onMouseUp,className:"".concat(F,"-input"),tabIndex:se,autoComplete:g,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:ut?this.onKeyDown:o,onKeyUp:ut?this.onKeyUp:o,autoFocus:Le,maxLength:Ee,readOnly:N,disabled:E,max:oe,min:Ce,step:ue,name:Ie,title:Se,id:Re,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ot),pattern:je,inputMode:Pe,onInput:Xe},Be))))}}]),w}(r.a.Component);O.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:_,min:-_,step:1,style:{},onChange:o,onKeyDown:o,onPressEnter:o,onFocus:o,onBlur:o,parser:a,required:!1,autoComplete:"off"};var A=O,S=xe.a=A},fjLI:function(nt,xe,Z){"use strict";Z.d(xe,"f",function(){return p}),Z.d(xe,"b",function(){return h}),Z.d(xe,"a",function(){return l}),Z.d(xe,"d",function(){return f}),Z.d(xe,"e",function(){return o}),Z.d(xe,"c",function(){return u});var ne=Z("8HAY"),J=Z("Vhoy"),P=Z("MI8n"),X=Z("JYp7"),j=Z("pmY6"),B=Z("24hK"),K=Z("nnTU"),G=Z("T8No"),r=Z("Cg/j"),L=Z("t9D7"),v=function(a,s,R,_){var C=arguments.length,D=C<3?s:_===null?_=Object.getOwnPropertyDescriptor(s,R):_,O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(a,s,R,_);else for(var A=a.length-1;A>=0;A--)(O=a[A])&&(D=(C<3?O(D):C>3?O(s,R,D):O(s,R))||D);return C>3&&D&&Object.defineProperty(s,R,D),D},m=function(a,s){return function(R,_){s(R,_,a)}};function p(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 l=Object(r.c)("menuService"),f=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new P.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:a=>a===h.CommandPalette}}addCommand(a){return this.addCommands(X.a.single(a))}addCommands(a){for(const s of a)this._commands.set(s.id,s);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(j.i)(()=>{let s=!1;for(const R of a)s=this._commands.delete(R.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,R)=>a.set(R,s)),a}appendMenuItem(a,s){return this.appendMenuItems(X.a.single({id:a,item:s}))}appendMenuItems(a){const s=new Set,R=new B.a;for(const{id:_,item:C}of a){let D=this._menuItems.get(_);D||(D=new B.a,this._menuItems.set(_,D)),R.push(D.push(C)),s.add(_)}return this._onDidChangeMenu.fire(s),Object(j.i)(()=>{if(R.size>0){for(let _ of R)_();this._onDidChangeMenu.fire(s),R.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 R of a)p(R)&&(s.add(R.command.id),R.alt&&s.add(R.alt.id));this._commands.forEach((R,_)=>{s.has(_)||a.push({command:R})})}};class o extends ne.e{constructor(a,s,R,_){super(`submenuitem.${a.submenu.id}`,typeof a.title=="string"?a.title:a.title.value,[],"submenu");this.item=a,this._menuService=s,this._contextKeyService=R,this._options=_}get actions(){const a=[],s=this._menuService.createMenu(this.item.submenu,this._contextKeyService),R=s.getActions(this._options);s.dispose();for(const[,_]of R)_.length>0&&(a.push(..._),a.push(new ne.d));return a.length&&a.pop(),a}}let u=class a{constructor(s,R,_,C,D){var O,A;if(this._commandService=D,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=(A=typeof s.tooltip=="string"?s.tooltip:(O=s.tooltip)===null||O===void 0?void 0:O.value)!==null&&A!==void 0?A:"",this.enabled=!s.precondition||C.contextMatchesRules(s.precondition),this.checked=void 0,s.toggled){const S=s.toggled.condition?s.toggled:{condition:s.toggled};this.checked=C.contextMatchesRules(S.condition),this.checked&&S.tooltip&&(this.tooltip=typeof S.tooltip=="string"?S.tooltip:S.tooltip.value),S.title&&(this.label=typeof S.title=="string"?S.title:S.title.value)}this.item=s,this.alt=R?new a(R,void 0,_,C,D):void 0,this._options=_,L.d.isThemeIcon(s.icon)&&(this.class=J.a.asClassName(s.icon))}dispose(){}run(...s){var R,_;let C=[];return((R=this._options)===null||R===void 0?void 0:R.arg)&&(C=[...C,this._options.arg]),((_=this._options)===null||_===void 0?void 0:_.shouldForwardArgs)&&(C=[...C,...s]),this._commandService.executeCommand(this.id,...C)}};u=v([m(3,G.b),m(4,K.b)],u)},h78n:function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return b});var ne=Z("q1tI"),J=Z.n(ne),P=Z("TSYQ"),X=Z.n(P),j={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},B=function(E){var N=E.map(function(){return Object(ne.useRef)()}),I=Object(ne.useRef)();return Object(ne.useEffect)(function(){var g=Date.now(),H=!1;Object.keys(N).forEach(function($){var ie=N[$].current;if(!ie)return;H=!0;var oe=ie.style;oe.transitionDuration=".3s, .3s, .3s, .06s",I.current&&g-I.current<100&&(oe.transitionDuration="0s, 0s")}),H&&(I.current=Date.now())}),[N]};function K(){return K=Object.assign||function(F){for(var E=1;E<arguments.length;E++){var N=arguments[E];for(var I in N)Object.prototype.hasOwnProperty.call(N,I)&&(F[I]=N[I])}return F},K.apply(this,arguments)}function G(F,E){return p(F)||m(F,E)||L(F,E)||r()}function r(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L(F,E){if(!F)return;if(typeof F=="string")return v(F,E);var N=Object.prototype.toString.call(F).slice(8,-1);if(N==="Object"&&F.constructor&&(N=F.constructor.name),N==="Map"||N==="Set")return Array.from(F);if(N==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(N))return v(F,E)}function v(F,E){(E==null||E>F.length)&&(E=F.length);for(var N=0,I=new Array(E);N<E;N++)I[N]=F[N];return I}function m(F,E){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(F)))return;var N=[],I=!0,g=!1,H=void 0;try{for(var $=F[Symbol.iterator](),ie;!(I=(ie=$.next()).done)&&!(N.push(ie.value),E&&N.length===E);I=!0);}catch(oe){g=!0,H=oe}finally{try{!I&&$.return!=null&&$.return()}finally{if(g)throw H}}return N}function p(F){if(Array.isArray(F))return F}function h(F,E){if(F==null)return{};var N=l(F,E),I,g;if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(F);for(g=0;g<H.length;g++){if(I=H[g],E.indexOf(I)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(F,I))continue;N[I]=F[I]}}return N}function l(F,E){if(F==null)return{};var N={},I=Object.keys(F),g,H;for(H=0;H<I.length;H++){if(g=I[H],E.indexOf(g)>=0)continue;N[g]=F[g]}return N}var f=function(E){var N=E.className,I=E.percent,g=E.prefixCls,H=E.strokeColor,$=E.strokeLinecap,ie=E.strokeWidth,oe=E.style,Ce=E.trailColor,ve=E.trailWidth,Se=E.transition,Ae=h(E,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Ae.gapPosition;var Oe=Array.isArray(I)?I:[I],he=Array.isArray(H)?H:[H],ce=B(Oe),re=G(ce,1),fe=re[0],se=ie/2,ke=100-ie/2,Ne="M ".concat($==="round"?se:0,",").concat(se,`
L `).concat($==="round"?ke:100,",").concat(se),Re="0 0 100 ".concat(ie),Pe=0;return J.a.createElement("svg",K({className:X()("".concat(g,"-line"),N),viewBox:Re,preserveAspectRatio:"none",style:oe},Ae),J.a.createElement("path",{className:"".concat(g,"-line-trail"),d:Ne,strokeLinecap:$,stroke:Ce,strokeWidth:ve||ie,fillOpacity:"0"}),Oe.map(function(je,ue){var Ee={strokeDasharray:"".concat(je,"px, 100px"),strokeDashoffset:"-".concat(Pe,"px"),transition:Se||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Le=he[ue]||he[he.length-1];return Pe+=je,J.a.createElement("path",{key:ue,className:"".concat(g,"-line-path"),d:Ne,strokeLinecap:$,stroke:Le,strokeWidth:ie,fillOpacity:"0",ref:fe[ue],style:Ee})}))};f.defaultProps=j;var o=f;function u(){return u=Object.assign||function(F){for(var E=1;E<arguments.length;E++){var N=arguments[E];for(var I in N)Object.prototype.hasOwnProperty.call(N,I)&&(F[I]=N[I])}return F},u.apply(this,arguments)}function a(F,E){return D(F)||C(F,E)||R(F,E)||s()}function s(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R(F,E){if(!F)return;if(typeof F=="string")return _(F,E);var N=Object.prototype.toString.call(F).slice(8,-1);if(N==="Object"&&F.constructor&&(N=F.constructor.name),N==="Map"||N==="Set")return Array.from(F);if(N==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(N))return _(F,E)}function _(F,E){(E==null||E>F.length)&&(E=F.length);for(var N=0,I=new Array(E);N<E;N++)I[N]=F[N];return I}function C(F,E){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(F)))return;var N=[],I=!0,g=!1,H=void 0;try{for(var $=F[Symbol.iterator](),ie;!(I=(ie=$.next()).done)&&!(N.push(ie.value),E&&N.length===E);I=!0);}catch(oe){g=!0,H=oe}finally{try{!I&&$.return!=null&&$.return()}finally{if(g)throw H}}return N}function D(F){if(Array.isArray(F))return F}function O(F,E){if(F==null)return{};var N=A(F,E),I,g;if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(F);for(g=0;g<H.length;g++){if(I=H[g],E.indexOf(I)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(F,I))continue;N[I]=F[I]}}return N}function A(F,E){if(F==null)return{};var N={},I=Object.keys(F),g,H;for(H=0;H<I.length;H++){if(g=I[H],E.indexOf(g)>=0)continue;N[g]=F[g]}return N}var S=0;function T(F){return+F.replace("%","")}function c(F){return Array.isArray(F)?F:[F]}function w(F,E,N,I){var g=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,H=arguments.length>5?arguments[5]:void 0,$=50-I/2,ie=0,oe=-$,Ce=0,ve=-2*$;switch(H){case"left":ie=-$,oe=0,Ce=2*$,ve=0;break;case"right":ie=$,oe=0,Ce=-2*$,ve=0;break;case"bottom":oe=$,ve=2*$;break;default:}var Se="M 50,50 m ".concat(ie,",").concat(oe,`
a `).concat($,",").concat($," 0 1 1 ").concat(Ce,",").concat(-ve,`
a `).concat($,",").concat($," 0 1 1 ").concat(-Ce,",").concat(ve),Ae=Math.PI*2*$,Oe={stroke:N,strokeDasharray:"".concat(E/100*(Ae-g),"px ").concat(Ae,"px"),strokeDashoffset:"-".concat(g/2+F/100*(Ae-g),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Se,pathStyle:Oe}}var y=function(E){var N=E.prefixCls,I=E.strokeWidth,g=E.trailWidth,H=E.gapDegree,$=E.gapPosition,ie=E.trailColor,oe=E.strokeLinecap,Ce=E.style,ve=E.className,Se=E.strokeColor,Ae=E.percent,Oe=O(E,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),he=Object(ne.useMemo)(function(){return S+=1,S},[]),ce=w(0,100,ie,I,H,$),re=ce.pathString,fe=ce.pathStyle,se=c(Ae),ke=c(Se),Ne=ke.find(function(Ee){return Object.prototype.toString.call(Ee)==="[object Object]"}),Re=B(se),Pe=a(Re,1),je=Pe[0],ue=function(){var Le=0;return se.map(function(Ie,Ge){var Xe=ke[Ge]||ke[ke.length-1],Je=Object.prototype.toString.call(Xe)==="[object Object]"?"url(#".concat(N,"-gradient-").concat(he,")"):"",Qe=w(Le,Ie,Xe,I,H,$);return Le+=Ie,J.a.createElement("path",{key:Ge,className:"".concat(N,"-circle-path"),d:Qe.pathString,stroke:Je,strokeLinecap:oe,strokeWidth:I,opacity:Ie===0?0:1,fillOpacity:"0",style:Qe.pathStyle,ref:je[Ge]})})};return J.a.createElement("svg",u({className:X()("".concat(N,"-circle"),ve),viewBox:"0 0 100 100",style:Ce},Oe),Ne&&J.a.createElement("defs",null,J.a.createElement("linearGradient",{id:"".concat(N,"-gradient-").concat(he),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Ne).sort(function(Ee,Le){return T(Ee)-T(Le)}).map(function(Ee,Le){return J.a.createElement("stop",{key:Le,offset:Ee,stopColor:Ne[Ee]})}))),J.a.createElement("path",{className:"".concat(N,"-circle-trail"),d:re,stroke:ie,strokeLinecap:oe,strokeWidth:g||I,fillOpacity:"0",style:fe}),ue().reverse())};y.defaultProps=j;var b=y,U={Line:o,Circle:b}},ic2d:function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return X});var ne=Z("FWmy"),J=Z("746U");class P{constructor(){this.data=new Map}add(j,B){ne.a(J.l(j)),ne.a(J.k(B)),ne.a(!this.data.has(j),"There is already an extension with this id"),this.data.set(j,B)}as(j){return this.data.get(j)||null}}const X=new P},kSUc:function(nt,xe,Z){},lZu9:function(nt,xe,Z){(function(ne){ne(Z("VrN/"),Z("1eCo"),Z("8EBN"))})(function(ne){"use strict";ne.defineMode("markdown",function(J,P){var X=ne.getMode(J,"text/html"),j=X.name=="null";function B(I){if(ne.findModeByName){var g=ne.findModeByName(I);g&&(I=g.mime||g.mimes[0])}var H=ne.getMode(J,I);return H.name=="null"?null:H}P.highlightFormatting===void 0&&(P.highlightFormatting=!1),P.maxBlockquoteDepth===void 0&&(P.maxBlockquoteDepth=0),P.taskLists===void 0&&(P.taskLists=!1),P.strikethrough===void 0&&(P.strikethrough=!1),P.emoji===void 0&&(P.emoji=!1),P.fencedCodeBlockHighlighting===void 0&&(P.fencedCodeBlockHighlighting=!0),P.fencedCodeBlockDefaultMode===void 0&&(P.fencedCodeBlockDefaultMode="text/plain"),P.xml===void 0&&(P.xml=!0),P.tokenTypeOverrides===void 0&&(P.tokenTypeOverrides={});var K={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 G in K)K.hasOwnProperty(G)&&P.tokenTypeOverrides[G]&&(K[G]=P.tokenTypeOverrides[G]);var r=/^([*\-_])(?:\s*\1){2,}\s*$/,L=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,v=/^\[(x| )\](?=\s)/i,m=P.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,p=/^ {0,3}(?:\={1,}|-{2,})\s*$/,h=/^[^#!\[\]*_\\<>` "'(~:]+/,l=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,f=/^\s*\[[^\]]+?\]:.*$/,o=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,u=" ";function a(I,g,H){return g.f=g.inline=H,H(I,g)}function s(I,g,H){return g.f=g.block=H,H(I,g)}function R(I){return!I||!/\S/.test(I.string)}function _(I){if(I.linkTitle=!1,I.linkHref=!1,I.linkText=!1,I.em=!1,I.strong=!1,I.strikethrough=!1,I.quote=0,I.indentedCode=!1,I.f==D){var g=j;if(!g){var H=ne.innerMode(X,I.htmlState);g=H.mode.name=="xml"&&H.state.tagStart===null&&!H.state.context&&H.state.tokenize.isInText}g&&(I.f=T,I.block=C,I.htmlState=null)}return I.trailingSpace=0,I.trailingSpaceNewLine=!1,I.prevLine=I.thisLine,I.thisLine={stream:null},null}function C(I,g){var H=I.column()===g.indentation,$=R(g.prevLine.stream),ie=g.indentedCode,oe=g.prevLine.hr,Ce=g.list!==!1,ve=(g.listStack[g.listStack.length-1]||0)+3;g.indentedCode=!1;var Se=g.indentation;if(g.indentationDiff===null&&(g.indentationDiff=g.indentation,Ce)){for(g.list=null;Se<g.listStack[g.listStack.length-1];)g.listStack.pop(),g.listStack.length?g.indentation=g.listStack[g.listStack.length-1]:g.list=!1;g.list!==!1&&(g.indentationDiff=Se-g.listStack[g.listStack.length-1])}var Ae=!$&&!oe&&!g.prevLine.header&&(!Ce||!ie)&&!g.prevLine.fencedCodeEnd,Oe=(g.list===!1||oe||$)&&g.indentation<=ve&&I.match(r),he=null;if(g.indentationDiff>=4&&(ie||g.prevLine.fencedCodeEnd||g.prevLine.header||$))return I.skipToEnd(),g.indentedCode=!0,K.code;if(I.eatSpace())return null;if(H&&g.indentation<=ve&&(he=I.match(m))&&he[1].length<=6)return g.quote=0,g.header=he[1].length,g.thisLine.header=!0,P.highlightFormatting&&(g.formatting="header"),g.f=g.inline,A(g);if(g.indentation<=ve&&I.eat(">"))return g.quote=H?1:g.quote+1,P.highlightFormatting&&(g.formatting="quote"),I.eatSpace(),A(g);if(!Oe&&!g.setext&&H&&g.indentation<=ve&&(he=I.match(L))){var ce=he[1]?"ol":"ul";return g.indentation=Se+I.current().length,g.list=!0,g.quote=0,g.listStack.push(g.indentation),g.em=!1,g.strong=!1,g.code=!1,g.strikethrough=!1,P.taskLists&&I.match(v,!1)&&(g.taskList=!0),g.f=g.inline,P.highlightFormatting&&(g.formatting=["list","list-"+ce]),A(g)}else{if(H&&g.indentation<=ve&&(he=I.match(l,!0)))return g.quote=0,g.fencedEndRE=new RegExp(he[1]+"+ *$"),g.localMode=P.fencedCodeBlockHighlighting&&B(he[2]||P.fencedCodeBlockDefaultMode),g.localMode&&(g.localState=ne.startState(g.localMode)),g.f=g.block=O,P.highlightFormatting&&(g.formatting="code-block"),g.code=-1,A(g);if(g.setext||(!Ae||!Ce)&&!g.quote&&g.list===!1&&!g.code&&!Oe&&!f.test(I.string)&&(he=I.lookAhead(1))&&(he=he.match(p)))return g.setext?(g.header=g.setext,g.setext=0,I.skipToEnd(),P.highlightFormatting&&(g.formatting="header")):(g.header=he[0].charAt(0)=="="?1:2,g.setext=g.header),g.thisLine.header=!0,g.f=g.inline,A(g);if(Oe)return I.skipToEnd(),g.hr=!0,g.thisLine.hr=!0,K.hr;if(I.peek()==="[")return a(I,g,U)}return a(I,g,g.inline)}function D(I,g){var H=X.token(I,g.htmlState);if(!j){var $=ne.innerMode(X,g.htmlState);($.mode.name=="xml"&&$.state.tagStart===null&&!$.state.context&&$.state.tokenize.isInText||g.md_inside&&I.current().indexOf(">")>-1)&&(g.f=T,g.block=C,g.htmlState=null)}return H}function O(I,g){var H=g.listStack[g.listStack.length-1]||0,$=g.indentation<H,ie=H+3;if(g.fencedEndRE&&g.indentation<=ie&&($||I.match(g.fencedEndRE))){P.highlightFormatting&&(g.formatting="code-block");var oe;return $||(oe=A(g)),g.localMode=g.localState=null,g.block=C,g.f=T,g.fencedEndRE=null,g.code=0,g.thisLine.fencedCodeEnd=!0,$?s(I,g,g.block):oe}else return g.localMode?g.localMode.token(I,g.localState):(I.skipToEnd(),K.code)}function A(I){var g=[];if(I.formatting){g.push(K.formatting),typeof I.formatting=="string"&&(I.formatting=[I.formatting]);for(var H=0;H<I.formatting.length;H++)g.push(K.formatting+"-"+I.formatting[H]),I.formatting[H]==="header"&&g.push(K.formatting+"-"+I.formatting[H]+"-"+I.header),I.formatting[H]==="quote"&&(!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=I.quote?g.push(K.formatting+"-"+I.formatting[H]+"-"+I.quote):g.push("error"))}if(I.taskOpen)return g.push("meta"),g.length?g.join(" "):null;if(I.taskClosed)return g.push("property"),g.length?g.join(" "):null;if(I.linkHref?g.push(K.linkHref,"url"):(I.strong&&g.push(K.strong),I.em&&g.push(K.em),I.strikethrough&&g.push(K.strikethrough),I.emoji&&g.push(K.emoji),I.linkText&&g.push(K.linkText),I.code&&g.push(K.code),I.image&&g.push(K.image),I.imageAltText&&g.push(K.imageAltText,"link"),I.imageMarker&&g.push(K.imageMarker)),I.header&&g.push(K.header,K.header+"-"+I.header),I.quote&&(g.push(K.quote),!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=I.quote?g.push(K.quote+"-"+I.quote):g.push(K.quote+"-"+P.maxBlockquoteDepth)),I.list!==!1){var $=(I.listStack.length-1)%3;$?$===1?g.push(K.list2):g.push(K.list3):g.push(K.list1)}return I.trailingSpaceNewLine?g.push("trailing-space-new-line"):I.trailingSpace&&g.push("trailing-space-"+(I.trailingSpace%2?"a":"b")),g.length?g.join(" "):null}function S(I,g){return I.match(h,!0)?A(g):void 0}function T(I,g){var H=g.text(I,g);if(typeof H!="undefined")return H;if(g.list)return g.list=null,A(g);if(g.taskList){var $=I.match(v,!0)[1]===" ";return $?g.taskOpen=!0:g.taskClosed=!0,P.highlightFormatting&&(g.formatting="task"),g.taskList=!1,A(g)}if(g.taskOpen=!1,g.taskClosed=!1,g.header&&I.match(/^#+$/,!0))return P.highlightFormatting&&(g.formatting="header"),A(g);var ie=I.next();if(g.linkTitle){g.linkTitle=!1;var oe=ie;ie==="("&&(oe=")"),oe=(oe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ce="^\\s*(?:[^"+oe+"\\\\]+|\\\\\\\\|\\\\.)"+oe;if(I.match(new RegExp(Ce),!0))return K.linkHref}if(ie==="`"){var ve=g.formatting;P.highlightFormatting&&(g.formatting="code"),I.eatWhile("`");var Se=I.current().length;if(g.code==0&&(!g.quote||Se==1))return g.code=Se,A(g);if(Se==g.code){var Ae=A(g);return g.code=0,Ae}else return g.formatting=ve,A(g)}else if(g.code)return A(g);if(ie==="\\"&&(I.next(),P.highlightFormatting)){var Oe=A(g),he=K.formatting+"-escape";return Oe?Oe+" "+he:he}if(ie==="!"&&I.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return g.imageMarker=!0,g.image=!0,P.highlightFormatting&&(g.formatting="image"),A(g);if(ie==="["&&g.imageMarker&&I.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return g.imageMarker=!1,g.imageAltText=!0,P.highlightFormatting&&(g.formatting="image"),A(g);if(ie==="]"&&g.imageAltText){P.highlightFormatting&&(g.formatting="image");var Oe=A(g);return g.imageAltText=!1,g.image=!1,g.inline=g.f=w,Oe}if(ie==="["&&!g.image)return g.linkText&&I.match(/^.*?\]/)||(g.linkText=!0,P.highlightFormatting&&(g.formatting="link")),A(g);if(ie==="]"&&g.linkText){P.highlightFormatting&&(g.formatting="link");var Oe=A(g);return g.linkText=!1,g.inline=g.f=I.match(/\(.*?\)| ?\[.*?\]/,!1)?w:T,Oe}if(ie==="<"&&I.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=c,P.highlightFormatting&&(g.formatting="link");var Oe=A(g);return Oe?Oe+=" ":Oe="",Oe+K.linkInline}if(ie==="<"&&I.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=c,P.highlightFormatting&&(g.formatting="link");var Oe=A(g);return Oe?Oe+=" ":Oe="",Oe+K.linkEmail}if(P.xml&&ie==="<"&&I.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ce=I.string.indexOf(">",I.pos);if(ce!=-1){var re=I.string.substring(I.start,ce);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(re)&&(g.md_inside=!0)}return I.backUp(1),g.htmlState=ne.startState(X),s(I,g,D)}if(P.xml&&ie==="<"&&I.match(/^\/\w*?>/))return g.md_inside=!1,"tag";if(ie==="*"||ie==="_"){for(var fe=1,se=I.pos==1?" ":I.string.charAt(I.pos-2);fe<3&&I.eat(ie);)fe++;var ke=I.peek()||" ",Ne=!/\s/.test(ke)&&(!o.test(ke)||/\s/.test(se)||o.test(se)),Re=!/\s/.test(se)&&(!o.test(se)||/\s/.test(ke)||o.test(ke)),Pe=null,je=null;if(fe%2&&(!g.em&&Ne&&(ie==="*"||!Re||o.test(se))?Pe=!0:g.em==ie&&Re&&(ie==="*"||!Ne||o.test(ke))&&(Pe=!1)),fe>1&&(!g.strong&&Ne&&(ie==="*"||!Re||o.test(se))?je=!0:g.strong==ie&&Re&&(ie==="*"||!Ne||o.test(ke))&&(je=!1)),je!=null||Pe!=null){P.highlightFormatting&&(g.formatting=Pe==null?"strong":je==null?"em":"strong em"),Pe===!0&&(g.em=ie),je===!0&&(g.strong=ie);var Ae=A(g);return Pe===!1&&(g.em=!1),je===!1&&(g.strong=!1),Ae}}else if(ie===" "&&(I.eat("*")||I.eat("_"))){if(I.peek()===" ")return A(g);I.backUp(1)}if(P.strikethrough){if(ie==="~"&&I.eatWhile(ie)){if(g.strikethrough){P.highlightFormatting&&(g.formatting="strikethrough");var Ae=A(g);return g.strikethrough=!1,Ae}else if(I.match(/^[^\s]/,!1))return g.strikethrough=!0,P.highlightFormatting&&(g.formatting="strikethrough"),A(g)}else if(ie===" "&&I.match(/^~~/,!0)){if(I.peek()===" ")return A(g);I.backUp(2)}}if(P.emoji&&ie===":"&&I.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){g.emoji=!0,P.highlightFormatting&&(g.formatting="emoji");var ue=A(g);return g.emoji=!1,ue}return ie===" "&&(I.match(/^ +$/,!1)?g.trailingSpace++:g.trailingSpace&&(g.trailingSpaceNewLine=!0)),A(g)}function c(I,g){var H=I.next();if(H===">"){g.f=g.inline=T,P.highlightFormatting&&(g.formatting="link");var $=A(g);return $?$+=" ":$="",$+K.linkInline}return I.match(/^[^>]+/,!0),K.linkInline}function w(I,g){if(I.eatSpace())return null;var H=I.next();return H==="("||H==="["?(g.f=g.inline=b(H==="("?")":"]"),P.highlightFormatting&&(g.formatting="link-string"),g.linkHref=!0,A(g)):"error"}var y={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function b(I){return function(g,H){var $=g.next();if($===I){H.f=H.inline=T,P.highlightFormatting&&(H.formatting="link-string");var ie=A(H);return H.linkHref=!1,ie}return g.match(y[I]),H.linkHref=!0,A(H)}}function U(I,g){return I.match(/^([^\]\\]|\\.)*\]:/,!1)?(g.f=F,I.next(),P.highlightFormatting&&(g.formatting="link"),g.linkText=!0,A(g)):a(I,g,T)}function F(I,g){if(I.match(/^\]:/,!0)){g.f=g.inline=E,P.highlightFormatting&&(g.formatting="link");var H=A(g);return g.linkText=!1,H}return I.match(/^([^\]\\]|\\.)+/,!0),K.linkText}function E(I,g){return I.eatSpace()?null:(I.match(/^[^\s]+/,!0),I.peek()===void 0?g.linkTitle=!0:I.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),g.f=g.inline=T,K.linkHref+" url")}var N={startState:function(){return{f:C,prevLine:{stream:null},thisLine:{stream:null},block:C,htmlState:null,indentation:0,inline:T,text:S,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(I){return{f:I.f,prevLine:I.prevLine,thisLine:I.thisLine,block:I.block,htmlState:I.htmlState&&ne.copyState(X,I.htmlState),indentation:I.indentation,localMode:I.localMode,localState:I.localMode?ne.copyState(I.localMode,I.localState):null,inline:I.inline,text:I.text,formatting:!1,linkText:I.linkText,linkTitle:I.linkTitle,linkHref:I.linkHref,code:I.code,em:I.em,strong:I.strong,strikethrough:I.strikethrough,emoji:I.emoji,header:I.header,setext:I.setext,hr:I.hr,taskList:I.taskList,list:I.list,listStack:I.listStack.slice(0),quote:I.quote,indentedCode:I.indentedCode,trailingSpace:I.trailingSpace,trailingSpaceNewLine:I.trailingSpaceNewLine,md_inside:I.md_inside,fencedEndRE:I.fencedEndRE}},token:function(I,g){if(g.formatting=!1,I!=g.thisLine.stream){if(g.header=0,g.hr=!1,I.match(/^\s*$/,!0))return _(g),null;if(g.prevLine=g.thisLine,g.thisLine={stream:I},g.taskList=!1,g.trailingSpace=0,g.trailingSpaceNewLine=!1,!g.localState&&(g.f=g.block,g.f!=D)){var H=I.match(/^\s*/,!0)[0].replace(/\t/g,u).length;if(g.indentation=H,g.indentationDiff=null,H>0)return null}}return g.f(I,g)},innerMode:function(I){return I.block==D?{state:I.htmlState,mode:X}:I.localState?{state:I.localState,mode:I.localMode}:{state:I,mode:N}},indent:function(I,g,H){return I.block==D&&X.indent?X.indent(I.htmlState,g,H):I.localState&&I.localMode.indent?I.localMode.indent(I.localState,g,H):ne.Pass},blankLine:_,getType:A,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return N},"xml"),ne.defineMIME("text/markdown","markdown"),ne.defineMIME("text/x-markdown","markdown")})},nEHx:function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return ne});var ne;(function(J){J.DARK="dark",J.LIGHT="light",J.HIGH_CONTRAST="hc"})(ne||(ne={}))},nnTU:function(nt,xe,Z){"use strict";Z.d(xe,"b",function(){return K}),Z.d(xe,"a",function(){return G});var ne=Z("MI8n"),J=Z("JYp7"),P=Z("pmY6"),X=Z("24hK"),j=Z("746U"),B=Z("Cg/j");const K=Object(B.c)("commandService"),G=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ne.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(r,L){if(!r)throw new Error("invalid command");if(typeof r=="string"){if(!L)throw new Error("invalid command");return this.registerCommand({id:r,handler:L})}if(r.description){const l=[];for(let o of r.description.args)l.push(o.constraint);const f=r.handler;r.handler=function(o,...u){return Object(j.o)(u,l),f(o,...u)}}const{id:v}=r;let m=this._commands.get(v);m||(m=new X.a,this._commands.set(v,m));let p=m.unshift(r),h=Object(P.i)(()=>{p();const l=this._commands.get(v);(l==null?void 0:l.isEmpty())&&this._commands.delete(v)});return this._onDidRegisterCommand.fire(v),h}registerCommandAlias(r,L){return G.registerCommand(r,(v,...m)=>v.get(K).executeCommand(L,...m))}getCommand(r){const L=this._commands.get(r);return!L||L.isEmpty()?void 0:J.a.first(L)}getCommands(){const r=new Map;for(const L of this._commands.keys()){const v=this.getCommand(L);v&&r.set(L,v)}return r}};G.registerCommand("noop",()=>{})},osHv:function(nt,xe,Z){(function(ne){ne(Z("VrN/"))})(function(ne){"use strict";var J=ne.Pos;function P(o,u){return o.line-u.line||o.ch-u.ch}var X="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",j=X+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",B=new RegExp("<(/?)(["+X+"]["+j+"]*)","g");function K(o,u,a,s){this.line=u,this.ch=a,this.cm=o,this.text=o.getLine(u),this.min=s?Math.max(s.from,o.firstLine()):o.firstLine(),this.max=s?Math.min(s.to-1,o.lastLine()):o.lastLine()}function G(o,u){var a=o.cm.getTokenTypeAt(J(o.line,u));return a&&/\btag\b/.test(a)}function r(o){return o.line>=o.max?void 0:(o.ch=0,o.text=o.cm.getLine(++o.line),!0)}function L(o){return o.line<=o.min?void 0:(o.text=o.cm.getLine(--o.line),o.ch=o.text.length,!0)}function v(o){for(;;){var u=o.text.indexOf(">",o.ch);if(u==-1){if(r(o))continue;return}if(!G(o,u+1)){o.ch=u+1;continue}var a=o.text.lastIndexOf("/",u),s=a>-1&&!/\S/.test(o.text.slice(a+1,u));return o.ch=u+1,s?"selfClose":"regular"}}function m(o){for(;;){var u=o.ch?o.text.lastIndexOf("<",o.ch-1):-1;if(u==-1){if(L(o))continue;return}if(!G(o,u+1)){o.ch=u;continue}B.lastIndex=u,o.ch=u;var a=B.exec(o.text);if(a&&a.index==u)return a}}function p(o){for(;;){B.lastIndex=o.ch;var u=B.exec(o.text);if(!u){if(r(o))continue;return}if(!G(o,u.index+1)){o.ch=u.index+1;continue}return o.ch=u.index+u[0].length,u}}function h(o){for(;;){var u=o.ch?o.text.lastIndexOf(">",o.ch-1):-1;if(u==-1){if(L(o))continue;return}if(!G(o,u+1)){o.ch=u;continue}var a=o.text.lastIndexOf("/",u),s=a>-1&&!/\S/.test(o.text.slice(a+1,u));return o.ch=u+1,s?"selfClose":"regular"}}function l(o,u){for(var a=[];;){var s=p(o),R,_=o.line,C=o.ch-(s?s[0].length:0);if(!s||!(R=v(o)))return;if(R=="selfClose")continue;if(s[1]){for(var D=a.length-1;D>=0;--D)if(a[D]==s[2]){a.length=D;break}if(D<0&&(!u||u==s[2]))return{tag:s[2],from:J(_,C),to:J(o.line,o.ch)}}else a.push(s[2])}}function f(o,u){for(var a=[];;){var s=h(o);if(!s)return;if(s=="selfClose"){m(o);continue}var R=o.line,_=o.ch,C=m(o);if(!C)return;if(C[1])a.push(C[2]);else{for(var D=a.length-1;D>=0;--D)if(a[D]==C[2]){a.length=D;break}if(D<0&&(!u||u==C[2]))return{tag:C[2],from:J(o.line,o.ch),to:J(R,_)}}}}ne.registerHelper("fold","xml",function(o,u){for(var a=new K(o,u.line,0);;){var s=p(a);if(!s||a.line!=u.line)return;var R=v(a);if(!R)return;if(!s[1]&&R!="selfClose"){var _=J(a.line,a.ch),C=l(a,s[2]);return C&&P(C.from,_)>0?{from:_,to:C.from}:null}}}),ne.findMatchingTag=function(o,u,a){var s=new K(o,u.line,u.ch,a);if(s.text.indexOf(">")==-1&&s.text.indexOf("<")==-1)return;var R=v(s),_=R&&J(s.line,s.ch),C=R&&m(s);if(!R||!C||P(s,u)>0)return;var D={from:J(s.line,s.ch),to:_,tag:C[2]};return R=="selfClose"?{open:D,close:null,at:"open"}:C[1]?{open:f(s,C[2]),close:D,at:"close"}:(s=new K(o,_.line,_.ch,a),{open:D,close:l(s,C[2]),at:"open"})},ne.findEnclosingTag=function(o,u,a,s){for(var R=new K(o,u.line,u.ch,a);;){var _=f(R,s);if(!_)break;var C=new K(o,u.line,u.ch,a),D=l(C,_.tag);if(D)return{open:_,close:D}}},ne.scanForClosingTag=function(o,u,a,s){var R=new K(o,u.line,u.ch,s?{from:0,to:s}:null);return l(R,a)}})},p5ED:function(nt,xe,Z){"use strict";var ne=Z("+L6B"),J=Z("2/Rp"),P=Z("5Dmo"),X=Z("3S7+"),j=Z("k1fw"),B=Z("9og8"),K=Z("tJVT"),G=Z("WmNS"),r=Z.n(G),L=Z("q1tI"),v=Z.n(L),m=Z("vHTk"),p=Z.n(m),h=Z("yEEn"),l=Z("ZW9T"),f=Z("1vsH"),o=Z("V0Rq"),u=Z("m3rI");xe.a=function(a){var s,R,_,C,D,O,A,S=a.editOffice,T=S===void 0?"view":S,c=a.data,w=a.theme,y=a.type,b=a.filename,U=a.monacoEditor,F=a.className,E=a.style,N=a.close,I=a.onClose,g=a.hasMask,H=a.disabledDownload,$=Object(L.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ie=Object(K.a)($,2),oe=ie[0],Ce=ie[1],ve=Object(L.useState)(""),Se=Object(K.a)(ve,2),Ae=Se[0],Oe=Se[1],he=Object(L.useState)(),ce=Object(K.a)(he,2),re=ce[0],fe=ce[1],se=window.ENV==="build"?"/react/build":"",ke=u.a.PROXY_SERVER||location.origin,Ne,Re=1024*1024,Pe=10*Re,je=Object(L.useRef)();(s=c)!==null&&s!==void 0&&s.startsWith("/api")&&y!=="txt"&&(c=u.a.API_SERVER+c),y==="office"&&(Ne=Object(f.T)(c).filesize,Ne>Pe&&(y="other")),b&&U&&(U.filename=b),Object(L.useEffect)(function(){var Ie,Ge,Xe=(Ie=document.cookie)===null||Ie===void 0||((Ge=Ie.replace(/\s/g,""))===null||Ge===void 0)?void 0:Ge.split(";");Xe==null||Xe.map(function(Je){var Qe=Je.split("=");Qe[0]==="_educoder_session"&&Oe(Qe[1])})},[]),Object(L.useEffect)(function(){y==="office"&&ue()},[y,c]);var ue=function(){var Ie=Object(B.a)(r.a.mark(function Ge(){var Xe,Je,Qe;return r.a.wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:return console.log("data:",c),Xe=c,c.startsWith("http")||(Xe=location.origin+Xe),Je=new URL(Xe).pathname.split("/").pop(),qe.next=6,Object(o.V)({attachment_id:Je});case 6:Qe=qe.sent,fe(Qe);case 8:case"end":return qe.stop()}},Ge)}));return function(){return Ie.apply(this,arguments)}}(),Ee=function(){if(c.startsWith("http")||c.startsWith("blob:")){Le();return}Object(f.z)(b||"educoder",c,b)},Le=function(){Object(f.x)(b||"educoder",decodeURIComponent(c))};return v.a.createElement("div",{style:Object(j.a)({},E||{}),className:"".concat(g&&p.a.bgBlack," ").concat(y?p.a.wrp:"hide")},N&&v.a.createElement("div",{className:p.a.close,ref:je},!H&&v.a.createElement(X.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return je.current}},v.a.createElement("span",{onClick:Le},v.a.createElement("i",{className:"icon-quxiaozhiding"}))),v.a.createElement(X.a,{title:"\u5173\u95ED",getPopupContainer:function(){return je.current}},v.a.createElement("span",{className:"",onClick:I},v.a.createElement("i",{className:"icon-guanbi1"})))),v.a.createElement("div",{className:"".concat(p.a[F]," ").concat(F," ").concat(p.a.monaco," ").concat(y==="txt"?"show":"hide")},y==="txt"&&v.a.createElement(l.b,U)),y==="audio"&&v.a.createElement("audio",{src:"".concat(((R=c)===null||R===void 0?void 0:R.indexOf("http://"))>-1||((_=c)===null||_===void 0?void 0:_.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(c),autoPlay:!0}),y==="video"&&v.a.createElement(v.a.Fragment,null,((C=c)===null||C===void 0?void 0:C.indexOf("http"))>-1?v.a.createElement("video",{controls:!0,src:"".concat(c),autoPlay:!0}):v.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(c),autoPlay:!0})),y==="office"&&re&&v.a.createElement("iframe",{src:"".concat(se,"/office.html?key=").concat(re.key,"&url=").concat(ke+re.url,"&callbackUrl=").concat(ke+re.callbackUrl,"&fileType=").concat(re.fileType,"&title=").concat(re.title,"&model=").concat(T,"&officeServer=").concat(u.a.OFFICE_SERVER,"&disabledDownload=").concat(!!H)}),y==="html"&&v.a.createElement("iframe",{src:c+"&disposition=inline"}),y==="pdf"&&v.a.createElement("iframe",{src:"".concat(se,"/js/pdfview/index.html?url=").concat(c,"&disabledDownload=").concat(!!H)}),y==="image"&&v.a.createElement("img",{src:"".concat(((D=c)===null||D===void 0?void 0:D.indexOf("http://"))>-1||((O=c)===null||O===void 0?void 0:O.indexOf("https://"))>-1||(A=c)!==null&&A!==void 0&&A.startsWith("/api")?"":"data:image/png;base64,").concat(c)}),y==="other"&&v.a.createElement("div",null,v.a.createElement(J.a,{type:"primary",size:"large",onClick:Ee},v.a.createElement(h.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),y==="download"&&v.a.createElement(J.a,{type:"primary",size:"large",onClick:Ee},v.a.createElement(h.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(nt,xe,Z){},pmY6:function(nt,xe,Z){"use strict";Z.d(xe,"h",function(){return L}),Z.d(xe,"g",function(){return m}),Z.d(xe,"f",function(){return p}),Z.d(xe,"e",function(){return h}),Z.d(xe,"i",function(){return l}),Z.d(xe,"b",function(){return f}),Z.d(xe,"a",function(){return o}),Z.d(xe,"d",function(){return u}),Z.d(xe,"c",function(){return a});var ne=Z("C/vA"),J=Z("JYp7");const P=!1;let X=null;function j(s){X=s}if(P){const s="__is_disposable_tracked__";j(new class{trackDisposable(R){const _=new Error("Potentially leaked disposable").stack;setTimeout(()=>{R[s]||console.log(_)},3e3)}setParent(R,_){if(R&&R!==o.None)try{R[s]=!0}catch(C){}}markAsDisposed(R){if(R&&R!==o.None)try{R[s]=!0}catch(_){}}markAsSingleton(R){}})}function B(s){return X==null||X.trackDisposable(s),s}function K(s){X==null||X.markAsDisposed(s)}function G(s,R){X==null||X.setParent(s,R)}function r(s,R){if(!X)return;for(const _ of s)X.setParent(_,R)}function L(s){return X==null||X.markAsSingleton(s),s}class v extends Error{constructor(s){super(`Encountered errors while disposing of store. Errors: [${s.join(", ")}]`);this.errors=s}}function m(s){return typeof s.dispose=="function"&&s.dispose.length===0}function p(s){if(J.a.is(s)){let R=[];for(const _ of s)if(_)try{_.dispose()}catch(C){R.push(C)}if(R.length===1)throw R[0];if(R.length>1)throw new v(R);return Array.isArray(s)?[]:s}else if(s)return s.dispose(),s}function h(...s){const R=l(()=>p(s));return r(s,R),R}function l(s){const R=B({dispose:Object(ne.a)(()=>{K(R),s()})});return R}class f{constructor(){this._toDispose=new Set,this._isDisposed=!1,B(this)}dispose(){if(this._isDisposed)return;K(this),this._isDisposed=!0,this.clear()}clear(){try{p(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 G(s,this),this._isDisposed?f.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}}f.DISABLE_DISPOSED_WARNING=!1;class o{constructor(){this._store=new f,B(this),G(this._store,this)}dispose(){K(this),this._store.dispose()}_register(s){if(s===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(s)}}o.None=Object.freeze({dispose(){}});class u{constructor(){this._isDisposed=!1,B(this)}get value(){return this._isDisposed?void 0:this._value}set value(s){var R;if(this._isDisposed||s===this._value)return;(R=this._value)===null||R===void 0||R.dispose(),s&&G(s,this),this._value=s}clear(){this.value=void 0}dispose(){var s;this._isDisposed=!0,K(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&&G(s,null),s}}class a{constructor(s){this.object=s}dispose(){}}},psGv:function(nt,xe,Z){var ne,J;(function(){var P;(function(){"use strict";var K=[,,function(v){function m(l){this.__parent=l,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=[]}m.prototype.clone_empty=function(){var l=new m(this.__parent);return l.set_indent(this.__indent_count,this.__alignment_count),l},m.prototype.item=function(l){return l<0?this.__items[this.__items.length+l]:this.__items[l]},m.prototype.has_match=function(l){for(var f=this.__items.length-1;f>=0;f--)if(this.__items[f].match(l))return!0;return!1},m.prototype.set_indent=function(l,f){this.is_empty()&&(this.__indent_count=l||0,this.__alignment_count=f||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.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)},m.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},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var l=this.__parent.current_line;return l.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),l.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),l.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,l.__items[0]===" "&&(l.__items.splice(0,1),l.__character_count-=1),!0}return!1},m.prototype.is_empty=function(){return this.__items.length===0},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(l){this.__items.push(l);var f=l.lastIndexOf(`
`);f!==-1?this.__character_count=l.length-f:this.__character_count+=l.length},m.prototype.pop=function(){var l=null;return this.is_empty()||(l=this.__items.pop(),this.__character_count-=l.length),l},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var l="";return this.is_empty()?this.__parent.indent_empty_lines&&(l=this.__parent.get_indent_string(this.__indent_count)):(l=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),l+=this.__items.join("")),l};function p(l,f){this.__cache=[""],this.__indent_size=l.indent_size,this.__indent_string=l.indent_char,l.indent_with_tabs||(this.__indent_string=new Array(l.indent_size+1).join(l.indent_char)),f=f||"",l.indent_level>0&&(f=new Array(l.indent_level+1).join(this.__indent_string)),this.__base_string=f,this.__base_string_length=f.length}p.prototype.get_indent_size=function(l,f){var o=this.__base_string_length;return f=f||0,l<0&&(o=0),o+=l*this.__indent_size,o+=f,o},p.prototype.get_indent_string=function(l,f){var o=this.__base_string;return f=f||0,l<0&&(l=0,o=""),f+=l*this.__indent_size,this.__ensure_cache(f),o+=this.__cache[f],o},p.prototype.__ensure_cache=function(l){for(;l>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var l=this.__cache.length,f=0,o="";this.__indent_size&&l>=this.__indent_size&&(f=Math.floor(l/this.__indent_size),l-=f*this.__indent_size,o=new Array(f+1).join(this.__indent_string)),l&&(o+=new Array(l+1).join(" ")),this.__cache.push(o)};function h(l,f){this.__indent_cache=new p(l,f),this.raw=!1,this._end_with_newline=l.end_with_newline,this.indent_size=l.indent_size,this.wrap_line_length=l.wrap_line_length,this.indent_empty_lines=l.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new m(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(l,f){return this.__indent_cache.get_indent_string(l,f)},h.prototype.get_indent_size=function(l,f){return this.__indent_cache.get_indent_size(l,f)},h.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},h.prototype.add_new_line=function(l){return this.is_empty()||!l&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},h.prototype.get_code=function(l){this.trim(!0);var f=this.current_line.pop();f&&(f[f.length-1]===`
`&&(f=f.replace(/\n+$/g,"")),this.current_line.push(f)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
`);return l!==`
`&&(o=o.replace(/[\n]/g,l)),o},h.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},h.prototype.set_indent=function(l,f){return l=l||0,f=f||0,this.next_line.set_indent(l,f),this.__lines.length>1?(this.current_line.set_indent(l,f),!0):(this.current_line.set_indent(),!1)},h.prototype.add_raw_token=function(l){for(var f=0;f<l.newlines;f++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(l.whitespace_before),this.current_line.push(l.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},h.prototype.add_token=function(l){this.__add_space_before_token(),this.current_line.push(l),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},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(l){for(var f=this.__lines.length;l<f;)this.__lines[l]._remove_indent(),l++;this.current_line._remove_wrap_indent()},h.prototype.trim=function(l){for(l=l===void 0?!1:l,this.current_line.trim();l&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},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(l,f){for(var o=this.__lines.length-2;o>=0;){var u=this.__lines[o];if(u.is_empty())break;if(u.item(0).indexOf(l)!==0&&u.item(-1)!==f){this.__lines.splice(o+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},v.exports.Output=h},function(v){function m(p,h,l,f){this.type=p,this.text=h,this.comments_before=null,this.newlines=l||0,this.whitespace_before=f||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}v.exports.Token=m},,,function(v){function m(l,f){this.raw_options=p(l,f),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"])}m.prototype._get_array=function(l,f){var o=this.raw_options[l],u=f||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(u=o.concat()):typeof o=="string"&&(u=o.split(/[^a-zA-Z0-9_\/\-]+/)),u},m.prototype._get_boolean=function(l,f){var o=this.raw_options[l],u=o===void 0?!!f:!!o;return u},m.prototype._get_characters=function(l,f){var o=this.raw_options[l],u=f||"";return typeof o=="string"&&(u=o.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),u},m.prototype._get_number=function(l,f){var o=this.raw_options[l];f=parseInt(f,10),isNaN(f)&&(f=0);var u=parseInt(o,10);return isNaN(u)&&(u=f),u},m.prototype._get_selection=function(l,f,o){var u=this._get_selection_list(l,f,o);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+l+`' can only be one of the following values:
`+f+`
You passed in: '`+this.raw_options[l]+"'");return u[0]},m.prototype._get_selection_list=function(l,f,o){if(!f||f.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[f[0]],!this._is_valid_selection(o,f))throw new Error("Invalid Default Value!");var u=this._get_array(l,o);if(!this._is_valid_selection(u,f))throw new Error("Invalid Option Value: The option '"+l+`' can contain only the following values:
`+f+`
You passed in: '`+this.raw_options[l]+"'");return u},m.prototype._is_valid_selection=function(l,f){return l.length&&f.length&&!l.some(function(o){return f.indexOf(o)===-1})};function p(l,f){var o={};l=h(l);var u;for(u in l)u!==f&&(o[u]=l[u]);if(f&&l[f])for(u in l[f])o[u]=l[f][u];return o}function h(l){var f={},o;for(o in l){var u=o.replace(/-/g,"_");f[u]=l[o]}return f}v.exports.Options=m,v.exports.normalizeOpts=h,v.exports.mergeOpts=p},,function(v){var m=RegExp.prototype.hasOwnProperty("sticky");function p(h){this.__input=h||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var h=null;return this.hasNext()&&(h=this.__input.charAt(this.__position),this.__position+=1),h},p.prototype.peek=function(h){var l=null;return h=h||0,h+=this.__position,h>=0&&h<this.__input_length&&(l=this.__input.charAt(h)),l},p.prototype.__match=function(h,l){h.lastIndex=l;var f=h.exec(this.__input);return f&&!(m&&h.sticky)&&(f.index!==l&&(f=null)),f},p.prototype.test=function(h,l){return l=l||0,l+=this.__position,l>=0&&l<this.__input_length?!!this.__match(h,l):!1},p.prototype.testChar=function(h,l){var f=this.peek(l);return h.lastIndex=0,f!==null&&h.test(f)},p.prototype.match=function(h){var l=this.__match(h,this.__position);return l?this.__position+=l[0].length:l=null,l},p.prototype.read=function(h,l,f){var o="",u;return h&&(u=this.match(h),u&&(o+=u[0])),l&&(u||!h)&&(o+=this.readUntil(l,f)),o},p.prototype.readUntil=function(h,l){var f="",o=this.__position;h.lastIndex=this.__position;var u=h.exec(this.__input);return u?(o=u.index,l&&(o+=u[0].length)):o=this.__input_length,f=this.__input.substring(this.__position,o),this.__position=o,f},p.prototype.readUntilAfter=function(h){return this.readUntil(h,!0)},p.prototype.get_regexp=function(h,l){var f=null,o="g";return l&&m&&(o="y"),typeof h=="string"&&h!==""?f=new RegExp(h,o):h&&(f=new RegExp(h.source,o)),f},p.prototype.get_literal_regexp=function(h){return RegExp(h.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(h){var l=this.__position,f=this.readUntilAfter(h);return this.__position=l,f},p.prototype.lookBack=function(h){var l=this.__position-1;return l>=h.length&&this.__input.substring(l-h.length,l).toLowerCase()===h},v.exports.InputScanner=p},function(v,m,p){var h=p(8).InputScanner,l=p(3).Token,f=p(10).TokenStream,o=p(11).WhitespacePattern,u={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},a=function(s,R){this._input=new h(s),this._options=R||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};a.prototype.tokenize=function(){this._input.restart(),this.__tokens=new f,this._reset();for(var s,R=new l(u.START,""),_=null,C=[],D=new f;R.type!==u.EOF;){for(s=this._get_next_token(R,_);this._is_comment(s);)D.add(s),s=this._get_next_token(R,_);D.isEmpty()||(s.comments_before=D,D=new f),s.parent=_,this._is_opening(s)?(C.push(_),_=s):_&&this._is_closing(s,_)&&(s.opened=_,_.closed=s,_=C.pop(),s.parent=_),s.previous=R,R.next=s,this.__tokens.add(s),R=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,R){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,R){return!1},a.prototype._create_token=function(s,R){var _=new l(s,R,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return _},a.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},v.exports.Tokenizer=a,v.exports.TOKEN=u},function(v){function m(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position<this.__tokens_length},m.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__tokens[this.__position],this.__position+=1),p},m.prototype.peek=function(p){var h=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(h=this.__tokens[p]),h},m.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},v.exports.TokenStream=m},function(v,m,p){var h=p(12).Pattern;function l(f,o){h.call(this,f,o),o?this._line_regexp=this._input.get_regexp(o._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}l.prototype=new h,l.prototype.__set_whitespace_patterns=function(f,o){f+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+f+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},l.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var f=this._input.read(this._match_pattern);if(f===" ")this.whitespace_before_token=" ";else if(f){var o=this.__split(this._newline_regexp,f);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return f},l.prototype.matching=function(f,o){var u=this._create();return u.__set_whitespace_patterns(f,o),u._update(),u},l.prototype._create=function(){return new l(this._input,this)},l.prototype.__split=function(f,o){f.lastIndex=0;for(var u=0,a=[],s=f.exec(o);s;)a.push(o.substring(u,s.index)),u=s.index+s[0].length,s=f.exec(o);return u<o.length?a.push(o.substring(u,o.length)):a.push(""),a},v.exports.WhitespacePattern=l},function(v){function m(p,h){this._input=p,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)}m.prototype.read=function(){var p=this._input.read(this._starting_pattern);return(!this._starting_pattern||p)&&(p+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),p},m.prototype.read_match=function(){return this._input.match(this._match_pattern)},m.prototype.until_after=function(p){var h=this._create();return h._until_after=!0,h._until_pattern=this._input.get_regexp(p),h._update(),h},m.prototype.until=function(p){var h=this._create();return h._until_after=!1,h._until_pattern=this._input.get_regexp(p),h._update(),h},m.prototype.starting_with=function(p){var h=this._create();return h._starting_pattern=this._input.get_regexp(p,!0),h._update(),h},m.prototype.matching=function(p){var h=this._create();return h._match_pattern=this._input.get_regexp(p,!0),h._update(),h},m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){},v.exports.Pattern=m},function(v){function m(p,h){p=typeof p=="string"?p:p.source,h=typeof h=="string"?h:h.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+h,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+h,"g")}m.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var h={};this.__directive_pattern.lastIndex=0;for(var l=this.__directive_pattern.exec(p);l;)h[l[1]]=l[2],l=this.__directive_pattern.exec(p);return h},m.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},v.exports.Directives=m},function(v,m,p){var h=p(12).Pattern,l={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function f(o,u){h.call(this,o,u),this.__template_pattern=null,this._disabled=Object.assign({},l),this._excluded=Object.assign({},l),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(o);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}/)}}f.prototype=new h,f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){this.__set_templated_pattern()},f.prototype.disable=function(o){var u=this._create();return u._disabled[o]=!0,u._update(),u},f.prototype.read_options=function(o){var u=this._create();for(var a in l)u._disabled[a]=o.templating.indexOf(a)===-1;return u._update(),u},f.prototype.exclude=function(o){var u=this._create();return u._excluded[o]=!0,u._update(),u},f.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 u=this._read_template();u;)this._match_pattern?u+=this._input.read(this._match_pattern):u+=this._input.readUntil(this.__template_pattern),o+=u,u=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},f.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("|")+")")},f.prototype._read_template=function(){var o="",u=this._input.peek();if(u==="<"){var a=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&a==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&a==="%"&&(o=o||this.__patterns.erb.read())}else u==="{"&&(!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},v.exports.TemplatablePattern=f},,,,function(v,m,p){var h=p(19).Beautifier,l=p(20).Options;function f(o,u,a,s){var R=new h(o,u,a,s);return R.beautify()}v.exports=f,v.exports.defaultOptions=function(){return new l}},function(v,m,p){var h=p(20).Options,l=p(2).Output,f=p(21).Tokenizer,o=p(21).TOKEN,u=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,s=function(w,y){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=w.max_preserve_newlines,this.preserve_newlines=w.preserve_newlines,this._output=new l(w,y)};s.prototype.current_line_has_match=function(w){return this._output.current_line.has_match(w)},s.prototype.set_space_before_token=function(w,y){this._output.space_before_token=w,this._output.non_breaking_space=y},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(w){this._output.add_raw_token(w)},s.prototype.print_preserved_newlines=function(w){var y=0;w.type!==o.TEXT&&w.previous.type!==o.TEXT&&(y=w.newlines?1:0),this.preserve_newlines&&(y=w.newlines<this.max_preserve_newlines+1?w.newlines:this.max_preserve_newlines+1);for(var b=0;b<y;b++)this.print_newline(b>0);return y!==0},s.prototype.traverse_whitespace=function(w){return w.whitespace_before||w.newlines?(this.print_preserved_newlines(w)||(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(w){this._output.add_new_line(w)},s.prototype.print_token=function(w){w.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(w.text))},s.prototype.indent=function(){this.indent_level++},s.prototype.get_full_indent=function(w){return w=this.indent_level+(w||0),w<1?"":this._output.get_indent_string(w)};var R=function(w){for(var y=null,b=w.next;b.type!==o.EOF&&w.closed!==b;){if(b.type===o.ATTRIBUTE&&b.text==="type"){b.next&&b.next.type===o.EQUALS&&b.next.next&&b.next.next.type===o.VALUE&&(y=b.next.next.text);break}b=b.next}return y},_=function(w,y){var b=null,U=null;return y.closed?(w==="script"?b="text/javascript":w==="style"&&(b="text/css"),b=R(y)||b,b.search("text/css")>-1?U="css":b.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?U="javascript":b.search(/(text|application|dojo)\/(x-)?(html)/)>-1?U="html":b.search(/test\/null/)>-1&&(U="null"),U):null};function C(w,y){return y.indexOf(w)!==-1}function D(w,y,b){this.parent=w||null,this.tag=y?y.tag_name:"",this.indent_level=b||0,this.parser_token=y||null}function O(w){this._printer=w,this._current_frame=null}O.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},O.prototype.record_tag=function(w){var y=new D(this._current_frame,w,this._printer.indent_level);this._current_frame=y},O.prototype._try_pop_frame=function(w){var y=null;return w&&(y=w.parser_token,this._printer.indent_level=w.indent_level,this._current_frame=w.parent),y},O.prototype._get_frame=function(w,y){for(var b=this._current_frame;b&&!(w.indexOf(b.tag)!==-1);){if(y&&y.indexOf(b.tag)!==-1){b=null;break}b=b.parent}return b},O.prototype.try_pop=function(w,y){var b=this._get_frame([w],y);return this._try_pop_frame(b)},O.prototype.indent_to_tag=function(w){var y=this._get_frame(w);y&&(this._printer.indent_level=y.indent_level)};function A(w,y,b,U){this._source_text=w||"",y=y||{},this._js_beautify=b,this._css_beautify=U,this._tag_stack=null;var F=new h(y,"html");this._options=F,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"}A.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var w=this._source_text,y=this._options.eol;this._options.eol==="auto"&&(y=`
`,w&&u.test(w)&&(y=w.match(u)[0])),w=w.replace(a,`
`);var b=w.match(/^[\t ]*/)[0],U={text:"",type:""},F=new S,E=new s(this._options,b),N=new f(w,this._options).tokenize();this._tag_stack=new O(E);for(var I=null,g=N.next();g.type!==o.EOF;)g.type===o.TAG_OPEN||g.type===o.COMMENT?(I=this._handle_tag_open(E,g,F,U),F=I):g.type===o.ATTRIBUTE||g.type===o.EQUALS||g.type===o.VALUE||g.type===o.TEXT&&!F.tag_complete?I=this._handle_inside_tag(E,g,F,N):g.type===o.TAG_CLOSE?I=this._handle_tag_close(E,g,F):g.type===o.TEXT?I=this._handle_text(E,g,F):E.add_raw_token(g),U=I,g=N.next();var H=E._output.get_code(y);return H},A.prototype._handle_tag_close=function(w,y,b){var U={text:y.text,type:y.type};return w.alignment_size=0,b.tag_complete=!0,w.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),b.is_unformatted?w.add_raw_token(y):(b.tag_start_char==="<"&&(w.set_space_before_token(y.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&b.has_wrapped_attrs&&w.print_newline(!1)),w.print_token(y)),b.indent_content&&!(b.is_unformatted||b.is_content_unformatted)&&(w.indent(),b.indent_content=!1),!b.is_inline_element&&!(b.is_unformatted||b.is_content_unformatted)&&w.set_wrap_point(),U},A.prototype._handle_inside_tag=function(w,y,b,U){var F=b.has_wrapped_attrs,E={text:y.text,type:y.type};if(w.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),b.is_unformatted)w.add_raw_token(y);else if(b.tag_start_char==="{"&&y.type===o.TEXT)w.print_preserved_newlines(y)?(y.newlines=0,w.add_raw_token(y)):w.print_token(y);else{if(y.type===o.ATTRIBUTE?(w.set_space_before_token(!0),b.attr_count+=1):(y.type===o.EQUALS||y.type===o.VALUE&&y.previous.type===o.EQUALS)&&w.set_space_before_token(!1),y.type===o.ATTRIBUTE&&b.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(w.traverse_whitespace(y),F=F||y.newlines!==0),this._is_wrap_attributes_force)){var N=b.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&b.attr_count===1){var I=!0,g=0,H;do{if(H=U.peek(g),H.type===o.ATTRIBUTE){I=!1;break}g+=1}while(g<4&&H.type!==o.EOF&&H.type!==o.TAG_CLOSE);N=!I}N&&(w.print_newline(!1),F=!0)}w.print_token(y),F=F||w.previous_token_wrapped(),b.has_wrapped_attrs=F}return E},A.prototype._handle_text=function(w,y,b){var U={text:y.text,type:"TK_CONTENT"};return b.custom_beautifier_name?this._print_custom_beatifier_text(w,y,b):b.is_unformatted||b.is_content_unformatted?w.add_raw_token(y):(w.traverse_whitespace(y),w.print_token(y)),U},A.prototype._print_custom_beatifier_text=function(w,y,b){var U=this;if(y.text!==""){var F=y.text,E,N=1,I="",g="";b.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?E=this._js_beautify:b.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?E=this._css_beautify:b.custom_beautifier_name==="html"&&(E=function(ve,Se){var Ae=new A(ve,Se,U._js_beautify,U._css_beautify);return Ae.beautify()}),this._options.indent_scripts==="keep"?N=0:this._options.indent_scripts==="separate"&&(N=-w.indent_level);var H=w.get_full_indent(N);if(F=F.replace(/\n[ \t]*$/,""),b.custom_beautifier_name!=="html"&&F[0]==="<"&&F.match(/^(<!--|<!\[CDATA\[)/)){var $=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(F);if(!$){w.add_raw_token(y);return}I=H+$[1]+`
`,F=$[4],$[5]&&(g=H+$[5]),F=F.replace(/\n[ \t]*$/,""),($[2]||$[3].indexOf(`
`)!==-1)&&($=$[3].match(/[ \t]+$/),$&&(y.whitespace_before=$[0]))}if(F)if(E){var ie=function(){this.eol=`
`};ie.prototype=this._options.raw_options;var oe=new ie;F=E(H+F,oe)}else{var Ce=y.whitespace_before;Ce&&(F=F.replace(new RegExp(`
(`+Ce+")?","g"),`
`)),F=H+F.replace(/\n/g,`
`+H)}I&&(F?F=I+F+`
`+g:F=I+g),w.print_newline(!1),F&&(y.text=F,y.whitespace_before="",y.newlines=0,w.add_raw_token(y),w.print_newline(!0))}},A.prototype._handle_tag_open=function(w,y,b,U){var F=this._get_tag_open_token(y);return(b.is_unformatted||b.is_content_unformatted)&&!b.is_empty_element&&y.type===o.TAG_OPEN&&y.text.indexOf("</")===0?(w.add_raw_token(y),F.start_tag_token=this._tag_stack.try_pop(F.tag_name)):(w.traverse_whitespace(y),this._set_tag_position(w,y,F,b,U),F.is_inline_element||w.set_wrap_point(),w.print_token(y)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(F.alignment_size=y.text.length+1),!F.tag_complete&&!F.is_unformatted&&(w.alignment_size=F.alignment_size),F};var S=function(w,y){if(this.parent=w||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="",!y)this.tag_complete=!0;else{var b;this.tag_start_char=y.text[0],this.text=y.text,this.tag_start_char==="<"?(b=y.text.match(/^<([^\s>]*)/),this.tag_check=b?b[1]:""):(b=y.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=b?b[1]:"",(y.text.startsWith("{{#>")||y.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&y.next!==null?this.tag_check=y.next.text.split(" ")[0]:this.tag_check=y.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),y.type===o.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||y.closed&&y.closed.text==="/>";var U=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(U=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(U)))}};A.prototype._get_tag_open_token=function(w){var y=new S(this._tag_stack.get_parser_token(),w);return y.alignment_size=this._options.wrap_attributes_indent_size,y.is_end_tag=y.is_end_tag||C(y.tag_check,this._options.void_elements),y.is_empty_element=y.tag_complete||y.is_start_tag&&y.is_end_tag,y.is_unformatted=!y.tag_complete&&C(y.tag_check,this._options.unformatted),y.is_content_unformatted=!y.is_empty_element&&C(y.tag_check,this._options.content_unformatted),y.is_inline_element=C(y.tag_name,this._options.inline)||y.tag_name.includes("-")||y.tag_start_char==="{",y},A.prototype._set_tag_position=function(w,y,b,U,F){if(b.is_empty_element||(b.is_end_tag?b.start_tag_token=this._tag_stack.try_pop(b.tag_name):(this._do_optional_end_element(b)&&(b.is_inline_element||w.print_newline(!1)),this._tag_stack.record_tag(b),(b.tag_name==="script"||b.tag_name==="style")&&!(b.is_unformatted||b.is_content_unformatted)&&(b.custom_beautifier_name=_(b.tag_check,y)))),C(b.tag_check,this._options.extra_liners)&&(w.print_newline(!1),w._output.just_added_blankline()||w.print_newline(!0)),b.is_empty_element){if(b.tag_start_char==="{"&&b.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),b.indent_content=!0;var E=w.current_line_has_match(/{{#if/);E||w.print_newline(!1)}b.tag_name==="!--"&&F.type===o.TAG_CLOSE&&U.is_end_tag&&b.text.indexOf(`
`)===-1||(b.is_inline_element||b.is_unformatted||w.print_newline(!1),this._calcluate_parent_multiline(w,b))}else if(b.is_end_tag){var N=!1;N=b.start_tag_token&&b.start_tag_token.multiline_content,N=N||!b.is_inline_element&&!(U.is_inline_element||U.is_unformatted)&&!(F.type===o.TAG_CLOSE&&b.start_tag_token===U)&&F.type!=="TK_CONTENT",(b.is_content_unformatted||b.is_unformatted)&&(N=!1),N&&w.print_newline(!1)}else b.indent_content=!b.custom_beautifier_name,b.tag_start_char==="<"&&(b.tag_name==="html"?b.indent_content=this._options.indent_inner_html:b.tag_name==="head"?b.indent_content=this._options.indent_head_inner_html:b.tag_name==="body"&&(b.indent_content=this._options.indent_body_inner_html)),!(b.is_inline_element||b.is_unformatted)&&(F.type!=="TK_CONTENT"||b.is_content_unformatted)&&w.print_newline(!1),this._calcluate_parent_multiline(w,b)},A.prototype._calcluate_parent_multiline=function(w,y){y.parent&&w._output.just_added_newline()&&!((y.is_inline_element||y.is_unformatted)&&y.parent.is_inline_element)&&(y.parent.multiline_content=!0)};var T=["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"];A.prototype._do_optional_end_element=function(w){var y=null;if(w.is_empty_element||!w.is_start_tag||!w.parent)return;if(w.tag_name==="body")y=y||this._tag_stack.try_pop("head");else if(w.tag_name==="li")y=y||this._tag_stack.try_pop("li",["ol","ul"]);else if(w.tag_name==="dd"||w.tag_name==="dt")y=y||this._tag_stack.try_pop("dt",["dl"]),y=y||this._tag_stack.try_pop("dd",["dl"]);else if(w.parent.tag_name==="p"&&T.indexOf(w.tag_name)!==-1){var b=w.parent.parent;(!b||c.indexOf(b.tag_name)===-1)&&(y=y||this._tag_stack.try_pop("p"))}else w.tag_name==="rp"||w.tag_name==="rt"?(y=y||this._tag_stack.try_pop("rt",["ruby","rtc"]),y=y||this._tag_stack.try_pop("rp",["ruby","rtc"])):w.tag_name==="optgroup"?y=y||this._tag_stack.try_pop("optgroup",["select"]):w.tag_name==="option"?y=y||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):w.tag_name==="colgroup"?y=y||this._tag_stack.try_pop("caption",["table"]):w.tag_name==="thead"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"])):w.tag_name==="tbody"||w.tag_name==="tfoot"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("thead",["table"]),y=y||this._tag_stack.try_pop("tbody",["table"])):w.tag_name==="tr"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(w.tag_name==="th"||w.tag_name==="td")&&(y=y||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),y=y||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return w.parent=this._tag_stack.get_parser_token(),y},v.exports.Beautifier=A},function(v,m,p){var h=p(6).Options;function l(f){h.call(this,f,"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"])}l.prototype=new h,v.exports.Options=l},function(v,m,p){var h=p(9).Tokenizer,l=p(9).TOKEN,f=p(13).Directives,o=p(14).TemplatablePattern,u=p(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:l.START,RAW:l.RAW,EOF:l.EOF},s=new f(/<\!--/,/-->/),R=function(_,C){h.call(this,_,C),this._current_tag_name="";var D=new o(this._input).read_options(this._options),O=new u(this._input);if(this.__patterns={word:D.until(/[\n\r\t <]/),single_quote:D.until_after(/'/),double_quote:D.until_after(/"/),attribute:D.until(/[\n\r\t =>]|\/>/),element_name:D.until(/[\n\r\t >\/]/),handlebars_comment:O.starting_with(/{{!--/).until_after(/--}}/),handlebars:O.starting_with(/{{/).until_after(/}}/),handlebars_open:O.until(/[\n\r\t }]/),handlebars_raw_close:O.until(/}}/),comment:O.starting_with(/<!--/).until_after(/-->/),cdata:O.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:O.starting_with(/<!\[/).until_after(/]>/),processing:O.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 A=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=O.matching(A).until_after(A)}};R.prototype=new h,R.prototype._is_comment=function(_){return!1},R.prototype._is_opening=function(_){return _.type===a.TAG_OPEN},R.prototype._is_closing=function(_,C){return _.type===a.TAG_CLOSE&&C&&((_.text===">"||_.text==="/>")&&C.text[0]==="<"||_.text==="}}"&&C.text[0]==="{"&&C.text[1]==="{")},R.prototype._reset=function(){this._current_tag_name=""},R.prototype._get_next_token=function(_,C){var D=null;this._readWhitespace();var O=this._input.peek();return O===null?this._create_token(a.EOF,""):(D=D||this._read_open_handlebars(O,C),D=D||this._read_attribute(O,_,C),D=D||this._read_close(O,C),D=D||this._read_raw_content(O,_,C),D=D||this._read_content_word(O),D=D||this._read_comment_or_cdata(O),D=D||this._read_processing(O),D=D||this._read_open(O,C),D=D||this._create_token(a.UNKNOWN,this._input.next()),D)},R.prototype._read_comment_or_cdata=function(_){var C=null,D=null,O=null;if(_==="<"){var A=this._input.peek(1);A==="!"&&(D=this.__patterns.comment.read(),D?(O=s.get_directives(D),O&&O.ignore==="start"&&(D+=s.readIgnored(this._input))):D=this.__patterns.cdata.read()),D&&(C=this._create_token(a.COMMENT,D),C.directives=O)}return C},R.prototype._read_processing=function(_){var C=null,D=null,O=null;if(_==="<"){var A=this._input.peek(1);(A==="!"||A==="?")&&(D=this.__patterns.conditional_comment.read(),D=D||this.__patterns.processing.read()),D&&(C=this._create_token(a.COMMENT,D),C.directives=O)}return C},R.prototype._read_open=function(_,C){var D=null,O=null;return C||_==="<"&&(D=this._input.next(),this._input.peek()==="/"&&(D+=this._input.next()),D+=this.__patterns.element_name.read(),O=this._create_token(a.TAG_OPEN,D)),O},R.prototype._read_open_handlebars=function(_,C){var D=null,O=null;return C||this._options.indent_handlebars&&_==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(D=this.__patterns.handlebars_comment.read(),D=D||this.__patterns.handlebars.read(),O=this._create_token(a.COMMENT,D)):(D=this.__patterns.handlebars_open.read(),O=this._create_token(a.TAG_OPEN,D))),O},R.prototype._read_close=function(_,C){var D=null,O=null;return C&&(C.text[0]==="<"&&(_===">"||_==="/"&&this._input.peek(1)===">")?(D=this._input.next(),_==="/"&&(D+=this._input.next()),O=this._create_token(a.TAG_CLOSE,D)):C.text[0]==="{"&&_==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),O=this._create_token(a.TAG_CLOSE,"}}"))),O},R.prototype._read_attribute=function(_,C,D){var O=null,A="";if(D&&D.text[0]==="<")if(_==="=")O=this._create_token(a.EQUALS,this._input.next());else if(_==='"'||_==="'"){var S=this._input.next();_==='"'?S+=this.__patterns.double_quote.read():S+=this.__patterns.single_quote.read(),O=this._create_token(a.VALUE,S)}else A=this.__patterns.attribute.read(),A&&(C.type===a.EQUALS?O=this._create_token(a.VALUE,A):O=this._create_token(a.ATTRIBUTE,A));return O},R.prototype._is_content_unformatted=function(_){return this._options.void_elements.indexOf(_)===-1&&(this._options.content_unformatted.indexOf(_)!==-1||this._options.unformatted.indexOf(_)!==-1)},R.prototype._read_raw_content=function(_,C,D){var O="";if(D&&D.text[0]==="{")O=this.__patterns.handlebars_raw_close.read();else if(C.type===a.TAG_CLOSE&&C.opened.text[0]==="<"&&C.text[0]!=="/"){var A=C.opened.text.substr(1).toLowerCase();if(A==="script"||A==="style"){var S=this._read_comment_or_cdata(_);if(S)return S.type=a.TEXT,S;O=this._input.readUntil(new RegExp("</"+A+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(A)&&(O=this._input.readUntil(new RegExp("</"+A+"[\\n\\r\\t ]*?>","ig")))}return O?this._create_token(a.TEXT,O):null},R.prototype._read_content_word=function(_){var C="";if(this._options.unformatted_content_delimiter&&(_===this._options.unformatted_content_delimiter[0]&&(C=this.__patterns.unformatted_content_delimiter.read())),C||(C=this.__patterns.word.read()),C)return this._create_token(a.TEXT,C)},v.exports.Tokenizer=R,v.exports.TOKEN=a}],G={};function r(v){var m=G[v];if(m!==void 0)return m.exports;var p=G[v]={exports:{}};return K[v](p,p.exports,r),p.exports}var L=r(18);P=L})();var X=P;if(!0)!(ne=[Z,Z("6UM0"),Z("TXwP")],J=function(K){var G=Z("6UM0"),r=Z("TXwP");return{html_beautify:function(L,v){return X(L,v,G.js_beautify,r.css_beautify)}}}.apply(xe,ne),J!==void 0&&(nt.exports=J));else var j,B})()},"rAM+":function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return J});var ne=Z("Qw5x");function J(P,X){var j;if(typeof Symbol=="undefined"||P[Symbol.iterator]==null){if(Array.isArray(P)||(j=Object(ne.a)(P))||X&&P&&typeof P.length=="number"){j&&(P=j);var B=0,K=function(){};return{s:K,n:function(){return B>=P.length?{done:!0}:{done:!1,value:P[B++]}},e:function(m){throw m},f:K}}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 G=!0,r=!1,L;return{s:function(){j=P[Symbol.iterator]()},n:function(){var m=j.next();return G=m.done,m},e:function(m){r=!0,L=m},f:function(){try{!G&&j.return!=null&&j.return()}finally{if(r)throw L}}}}},rUJ1:function(nt,xe){const Z=/[&<>"']/,ne=/[&<>"']/g,J=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,X={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},j=O=>X[O];function B(O,A){if(A){if(Z.test(O))return O.replace(ne,j)}else if(J.test(O))return O.replace(P,j);return O}const K=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function G(O){return O.replace(K,(A,S)=>(S=S.toLowerCase(),S==="colon"?":":S.charAt(0)==="#"?S.charAt(1)==="x"?String.fromCharCode(parseInt(S.substring(2),16)):String.fromCharCode(+S.substring(1)):""))}const r=/(^|[^\[])\^/g;function L(O,A){O=O.source||O,A=A||"";const S={replace:(T,c)=>(c=c.source||c,c=c.replace(r,"$1"),O=O.replace(T,c),S),getRegex:()=>new RegExp(O,A)};return S}const v=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(O,A,S){if(O){let T;try{T=decodeURIComponent(G(S)).replace(v,"").toLowerCase()}catch(c){return null}if(T.indexOf("javascript:")===0||T.indexOf("vbscript:")===0||T.indexOf("data:")===0)return null}A&&!m.test(S)&&(S=u(A,S));try{S=encodeURI(S).replace(/%25/g,"%")}catch(T){return null}return S}const h={},l=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,o=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(O,A){h[" "+O]||(l.test(O)?h[" "+O]=O+"/":h[" "+O]=_(O,"/",!0)),O=h[" "+O];const S=O.indexOf(":")===-1;return A.substring(0,2)==="//"?S?A:O.replace(f,"$1")+A:A.charAt(0)==="/"?S?A:O.replace(o,"$1")+A:O+A}const a={exec:function(){}};function s(O){let A=1,S,T;for(;A<arguments.length;A++){S=arguments[A];for(T in S)Object.prototype.hasOwnProperty.call(S,T)&&(O[T]=S[T])}return O}function R(O,A){const S=O.replace(/\|/g,(w,y,b)=>{let U=!1,F=y;for(;--F>=0&&b[F]==="\\";)U=!U;return U?"|":" |"}),T=S.split(/ \|/);let c=0;if(T.length>A)T.splice(A);else for(;T.length<A;)T.push("");for(;c<T.length;c++)T[c]=T[c].trim().replace(/\\\|/g,"|");return T}function _(O,A,S){const T=O.length;if(T===0)return"";let c=0;for(;c<T;){const w=O.charAt(T-c-1);if(w===A&&!S)c++;else if(w!==A&&S)c++;else break}return O.substr(0,T-c)}function C(O,A){if(O.indexOf(A[1])===-1)return-1;const S=O.length;let T=0,c=0;for(;c<S;c++)if(O[c]==="\\")c++;else if(O[c]===A[0])T++;else if(O[c]===A[1]&&(T--,T<0))return c;return-1}function D(O){O&&O.sanitize&&!O.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")}nt.exports={escape:B,unescape:G,edit:L,cleanUrl:p,resolveUrl:u,noopTest:a,merge:s,splitCells:R,rtrim:_,findClosingBracket:C,checkSanitizeDeprecation:D}},t9D7:function(nt,xe,Z){"use strict";Z.d(xe,"b",function(){return K}),Z.d(xe,"g",function(){return r}),Z.d(xe,"d",function(){return L}),Z.d(xe,"e",function(){return v}),Z.d(xe,"a",function(){return m}),Z.d(xe,"f",function(){return l}),Z.d(xe,"c",function(){return f});var ne=Z("Vhoy"),J=Z("MI8n"),P=Z("pmY6"),X=Z("Cg/j"),j=Z("ic2d"),B=Z("nEHx");const K=Object(X.c)("themeService");var G;(function(o){function u(a){return a&&typeof a=="object"&&typeof a.id=="string"}o.isThemeColor=u})(G||(G={}));function r(o){return{id:o}}var L;(function(o){function u(D){return D&&typeof D=="object"&&typeof D.id=="string"&&(typeof D.color=="undefined"||G.isThemeColor(D.color))}o.isThemeIcon=u;const a=new RegExp(`^\\$\\((${ne.a.iconNameExpression}(?:${ne.a.iconModifierExpression})?)\\)$`);function s(D){const O=a.exec(D);if(!O)return;let[,A]=O;return{id:A}}o.fromString=s;function R(D,O){let A=D.id;const S=A.lastIndexOf("~");return S!==-1&&(A=A.substring(0,S)),O&&(A=`${A}~${O}`),{id:A}}o.modify=R;function _(D,O){var A,S;return D.id===O.id&&((A=D.color)===null||A===void 0?void 0:A.id)===((S=O.color)===null||S===void 0?void 0:S.id)}o.isEqual=_;function C(D,O){return{id:D.id,color:O?r(O):void 0}}o.asThemeIcon=C,o.asClassNameArray=ne.a.asClassNameArray,o.asClassName=ne.a.asClassName,o.asCSSSelector=ne.a.asCSSSelector})(L||(L={}));function v(o){switch(o){case B.a.DARK:return"vs-dark";case B.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const m={ThemingContribution:"base.contributions.theming"};class p{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new J.b}onColorThemeChange(o){return this.themingParticipants.push(o),this.onThemingParticipantAddedEmitter.fire(o),Object(P.i)(()=>{const u=this.themingParticipants.indexOf(o);this.themingParticipants.splice(u,1)})}getThemingParticipants(){return this.themingParticipants}}let h=new p;j.a.add(m.ThemingContribution,h);function l(o){return h.onColorThemeChange(o)}class f extends P.a{constructor(o){super();this.themeService=o,this.theme=o.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(u=>this.onThemeChange(u)))}onThemeChange(o){this.theme=o,this.updateStyles()}updateStyles(){}}},ulZh:function(nt,xe,Z){typeof window!="undefined"&&function(J,P){nt.exports=P()}(this,function(){return function(ne){var J={};function P(X){if(J[X])return J[X].exports;var j=J[X]={i:X,l:!1,exports:{}};return ne[X].call(j.exports,j,j.exports,P),j.l=!0,j.exports}return P.m=ne,P.c=J,P.d=function(X,j,B){P.o(X,j)||Object.defineProperty(X,j,{enumerable:!0,get:B})},P.r=function(X){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(X,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(X,"__esModule",{value:!0})},P.t=function(X,j){if(j&1&&(X=P(X)),j&8)return X;if(j&4&&typeof X=="object"&&X&&X.__esModule)return X;var B=Object.create(null);if(P.r(B),Object.defineProperty(B,"default",{enumerable:!0,value:X}),j&2&&typeof X!="string")for(var K in X)P.d(B,K,function(G){return X[G]}.bind(null,K));return B},P.n=function(X){var j=X&&X.__esModule?function(){return X.default}:function(){return X};return P.d(j,"a",j),j},P.o=function(X,j){return Object.prototype.hasOwnProperty.call(X,j)},P.p="/dist/",P(P.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ne,J,P){"use strict";var X=Object.prototype.hasOwnProperty,j="~";function B(){}Object.create&&(B.prototype=Object.create(null),new B().__proto__||(j=!1));function K(v,m,p){this.fn=v,this.context=m,this.once=p||!1}function G(v,m,p,h,l){if(typeof p!="function")throw new TypeError("The listener must be a function");var f=new K(p,h||v,l),o=j?j+m:m;return v._events[o]?v._events[o].fn?v._events[o]=[v._events[o],f]:v._events[o].push(f):(v._events[o]=f,v._eventsCount++),v}function r(v,m){--v._eventsCount===0?v._events=new B:delete v._events[m]}function L(){this._events=new B,this._eventsCount=0}L.prototype.eventNames=function(){var m=[],p,h;if(this._eventsCount===0)return m;for(h in p=this._events)X.call(p,h)&&m.push(j?h.slice(1):h);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(p)):m},L.prototype.listeners=function(m){var p=j?j+m:m,h=this._events[p];if(!h)return[];if(h.fn)return[h.fn];for(var l=0,f=h.length,o=new Array(f);l<f;l++)o[l]=h[l].fn;return o},L.prototype.listenerCount=function(m){var p=j?j+m:m,h=this._events[p];return h?h.fn?1:h.length:0},L.prototype.emit=function(m,p,h,l,f,o){var u=j?j+m:m;if(!this._events[u])return!1;var a=this._events[u],s=arguments.length,R,_;if(a.fn){a.once&&this.removeListener(m,a.fn,void 0,!0);switch(s){case 1:return a.fn.call(a.context),!0;case 2:return a.fn.call(a.context,p),!0;case 3:return a.fn.call(a.context,p,h),!0;case 4:return a.fn.call(a.context,p,h,l),!0;case 5:return a.fn.call(a.context,p,h,l,f),!0;case 6:return a.fn.call(a.context,p,h,l,f,o),!0}for(_=1,R=new Array(s-1);_<s;_++)R[_-1]=arguments[_];a.fn.apply(a.context,R)}else{var C=a.length,D;for(_=0;_<C;_++){a[_].once&&this.removeListener(m,a[_].fn,void 0,!0);switch(s){case 1:a[_].fn.call(a[_].context);break;case 2:a[_].fn.call(a[_].context,p);break;case 3:a[_].fn.call(a[_].context,p,h);break;case 4:a[_].fn.call(a[_].context,p,h,l);break;default:if(!R)for(D=1,R=new Array(s-1);D<s;D++)R[D-1]=arguments[D];a[_].fn.apply(a[_].context,R)}}}return!0},L.prototype.on=function(m,p,h){return G(this,m,p,h,!1)},L.prototype.once=function(m,p,h){return G(this,m,p,h,!0)},L.prototype.removeListener=function(m,p,h,l){var f=j?j+m:m;if(!this._events[f])return this;if(!p)return r(this,f),this;var o=this._events[f];if(o.fn)o.fn===p&&(!l||o.once)&&(!h||o.context===h)&&r(this,f);else{for(var u=0,a=[],s=o.length;u<s;u++)(o[u].fn!==p||l&&!o[u].once||h&&o[u].context!==h)&&a.push(o[u]);a.length?this._events[f]=a.length===1?a[0]:a:r(this,f)}return this},L.prototype.removeAllListeners=function(m){var p;return m?(p=j?j+m:m,this._events[p]&&r(this,p)):(this._events=new B,this._eventsCount=0),this},L.prototype.off=L.prototype.removeListener,L.prototype.addListener=L.prototype.on,L.prefixed=j,L.EventEmitter=L,ne.exports=L},"./node_modules/url-toolkit/src/url-toolkit.js":function(ne,J,P){(function(X){var j=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,B=/^([^\/?#]*)([^]*)$/,K=/(?:\/|^)\.(?=\/)/g,G=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,r={buildAbsoluteURL:function(L,v,m){if(m=m||{},L=L.trim(),v=v.trim(),!v){if(!m.alwaysNormalize)return L;var p=r.parseURL(L);if(!p)throw new Error("Error trying to parse base URL.");return p.path=r.normalizePath(p.path),r.buildURLFromParts(p)}var h=r.parseURL(v);if(!h)throw new Error("Error trying to parse relative URL.");if(h.scheme)return m.alwaysNormalize?(h.path=r.normalizePath(h.path),r.buildURLFromParts(h)):v;var l=r.parseURL(L);if(!l)throw new Error("Error trying to parse base URL.");if(!l.netLoc&&l.path&&l.path[0]!=="/"){var f=B.exec(l.path);l.netLoc=f[1],l.path=f[2]}l.netLoc&&!l.path&&(l.path="/");var o={scheme:l.scheme,netLoc:h.netLoc,path:null,params:h.params,query:h.query,fragment:h.fragment};if(!h.netLoc&&(o.netLoc=l.netLoc,h.path[0]!=="/"))if(!h.path)o.path=l.path,h.params||(o.params=l.params,h.query||(o.query=l.query));else{var u=l.path,a=u.substring(0,u.lastIndexOf("/")+1)+h.path;o.path=r.normalizePath(a)}return o.path===null&&(o.path=m.alwaysNormalize?r.normalizePath(h.path):h.path),r.buildURLFromParts(o)},parseURL:function(L){var v=j.exec(L);return v?{scheme:v[1]||"",netLoc:v[2]||"",path:v[3]||"",params:v[4]||"",query:v[5]||"",fragment:v[6]||""}:null},normalizePath:function(L){for(L=L.split("").reverse().join("").replace(K,"");L.length!==(L=L.replace(G,"")).length;);return L.split("").reverse().join("")},buildURLFromParts:function(L){return L.scheme+L.netLoc+L.path+L.params+L.query+L.fragment}};ne.exports=r})(this)},"./node_modules/webworkify-webpack/index.js":function(ne,J,P){function X(m){var p={};function h(f){if(p[f])return p[f].exports;var o=p[f]={i:f,l:!1,exports:{}};return m[f].call(o.exports,o,o.exports,h),o.l=!0,o.exports}h.m=m,h.c=p,h.i=function(f){return f},h.d=function(f,o,u){h.o(f,o)||Object.defineProperty(f,o,{configurable:!1,enumerable:!0,get:u})},h.r=function(f){Object.defineProperty(f,"__esModule",{value:!0})},h.n=function(f){var o=f&&f.__esModule?function(){return f.default}:function(){return f};return h.d(o,"a",o),o},h.o=function(f,o){return Object.prototype.hasOwnProperty.call(f,o)},h.p="/",h.oe=function(f){throw console.error(f),f};var l=h(h.s=ENTRY_MODULE);return l.default||l}var j="[\\.|\\-|\\+|\\w|/|@]+",B="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+j+").*?\\)";function K(m){return(m+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function G(m){return!isNaN(1*m)}function r(m,p,h){var l={};l[h]=[];var f=p.toString(),o=f.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!o)return l;for(var u=o[1],a=new RegExp("(\\\\n|\\W)"+K(u)+B,"g"),s;s=a.exec(f);){if(s[3]==="dll-reference")continue;l[h].push(s[3])}for(a=new RegExp("\\("+K(u)+'\\("(dll-reference\\s('+j+'))"\\)\\)'+B,"g");s=a.exec(f);)m[s[2]]||(l[h].push(s[1]),m[s[2]]=P(s[1]).m),l[s[2]]=l[s[2]]||[],l[s[2]].push(s[4]);for(var R=Object.keys(l),_=0;_<R.length;_++)for(var C=0;C<l[R[_]].length;C++)G(l[R[_]][C])&&(l[R[_]][C]=1*l[R[_]][C]);return l}function L(m){var p=Object.keys(m);return p.reduce(function(h,l){return h||m[l].length>0},!1)}function v(m,p){for(var h={main:[p]},l={main:[]},f={main:{}};L(h);)for(var o=Object.keys(h),u=0;u<o.length;u++){var a=o[u],s=h[a],R=s.pop();if(f[a]=f[a]||{},f[a][R]||!m[a][R])continue;f[a][R]=!0,l[a]=l[a]||[],l[a].push(R);for(var _=r(m,m[a][R],a),C=Object.keys(_),D=0;D<C.length;D++)h[C[D]]=h[C[D]]||[],h[C[D]]=h[C[D]].concat(_[C[D]])}return l}ne.exports=function(m,p){p=p||{};var h={main:P.m},l=p.all?{main:Object.keys(h.main)}:v(h,m),f="";Object.keys(l).filter(function(R){return R!=="main"}).forEach(function(R){for(var _=0;l[R][_];)_++;l[R].push(_),h[R][_]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",f=f+"var "+R+" = ("+X.toString().replace("ENTRY_MODULE",JSON.stringify(_))+")({"+l[R].map(function(C){return""+JSON.stringify(C)+": "+h[R][C].toString()}).join(",")+`});
`}),f=f+"new (("+X.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+l.main.map(function(R){return""+JSON.stringify(R)+": "+h.main[R].toString()}).join(",")+"}))(self);";var o=new window.Blob([f],{type:"text/javascript"});if(p.bare)return o;var u=window.URL||window.webkitURL||window.mozURL||window.msURL,a=u.createObjectURL(o),s=new window.Worker(a);return s.objectURL=a,s}},"./src/config.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"hlsDefaultConfig",function(){return D}),P.d(J,"mergeConfig",function(){return A}),P.d(J,"enableStreamingMode",function(){return S});var X=P("./src/controller/abr-controller.ts"),j=P("./src/controller/audio-stream-controller.ts"),B=P("./src/controller/audio-track-controller.ts"),K=P("./src/controller/subtitle-stream-controller.ts"),G=P("./src/controller/subtitle-track-controller.ts"),r=P("./src/controller/buffer-controller.ts"),L=P("./src/controller/timeline-controller.ts"),v=P("./src/controller/cap-level-controller.ts"),m=P("./src/controller/fps-controller.ts"),p=P("./src/controller/eme-controller.ts"),h=P("./src/controller/cmcd-controller.ts"),l=P("./src/utils/xhr-loader.ts"),f=P("./src/utils/fetch-loader.ts"),o=P("./src/utils/cues.ts"),u=P("./src/utils/mediakeys-helper.ts"),a=P("./src/utils/logger.ts");function s(){return s=Object.assign||function(T){for(var c=1;c<arguments.length;c++){var w=arguments[c];for(var y in w)Object.prototype.hasOwnProperty.call(w,y)&&(T[y]=w[y])}return T},s.apply(this,arguments)}function R(T,c){var w=Object.keys(T);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(T);c&&(y=y.filter(function(b){return Object.getOwnPropertyDescriptor(T,b).enumerable})),w.push.apply(w,y)}return w}function _(T){for(var c=1;c<arguments.length;c++){var w=arguments[c]!=null?arguments[c]:{};c%2?R(Object(w),!0).forEach(function(y){C(T,y,w[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(w)):R(Object(w)).forEach(function(y){Object.defineProperty(T,y,Object.getOwnPropertyDescriptor(w,y))})}return T}function C(T,c,w){return c in T?Object.defineProperty(T,c,{value:w,enumerable:!0,configurable:!0,writable:!0}):T[c]=w,T}var D=_(_({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:l.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:X.default,bufferController:r.default,capLevelController:v.default,fpsController:m.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},O()),{},{subtitleStreamController:K.SubtitleStreamController,subtitleTrackController:G.default,timelineController:L.TimelineController,audioStreamController:j.default,audioTrackController:B.default,emeController:p.default,cmcdController:h.default});function O(){return{cueHandler:o.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function A(T,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({},T,c)}function S(T){var c=T.loader;if(c!==f.default&&c!==l.default)a.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),T.progressive=!1;else{var w=Object(f.fetchSupported)();w&&(T.loader=f.default,T.progressive=!0,T.enableSoftwareAES=!0,a.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/polyfills/number.ts"),j=P("./src/utils/ewma-bandwidth-estimator.ts"),B=P("./src/events.ts"),K=P("./src/utils/buffer-helper.ts"),G=P("./src/errors.ts"),r=P("./src/types/loader.ts"),L=P("./src/utils/logger.ts");function v(h,l){for(var f=0;f<l.length;f++){var o=l[f];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(h,o.key,o)}}function m(h,l,f){return l&&v(h.prototype,l),f&&v(h,f),h}var p=function(){function h(f){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=f;var o=f.config;this.bwEstimator=new j.default(o.abrEwmaSlowVoD,o.abrEwmaFastVoD,o.abrEwmaDefaultEstimate),this.registerListeners()}var l=h.prototype;return l.registerListeners=function(){var o=this.hls;o.on(B.Events.FRAG_LOADING,this.onFragLoading,this),o.on(B.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(B.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.on(B.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var o=this.hls;o.off(B.Events.FRAG_LOADING,this.onFragLoading,this),o.off(B.Events.FRAG_LOADED,this.onFragLoaded,this),o.off(B.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.off(B.Events.ERROR,this.onError,this)},l.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},l.onFragLoading=function(o,u){var a=u.frag;if(a.type===r.PlaylistLevelType.MAIN&&!this.timer){var s;this.fragCurrent=a,this.partCurrent=(s=u.part)!=null?s:null,this.timer=self.setInterval(this.onCheck,100)}},l.onLevelLoaded=function(o,u){var a=this.hls.config;u.details.live?this.bwEstimator.update(a.abrEwmaSlowLive,a.abrEwmaFastLive):this.bwEstimator.update(a.abrEwmaSlowVoD,a.abrEwmaFastVoD)},l._abandonRulesCheck=function(){var o=this.fragCurrent,u=this.partCurrent,a=this.hls,s=a.autoLevelEnabled,R=a.config,_=a.media;if(!o||!_)return;var C=u?u.stats:o.stats,D=u?u.duration:o.duration;if(C.aborted){L.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!s||_.paused||!_.playbackRate||!_.readyState)return;var O=performance.now()-C.loading.start,A=Math.abs(_.playbackRate);if(O<=500*D/A)return;var S=a.levels,T=a.minAutoLevel,c=S[o.level],w=C.total||Math.max(C.loaded,Math.round(D*c.maxBitrate/8)),y=Math.max(1,C.bwEstimate?C.bwEstimate/8:C.loaded*1e3/O),b=(w-C.loaded)/y,U=_.currentTime,F=(K.BufferHelper.bufferInfo(_,U,R.maxBufferHole).end-U)/A;if(F>=2*D/A||b<=F)return;var E=Number.POSITIVE_INFINITY,N;for(N=o.level-1;N>T;N--){var I=S[N].maxBitrate;if(E=D*I/(8*.8*y),E<F)break}if(E>=b)return;var g=this.bwEstimator.getEstimate();L.logger.warn("Fragment "+o.sn+(u?" part "+u.index:"")+" of level "+o.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+N+`
Current BW estimate: `+(Object(X.isFiniteNumber)(g)?(g/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+b.toFixed(3)+` s
Estimated load time for the next fragment: `+E.toFixed(3)+` s
Time to underbuffer: `+F.toFixed(3)+" s"),a.nextLoadLevel=N,this.bwEstimator.sample(O,C.loaded),this.clearTimer(),o.loader&&(this.fragCurrent=this.partCurrent=null,o.loader.abort()),a.trigger(B.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:o,part:u,stats:C})},l.onFragLoaded=function(o,u){var a=u.frag,s=u.part;if(a.type===r.PlaylistLevelType.MAIN&&Object(X.isFiniteNumber)(a.sn)){var R=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 C=this.hls.levels[a.level],D=(C.loaded?C.loaded.bytes:0)+R.loaded,O=(C.loaded?C.loaded.duration:0)+_;C.loaded={bytes:D,duration:O},C.realBitrate=Math.round(8*D/O)}if(a.bitrateTest){var A={stats:R,frag:a,part:s,id:a.type};this.onFragBuffered(B.Events.FRAG_BUFFERED,A),a.bitrateTest=!1}}},l.onFragBuffered=function(o,u){var a=u.frag,s=u.part,R=s?s.stats:a.stats;if(R.aborted)return;if(a.type!==r.PlaylistLevelType.MAIN||a.sn==="initSegment")return;var _=R.parsing.end-R.loading.start;this.bwEstimator.sample(_,R.loaded),R.bwEstimate=this.bwEstimator.getEstimate(),a.bitrateTest?this.bitrateTestDelay=_/1e3:this.bitrateTestDelay=0},l.onError=function(o,u){switch(u.details){case G.ErrorDetails.FRAG_LOAD_ERROR:case G.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},l.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},l.getNextABRAutoLevel=function(){var o=this.fragCurrent,u=this.partCurrent,a=this.hls,s=a.maxAutoLevel,R=a.config,_=a.minAutoLevel,C=a.media,D=u?u.duration:o?o.duration:0,O=C?C.currentTime:0,A=C&&C.playbackRate!==0?Math.abs(C.playbackRate):1,S=this.bwEstimator?this.bwEstimator.getEstimate():R.abrEwmaDefaultEstimate,T=(K.BufferHelper.bufferInfo(C,O,R.maxBufferHole).end-O)/A,c=this.findBestLevel(S,_,s,T,R.abrBandWidthFactor,R.abrBandWidthUpFactor);if(c>=0)return c;L.logger.trace((T?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var w=D?Math.min(D,R.maxStarvationDelay):R.maxStarvationDelay,y=R.abrBandWidthFactor,b=R.abrBandWidthUpFactor;if(!T){var U=this.bitrateTestDelay;if(U){var F=D?Math.min(D,R.maxLoadingDelay):R.maxLoadingDelay;w=F-U,L.logger.trace("bitrate test took "+Math.round(1e3*U)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*w)+" ms"),y=b=1}}return c=this.findBestLevel(S,_,s,T+w,y,b),Math.max(c,0)},l.findBestLevel=function(o,u,a,s,R,_){for(var C,D=this.fragCurrent,O=this.partCurrent,A=this.lastLoadedFragLevel,S=this.hls.levels,T=S[A],c=!!(T!=null&&(C=T.details)!==null&&C!==void 0&&C.live),w=T==null?void 0:T.codecSet,y=O?O.duration:D?D.duration:0,b=a;b>=u;b--){var U=S[b];if(!U||w&&U.codecSet!==w)continue;var F=U.details,E=(O?F==null?void 0:F.partTarget:F==null?void 0:F.averagetargetduration)||y,N=void 0;b<=A?N=R*o:N=_*o;var I=S[b].maxBitrate,g=I*E/N;if(L.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+b+"/"+Math.round(N)+"/"+I+"/"+E+"/"+s+"/"+g),N>I&&(!g||c&&!this.bitrateTestDelay||g<s))return b}return-1},m(h,[{key:"nextAutoLevel",get:function(){var o=this._nextAutoLevel,u=this.bwEstimator;if(o!==-1&&(!u||!u.canEstimate()))return o;var a=this.getNextABRAutoLevel();return o!==-1&&(a=Math.min(o,a)),a},set:function(o){this._nextAutoLevel=o}}]),h}();J.default=p},"./src/controller/audio-stream-controller.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/polyfills/number.ts"),j=P("./src/controller/base-stream-controller.ts"),B=P("./src/events.ts"),K=P("./src/utils/buffer-helper.ts"),G=P("./src/controller/fragment-tracker.ts"),r=P("./src/types/level.ts"),L=P("./src/types/loader.ts"),v=P("./src/loader/fragment.ts"),m=P("./src/demux/chunk-cache.ts"),p=P("./src/demux/transmuxer-interface.ts"),h=P("./src/types/transmuxer.ts"),l=P("./src/controller/fragment-finders.ts"),f=P("./src/utils/discontinuities.ts"),o=P("./src/errors.ts"),u=P("./src/utils/logger.ts");function a(){return a=Object.assign||function(D){for(var O=1;O<arguments.length;O++){var A=arguments[O];for(var S in A)Object.prototype.hasOwnProperty.call(A,S)&&(D[S]=A[S])}return D},a.apply(this,arguments)}function s(D,O){D.prototype=Object.create(O.prototype),D.prototype.constructor=D,R(D,O)}function R(D,O){return R=Object.setPrototypeOf||function(S,T){return S.__proto__=T,S},R(D,O)}var _=100,C=function(D){s(O,D);function O(S,T){var c;return c=D.call(this,S,T,"[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 A=O.prototype;return A.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},A._registerListeners=function(){var T=this.hls;T.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.on(B.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),T.on(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),T.on(B.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),T.on(B.Events.ERROR,this.onError,this),T.on(B.Events.BUFFER_RESET,this.onBufferReset,this),T.on(B.Events.BUFFER_CREATED,this.onBufferCreated,this),T.on(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),T.on(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),T.on(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A._unregisterListeners=function(){var T=this.hls;T.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.off(B.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),T.off(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),T.off(B.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),T.off(B.Events.ERROR,this.onError,this),T.off(B.Events.BUFFER_RESET,this.onBufferReset,this),T.off(B.Events.BUFFER_CREATED,this.onBufferCreated,this),T.off(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),T.off(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),T.off(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A.onInitPtsFound=function(T,c){var w=c.frag,y=c.id,b=c.initPTS;if(y==="main"){var U=w.cc;this.initPTS[w.cc]=b,this.log("InitPTS for cc: "+U+" found from main: "+b),this.videoTrackCC=U,this.state===j.State.WAITING_INIT_PTS&&this.tick()}},A.startLoad=function(T){if(!this.levels){this.startPosition=T,this.state=j.State.STOPPED;return}var c=this.lastCurrentTime;this.stopLoad(),this.setInterval(_),this.fragLoadError=0,c>0&&T===-1?(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),this.state=j.State.IDLE):(this.loadedmetadata=!1,this.state=j.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=T,this.tick()},A.doTick=function(){switch(this.state){case j.State.IDLE:this.doTickIdle();break;case j.State.WAITING_TRACK:{var T,c=this.levels,w=this.trackId,y=c==null||((T=c[w])===null||T===void 0)?void 0:T.details;if(y){if(this.waitForCdnTuneIn(y))break;this.state=j.State.WAITING_INIT_PTS}break}case j.State.FRAG_LOADING_WAITING_RETRY:{var b,U=performance.now(),F=this.retryDate;(!F||U>=F||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=j.State.IDLE);break}case j.State.WAITING_INIT_PTS:{var E=this.waitingData;if(E){var N=E.frag,I=E.part,g=E.cache,H=E.complete;if(this.initPTS[N.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=j.State.FRAG_LOADING;var $=g.flush(),ie={frag:N,part:I,payload:$,networkDetails:null};this._handleFragmentLoadProgress(ie),H&&D.prototype._handleFragmentLoadComplete.call(this,ie)}else if(this.videoTrackCC!==this.waitingVideoCC)u.logger.log("Waiting fragment cc ("+N.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var oe=this.getLoadPosition(),Ce=K.BufferHelper.bufferInfo(this.mediaBuffer,oe,this.config.maxBufferHole),ve=Object(l.fragmentWithinToleranceTest)(Ce.end,this.config.maxFragLookUpTolerance,N);ve<0&&(u.logger.log("Waiting fragment cc ("+N.cc+") @ "+N.start+" cancelled because another fragment at "+Ce.end+" is needed"),this.clearWaitingFragment())}}else this.state=j.State.IDLE}}this.onTickEnd()},A.clearWaitingFragment=function(){var T=this.waitingData;T&&(this.fragmentTracker.removeFragment(T.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=j.State.IDLE)},A.onTickEnd=function(){var T=this.media;if(!T||!T.readyState)return;var c=this.mediaBuffer?this.mediaBuffer:T,w=c.buffered;!this.loadedmetadata&&w.length&&(this.loadedmetadata=!0),this.lastCurrentTime=T.currentTime},A.doTickIdle=function(){var T,c,w=this.hls,y=this.levels,b=this.media,U=this.trackId,F=w.config;if(!y||!y[U])return;if(!b&&(this.startFragRequested||!F.startFragPrefetch))return;var E=y[U],N=E.details;if(!N||N.live&&this.levelLastLoaded!==U||this.waitForCdnTuneIn(N)){this.state=j.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,v.ElementaryStreamTypes.AUDIO,L.PlaylistLevelType.AUDIO));var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,L.PlaylistLevelType.AUDIO);if(I===null)return;var g=I.len,H=this.getMaxBufferLength(),$=this.audioSwitch;if(g>=H&&!$)return;if(!$&&this._streamEnded(I,N)){w.trigger(B.Events.BUFFER_EOS,{type:"audio"}),this.state=j.State.ENDED;return}var ie=N.fragments,oe=ie[0].start,Ce=I.end;if($){var ve=this.getLoadPosition();Ce=ve,N.PTSKnown&&ve<oe&&((I.end>oe||I.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),b.currentTime=oe+.05))}var Se=this.getNextFragment(Ce,N);if(!Se){this.bufferFlushed=!0;return}((T=Se.decryptdata)===null||T===void 0?void 0:T.keyFormat)==="identity"&&!((c=Se.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(Se,N):this.loadFragment(Se,N,Ce)},A.getMaxBufferLength=function(){var T=D.prototype.getMaxBufferLength.call(this),c=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,L.PlaylistLevelType.MAIN);return c===null?T:Math.max(T,c.len)},A.onMediaDetaching=function(){this.videoBuffer=null,D.prototype.onMediaDetaching.call(this)},A.onAudioTracksUpdated=function(T,c){var w=c.audioTracks;this.resetTransmuxer(),this.levels=w.map(function(y){return new r.Level(y)})},A.onAudioTrackSwitching=function(T,c){var w=!!c.url;this.trackId=c.id;var y=this.fragCurrent;y!=null&&y.loader&&y.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),w?this.setInterval(_):this.resetTransmuxer(),w?(this.audioSwitch=!0,this.state=j.State.IDLE):this.state=j.State.STOPPED,this.tick()},A.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},A.onLevelLoaded=function(T,c){this.mainDetails=c.details},A.onAudioTrackLoaded=function(T,c){var w,y=this.levels,b=c.details,U=c.id;if(!y){this.warn("Audio tracks were reset while loading level "+U);return}this.log("Track "+U+" loaded ["+b.startSN+","+b.endSN+"],duration:"+b.totalduration);var F=y[U],E=0;if(b.live||(w=F.details)!==null&&w!==void 0&&w.live){var N=this.mainDetails;if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed||!N)return;!F.details&&b.hasProgramDateTime&&N.hasProgramDateTime?(Object(f.alignMediaPlaylistByPDT)(b,N),E=b.fragments[0].start):E=this.alignPlaylists(b,F.details)}F.details=b,this.levelLastLoaded=U,!this.startFragRequested&&(this.mainDetails||!b.live)&&this.setStartPosition(F.details,E),this.state===j.State.WAITING_TRACK&&!this.waitForCdnTuneIn(b)&&(this.state=j.State.IDLE),this.tick()},A._handleFragmentLoadProgress=function(T){var c,w=T.frag,y=T.part,b=T.payload,U=this.config,F=this.trackId,E=this.levels;if(!E){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+w.sn+" of level "+w.level+" will not be buffered");return}var N=E[F];console.assert(N,"Audio track is defined on fragment load progress");var I=N.details;console.assert(I,"Audio track details are defined on fragment load progress");var g=U.defaultAudioCodec||N.audioCodec||"mp4a.40.2",H=this.transmuxer;H||(H=this.transmuxer=new p.default(this.hls,L.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var $=this.initPTS[w.cc],ie=(c=w.initSegment)===null||c===void 0?void 0:c.data;if($!==void 0){var oe=!1,Ce=y?y.index:-1,ve=Ce!==-1,Se=new h.ChunkMetadata(w.level,w.sn,w.stats.chunkCount,b.byteLength,Ce,ve);H.push(b,ie,g,"",w,y,I.totalduration,oe,Se,$)}else{u.logger.log("Unknown video PTS for cc "+w.cc+", waiting for video PTS before demuxing audio frag "+w.sn+" of ["+I.startSN+" ,"+I.endSN+"],track "+F);var Ae=this.waitingData=this.waitingData||{frag:w,part:y,cache:new m.default,complete:!1},Oe=Ae.cache;Oe.push(new Uint8Array(b)),this.waitingVideoCC=this.videoTrackCC,this.state=j.State.WAITING_INIT_PTS}},A._handleFragmentLoadComplete=function(T){if(this.waitingData){this.waitingData.complete=!0;return}D.prototype._handleFragmentLoadComplete.call(this,T)},A.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},A.onBufferCreated=function(T,c){var w=c.tracks.audio;w&&(this.mediaBuffer=w.buffer),c.tracks.video&&(this.videoBuffer=c.tracks.video.buffer)},A.onFragBuffered=function(T,c){var w=c.frag,y=c.part;if(w.type!==L.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(w)){this.warn("Fragment "+w.sn+(y?" p: "+y.index:"")+" of level "+w.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}w.sn!=="initSegment"&&(this.fragPrevious=w,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(w,y)},A.onError=function(T,c){switch(c.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(L.PlaylistLevelType.AUDIO,c);break;case o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==j.State.ERROR&&this.state!==j.State.STOPPED&&(this.state=c.fatal?j.State.ERROR:j.State.IDLE,this.warn(c.details+" while loading frag, switching to "+this.state+" state"));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="audio"&&(this.state===j.State.PARSING||this.state===j.State.PARSED)){var w=!0,y=this.getFwdBufferInfo(this.mediaBuffer,L.PlaylistLevelType.AUDIO);y&&y.len>.5&&(w=!this.reduceMaxBufferLength(y.len)),w&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},A.onBufferFlushed=function(T,c){var w=c.type;w===v.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},A._handleTransmuxComplete=function(T){var c,w="audio",y=this.hls,b=T.remuxResult,U=T.chunkMeta,F=this.getCurrentContext(U);if(!F){this.warn("The loading context changed while buffering fragment "+U.sn+" of level "+U.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(U.level);return}var E=F.frag,N=F.part,I=b.audio,g=b.text,H=b.id3,$=b.initSegment;if(this.fragContextChanged(E))return;if(this.state=j.State.PARSING,this.audioSwitch&&I&&this.completeAudioSwitch(),$!=null&&$.tracks&&(this._bufferInitSegment($.tracks,E,U),y.trigger(B.Events.FRAG_PARSING_INIT_SEGMENT,{frag:E,id:w,tracks:$.tracks})),I){var ie=I.startPTS,oe=I.endPTS,Ce=I.startDTS,ve=I.endDTS;N&&(N.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:ie,endPTS:oe,startDTS:Ce,endDTS:ve}),E.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,ie,oe,Ce,ve),this.bufferFragmentData(I,E,N,U)}if(H!=null&&(c=H.samples)!==null&&c!==void 0&&c.length){var Se=a({frag:E,id:w},H);y.trigger(B.Events.FRAG_PARSING_METADATA,Se)}if(g){var Ae=a({frag:E,id:w},g);y.trigger(B.Events.FRAG_PARSING_USERDATA,Ae)}},A._bufferInitSegment=function(T,c,w){if(this.state!==j.State.PARSING)return;T.video&&delete T.video;var y=T.audio;if(!y)return;y.levelCodec=y.codec,y.id="audio",this.log("Init audio buffer, container:"+y.container+", codecs[parsed]=["+y.codec+"]"),this.hls.trigger(B.Events.BUFFER_CODECS,T);var b=y.initSegment;if(b!=null&&b.byteLength){var U={type:"audio",frag:c,part:null,chunkMeta:w,parent:c.type,data:b};this.hls.trigger(B.Events.BUFFER_APPENDING,U)}this.tick()},A.loadFragment=function(T,c,w){var y=this.fragmentTracker.getState(T);this.fragCurrent=T,(this.audioSwitch||y===G.FragmentState.NOT_LOADED||y===G.FragmentState.PARTIAL)&&(T.sn==="initSegment"?this._loadInitSegment(T):c.live&&!Object(X.isFiniteNumber)(this.initPTS[T.cc])?(this.log("Waiting for video PTS in continuity counter "+T.cc+" of live stream before loading audio fragment "+T.sn+" of level "+this.trackId),this.state=j.State.WAITING_INIT_PTS):(this.startFragRequested=!0,D.prototype.loadFragment.call(this,T,c,w)))},A.completeAudioSwitch=function(){var T=this.hls,c=this.media,w=this.trackId;c&&(this.log("Switching audio track : flushing all audio"),D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,T.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:w})},O}(j.default);J.default=C},"./src/controller/audio-track-controller.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/events.ts"),j=P("./src/errors.ts"),B=P("./src/controller/base-playlist-controller.ts"),K=P("./src/types/loader.ts");function G(p,h){for(var l=0;l<h.length;l++){var f=h[l];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(p,f.key,f)}}function r(p,h,l){return h&&G(p.prototype,h),l&&G(p,l),p}function L(p,h){p.prototype=Object.create(h.prototype),p.prototype.constructor=p,v(p,h)}function v(p,h){return v=Object.setPrototypeOf||function(f,o){return f.__proto__=o,f},v(p,h)}var m=function(p){L(h,p);function h(f){var o;return o=p.call(this,f,"[audio-track-controller]")||this,o.tracks=[],o.groupId=null,o.tracksInGroup=[],o.trackId=-1,o.trackName="",o.selectDefaultTrack=!0,o.registerListeners(),o}var l=h.prototype;return l.registerListeners=function(){var o=this.hls;o.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(X.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.on(X.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.on(X.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var o=this.hls;o.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(X.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.off(X.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.off(X.Events.ERROR,this.onError,this)},l.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,p.prototype.destroy.call(this)},l.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},l.onManifestParsed=function(o,u){this.tracks=u.audioTracks||[]},l.onAudioTrackLoaded=function(o,u){var a=u.id,s=u.details,R=this.tracksInGroup[a];if(!R){this.warn("Invalid audio track id "+a);return}var _=R.details;R.details=u.details,this.log("audioTrack "+a+" loaded ["+s.startSN+"-"+s.endSN+"]"),a===this.trackId&&(this.retryCount=0,this.playlistLoaded(a,u,_))},l.onLevelLoading=function(o,u){this.switchLevel(u.level)},l.onLevelSwitching=function(o,u){this.switchLevel(u.level)},l.switchLevel=function(o){var u=this.hls.levels[o];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 R={audioTracks:s};this.log("Updating audio tracks, "+s.length+' track(s) found in "'+a+'" group-id'),this.hls.trigger(X.Events.AUDIO_TRACKS_UPDATED,R),this.selectInitialTrack()}},l.onError=function(o,u){if(p.prototype.onError.call(this,o,u),u.fatal||!u.context)return;u.context.type===K.PlaylistContextType.AUDIO_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},l.setAudioTrack=function(o){var u=this.tracksInGroup;if(o<0||o>=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 "+o);var s=u[o],R=s.id,_=s.groupId,C=_===void 0?"":_,D=s.name,O=s.type,A=s.url;if(this.trackId=o,this.trackName=D,this.selectDefaultTrack=!1,this.hls.trigger(X.Events.AUDIO_TRACK_SWITCHING,{id:R,groupId:C,name:D,type:O,url:A}),s.details&&!s.details.live)return;var S=this.switchParams(s.url,a==null?void 0:a.details);this.loadPlaylist(S)},l.selectInitialTrack=function(){var o=this.tracksInGroup;console.assert(o.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(X.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},l.findTrackId=function(o){for(var u=this.tracksInGroup,a=0;a<u.length;a++){var s=u[a];if((!this.selectDefaultTrack||s.default)&&(!o||o===s.name))return s.id}return-1},l.loadPlaylist=function(o){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var a=u.id,s=u.groupId,R=u.url;if(o)try{R=o.addDirectives(R)}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(X.Events.AUDIO_TRACK_LOADING,{url:R,id:a,groupId:s,deliveryDirectives:o||null})}},r(h,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(o){this.selectDefaultTrack=!1,this.setAudioTrack(o)}}]),h}(B.default);J.default=m},"./src/controller/base-playlist-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return r});var X=P("./src/polyfills/number.ts"),j=P("./src/types/level.ts"),B=P("./src/controller/level-helper.ts"),K=P("./src/utils/logger.ts"),G=P("./src/errors.ts"),r=function(){function L(m,p){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=K.logger.log.bind(K.logger,p+":"),this.warn=K.logger.warn.bind(K.logger,p+":"),this.hls=m}var v=L.prototype;return v.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},v.onError=function(p,h){h.fatal&&h.type===G.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},v.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},v.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},v.stopLoad=function(){this.canLoad=!1,this.clearTimer()},v.switchParams=function(p,h){var l=h==null?void 0:h.renditionReports;if(l)for(var f=0;f<l.length;f++){var o=l[f],u=""+o.URI;if(u===p.substr(-u.length)){var a=parseInt(o["LAST-MSN"]),s=parseInt(o["LAST-PART"]);if(h&&this.hls.config.lowLatencyMode){var R=Math.min(h.age-h.partTarget,h.targetduration);s!==void 0&&R>h.partTarget&&(s+=1)}if(Object(X.isFiniteNumber)(a))return new j.HlsUrlParameters(a,Object(X.isFiniteNumber)(s)?s:void 0,j.HlsSkip.No)}}},v.loadPlaylist=function(p){},v.shouldLoadTrack=function(p){return this.canLoad&&p&&!!p.url&&(!p.details||p.details.live)},v.playlistLoaded=function(p,h,l){var f=this,o=h.details,u=h.stats,a=u.loading.end?Math.max(0,self.performance.now()-u.loading.end):0;if(o.advancedDateTime=Date.now()-a,o.live||l!=null&&l.live){if(o.reloaded(l),l&&this.log("live playlist "+p+" "+(o.advanced?"REFRESHED "+o.lastPartSn+"-"+o.lastPartIndex:"MISSED")),l&&o.fragments.length>0&&Object(B.mergeDetails)(l,o),!this.canLoad||!o.live)return;var s,R=void 0,_=void 0;if(o.canBlockReload&&o.endSN&&o.advanced){var C=this.hls.config.lowLatencyMode,D=o.lastPartSn,O=o.endSN,A=o.lastPartIndex,S=A!==-1,T=D===O,c=C?0:A;S?(R=T?O+1:D,_=T?c:A+1):R=O+1;var w=o.age,y=w+o.ageHeader,b=Math.min(y-o.partTarget,o.targetduration*1.5);if(b>0){if(l&&b>l.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+l.tuneInGoal+" to: "+b+" with playlist age: "+o.age),b=0;else{var U=Math.floor(b/o.targetduration);if(R+=U,_!==void 0){var F=Math.round(b%o.targetduration/o.partTarget);_+=F}this.log("CDN Tune-in age: "+o.ageHeader+"s last advanced "+w.toFixed(2)+"s goal: "+b+" skip sn "+U+" to part "+_)}o.tuneInGoal=b}if(s=this.getDeliveryDirectives(o,h.deliveryDirectives,R,_),C||!T){this.loadPlaylist(s);return}}else s=this.getDeliveryDirectives(o,h.deliveryDirectives,R,_);var E=Object(B.computeReloadInterval)(o,u);R!==void 0&&o.canBlockReload&&(E-=o.partTarget||1),this.log("reload live playlist "+p+" in "+Math.round(E)+" ms"),this.timer=self.setTimeout(function(){return f.loadPlaylist(s)},E)}else this.clearTimer()},v.getDeliveryDirectives=function(p,h,l,f){var o=Object(j.getSkipValue)(p,l);return h!=null&&h.skip&&p.deltaUpdateFailed&&(l=h.msn,f=h.part,o=j.HlsSkip.No),new j.HlsUrlParameters(l,f,o)},v.retryLoadingOrFail=function(p){var h=this,l=this.hls.config,f=this.retryCount<l.levelLoadingMaxRetry;if(f){var o;if(this.retryCount++,p.details.indexOf("LoadTimeOut")>-1&&(o=p.context)!==null&&o!==void 0&&o.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+p.details+'"'),this.loadPlaylist();else{var u=Math.min(Math.pow(2,this.retryCount)*l.levelLoadingRetryDelay,l.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return h.loadPlaylist()},u),this.warn("retry playlist loading #"+this.retryCount+" in "+u+' ms after "'+p.details+'"')}}else this.warn('cannot recover from error "'+p.details+'"'),this.clearTimer(),p.fatal=!0;return f},L}()},"./src/controller/base-stream-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"State",function(){return O}),P.d(J,"default",function(){return A});var X=P("./src/polyfills/number.ts"),j=P("./src/task-loop.ts"),B=P("./src/controller/fragment-tracker.ts"),K=P("./src/utils/buffer-helper.ts"),G=P("./src/utils/logger.ts"),r=P("./src/events.ts"),L=P("./src/errors.ts"),v=P("./src/types/transmuxer.ts"),m=P("./src/utils/mp4-tools.ts"),p=P("./src/utils/discontinuities.ts"),h=P("./src/controller/fragment-finders.ts"),l=P("./src/controller/level-helper.ts"),f=P("./src/loader/fragment-loader.ts"),o=P("./src/crypt/decrypter.ts"),u=P("./src/utils/time-ranges.ts"),a=P("./src/types/loader.ts");function s(S,T){for(var c=0;c<T.length;c++){var w=T[c];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(S,w.key,w)}}function R(S,T,c){return T&&s(S.prototype,T),c&&s(S,c),S}function _(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}function C(S,T){S.prototype=Object.create(T.prototype),S.prototype.constructor=S,D(S,T)}function D(S,T){return D=Object.setPrototypeOf||function(w,y){return w.__proto__=y,w},D(S,T)}var O={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"},A=function(S){C(T,S);function T(w,y,b){var U;return U=S.call(this)||this,U.hls=void 0,U.fragPrevious=null,U.fragCurrent=null,U.fragmentTracker=void 0,U.transmuxer=null,U._state=O.STOPPED,U.media=void 0,U.mediaBuffer=void 0,U.config=void 0,U.bitrateTest=!1,U.lastCurrentTime=0,U.nextLoadPosition=0,U.startPosition=0,U.loadedmetadata=!1,U.fragLoadError=0,U.retryDate=0,U.levels=null,U.fragmentLoader=void 0,U.levelLastLoaded=null,U.startFragRequested=!1,U.decrypter=void 0,U.initPTS=[],U.onvseeking=null,U.onvended=null,U.logPrefix="",U.log=void 0,U.warn=void 0,U.logPrefix=b,U.log=G.logger.log.bind(G.logger,b+":"),U.warn=G.logger.warn.bind(G.logger,b+":"),U.hls=w,U.fragmentLoader=new f.default(w.config),U.fragmentTracker=y,U.config=w.config,U.decrypter=new o.default(w,w.config),w.on(r.Events.KEY_LOADED,U.onKeyLoaded,_(U)),U}var c=T.prototype;return c.doTick=function(){this.onTickEnd()},c.onTickEnd=function(){},c.startLoad=function(y){},c.stopLoad=function(){this.fragmentLoader.abort();var y=this.fragCurrent;y&&this.fragmentTracker.removeFragment(y),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=O.STOPPED},c._streamEnded=function(y,b){var U=this.fragCurrent,F=this.fragmentTracker;if(!b.live&&U&&U.sn===b.endSN&&!y.nextStart){var E=F.getState(U);return E===B.FragmentState.PARTIAL||E===B.FragmentState.OK}return!1},c.onMediaAttached=function(y,b){var U=this.media=this.mediaBuffer=b.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),U.addEventListener("seeking",this.onvseeking),U.addEventListener("ended",this.onvended);var F=this.config;this.levels&&F.autoStartLoad&&this.state===O.STOPPED&&this.startLoad(F.startPosition)},c.onMediaDetaching=function(){var y=this.media;y!=null&&y.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),y&&(y.removeEventListener("seeking",this.onvseeking),y.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 y=this.config,b=this.fragCurrent,U=this.media,F=this.mediaBuffer,E=this.state,N=U?U.currentTime:0,I=K.BufferHelper.bufferInfo(F||U,N,y.maxBufferHole);if(this.log("media seeking to "+(Object(X.isFiniteNumber)(N)?N.toFixed(3):N)+", state: "+E),E===O.ENDED)this.resetLoadingState();else if(b&&!I.len){var g=y.maxFragLookUpTolerance,H=b.start-g,$=b.start+b.duration+g,ie=N>$;(N<H||ie)&&(ie&&b.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),b.loader.abort()),this.resetLoadingState())}U&&(this.lastCurrentTime=N),!this.loadedmetadata&&!I.len&&(this.nextLoadPosition=this.startPosition=N),this.tickImmediate()},c.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},c.onKeyLoaded=function(y,b){if(this.state!==O.KEY_LOADING||b.frag!==this.fragCurrent||!this.levels)return;this.state=O.IDLE;var U=this.levels[b.frag.level].details;U&&this.loadFragment(b.frag,U,b.frag.start)},c.onHandlerDestroying=function(){this.stopLoad(),S.prototype.onHandlerDestroying.call(this)},c.onHandlerDestroyed=function(){this.state=O.STOPPED,this.hls.off(r.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,S.prototype.onHandlerDestroyed.call(this)},c.loadKey=function(y,b){this.log("Loading key for "+y.sn+" of ["+b.startSN+"-"+b.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level),this.state=O.KEY_LOADING,this.fragCurrent=y,this.hls.trigger(r.Events.KEY_LOADING,{frag:y})},c.loadFragment=function(y,b,U){this._loadFragForPlayback(y,b,U)},c._loadFragForPlayback=function(y,b,U){var F=this,E=function(I){if(F.fragContextChanged(y)){F.warn("Fragment "+y.sn+(I.part?" p: "+I.part.index:"")+" of level "+y.level+" was dropped during download."),F.fragmentTracker.removeFragment(y);return}y.stats.chunkCount++,F._handleFragmentLoadProgress(I)};this._doFragLoad(y,b,U,E).then(function(N){if(!N)return;F.fragLoadError=0;var I=F.state;if(F.fragContextChanged(y)){(I===O.FRAG_LOADING||I===O.BACKTRACKING||!F.fragCurrent&&I===O.PARSING)&&(F.fragmentTracker.removeFragment(y),F.state=O.IDLE);return}if("payload"in N&&(F.log("Loaded fragment "+y.sn+" of level "+y.level),F.hls.trigger(r.Events.FRAG_LOADED,N),F.state===O.BACKTRACKING)){F.fragmentTracker.backtrack(y,N),F.resetFragmentLoading(y);return}F._handleFragmentLoadComplete(N)}).catch(function(N){F.warn(N),F.resetFragmentLoading(y)})},c.flushMainBuffer=function(y,b,U){if(U===void 0&&(U=null),!(y-b))return;var F={startOffset:y,endOffset:b,type:U};this.fragLoadError=0,this.hls.trigger(r.Events.BUFFER_FLUSHING,F)},c._loadInitSegment=function(y){var b=this;this._doFragLoad(y).then(function(U){if(!U||b.fragContextChanged(y)||!b.levels)throw new Error("init load aborted");return U}).then(function(U){var F=b.hls,E=U.payload,N=y.decryptdata;if(E&&E.byteLength>0&&N&&N.key&&N.iv&&N.method==="AES-128"){var I=self.performance.now();return b.decrypter.webCryptoDecrypt(new Uint8Array(E),N.key.buffer,N.iv.buffer).then(function(g){var H=self.performance.now();return F.trigger(r.Events.FRAG_DECRYPTED,{frag:y,payload:g,stats:{tstart:I,tdecrypt:H}}),U.payload=g,U})}return U}).then(function(U){var F=b.fragCurrent,E=b.hls,N=b.levels;if(!N)throw new Error("init load aborted, missing levels");var I=N[y.level].details;console.assert(I,"Level details are defined when init segment is loaded");var g=y.stats;b.state=O.IDLE,b.fragLoadError=0,y.data=new Uint8Array(U.payload),g.parsing.start=g.buffering.start=self.performance.now(),g.parsing.end=g.buffering.end=self.performance.now(),U.frag===F&&E.trigger(r.Events.FRAG_BUFFERED,{stats:g,frag:F,part:null,id:y.type}),b.tick()}).catch(function(U){b.warn(U),b.resetFragmentLoading(y)})},c.fragContextChanged=function(y){var b=this.fragCurrent;return!y||!b||y.level!==b.level||y.sn!==b.sn||y.urlId!==b.urlId},c.fragBufferedComplete=function(y,b){var U=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+y.type+" sn: "+y.sn+(b?" part: "+b.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level+" "+u.default.toString(K.BufferHelper.getBuffered(U))),this.state=O.IDLE,this.tick()},c._handleFragmentLoadComplete=function(y){var b=this.transmuxer;if(!b)return;var U=y.frag,F=y.part,E=y.partsLoaded,N=!E||E.length===0||E.some(function(g){return!g}),I=new v.ChunkMetadata(U.level,U.sn,U.stats.chunkCount+1,0,F?F.index:-1,!N);b.flush(I)},c._handleFragmentLoadProgress=function(y){},c._doFragLoad=function(y,b,U,F){var E=this;if(U===void 0&&(U=null),!this.levels)throw new Error("frag load aborted, missing levels");if(U=Math.max(y.start,U||0),this.config.lowLatencyMode&&b){var N=b.partList;if(N&&F){U>y.end&&b.fragmentHint&&(y=b.fragmentHint);var I=this.getNextPart(N,y,U);if(I>-1){var g=N[I];return this.log("Loading part sn: "+y.sn+" p: "+g.index+" cc: "+y.cc+" of playlist ["+b.startSN+"-"+b.endSN+"] parts [0-"+I+"-"+(N.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(U.toFixed(3))),this.nextLoadPosition=g.start+g.duration,this.state=O.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:y,part:N[I],targetBufferTime:U}),this.doFragPartsLoad(y,N,I,F).catch(function(H){return E.handleFragLoadError(H)})}else if(!y.url||this.loadedEndOfParts(N,U))return Promise.resolve(null)}}return this.log("Loading fragment "+y.sn+" cc: "+y.cc+" "+(b?"of ["+b.startSN+"-"+b.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(U.toFixed(3))),Object(X.isFiniteNumber)(y.sn)&&!this.bitrateTest&&(this.nextLoadPosition=y.start+y.duration),this.state=O.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:y,targetBufferTime:U}),this.fragmentLoader.load(y,F).catch(function(H){return E.handleFragLoadError(H)})},c.doFragPartsLoad=function(y,b,U,F){var E=this;return new Promise(function(N,I){var g=[],H=function $(ie){var oe=b[ie];E.fragmentLoader.loadPart(y,oe,F).then(function(Ce){g[oe.index]=Ce;var ve=Ce.part;E.hls.trigger(r.Events.FRAG_LOADED,Ce);var Se=b[ie+1];if(Se&&Se.fragment===y)$(ie+1);else return N({frag:y,part:ve,partsLoaded:g})}).catch(I)};H(U)})},c.handleFragLoadError=function(y){var b=y.data;return b&&b.details===L.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(b.frag,b.part):this.hls.trigger(r.Events.ERROR,b),null},c._handleTransmuxerFlush=function(y){var b=this.getCurrentContext(y);if(!b||this.state!==O.PARSING){this.fragCurrent||(this.state=O.IDLE);return}var U=b.frag,F=b.part,E=b.level,N=self.performance.now();U.stats.parsing.end=N,F&&(F.stats.parsing.end=N),this.updateLevelTiming(U,F,E,y.partial)},c.getCurrentContext=function(y){var b=this.levels,U=y.level,F=y.sn,E=y.part;if(!b||!b[U])return this.warn("Levels object was unset while buffering fragment "+F+" of level "+U+". The current chunk will not be buffered."),null;var N=b[U],I=E>-1?Object(l.getPartWith)(N,F,E):null,g=I?I.fragment:Object(l.getFragmentWithSN)(N,F,this.fragCurrent);return g?{frag:g,part:I,level:N}:null},c.bufferFragmentData=function(y,b,U,F){if(!y||this.state!==O.PARSING)return;var E=y.data1,N=y.data2,I=E;if(E&&N&&(I=Object(m.appendUint8Array)(E,N)),!I||!I.length)return;var g={type:y.type,frag:b,part:U,chunkMeta:F,parent:b.type,data:I};this.hls.trigger(r.Events.BUFFER_APPENDING,g),y.dropped&&y.independent&&!U&&this.flushBufferGap(b)},c.flushBufferGap=function(y){var b=this.media;if(!b)return;if(!K.BufferHelper.isBuffered(b,b.currentTime)){this.flushMainBuffer(0,y.start);return}var U=b.currentTime,F=K.BufferHelper.bufferInfo(b,U,0),E=y.duration,N=Math.min(this.config.maxFragLookUpTolerance*2,E*.25),I=Math.max(Math.min(y.start-N,F.end-N),U+N);y.start-I>N&&this.flushMainBuffer(I,y.start)},c.getFwdBufferInfo=function(y,b){var U=this.config,F=this.getLoadPosition();if(!Object(X.isFiniteNumber)(F))return null;var E=K.BufferHelper.bufferInfo(y,F,U.maxBufferHole);if(E.len===0&&E.nextStart!==void 0){var N=this.fragmentTracker.getBufferedFrag(F,b);if(N&&E.nextStart<N.end)return K.BufferHelper.bufferInfo(y,F,Math.max(E.nextStart,U.maxBufferHole))}return E},c.getMaxBufferLength=function(y){var b=this.config,U;return y?U=Math.max(8*b.maxBufferSize/y,b.maxBufferLength):U=b.maxBufferLength,Math.min(U,b.maxMaxBufferLength)},c.reduceMaxBufferLength=function(y){var b=this.config,U=y||b.maxBufferLength;return b.maxMaxBufferLength>=U?(b.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+b.maxMaxBufferLength+"s"),!0):!1},c.getNextFragment=function(y,b){var U,F,E=b.fragments,N=E.length;if(!N)return null;var I=this.config,g=E[0].start,H;if(b.live){var $=I.initialLiveManifestSize;if(N<$)return this.warn("Not enough fragments to start playback (have: "+N+", need: "+$+")"),null;!b.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(H=this.getInitialLiveFragment(b,E),this.startPosition=H?this.hls.liveSyncPosition||H.start:y)}else y<=g&&(H=E[0]);if(!H){var ie=I.lowLatencyMode?b.partEnd:b.fragmentEnd;H=this.getFragmentAtPosition(y,ie,b)}return(U=H)!==null&&U!==void 0&&U.initSegment&&!((F=H)!==null&&F!==void 0&&F.initSegment.data)&&!this.bitrateTest&&(H=H.initSegment),H},c.getNextPart=function(y,b,U){for(var F=-1,E=!1,N=!0,I=0,g=y.length;I<g;I++){var H=y[I];if(N=N&&!H.independent,F>-1&&U<H.start)break;var $=H.loaded;!$&&(E||H.independent||N)&&H.fragment===b&&(F=I),E=$}return F},c.loadedEndOfParts=function(y,b){var U=y[y.length-1];return U&&b>U.start&&U.loaded},c.getInitialLiveFragment=function(y,b){var U=this.fragPrevious,F=null;if(U){if(y.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+U.programDateTime),F=Object(h.findFragmentByPDT)(b,U.endProgramDateTime,this.config.maxFragLookUpTolerance)),!F){var E=U.sn+1;if(E>=y.startSN&&E<=y.endSN){var N=b[E-y.startSN];U.cc===N.cc&&(F=N,this.log("Live playlist, switching playlist, load frag with next SN: "+F.sn))}F||(F=Object(h.findFragWithCC)(b,U.cc),F&&this.log("Live playlist, switching playlist, load frag with same CC: "+F.sn))}}else{var I=this.hls.liveSyncPosition;I!==null&&(F=this.getFragmentAtPosition(I,this.bitrateTest?y.fragmentEnd:y.edge,y))}return F},c.getFragmentAtPosition=function(y,b,U){var F=this.config,E=this.fragPrevious,N=U.fragments,I=U.endSN,g=U.fragmentHint,H=F.maxFragLookUpTolerance,$=!!(F.lowLatencyMode&&U.partList&&g);$&&g&&!this.bitrateTest&&(N=N.concat(g),I=g.sn);var ie;if(y<b){var oe=y>b-H?0:H;ie=Object(h.findFragmentByPTS)(E,N,y,oe)}else ie=N[N.length-1];if(ie){var Ce=ie.sn-U.startSN,ve=E&&ie.level===E.level,Se=N[Ce+1],Ae=this.fragmentTracker.getState(ie);if(Ae===B.FragmentState.BACKTRACKED){ie=null;for(var Oe=Ce;N[Oe]&&this.fragmentTracker.getState(N[Oe])===B.FragmentState.BACKTRACKED;)E?ie=N[Oe--]:ie=N[--Oe];ie||(ie=Se)}else E&&ie.sn===E.sn&&!$&&(ve&&(ie.sn<I&&this.fragmentTracker.getState(Se)!==B.FragmentState.OK?(this.log("SN "+ie.sn+" just loaded, load next one: "+Se.sn),ie=Se):ie=null))}return ie},c.synchronizeToLiveEdge=function(y){var b=this.config,U=this.media;if(!U)return;var F=this.hls.liveSyncPosition,E=U.currentTime,N=y.fragments[0].start,I=y.edge,g=E>=N-b.maxFragLookUpTolerance&&E<=I;if(F!==null&&U.duration>F&&(E<F||!g)){var H=b.liveMaxLatencyDuration!==void 0?b.liveMaxLatencyDuration:b.liveMaxLatencyDurationCount*y.targetduration;(!g&&U.readyState<4||E<I-H)&&(this.loadedmetadata||(this.nextLoadPosition=F),U.readyState&&(this.warn("Playback: "+E.toFixed(3)+" is located too far from the end of live sliding playlist: "+I+", reset currentTime to : "+F.toFixed(3)),U.currentTime=F))}},c.alignPlaylists=function(y,b){var U=this.levels,F=this.levelLastLoaded,E=this.fragPrevious,N=F!==null?U[F]:null,I=y.fragments.length;if(!I)return this.warn("No fragments in live playlist"),0;var g=y.fragments[0].start,H=!b,$=y.alignedSliding&&Object(X.isFiniteNumber)(g);if(H||!$&&!g){Object(p.alignStream)(E,N,y);var ie=y.fragments[0].start;return this.log("Live playlist sliding: "+ie.toFixed(2)+" start-sn: "+(b?b.startSN:"na")+"->"+y.startSN+" prev-sn: "+(E?E.sn:"na")+" fragments: "+I),ie}return g},c.waitForCdnTuneIn=function(y){var b=3;return y.live&&y.canBlockReload&&y.tuneInGoal>Math.max(y.partHoldBack,y.partTarget*b)},c.setStartPosition=function(y,b){var U=this.startPosition;if(U<b&&(U=-1),U===-1||this.lastCurrentTime===-1){var F=y.startTimeOffset;Object(X.isFiniteNumber)(F)?(U=b+F,F<0&&(U+=y.totalduration),U=Math.min(Math.max(b,U),b+y.totalduration),this.log("Start time offset "+F+" found in playlist, adjust startPosition to "+U),this.startPosition=U):y.live?U=this.hls.liveSyncPosition||b:this.startPosition=U=0,this.lastCurrentTime=U}this.nextLoadPosition=U},c.getLoadPosition=function(){var y=this.media,b=0;return this.loadedmetadata&&y?b=y.currentTime:this.nextLoadPosition&&(b=this.nextLoadPosition),b},c.handleFragLoadAborted=function(y,b){this.transmuxer&&y.sn!=="initSegment"&&y.stats.aborted&&(this.warn("Fragment "+y.sn+(b?" part"+b.index:"")+" of level "+y.level+" was aborted"),this.resetFragmentLoading(y))},c.resetFragmentLoading=function(y){(!this.fragCurrent||!this.fragContextChanged(y))&&(this.state=O.IDLE)},c.onFragmentOrKeyLoadError=function(y,b){if(b.fatal)return;var U=b.frag;if(!U||U.type!==y)return;var F=this.fragCurrent;console.assert(F&&U.sn===F.sn&&U.level===F.level&&U.urlId===F.urlId,"Frag load error must match current frag to retry");var E=this.config;if(this.fragLoadError+1<=E.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(U.level))return;var N=Math.min(Math.pow(2,this.fragLoadError)*E.fragLoadingRetryDelay,E.fragLoadingMaxRetryTimeout);this.warn("Fragment "+U.sn+" of "+y+" "+U.level+" failed to load, retrying in "+N+"ms"),this.retryDate=self.performance.now()+N,this.fragLoadError++,this.state=O.FRAG_LOADING_WAITING_RETRY}else b.levelRetry?(y===a.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=O.IDLE):(G.logger.error(b.details+" reaches max retry, redispatch as fatal ..."),b.fatal=!0,this.hls.stopLoad(),this.state=O.ERROR)},c.afterBufferFlushed=function(y,b,U){if(!y)return;var F=K.BufferHelper.getBuffered(y);this.fragmentTracker.detectEvictedFragments(b,F,U),this.state===O.ENDED&&this.resetLoadingState()},c.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=O.IDLE},c.resetLiveStartWhenNotLoaded=function(y){if(!this.loadedmetadata){this.startFragRequested=!1;var b=this.levels?this.levels[y].details:null;if(b!=null&&b.live)return this.startPosition=-1,this.setStartPosition(b,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},c.updateLevelTiming=function(y,b,U,F){var E=this,N=U.details;console.assert(!!N,"level.details must be defined");var I=Object.keys(y.elementaryStreams).reduce(function(g,H){var $=y.elementaryStreams[H];if($){var ie=$.endPTS-$.startPTS;if(ie<=0)return E.warn("Could not parse fragment "+y.sn+" "+H+" duration reliably ("+ie+") resetting transmuxer to fallback to playlist timing"),E.resetTransmuxer(),g||!1;var oe=F?0:Object(l.updateFragPTSDTS)(N,y,$.startPTS,$.endPTS,$.startDTS,$.endDTS);return E.hls.trigger(r.Events.LEVEL_PTS_UPDATED,{details:N,level:U,drift:oe,type:H,frag:y,start:$.startPTS,end:$.endPTS}),!0}return g},!1);I?(this.state=O.PARSED,this.hls.trigger(r.Events.FRAG_PARSED,{frag:y,part:b})):this.resetLoadingState()},c.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},R(T,[{key:"state",get:function(){return this._state},set:function(y){var b=this._state;b!==y&&(this._state=y,this.log(b+"->"+y))}}]),T}(j.default)},"./src/controller/buffer-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return h});var X=P("./src/polyfills/number.ts"),j=P("./src/events.ts"),B=P("./src/utils/logger.ts"),K=P("./src/errors.ts"),G=P("./src/utils/buffer-helper.ts"),r=P("./src/utils/mediasource-helper.ts"),L=P("./src/loader/fragment.ts"),v=P("./src/controller/buffer-operation-queue.ts"),m=Object(r.getMediaSource)(),p=/([ha]vc.)(?:\.[^.,]+)+/,h=function(){function l(o){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,R=u.mediaSource;B.logger.log("[buffer-controller]: Media source opened"),s&&(u.updateMediaElementDuration(),a.trigger(j.Events.MEDIA_ATTACHED,{media:s})),R&&R.removeEventListener("sourceopen",u._onMediaSourceOpen),u.checkPendingTracks()},this._onMediaSourceClose=function(){B.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){B.logger.log("[buffer-controller]: Media source ended")},this.hls=o,this._initSourceBuffer(),this.registerListeners()}var f=l.prototype;return f.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},f.destroy=function(){this.unregisterListeners(),this.details=null},f.registerListeners=function(){var u=this.hls;u.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(j.Events.BUFFER_RESET,this.onBufferReset,this),u.on(j.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.on(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.on(j.Events.BUFFER_EOS,this.onBufferEos,this),u.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.on(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.on(j.Events.FRAG_PARSED,this.onFragParsed,this),u.on(j.Events.FRAG_CHANGED,this.onFragChanged,this)},f.unregisterListeners=function(){var u=this.hls;u.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(j.Events.BUFFER_RESET,this.onBufferReset,this),u.off(j.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.off(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.off(j.Events.BUFFER_EOS,this.onBufferEos,this),u.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.off(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.off(j.Events.FRAG_PARSED,this.onFragParsed,this),u.off(j.Events.FRAG_CHANGED,this.onFragChanged,this)},f._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new v.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},f.onManifestParsed=function(u,a){var s=2;(a.audio&&!a.video||!a.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,this.details=null,B.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},f.onMediaAttaching=function(u,a){var s=this.media=a.media;if(s&&m){var R=this.mediaSource=new m;R.addEventListener("sourceopen",this._onMediaSourceOpen),R.addEventListener("sourceended",this._onMediaSourceEnded),R.addEventListener("sourceclose",this._onMediaSourceClose),s.src=self.URL.createObjectURL(R),this._objectUrl=s.src}},f.onMediaDetaching=function(){var u=this.media,a=this.mediaSource,s=this._objectUrl;if(a){if(B.logger.log("[buffer-controller]: media source detaching"),a.readyState==="open")try{a.endOfStream()}catch(R){B.logger.warn("[buffer-controller]: onMediaDetaching: "+R.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()):B.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(j.Events.MEDIA_DETACHED,void 0)},f.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(R){B.logger.warn("[buffer-controller]: Failed to reset the "+a+" buffer",R)}}),this._initSourceBuffer()},f.onBufferCodecs=function(u,a){var s=this,R=this.getSourceBufferTypes().length;if(Object.keys(a).forEach(function(_){if(R){var C=s.tracks[_];if(C&&typeof C.buffer.changeType=="function"){var D=a[_],O=D.codec,A=D.levelCodec,S=D.container,T=(C.levelCodec||C.codec).replace(p,"$1"),c=(A||O).replace(p,"$1");if(T!==c){var w=S+";codecs="+(A||O);s.appendChangeType(_,w)}}}else s.pendingTracks[_]=a[_]}),R)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},f.appendChangeType=function(u,a){var s=this,R=this.operationQueue,_={execute:function(){var D=s.sourceBuffer[u];D&&(B.logger.log("[buffer-controller]: changing "+u+" sourceBuffer type to "+a),D.changeType(a)),R.shiftAndExecuteNext(u)},onStart:function(){},onComplete:function(){},onError:function(D){B.logger.warn("[buffer-controller]: Failed to change "+u+" SourceBuffer type",D)}};R.append(_,u)},f.onBufferAppending=function(u,a){var s=this,R=this.hls,_=this.operationQueue,C=this.tracks,D=a.data,O=a.type,A=a.frag,S=a.part,T=a.chunkMeta,c=T.buffering[O],w=self.performance.now();c.start=w;var y=A.stats.buffering,b=S?S.stats.buffering:null;y.start===0&&(y.start=w),b&&b.start===0&&(b.start=w);var U=C.audio,F=O==="audio"&&T.id===1&&(U==null?void 0:U.container)==="audio/mpeg",E={execute:function(){if(c.executeStart=self.performance.now(),F){var I=s.sourceBuffer[O];if(I){var g=A.start-I.timestampOffset;Math.abs(g)>=.1&&(B.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+A.start+" (delta: "+g+") sn: "+A.sn+")"),I.timestampOffset=A.start)}}s.appendExecutor(D,O)},onStart:function(){},onComplete:function(){var I=self.performance.now();c.executeEnd=c.end=I,y.first===0&&(y.first=I),b&&b.first===0&&(b.first=I);var g=s.sourceBuffer,H={};for(var $ in g)H[$]=G.BufferHelper.getBuffered(g[$]);s.appendError=0,s.hls.trigger(j.Events.BUFFER_APPENDED,{type:O,frag:A,part:S,chunkMeta:T,parent:A.type,timeRanges:H})},onError:function(I){B.logger.error("[buffer-controller]: Error encountered while trying to append to the "+O+" SourceBuffer",I);var g={type:K.ErrorTypes.MEDIA_ERROR,parent:A.type,details:K.ErrorDetails.BUFFER_APPEND_ERROR,err:I,fatal:!1};I.code===DOMException.QUOTA_EXCEEDED_ERR?g.details=K.ErrorDetails.BUFFER_FULL_ERROR:(s.appendError++,g.details=K.ErrorDetails.BUFFER_APPEND_ERROR,s.appendError>R.config.appendErrorMaxRetry&&(B.logger.error("[buffer-controller]: Failed "+R.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),g.fatal=!0)),R.trigger(j.Events.ERROR,g)}};_.append(E,O)},f.onBufferFlushing=function(u,a){var s=this,R=this.operationQueue,_=function(D){return{execute:s.removeExecutor.bind(s,D,a.startOffset,a.endOffset),onStart:function(){},onComplete:function(){s.hls.trigger(j.Events.BUFFER_FLUSHED,{type:D})},onError:function(A){B.logger.warn("[buffer-controller]: Failed to remove from "+D+" SourceBuffer",A)}}};a.type?R.append(_(a.type),a.type):this.getSourceBufferTypes().forEach(function(C){R.append(_(C),C)})},f.onFragParsed=function(u,a){var s=this,R=a.frag,_=a.part,C=[],D=_?_.elementaryStreams:R.elementaryStreams;D[L.ElementaryStreamTypes.AUDIOVIDEO]?C.push("audiovideo"):(D[L.ElementaryStreamTypes.AUDIO]&&C.push("audio"),D[L.ElementaryStreamTypes.VIDEO]&&C.push("video"));var O=function(){var S=self.performance.now();R.stats.buffering.end=S,_&&(_.stats.buffering.end=S);var T=_?_.stats:R.stats;s.hls.trigger(j.Events.FRAG_BUFFERED,{frag:R,part:_,stats:T,id:R.type})};C.length===0&&B.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+R.type+" level: "+R.level+" sn: "+R.sn),this.blockBuffers(O,C)},f.onFragChanged=function(u,a){this.flushBackBuffer()},f.onBufferEos=function(u,a){var s=this,R=this.getSourceBufferTypes().reduce(function(_,C){var D=s.sourceBuffer[C];return(!a.type||a.type===C)&&(D&&!D.ended&&(D.ended=!0,B.logger.log("[buffer-controller]: "+C+" sourceBuffer now EOS"))),_&&!!(!D||D.ended)},!0);R&&this.blockBuffers(function(){var _=s.mediaSource;if(!_||_.readyState!=="open")return;_.endOfStream()})},f.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()},f.flushBackBuffer=function(){var u=this.hls,a=this.details,s=this.media,R=this.sourceBuffer;if(!s||a===null)return;var _=this.getSourceBufferTypes();if(!_.length)return;var C=a.live&&u.config.liveBackBufferLength!==null?u.config.liveBackBufferLength:u.config.backBufferLength;if(!Object(X.isFiniteNumber)(C)||C<0)return;var D=s.currentTime,O=a.levelTargetDuration,A=Math.max(C,O),S=Math.floor(D/O)*O-A;_.forEach(function(T){var c=R[T];if(c){var w=G.BufferHelper.getBuffered(c);w.length>0&&S>w.start(0)&&(u.trigger(j.Events.BACK_BUFFER_REACHED,{bufferEnd:S}),a.live&&u.trigger(j.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:S}),u.trigger(j.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:S,type:T}))}})},f.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var u=this.details,a=this.hls,s=this.media,R=this.mediaSource,_=u.fragments[0].start+u.totalduration,C=s.duration,D=Object(X.isFiniteNumber)(R.duration)?R.duration:0;u.live&&a.config.liveDurationInfinity?(B.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),R.duration=Infinity,this.updateSeekableRange(u)):(_>D&&_>C||!Object(X.isFiniteNumber)(C))&&(B.logger.log("[buffer-controller]: Updating Media Source duration to "+_.toFixed(3)),R.duration=_)},f.updateSeekableRange=function(u){var a=this.mediaSource,s=u.fragments,R=s.length;if(R&&u.live&&a!==null&&a!==void 0&&a.setLiveSeekableRange){var _=Math.max(0,s[0].start),C=Math.max(_,_+u.totalduration);a.setLiveSeekableRange(_,C)}},f.checkPendingTracks=function(){var u=this.bufferCodecEventsExpected,a=this.operationQueue,s=this.pendingTracks,R=Object.keys(s).length;if(R&&!u||R===2){this.createSourceBuffers(s),this.pendingTracks={};var _=this.getSourceBufferTypes();if(_.length===0){this.hls.trigger(j.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}_.forEach(function(C){a.executeNext(C)})}},f.createSourceBuffers=function(u){var a=this.sourceBuffer,s=this.mediaSource;if(!s)throw Error("createSourceBuffers called when mediaSource was null");var R=0;for(var _ in u)if(!a[_]){var C=u[_];if(!C)throw Error("source buffer exists for track "+_+", however track does not");var D=C.levelCodec||C.codec,O=C.container+";codecs="+D;B.logger.log("[buffer-controller]: creating sourceBuffer("+O+")");try{var A=a[_]=s.addSourceBuffer(O),S=_;this.addBufferListener(S,"updatestart",this._onSBUpdateStart),this.addBufferListener(S,"updateend",this._onSBUpdateEnd),this.addBufferListener(S,"error",this._onSBUpdateError),this.tracks[_]={buffer:A,codec:D,container:C.container,levelCodec:C.levelCodec,id:C.id},R++}catch(T){B.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+T.message),this.hls.trigger(j.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:T,mimeType:O})}}R&&this.hls.trigger(j.Events.BUFFER_CREATED,{tracks:this.tracks})},f._onSBUpdateStart=function(u){var a=this.operationQueue,s=a.current(u);s.onStart()},f._onSBUpdateEnd=function(u){var a=this.operationQueue,s=a.current(u);s.onComplete(),a.shiftAndExecuteNext(u)},f._onSBUpdateError=function(u,a){B.logger.error("[buffer-controller]: "+u+" SourceBuffer error",a),this.hls.trigger(j.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var s=this.operationQueue.current(u);s&&s.onError(a)},f.removeExecutor=function(u,a,s){var R=this.media,_=this.mediaSource,C=this.operationQueue,D=this.sourceBuffer,O=D[u];if(!R||!_||!O){B.logger.warn("[buffer-controller]: Attempting to remove from the "+u+" SourceBuffer, but it does not exist"),C.shiftAndExecuteNext(u);return}var A=Object(X.isFiniteNumber)(R.duration)?R.duration:Infinity,S=Object(X.isFiniteNumber)(_.duration)?_.duration:Infinity,T=Math.max(0,a),c=Math.min(s,A,S);c>T?(B.logger.log("[buffer-controller]: Removing ["+T+","+c+"] from the "+u+" SourceBuffer"),console.assert(!O.updating,u+" sourceBuffer must not be updating"),O.remove(T,c)):C.shiftAndExecuteNext(u)},f.appendExecutor=function(u,a){var s=this.operationQueue,R=this.sourceBuffer,_=R[a];if(!_){B.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)},f.blockBuffers=function(u,a){var s=this;if(a===void 0&&(a=this.getSourceBufferTypes()),!a.length){B.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(u);return}var R=this.operationQueue,_=a.map(function(C){return R.appendBlocker(C)});Promise.all(_).then(function(){u(),a.forEach(function(C){var D=s.sourceBuffer[C];(!D||!D.updating)&&R.shiftAndExecuteNext(C)})})},f.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},f.addBufferListener=function(u,a,s){var R=this.sourceBuffer[u];if(!R)return;var _=s.bind(this,u);this.listeners[u].push({event:a,listener:_}),R.addEventListener(a,_)},f.removeBufferListeners=function(u){var a=this.sourceBuffer[u];if(!a)return;this.listeners[u].forEach(function(s){a.removeEventListener(s.event,s.listener)})},l}()},"./src/controller/buffer-operation-queue.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return j});var X=P("./src/utils/logger.ts"),j=function(){function B(G){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=G}var K=B.prototype;return K.append=function(r,L){var v=this.queues[L];v.push(r),v.length===1&&this.buffers[L]&&this.executeNext(L)},K.insertAbort=function(r,L){var v=this.queues[L];v.unshift(r),this.executeNext(L)},K.appendBlocker=function(r){var L,v=new Promise(function(p){L=p}),m={execute:L,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(m,r),v},K.executeNext=function(r){var L=this.buffers,v=this.queues,m=L[r],p=v[r];if(p.length){var h=p[0];try{h.execute()}catch(l){X.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),h.onError(l),(!m||!m.updating)&&(p.shift(),this.executeNext(r))}}},K.shiftAndExecuteNext=function(r){this.queues[r].shift(),this.executeNext(r)},K.current=function(r){return this.queues[r][0]},B}()},"./src/controller/cap-level-controller.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/events.ts");function j(G,r){for(var L=0;L<r.length;L++){var v=r[L];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(G,v.key,v)}}function B(G,r,L){return r&&j(G.prototype,r),L&&j(G,L),G}var K=function(){function G(L){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=L,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var r=G.prototype;return r.setStreamController=function(v){this.streamController=v},r.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},r.registerListeners=function(){var v=this.hls;v.on(X.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.on(X.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.unregisterListener=function(){var v=this.hls;v.off(X.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.off(X.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.onFpsDropLevelCapping=function(v,m){G.isLevelAllowed(m.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(m.droppedLevel)},r.onMediaAttaching=function(v,m){this.media=m.media instanceof HTMLVideoElement?m.media:null},r.onManifestParsed=function(v,m){var p=this.hls;this.restrictedLevels=[],this.firstLevel=m.firstLevel,p.config.capLevelToPlayerSize&&m.video&&this.startCapping()},r.onBufferCodecs=function(v,m){var p=this.hls;p.config.capLevelToPlayerSize&&m.video&&this.startCapping()},r.onMediaDetaching=function(){this.stopCapping()},r.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var v=this.hls.levels;if(v.length){var m=this.hls;m.autoLevelCapping=this.getMaxLevel(v.length-1),m.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=m.autoLevelCapping}}},r.getMaxLevel=function(v){var m=this,p=this.hls.levels;if(!p.length)return-1;var h=p.filter(function(l,f){return G.isLevelAllowed(f,m.restrictedLevels)&&f<=v});return this.clientRect=null,G.getMaxLevelByMediaSize(h,this.mediaWidth,this.mediaHeight)},r.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()},r.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},r.getDimensions=function(){if(this.clientRect)return this.clientRect;var v=this.media,m={width:0,height:0};if(v){var p=v.getBoundingClientRect();m.width=p.width,m.height=p.height,!m.width&&!m.height&&(m.width=p.right-p.left||v.width||0,m.height=p.bottom-p.top||v.height||0)}return this.clientRect=m,m},G.isLevelAllowed=function(v,m){return m===void 0&&(m=[]),m.indexOf(v)===-1},G.getMaxLevelByMediaSize=function(v,m,p){if(!v||!v.length)return-1;for(var h=function(a,s){return s?a.width!==s.width||a.height!==s.height:!0},l=v.length-1,f=0;f<v.length;f+=1){var o=v[f];if((o.width>=m||o.height>=p)&&h(o,v[f+1])){l=f;break}}return l},B(G,[{key:"mediaWidth",get:function(){return this.getDimensions().width*G.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*G.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var v=1;try{v=self.devicePixelRatio}catch(m){}return v}}]),G}();J.default=K},"./src/controller/cmcd-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return h});var X=P("./src/events.ts"),j=P("./src/types/cmcd.ts"),B=P("./src/utils/buffer-helper.ts"),K=P("./src/utils/logger.ts");function G(l,f){for(var o=0;o<f.length;o++){var u=f[o];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(l,u.key,u)}}function r(l,f,o){return f&&G(l.prototype,f),o&&G(l,o),l}function L(l,f){var o=typeof Symbol!="undefined"&&l[Symbol.iterator]||l["@@iterator"];if(o)return(o=o.call(l)).next.bind(o);if(Array.isArray(l)||(o=v(l))||f&&l&&typeof l.length=="number"){o&&(l=o);var u=0;return function(){return u>=l.length?{done:!0}:{done:!1,value:l[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 v(l,f){if(!l)return;if(typeof l=="string")return m(l,f);var o=Object.prototype.toString.call(l).slice(8,-1);if(o==="Object"&&l.constructor&&(o=l.constructor.name),o==="Map"||o==="Set")return Array.from(l);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return m(l,f)}function m(l,f){(f==null||f>l.length)&&(f=l.length);for(var o=0,u=new Array(f);o<f;o++)u[o]=l[o];return u}function p(){return p=Object.assign||function(l){for(var f=1;f<arguments.length;f++){var o=arguments[f];for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&(l[u]=o[u])}return l},p.apply(this,arguments)}var h=function(){function l(o){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(R){try{u.apply(R,{ot:j.CMCDObjectType.MANIFEST,su:!u.initialized})}catch(_){K.logger.warn("Could not generate manifest CMCD data.",_)}},this.applyFragmentData=function(R){try{var _=R.frag,C=u.hls.levels[_.level],D=u.getObjectType(_),O={d:_.duration*1e3,ot:D};(D===j.CMCDObjectType.VIDEO||D===j.CMCDObjectType.AUDIO||D==j.CMCDObjectType.MUXED)&&(O.br=C.bitrate/1e3,O.tb=u.getTopBandwidth(D),O.bl=u.getBufferLength(D)),u.apply(R,O)}catch(A){K.logger.warn("Could not generate segment CMCD data.",A)}},this.hls=o;var a=this.config=o.config,s=a.cmcd;s!=null&&(a.pLoader=this.createPlaylistLoader(),a.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||l.uuid(),this.cid=s.contentId,this.useHeaders=s.useHeaders===!0,this.registerListeners())}var f=l.prototype;return f.registerListeners=function(){var u=this.hls;u.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.on(X.Events.BUFFER_CREATED,this.onBufferCreated,this)},f.unregisterListeners=function(){var u=this.hls;u.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.off(X.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},f.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},f.onMediaAttached=function(u,a){this.media=a.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},f.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},f.onBufferCreated=function(u,a){var s,R;this.audioBuffer=(s=a.tracks.audio)===null||s===void 0?void 0:s.buffer,this.videoBuffer=(R=a.tracks.video)===null||R===void 0?void 0:R.buffer},f.createData=function(){var u;return{v:j.CMCDVersion,sf:j.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}},f.apply=function(u,a){a===void 0&&(a={}),p(a,this.createData());var s=a.ot===j.CMCDObjectType.INIT||a.ot===j.CMCDObjectType.VIDEO||a.ot===j.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 R=l.toHeaders(a);if(!Object.keys(R).length)return;u.headers||(u.headers={}),p(u.headers,R)}else{var _=l.toQuery(a);if(!_)return;u.url=l.appendQueryToUri(u.url,_)}},f.getObjectType=function(u){var a=u.type;return a==="subtitle"?j.CMCDObjectType.TIMED_TEXT:u.sn==="initSegment"?j.CMCDObjectType.INIT:a==="audio"?j.CMCDObjectType.AUDIO:a==="main"?this.hls.audioTracks.length?j.CMCDObjectType.VIDEO:j.CMCDObjectType.MUXED:void 0},f.getTopBandwidth=function(u){for(var a=0,s=u===j.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,R=L(s),_;!(_=R()).done;){var C=_.value;C.bitrate>a&&(a=C.bitrate)}return a>0?a:NaN},f.getBufferLength=function(u){var a=this.hls.media,s=u===j.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!s||!a)return NaN;var R=B.BufferHelper.bufferInfo(s,a.currentTime,this.config.maxBufferHole);return R.len*1e3},f.createPlaylistLoader=function(){var u=this.config.pLoader,a=this.applyPlaylistData,s=u||this.config.loader;return function(){function R(C){this.loader=void 0,this.loader=new s(C)}var _=R.prototype;return _.destroy=function(){this.loader.destroy()},_.abort=function(){this.loader.abort()},_.load=function(D,O,A){a(D),this.loader.load(D,O,A)},r(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},f.createFragmentLoader=function(){var u=this.config.fLoader,a=this.applyFragmentData,s=u||this.config.loader;return function(){function R(C){this.loader=void 0,this.loader=new s(C)}var _=R.prototype;return _.destroy=function(){this.loader.destroy()},_.abort=function(){this.loader.abort()},_.load=function(D,O,A){a(D),this.loader.load(D,O,A)},r(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},l.uuid=function(){var u=URL.createObjectURL(new Blob),a=u.toString();return URL.revokeObjectURL(u),a.substr(a.lastIndexOf("/")+1)},l.serialize=function(u){for(var a=[],s=function(F){return!Number.isNaN(F)&&F!=null&&F!==""&&F!==!1},R=function(F){return Math.round(F)},_=function(F){return R(F/100)*100},C=function(F){return encodeURIComponent(F)},D={br:R,d:R,bl:_,dl:_,mtp:_,nor:C,rtp:_,tb:R},O=Object.keys(u||{}).sort(),A=L(O),S;!(S=A()).done;){var T=S.value,c=u[T];if(!s(c))continue;if(T==="v"&&c===1)continue;if(T=="pr"&&c===1)continue;var w=D[T];w&&(c=w(c));var y=typeof c,b=void 0;T==="ot"||T==="sf"||T==="st"?b=T+"="+c:y==="boolean"?b=T:y==="number"?b=T+"="+c:b=T+"="+JSON.stringify(c),a.push(b)}return a.join(",")},l.toHeaders=function(u){for(var a=Object.keys(u),s={},R=["Object","Request","Session","Status"],_=[{},{},{},{}],C={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},D=0,O=a;D<O.length;D++){var A=O[D],S=C[A]!=null?C[A]:1;_[S][A]=u[A]}for(var T=0;T<_.length;T++){var c=l.serialize(_[T]);c&&(s["CMCD-"+R[T]]=c)}return s},l.toQuery=function(u){return"CMCD="+encodeURIComponent(l.serialize(u))},l.appendQueryToUri=function(u,a){if(!a)return u;var s=u.includes("?")?"&":"?";return""+u+s+a},l}()},"./src/controller/eme-controller.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/events.ts"),j=P("./src/errors.ts"),B=P("./src/utils/logger.ts"),K=P("./src/utils/mediakeys-helper.ts");function G(h,l){for(var f=0;f<l.length;f++){var o=l[f];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(h,o.key,o)}}function r(h,l,f){return l&&G(h.prototype,l),f&&G(h,f),h}var L=3,v=function(l,f,o){var u={audioCapabilities:[],videoCapabilities:[]};return l.forEach(function(a){u.audioCapabilities.push({contentType:'audio/mp4; codecs="'+a+'"',robustness:o.audioRobustness||""})}),f.forEach(function(a){u.videoCapabilities.push({contentType:'video/mp4; codecs="'+a+'"',robustness:o.videoRobustness||""})}),[u]},m=function(l,f,o,u){switch(l){case K.KeySystems.WIDEVINE:return v(f,o,u);default:throw new Error("Unknown key-system: "+l)}},p=function(){function h(f){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=f,this._config=f.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 l=h.prototype;return l.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},l._registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this)},l._unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this)},l.getLicenseServerUrl=function(o){switch(o){case K.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+o+'"')},l._attemptKeySystemAccess=function(o,u,a){var s=this,R=m(o,u,a,this._drmSystemOptions);B.logger.log("Requesting encrypted media key-system access");var _=this.requestMediaKeySystemAccess(o,R);this.mediaKeysPromise=_.then(function(C){return s._onMediaKeySystemAccessObtained(o,C)}),_.catch(function(C){B.logger.error('Failed to obtain key-system "'+o+'" access:',C)})},l._onMediaKeySystemAccessObtained=function(o,u){var a=this;B.logger.log('Access for key-system "'+o+'" obtained');var s={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:u,mediaKeySystemDomain:o};this._mediaKeysList.push(s);var R=Promise.resolve().then(function(){return u.createMediaKeys()}).then(function(_){return s.mediaKeys=_,B.logger.log('Media-keys created for key-system "'+o+'"'),a._onMediaKeysCreated(),_});return R.catch(function(_){B.logger.error("Failed to create media-keys:",_)}),R},l._onMediaKeysCreated=function(){var o=this;this._mediaKeysList.forEach(function(u){u.mediaKeysSession||(u.mediaKeysSession=u.mediaKeys.createSession(),o._onNewMediaKeySession(u.mediaKeysSession))})},l._onNewMediaKeySession=function(o){var u=this;B.logger.log("New key-system session "+o.sessionId),o.addEventListener("message",function(a){u._onKeySessionMessage(o,a.message)},!1)},l._onKeySessionMessage=function(o,u){B.logger.log("Got EME message event, creating license request"),this._requestLicense(u,function(a){B.logger.log("Received license data (length: "+(a&&a.byteLength)+"), updating key-session"),o.update(a)})},l.onMediaEncrypted=function(o){var u=this;if(B.logger.log('Media is encrypted using "'+o.initDataType+'" init data type'),!this.mediaKeysPromise){B.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var a=function(R){if(!u._media)return;u._attemptSetMediaKeys(R),u._generateRequestWithPreferredKeySession(o.initDataType,o.initData)};this.mediaKeysPromise.then(a).catch(a)},l._attemptSetMediaKeys=function(o){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){B.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}B.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(u.mediaKeys),this._hasSetMediaKeys=!0}},l._generateRequestWithPreferredKeySession=function(o,u){var a=this,s=this._mediaKeysList[0];if(!s){B.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(s.mediaKeysSessionInitialized){B.logger.warn("Key-Session already initialized but requested again");return}var R=s.mediaKeysSession;if(!R){B.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!u){B.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}B.logger.log('Generating key-session request for "'+o+'" init data type'),s.mediaKeysSessionInitialized=!0,R.generateRequest(o,u).then(function(){B.logger.debug("Key-session generation succeeded")}).catch(function(_){B.logger.error("Error generating key-session request:",_),a.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},l._createLicenseXhr=function(o,u,a){var s=new XMLHttpRequest;s.responseType="arraybuffer",s.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,s,o,u,a);var R=this._licenseXhrSetup;if(R)try{R.call(this.hls,s,o),R=void 0}catch(_){B.logger.error(_)}try{s.readyState||s.open("POST",o,!0),R&&R.call(this.hls,s,o)}catch(_){throw new Error("issue setting up KeySystem license XHR "+_)}return s},l._onLicenseRequestReadyStageChange=function(o,u,a,s){switch(o.readyState){case 4:if(o.status===200){this._requestLicenseFailureCount=0,B.logger.log("License request succeeded");var R=o.response,_=this._licenseResponseCallback;if(_)try{R=_.call(this.hls,o,u)}catch(D){B.logger.error(D)}s(R)}else{if(B.logger.error("License Request XHR failed ("+u+"). Status: "+o.status+" ("+o.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>L){this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var C=L-this._requestLicenseFailureCount+1;B.logger.warn("Retrying license request, "+C+" attempts left"),this._requestLicense(a,s)}break}},l._generateLicenseRequestChallenge=function(o,u){switch(o.mediaKeySystemDomain){case K.KeySystems.WIDEVINE:return u}throw new Error("unsupported key-system: "+o.mediaKeySystemDomain)},l._requestLicense=function(o,u){B.logger.log("Requesting content license for key-system");var a=this._mediaKeysList[0];if(!a){B.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var s=this.getLicenseServerUrl(a.mediaKeySystemDomain),R=this._createLicenseXhr(s,o,u);B.logger.log("Sending license request to URL: "+s);var _=this._generateLicenseRequestChallenge(a,o);R.send(_)}catch(C){B.logger.error("Failure requesting DRM license: "+C),this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},l.onMediaAttached=function(o,u){if(!this._emeEnabled)return;var a=u.media;this._media=a,a.addEventListener("encrypted",this._onMediaEncrypted)},l.onMediaDetached=function(){var o=this._media,u=this._mediaKeysList;if(!o)return;o.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 o.setMediaKeys(null)}).catch(function(){})},l.onManifestParsed=function(o,u){if(!this._emeEnabled)return;var a=u.levels.map(function(R){return R.audioCodec}).filter(function(R){return!!R}),s=u.levels.map(function(R){return R.videoCodec}).filter(function(R){return!!R});this._attemptKeySystemAccess(K.KeySystems.WIDEVINE,a,s)},r(h,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),h}();J.default=p},"./src/controller/fps-controller.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/events.ts"),j=P("./src/utils/logger.ts"),B=function(){function K(r){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=r,this.registerListeners()}var G=K.prototype;return G.setStreamController=function(L){this.streamController=L},G.registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},G.unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching)},G.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},G.onMediaAttaching=function(L,v){var m=this.hls.config;if(m.capLevelOnFPSDrop){var p=v.media instanceof self.HTMLVideoElement?v.media:null;this.media=p,p&&typeof p.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),m.fpsDroppedMonitoringPeriod)}},G.checkFPS=function(L,v,m){var p=performance.now();if(v){if(this.lastTime){var h=p-this.lastTime,l=m-this.lastDroppedFrames,f=v-this.lastDecodedFrames,o=1e3*l/h,u=this.hls;if(u.trigger(X.Events.FPS_DROP,{currentDropped:l,currentDecoded:f,totalDroppedFrames:m}),o>0&&l>u.config.fpsDroppedMonitoringThreshold*f){var a=u.currentLevel;j.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(X.Events.FPS_DROP_LEVEL_CAPPING,{level:a,droppedLevel:u.currentLevel}),u.autoLevelCapping=a,this.streamController.nextLevelSwitch())}}this.lastTime=p,this.lastDroppedFrames=m,this.lastDecodedFrames=v}},G.checkFPSInterval=function(){var L=this.media;if(L)if(this.isVideoPlaybackQualityAvailable){var v=L.getVideoPlaybackQuality();this.checkFPS(L,v.totalVideoFrames,v.droppedVideoFrames)}else this.checkFPS(L,L.webkitDecodedFrameCount,L.webkitDroppedFrameCount)},K}();J.default=B},"./src/controller/fragment-finders.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"findFragmentByPDT",function(){return B}),P.d(J,"findFragmentByPTS",function(){return K}),P.d(J,"fragmentWithinToleranceTest",function(){return G}),P.d(J,"pdtWithinToleranceTest",function(){return r}),P.d(J,"findFragWithCC",function(){return L});var X=P("./src/polyfills/number.ts"),j=P("./src/utils/binary-search.ts");function B(v,m,p){if(m===null||!Array.isArray(v)||!v.length||!Object(X.isFiniteNumber)(m))return null;var h=v[0].programDateTime;if(m<(h||0))return null;var l=v[v.length-1].endProgramDateTime;if(m>=(l||0))return null;p=p||0;for(var f=0;f<v.length;++f){var o=v[f];if(r(m,p,o))return o}return null}function K(v,m,p,h){p===void 0&&(p=0),h===void 0&&(h=0);var l=null;if(v?l=m[v.sn-m[0].sn+1]||null:p===0&&m[0].start===0&&(l=m[0]),l&&G(p,h,l)===0)return l;var f=j.default.search(m,G.bind(null,p,h));return f||l}function G(v,m,p){v===void 0&&(v=0),m===void 0&&(m=0);var h=Math.min(m,p.duration+(p.deltaPTS?p.deltaPTS:0));return p.start+p.duration-h<=v?1:p.start-h>v&&p.start?-1:0}function r(v,m,p){var h=Math.min(m,p.duration+(p.deltaPTS?p.deltaPTS:0))*1e3,l=p.endProgramDateTime||0;return l-h>v}function L(v,m){return j.default.search(v,function(p){return p.cc<m?1:p.cc>m?-1:0})}},"./src/controller/fragment-tracker.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"FragmentState",function(){return B}),P.d(J,"FragmentTracker",function(){return K});var X=P("./src/events.ts"),j=P("./src/types/loader.ts"),B;(function(L){L.NOT_LOADED="NOT_LOADED",L.BACKTRACKED="BACKTRACKED",L.APPENDING="APPENDING",L.PARTIAL="PARTIAL",L.OK="OK"})(B||(B={}));var K=function(){function L(m){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=m,this._registerListeners()}var v=L.prototype;return v._registerListeners=function(){var p=this.hls;p.on(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.on(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.on(X.Events.FRAG_LOADED,this.onFragLoaded,this)},v._unregisterListeners=function(){var p=this.hls;p.off(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.off(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.off(X.Events.FRAG_LOADED,this.onFragLoaded,this)},v.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},v.getAppendedFrag=function(p,h){if(h===j.PlaylistLevelType.MAIN){var l=this.activeFragment,f=this.activeParts;if(!l)return null;if(f)for(var o=f.length;o--;){var u=f[o],a=u?u.end:l.appendedPTS;if(u.start<=p&&a!==void 0&&p<=a)return o>9&&(this.activeParts=f.slice(o-9)),u}else if(l.start<=p&&l.appendedPTS!==void 0&&p<=l.appendedPTS)return l}return this.getBufferedFrag(p,h)},v.getBufferedFrag=function(p,h){for(var l=this.fragments,f=Object.keys(l),o=f.length;o--;){var u=l[f[o]];if((u==null?void 0:u.body.type)===h&&u.buffered){var a=u.body;if(a.start<=p&&p<=a.end)return a}}return null},v.detectEvictedFragments=function(p,h,l){var f=this;Object.keys(this.fragments).forEach(function(o){var u=f.fragments[o];if(!u)return;if(!u.buffered){u.body.type===l&&f.removeFragment(u.body);return}var a=u.range[p];if(!a)return;a.time.some(function(s){var R=!f.isTimeBuffered(s.startPTS,s.endPTS,h);return R&&f.removeFragment(u.body),R})})},v.detectPartialFragments=function(p){var h=this,l=this.timeRanges,f=p.frag,o=p.part;if(!l||f.sn==="initSegment")return;var u=r(f),a=this.fragments[u];if(!a)return;Object.keys(l).forEach(function(s){var R=f.elementaryStreams[s];if(!R)return;var _=l[s],C=o!==null||R.partial===!0;a.range[s]=h.getBufferedTimes(f,o,C,_)}),a.backtrack=a.loaded=null,Object.keys(a.range).length?a.buffered=!0:this.removeFragment(a.body)},v.fragBuffered=function(p){var h=r(p),l=this.fragments[h];l&&(l.backtrack=l.loaded=null,l.buffered=!0)},v.getBufferedTimes=function(p,h,l,f){for(var o={time:[],partial:l},u=h?h.start:p.start,a=h?h.end:p.end,s=p.minEndPTS||a,R=p.maxStartPTS||u,_=0;_<f.length;_++){var C=f.start(_)-this.bufferPadding,D=f.end(_)+this.bufferPadding;if(R>=C&&s<=D){o.time.push({startPTS:Math.max(u,f.start(_)),endPTS:Math.min(a,f.end(_))});break}else if(u<D&&a>C)o.partial=!0,o.time.push({startPTS:Math.max(u,f.start(_)),endPTS:Math.min(a,f.end(_))});else if(a<=C)break}return o},v.getPartialFragment=function(p){var h=null,l,f,o,u=0,a=this.bufferPadding,s=this.fragments;return Object.keys(s).forEach(function(R){var _=s[R];if(!_)return;G(_)&&(f=_.body.start-a,o=_.body.end+a,p>=f&&p<=o&&(l=Math.min(p-f,o-p),u<=l&&(h=_.body,u=l)))}),h},v.getState=function(p){var h=r(p),l=this.fragments[h];return l?l.buffered?G(l)?B.PARTIAL:B.OK:l.backtrack?B.BACKTRACKED:B.APPENDING:B.NOT_LOADED},v.backtrack=function(p,h){var l=r(p),f=this.fragments[l];if(!f||f.backtrack)return null;var o=f.backtrack=h||f.loaded;return f.loaded=null,o},v.getBacktrackData=function(p){var h=r(p),l=this.fragments[h];if(l){var f,o=l.backtrack;if(o!=null&&(f=o.payload)!==null&&f!==void 0&&f.byteLength)return o;this.removeFragment(p)}return null},v.isTimeBuffered=function(p,h,l){for(var f,o,u=0;u<l.length;u++){if(f=l.start(u)-this.bufferPadding,o=l.end(u)+this.bufferPadding,p>=f&&h<=o)return!0;if(h<=f)return!1}return!1},v.onFragLoaded=function(p,h){var l=h.frag,f=h.part;if(l.sn==="initSegment"||l.bitrateTest||f)return;var o=r(l);this.fragments[o]={body:l,loaded:h,backtrack:null,buffered:!1,range:Object.create(null)}},v.onBufferAppended=function(p,h){var l=this,f=h.frag,o=h.part,u=h.timeRanges;if(f.type===j.PlaylistLevelType.MAIN)if(this.activeFragment=f,o){var a=this.activeParts;a||(this.activeParts=a=[]),a.push(o)}else this.activeParts=null;this.timeRanges=u,Object.keys(u).forEach(function(s){var R=u[s];if(l.detectEvictedFragments(s,R),!o)for(var _=0;_<R.length;_++)f.appendedPTS=Math.max(R.end(_),f.appendedPTS||0)})},v.onFragBuffered=function(p,h){this.detectPartialFragments(h)},v.hasFragment=function(p){var h=r(p);return!!this.fragments[h]},v.removeFragmentsInRange=function(p,h,l){var f=this;Object.keys(this.fragments).forEach(function(o){var u=f.fragments[o];if(!u)return;if(u.buffered){var a=u.body;a.type===l&&a.start<h&&a.end>p&&f.removeFragment(a)}})},v.removeFragment=function(p){var h=r(p);p.stats.loaded=0,p.clearElementaryStreamInfo(),delete this.fragments[h]},v.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},L}();function G(L){var v,m;return L.buffered&&(((v=L.range.video)===null||v===void 0?void 0:v.partial)||((m=L.range.audio)===null||m===void 0?void 0:m.partial))}function r(L){return L.type+"_"+L.level+"_"+L.urlId+"_"+L.sn}},"./src/controller/gap-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"STALL_MINIMUM_DURATION_MS",function(){return G}),P.d(J,"MAX_START_GAP_JUMP",function(){return r}),P.d(J,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return L}),P.d(J,"SKIP_BUFFER_RANGE_START",function(){return v}),P.d(J,"default",function(){return m});var X=P("./src/utils/buffer-helper.ts"),j=P("./src/errors.ts"),B=P("./src/events.ts"),K=P("./src/utils/logger.ts"),G=250,r=2,L=.1,v=.05,m=function(){function p(l,f,o,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=l,this.media=f,this.fragmentTracker=o,this.hls=u}var h=p.prototype;return h.destroy=function(){this.hls=this.fragmentTracker=this.media=null},h.poll=function(f){var o=this.config,u=this.media,a=this.stalled,s=u.currentTime,R=u.seeking,_=this.seeking&&!R,C=!this.seeking&&R;if(this.seeking=R,s!==f){if(this.moved=!0,a!==null){if(this.stallReported){var D=self.performance.now()-a;K.logger.warn("playback not stuck anymore @"+s+", after "+Math.round(D)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((C||_)&&(this.stalled=null),u.paused||u.ended||u.playbackRate===0||!X.BufferHelper.getBuffered(u).length)return;var O=X.BufferHelper.bufferInfo(u,s,0),A=O.len>0,S=O.nextStart||0;if(!A&&!S)return;if(R){var T=O.len>r,c=!S||S-s>r&&!this.fragmentTracker.getPartialFragment(s);if(T||c)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var w,y=Math.max(S,O.start||0)-s,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,U=b==null||((w=b.details)===null||w===void 0)?void 0:w.live,F=U?b.details.targetduration*2:r;if(y>0&&y<=F){this._trySkipBufferHole(null);return}}var E=self.performance.now();if(a===null){this.stalled=E;return}var N=E-a;!R&&N>=G&&this._reportStall(O.len);var I=X.BufferHelper.bufferInfo(u,s,o.maxBufferHole);this._tryFixBufferStall(I,N)},h._tryFixBufferStall=function(f,o){var u=this.config,a=this.fragmentTracker,s=this.media,R=s.currentTime,_=a.getPartialFragment(R);if(_){var C=this._trySkipBufferHole(_);if(C)return}f.len>u.maxBufferHole&&o>u.highBufferWatchdogPeriod*1e3&&(K.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},h._reportStall=function(f){var o=this.hls,u=this.media,a=this.stallReported;a||(this.stallReported=!0,K.logger.warn("Playback stalling at @"+u.currentTime+" due to low buffer (buffer="+f+")"),o.trigger(B.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:f}))},h._trySkipBufferHole=function(f){for(var o=this.config,u=this.hls,a=this.media,s=a.currentTime,R=0,_=X.BufferHelper.getBuffered(a),C=0;C<_.length;C++){var D=_.start(C);if(s+o.maxBufferHole>=R&&s<D){var O=Math.max(D+v,a.currentTime+L);return K.logger.warn("skipping hole, adjusting currentTime from "+s+" to "+O),this.moved=!0,this.stalled=null,a.currentTime=O,f&&u.trigger(B.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+s+" to "+O,frag:f}),O}R=_.end(C)}return 0},h._tryNudgeBuffer=function(){var f=this.config,o=this.hls,u=this.media,a=u.currentTime,s=(this.nudgeRetry||0)+1;if(this.nudgeRetry=s,s<f.nudgeMaxRetry){var R=a+s*f.nudgeOffset;K.logger.warn("Nudging 'currentTime' from "+a+" to "+R),u.currentTime=R,o.trigger(B.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else K.logger.error("Playhead still not moving while enough data buffered @"+a+" after "+f.nudgeMaxRetry+" nudges"),o.trigger(B.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},p}()},"./src/controller/id3-track-controller.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/events.ts"),j=P("./src/utils/texttrack-utils.ts"),B=P("./src/demux/id3.ts"),K=.25,G=function(){function r(v){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=v,this._registerListeners()}var L=r.prototype;return L.destroy=function(){this._unregisterListeners()},L._registerListeners=function(){var m=this.hls;m.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(X.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.on(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},L._unregisterListeners=function(){var m=this.hls;m.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(X.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.off(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},L.onMediaAttached=function(m,p){this.media=p.media},L.onMediaDetaching=function(){if(!this.id3Track)return;Object(j.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},L.getID3Track=function(m){if(!this.media)return;for(var p=0;p<m.length;p++){var h=m[p];if(h.kind==="metadata"&&h.label==="id3")return Object(j.sendAddTrackEvent)(h,this.media),h}return this.media.addTextTrack("metadata","id3")},L.onFragParsingMetadata=function(m,p){if(!this.media)return;var h=p.frag,l=p.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var f=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,o=0;o<l.length;o++){var u=B.getID3Frames(l[o].data);if(u){var a=l[o].pts,s=o<l.length-1?l[o+1].pts:h.end,R=s-a;R<=0&&(s=a+K);for(var _=0;_<u.length;_++){var C=u[_];if(!B.isTimeStampFrame(C)){var D=new f(a,s,"");D.value=C,this.id3Track.addCue(D)}}}}},L.onBufferFlushing=function(m,p){var h=p.startOffset,l=p.endOffset,f=p.type;if(!f||f==="audio"){var o=this.id3Track;o&&Object(j.removeCuesInRange)(o,h,l)}},r}();J.default=G},"./src/controller/latency-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return r});var X=P("./src/errors.ts"),j=P("./src/events.ts"),B=P("./src/utils/logger.ts");function K(L,v){for(var m=0;m<v.length;m++){var p=v[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(L,p.key,p)}}function G(L,v,m){return v&&K(L.prototype,v),m&&K(L,m),L}var r=function(){function L(m){var p=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 p.timeupdate()},this.hls=m,this.config=m.config,this.registerListeners()}var v=L.prototype;return v.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},v.registerListeners=function(){this.hls.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(j.Events.ERROR,this.onError,this)},v.unregisterListeners=function(){this.hls.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(j.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(j.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(j.Events.ERROR,this.onError)},v.onMediaAttached=function(p,h){this.media=h.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},v.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},v.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},v.onLevelUpdated=function(p,h){var l=h.details;this.levelDetails=l,l.advanced&&this.timeupdate(),!l.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},v.onError=function(p,h){if(h.details!==X.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,B.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},v.timeupdate=function(){var p=this.media,h=this.levelDetails;if(!p||!h)return;this.currentTime=p.currentTime;var l=this.computeLatency();if(l===null)return;this._latency=l;var f=this.config,o=f.lowLatencyMode,u=f.maxLiveSyncPlaybackRate;if(!o||u===1)return;var a=this.targetLatency;if(a===null)return;var s=l-a,R=Math.min(this.maxLatency,a+h.targetduration),_=s<R;if(h.live&&_&&s>.05&&this.forwardBufferLength>1){var C=Math.min(2,Math.max(1,u)),D=Math.round(2/(1+Math.exp(-.75*s-this.edgeStalled))*20)/20;p.playbackRate=Math.min(C,Math.max(1,D))}else p.playbackRate!==1&&p.playbackRate!==0&&(p.playbackRate=1)},v.estimateLiveEdge=function(){var p=this.levelDetails;return p===null?null:p.edge+p.age},v.computeLatency=function(){var p=this.estimateLiveEdge();return p===null?null:p-this.currentTime},G(L,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var p=this.config,h=this.levelDetails;return p.liveMaxLatencyDuration!==void 0?p.liveMaxLatencyDuration:h?p.liveMaxLatencyDurationCount*h.targetduration:0}},{key:"targetLatency",get:function(){var p=this.levelDetails;if(p===null)return null;var h=p.holdBack,l=p.partHoldBack,f=p.targetduration,o=this.config,u=o.liveSyncDuration,a=o.liveSyncDurationCount,s=o.lowLatencyMode,R=this.hls.userConfig,_=s&&l||h;(R.liveSyncDuration||R.liveSyncDurationCount||_===0)&&(_=u!==void 0?u:a*f);var C=f,D=1;return _+Math.min(this.stallCount*D,C)}},{key:"liveSyncPosition",get:function(){var p=this.estimateLiveEdge(),h=this.targetLatency,l=this.levelDetails;if(p===null||h===null||l===null)return null;var f=l.edge,o=p-h-this.edgeStalled,u=f-l.totalduration,a=f-(this.config.lowLatencyMode&&l.partTarget||l.targetduration);return Math.min(Math.max(u,o),a)}},{key:"drift",get:function(){var p=this.levelDetails;return p===null?1:p.drift}},{key:"edgeStalled",get:function(){var p=this.levelDetails;if(p===null)return 0;var h=(this.config.lowLatencyMode&&p.partTarget||p.targetduration)*3;return Math.max(p.age-h,0)}},{key:"forwardBufferLength",get:function(){var p=this.media,h=this.levelDetails;if(!p||!h)return 0;var l=p.buffered.length;return l?p.buffered.end(l-1):h.edge-this.currentTime}}]),L}()},"./src/controller/level-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return o});var X=P("./src/types/level.ts"),j=P("./src/events.ts"),B=P("./src/errors.ts"),K=P("./src/utils/codecs.ts"),G=P("./src/controller/level-helper.ts"),r=P("./src/controller/base-playlist-controller.ts"),L=P("./src/types/loader.ts");function v(){return v=Object.assign||function(u){for(var a=1;a<arguments.length;a++){var s=arguments[a];for(var R in s)Object.prototype.hasOwnProperty.call(s,R)&&(u[R]=s[R])}return u},v.apply(this,arguments)}function m(u,a){for(var s=0;s<a.length;s++){var R=a[s];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(u,R.key,R)}}function p(u,a,s){return a&&m(u.prototype,a),s&&m(u,s),u}function h(u,a){u.prototype=Object.create(a.prototype),u.prototype.constructor=u,l(u,a)}function l(u,a){return l=Object.setPrototypeOf||function(R,_){return R.__proto__=_,R},l(u,a)}var f=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),o=function(u){h(a,u);function a(R){var _;return _=u.call(this,R,"[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(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),_.on(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.on(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.on(j.Events.FRAG_LOADED,this.onFragLoaded,this),_.on(j.Events.ERROR,this.onError,this)},s._unregisterListeners=function(){var _=this.hls;_.off(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),_.off(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.off(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.off(j.Events.FRAG_LOADED,this.onFragLoaded,this),_.off(j.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(C){C.loadError=0}),u.prototype.startLoad.call(this)},s.onManifestLoaded=function(_,C){var D=[],O=[],A=[],S,T={},c,w=!1,y=!1,b=!1;if(C.levels.forEach(function(N){var I=N.attrs;w=w||!!(N.width&&N.height),y=y||!!N.videoCodec,b=b||!!N.audioCodec,f&&N.audioCodec&&N.audioCodec.indexOf("mp4a.40.34")!==-1&&(N.audioCodec=void 0);var g=N.bitrate+"-"+N.attrs.RESOLUTION+"-"+N.attrs.CODECS;c=T[g],c?c.url.push(N.url):(c=new X.Level(N),T[g]=c,D.push(c)),I&&(I.AUDIO&&Object(G.addGroupId)(c,"audio",I.AUDIO),I.SUBTITLES&&Object(G.addGroupId)(c,"text",I.SUBTITLES))}),(w||y)&&b&&(D=D.filter(function(N){var I=N.videoCodec,g=N.width,H=N.height;return!!I||!!(g&&H)})),D=D.filter(function(N){var I=N.audioCodec,g=N.videoCodec;return(!I||Object(K.isCodecSupportedInMp4)(I,"audio"))&&(!g||Object(K.isCodecSupportedInMp4)(g,"video"))}),C.audioTracks&&(O=C.audioTracks.filter(function(N){return!N.audioCodec||Object(K.isCodecSupportedInMp4)(N.audioCodec,"audio")}),Object(G.assignTrackIdsByGroup)(O)),C.subtitles&&(A=C.subtitles,Object(G.assignTrackIdsByGroup)(A)),D.length>0){S=D[0].bitrate,D.sort(function(N,I){return N.bitrate-I.bitrate}),this._levels=D;for(var U=0;U<D.length;U++)if(D[U].bitrate===S){this._firstLevel=U,this.log("manifest loaded, "+D.length+" level(s) found, first bitrate: "+S);break}var F=b&&!y,E={levels:D,audioTracks:O,subtitleTracks:A,firstLevel:this._firstLevel,stats:C.stats,audio:b,video:y,altAudio:!F&&O.some(function(N){return!!N.url})};this.hls.trigger(j.Events.MANIFEST_PARSED,E),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(j.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:C.url,reason:"no level with compatible codecs found in manifest"})},s.onError=function(_,C){if(u.prototype.onError.call(this,_,C),C.fatal)return;var D=C.context,O=this._levels[this.currentLevelIndex];if(D&&(D.type===L.PlaylistContextType.AUDIO_TRACK&&O.audioGroupIds&&D.groupId===O.audioGroupIds[O.urlId]||D.type===L.PlaylistContextType.SUBTITLE_TRACK&&O.textGroupIds&&D.groupId===O.textGroupIds[O.urlId])){this.redundantFailover(this.currentLevelIndex);return}var A=!1,S=!0,T;switch(C.details){case B.ErrorDetails.FRAG_LOAD_ERROR:case B.ErrorDetails.FRAG_LOAD_TIMEOUT:case B.ErrorDetails.KEY_LOAD_ERROR:case B.ErrorDetails.KEY_LOAD_TIMEOUT:if(C.frag){var c=this._levels[C.frag.level];c?(c.fragmentError++,c.fragmentError>this.hls.config.fragLoadingMaxRetry&&(T=C.frag.level)):T=C.frag.level}break;case B.ErrorDetails.LEVEL_LOAD_ERROR:case B.ErrorDetails.LEVEL_LOAD_TIMEOUT:D&&(D.deliveryDirectives&&(S=!1),T=D.level),A=!0;break;case B.ErrorDetails.REMUX_ALLOC_ERROR:T=C.level,A=!0;break}T!==void 0&&this.recoverLevel(C,T,A,S)},s.recoverLevel=function(_,C,D,O){var A=_.details,S=this._levels[C];if(S.loadError++,D){var T=this.retryLoadingOrFail(_);if(T)_.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(O){var c=S.url.length;if(c>1&&S.loadError<c)_.levelRetry=!0,this.redundantFailover(C);else if(this.manualLevelIndex===-1){var w=C===0?this._levels.length-1:C-1;this.currentLevelIndex!==w&&this._levels[w].loadError===0&&(this.warn(A+": switch to "+w),_.levelRetry=!0,this.hls.nextAutoLevel=w)}}},s.redundantFailover=function(_){var C=this._levels[_],D=C.url.length;if(D>1){var O=(C.urlId+1)%D;this.warn("Switching to redundant URL-id "+O),this._levels.forEach(function(A){A.urlId=O}),this.level=_}},s.onFragLoaded=function(_,C){var D=C.frag;if(D!==void 0&&D.type===L.PlaylistLevelType.MAIN){var O=this._levels[D.level];O!==void 0&&(O.fragmentError=0,O.loadError=0)}},s.onLevelLoaded=function(_,C){var D,O=C.level,A=C.details,S=this._levels[O];if(!S){var T;this.warn("Invalid level index "+O),(T=C.deliveryDirectives)!==null&&T!==void 0&&T.skip&&(A.deltaUpdateFailed=!0);return}O===this.currentLevelIndex?(S.fragmentError===0&&(S.loadError=0,this.retryCount=0),this.playlistLoaded(O,C,S.details)):(D=C.deliveryDirectives)!==null&&D!==void 0&&D.skip&&(A.deltaUpdateFailed=!0)},s.onAudioTrackSwitched=function(_,C){var D=this.hls.levels[this.currentLevelIndex];if(!D)return;if(D.audioGroupIds){for(var O=-1,A=this.hls.audioTracks[C.id].groupId,S=0;S<D.audioGroupIds.length;S++)if(D.audioGroupIds[S]===A){O=S;break}O!==D.urlId&&(D.urlId=O,this.startLoad())}},s.loadPlaylist=function(_){var C=this.currentLevelIndex,D=this._levels[C];if(this.canLoad&&D&&D.url.length>0){var O=D.urlId,A=D.url[O];if(_)try{A=_.addDirectives(A)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("Attempt loading level index "+C+(_?" at sn "+_.msn+" part "+_.part:"")+" with URL-id "+O+" "+A),this.clearTimer(),this.hls.trigger(j.Events.LEVEL_LOADING,{url:A,level:C,id:O,deliveryDirectives:_||null})}},s.removeLevel=function(_,C){var D=function(S,T){return T!==C},O=this._levels.filter(function(A,S){return S!==_?!0:A.url.length>1&&C!==void 0?(A.url=A.url.filter(D),A.audioGroupIds&&(A.audioGroupIds=A.audioGroupIds.filter(D)),A.textGroupIds&&(A.textGroupIds=A.textGroupIds.filter(D)),A.urlId=0,!0):!1}).map(function(A,S){var T=A.details;return T!=null&&T.fragments&&T.fragments.forEach(function(c){c.level=S}),A});this._levels=O,this.hls.trigger(j.Events.LEVELS_UPDATED,{levels:O})},p(a,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(_){var C,D=this._levels;if(D.length===0)return;if(this.currentLevelIndex===_&&(C=D[_])!==null&&C!==void 0&&C.details)return;if(_<0||_>=D.length){var O=_<0;if(this.hls.trigger(j.Events.ERROR,{type:B.ErrorTypes.OTHER_ERROR,details:B.ErrorDetails.LEVEL_SWITCH_ERROR,level:_,fatal:O,reason:"invalid level idx"}),O)return;_=Math.min(_,D.length-1)}this.clearTimer();var A=this.currentLevelIndex,S=D[A],T=D[_];this.log("switching to level "+_+" from "+A),this.currentLevelIndex=_;var c=v({},T,{level:_,maxBitrate:T.maxBitrate,uri:T.uri,urlId:T.urlId});delete c._urlId,this.hls.trigger(j.Events.LEVEL_SWITCHING,c);var w=T.details;if(!w||w.live){var y=this.switchParams(T.uri,S==null?void 0:S.details);this.loadPlaylist(y)}}},{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}(r.default)},"./src/controller/level-helper.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"addGroupId",function(){return B}),P.d(J,"assignTrackIdsByGroup",function(){return K}),P.d(J,"updatePTS",function(){return G}),P.d(J,"updateFragPTSDTS",function(){return L}),P.d(J,"mergeDetails",function(){return v}),P.d(J,"mapPartIntersection",function(){return m}),P.d(J,"mapFragmentIntersection",function(){return p}),P.d(J,"adjustSliding",function(){return h}),P.d(J,"addSliding",function(){return l}),P.d(J,"computeReloadInterval",function(){return f}),P.d(J,"getFragmentWithSN",function(){return o}),P.d(J,"getPartWith",function(){return u});var X=P("./src/polyfills/number.ts"),j=P("./src/utils/logger.ts");function B(a,s,R){switch(s){case"audio":a.audioGroupIds||(a.audioGroupIds=[]),a.audioGroupIds.push(R);break;case"text":a.textGroupIds||(a.textGroupIds=[]),a.textGroupIds.push(R);break}}function K(a){var s={};a.forEach(function(R){var _=R.groupId||"";R.id=s[_]=s[_]||0,s[_]++})}function G(a,s,R){var _=a[s],C=a[R];r(_,C)}function r(a,s){var R=s.startPTS;if(Object(X.isFiniteNumber)(R)){var _=0,C;s.sn>a.sn?(_=R-a.start,C=a):(_=a.start-R,C=s),C.duration!==_&&(C.duration=_)}else if(s.sn>a.sn){var D=a.cc===s.cc;D&&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 L(a,s,R,_,C,D){var O=_-R;O<=0&&(j.logger.warn("Fragment should have a positive duration",s),_=R+s.duration,D=C+s.duration);var A=R,S=_,T=s.startPTS,c=s.endPTS;if(Object(X.isFiniteNumber)(T)){var w=Math.abs(T-R);Object(X.isFiniteNumber)(s.deltaPTS)?s.deltaPTS=Math.max(w,s.deltaPTS):s.deltaPTS=w,A=Math.max(R,T),R=Math.min(R,T),C=Math.min(C,s.startDTS),S=Math.min(_,c),_=Math.max(_,c),D=Math.max(D,s.endDTS)}s.duration=_-R;var y=R-s.start;s.appendedPTS=_,s.start=s.startPTS=R,s.maxStartPTS=A,s.startDTS=C,s.endPTS=_,s.minEndPTS=S,s.endDTS=D;var b=s.sn;if(!a||b<a.startSN||b>a.endSN)return 0;var U,F=b-a.startSN,E=a.fragments;for(E[F]=s,U=F;U>0;U--)r(E[U],E[U-1]);for(U=F;U<E.length-1;U++)r(E[U],E[U+1]);return a.fragmentHint&&r(E[E.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,y}function v(a,s){for(var R=null,_=a.fragments,C=_.length-1;C>=0;C--){var D=_[C].initSegment;if(D){R=D;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;var O=0,A;if(p(a,s,function(U,F){U.relurl&&(O=U.cc-F.cc),Object(X.isFiniteNumber)(U.startPTS)&&Object(X.isFiniteNumber)(U.endPTS)&&(F.start=F.startPTS=U.startPTS,F.startDTS=U.startDTS,F.appendedPTS=U.appendedPTS,F.maxStartPTS=U.maxStartPTS,F.endPTS=U.endPTS,F.endDTS=U.endDTS,F.minEndPTS=U.minEndPTS,F.duration=U.endPTS-U.startPTS,F.duration&&(A=F),s.PTSKnown=s.alignedSliding=!0),F.elementaryStreams=U.elementaryStreams,F.loader=U.loader,F.stats=U.stats,F.urlId=U.urlId,U.initSegment&&(F.initSegment=U.initSegment,R=U.initSegment)}),R){var S=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments;S.forEach(function(U){var F;(!U.initSegment||U.initSegment.relurl===((F=R)===null||F===void 0?void 0:F.relurl))&&(U.initSegment=R)})}if(s.skippedSegments&&(s.deltaUpdateFailed=s.fragments.some(function(U){return!U}),s.deltaUpdateFailed)){j.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var T=s.skippedSegments;T--;)s.fragments.shift();s.startSN=s.fragments[0].sn,s.startCC=s.fragments[0].cc}var c=s.fragments;if(O){j.logger.warn("discontinuity sliding from playlist, take drift into account");for(var w=0;w<c.length;w++)c[w].cc+=O}s.skippedSegments&&(s.startCC=s.fragments[0].cc),m(a.partList,s.partList,function(U,F){F.elementaryStreams=U.elementaryStreams,F.stats=U.stats}),A?L(s,A,A.startPTS,A.endPTS,A.startDTS,A.endDTS):h(a,s),c.length&&(s.totalduration=s.edge-c[0].start),s.driftStartTime=a.driftStartTime,s.driftStart=a.driftStart;var y=s.advancedDateTime;if(s.advanced&&y){var b=s.edge;s.driftStart||(s.driftStartTime=y,s.driftStart=b),s.driftEndTime=y,s.driftEnd=b}else s.driftEndTime=a.driftEndTime,s.driftEnd=a.driftEnd,s.advancedDateTime=a.advancedDateTime}function m(a,s,R){if(a&&s)for(var _=0,C=0,D=a.length;C<=D;C++){var O=a[C],A=s[C+_];O&&A&&O.index===A.index&&O.fragment.sn===A.fragment.sn?R(O,A):_--}}function p(a,s,R){for(var _=s.skippedSegments,C=Math.max(a.startSN,s.startSN)-s.startSN,D=(a.fragmentHint?1:0)+(_?s.endSN:Math.min(a.endSN,s.endSN))-s.startSN,O=s.startSN-a.startSN,A=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,S=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments,T=C;T<=D;T++){var c=S[O+T],w=A[T];_&&!w&&T<_&&(w=s.fragments[T]=c),c&&w&&R(c,w)}}function h(a,s){var R=s.startSN+s.skippedSegments-a.startSN,_=a.fragments;if(R<0||R>=_.length)return;l(s,_[R].start)}function l(a,s){if(s){for(var R=a.fragments,_=a.skippedSegments;_<R.length;_++)R[_].start+=s;a.fragmentHint&&(a.fragmentHint.start+=s)}}function f(a,s){var R=1e3*a.levelTargetDuration,_=R/2,C=a.age,D=C>0&&C<R*3,O=s.loading.end-s.loading.start,A,S=a.availabilityDelay;if(a.updated===!1)if(D){var T=333*a.misses;A=Math.max(Math.min(_,O*2),T),a.availabilityDelay=(a.availabilityDelay||0)+A}else A=_;else D?(S=Math.min(S||R/2,C),a.availabilityDelay=S,A=S+R-C):A=R-O;return Math.round(A)}function o(a,s,R){if(!a||!a.details)return null;var _=a.details,C=_.fragments[s-_.startSN];return C||(C=_.fragmentHint,C&&C.sn===s?C:s<_.startSN&&R&&R.sn===s?R:null)}function u(a,s,R){if(!a||!a.details)return null;var _=a.details.partList;if(_)for(var C=_.length;C--;){var D=_[C];if(D.index===R&&D.fragment.sn===s)return D}return null}},"./src/controller/stream-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return _});var X=P("./src/polyfills/number.ts"),j=P("./src/controller/base-stream-controller.ts"),B=P("./src/is-supported.ts"),K=P("./src/events.ts"),G=P("./src/utils/buffer-helper.ts"),r=P("./src/controller/fragment-tracker.ts"),L=P("./src/types/loader.ts"),v=P("./src/loader/fragment.ts"),m=P("./src/demux/transmuxer-interface.ts"),p=P("./src/types/transmuxer.ts"),h=P("./src/controller/gap-controller.ts"),l=P("./src/errors.ts"),f=P("./src/utils/logger.ts");function o(C,D){for(var O=0;O<D.length;O++){var A=D[O];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(C,A.key,A)}}function u(C,D,O){return D&&o(C.prototype,D),O&&o(C,O),C}function a(C,D){C.prototype=Object.create(D.prototype),C.prototype.constructor=C,s(C,D)}function s(C,D){return s=Object.setPrototypeOf||function(A,S){return A.__proto__=S,A},s(C,D)}var R=100,_=function(C){a(D,C);function D(A,S){var T;return T=C.call(this,A,S,"[stream-controller]")||this,T.audioCodecSwap=!1,T.gapController=null,T.level=-1,T._forceStartLoad=!1,T.altAudio=!1,T.audioOnly=!1,T.fragPlaying=null,T.onvplaying=null,T.onvseeked=null,T.fragLastKbps=0,T.stalled=!1,T.couldBacktrack=!1,T.audioCodecSwitch=!1,T.videoBuffer=null,T._registerListeners(),T}var O=D.prototype;return O._registerListeners=function(){var S=this.hls;S.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),S.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),S.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),S.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),S.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),S.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.on(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),S.on(K.Events.ERROR,this.onError,this),S.on(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),S.on(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.on(K.Events.BUFFER_CREATED,this.onBufferCreated,this),S.on(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),S.on(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),S.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O._unregisterListeners=function(){var S=this.hls;S.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),S.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),S.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),S.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),S.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.off(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),S.off(K.Events.ERROR,this.onError,this),S.off(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),S.off(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.off(K.Events.BUFFER_CREATED,this.onBufferCreated,this),S.off(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),S.off(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),S.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},O.startLoad=function(S){if(this.levels){var T=this.lastCurrentTime,c=this.hls;if(this.stopLoad(),this.setInterval(R),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var w=c.startLevel;w===-1&&(c.config.testBandwidth?(w=0,this.bitrateTest=!0):w=c.nextAutoLevel),this.level=c.nextLoadLevel=w,this.loadedmetadata=!1}T>0&&S===-1&&(this.log("Override startPosition with lastCurrentTime @"+T.toFixed(3)),S=T),this.state=j.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=S,this.tick()}else this._forceStartLoad=!0,this.state=j.State.STOPPED},O.stopLoad=function(){this._forceStartLoad=!1,C.prototype.stopLoad.call(this)},O.doTick=function(){switch(this.state){case j.State.IDLE:this.doTickIdle();break;case j.State.WAITING_LEVEL:{var S,T=this.levels,c=this.level,w=T==null||((S=T[c])===null||S===void 0)?void 0:S.details;if(w&&(!w.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(w))break;this.state=j.State.IDLE;break}break}case j.State.FRAG_LOADING_WAITING_RETRY:{var y,b=self.performance.now(),U=this.retryDate;(!U||b>=U||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=j.State.IDLE)}break;default:break}this.onTickEnd()},O.onTickEnd=function(){C.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},O.doTickIdle=function(){var S,T,c=this.hls,w=this.levelLastLoaded,y=this.levels,b=this.media,U=c.config,F=c.nextLoadLevel;if(w===null||!b&&(this.startFragRequested||!U.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!y||!y[F])return;var E=y[F];this.level=c.nextLoadLevel=F;var N=E.details;if(!N||this.state===j.State.WAITING_LEVEL||N.live&&this.levelLastLoaded!==F){this.state=j.State.WAITING_LEVEL;return}var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:b,L.PlaylistLevelType.MAIN);if(I===null)return;var g=I.len,H=this.getMaxBufferLength(E.maxBitrate);if(g>=H)return;if(this._streamEnded(I,N)){var $={};this.altAudio&&($.type="video"),this.hls.trigger(K.Events.BUFFER_EOS,$),this.state=j.State.ENDED;return}var ie=I.end,oe=this.getNextFragment(ie,N);if(this.couldBacktrack&&!this.fragPrevious&&oe&&oe.sn!=="initSegment"){var Ce=oe.sn-N.startSN;Ce>1&&(oe=N.fragments[Ce-1],this.fragmentTracker.removeFragment(oe))}if(oe&&this.fragmentTracker.getState(oe)===r.FragmentState.OK&&this.nextLoadPosition>ie){var ve=this.audioOnly&&!this.altAudio?v.ElementaryStreamTypes.AUDIO:v.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(b,ve,L.PlaylistLevelType.MAIN),oe=this.getNextFragment(this.nextLoadPosition,N)}if(!oe)return;oe.initSegment&&!oe.initSegment.data&&!this.bitrateTest&&(oe=oe.initSegment),((S=oe.decryptdata)===null||S===void 0?void 0:S.keyFormat)==="identity"&&!((T=oe.decryptdata)!==null&&T!==void 0&&T.key)?this.loadKey(oe,N):this.loadFragment(oe,N,ie)},O.loadFragment=function(S,T,c){var w,y=this.fragmentTracker.getState(S);if(this.fragCurrent=S,y===r.FragmentState.BACKTRACKED){var b=this.fragmentTracker.getBacktrackData(S);if(b){this._handleFragmentLoadProgress(b),this._handleFragmentLoadComplete(b);return}else y=r.FragmentState.NOT_LOADED}y===r.FragmentState.NOT_LOADED||y===r.FragmentState.PARTIAL?S.sn==="initSegment"?this._loadInitSegment(S):this.bitrateTest?(S.bitrateTest=!0,this.log("Fragment "+S.sn+" of level "+S.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(S)):(this.startFragRequested=!0,C.prototype.loadFragment.call(this,S,T,c)):y===r.FragmentState.APPENDING?this.reduceMaxBufferLength(S.duration)&&this.fragmentTracker.removeFragment(S):((w=this.media)===null||w===void 0?void 0:w.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},O.getAppendedFrag=function(S){var T=this.fragmentTracker.getAppendedFrag(S,L.PlaylistLevelType.MAIN);return T&&"fragment"in T?T.fragment:T},O.getBufferedFrag=function(S){return this.fragmentTracker.getBufferedFrag(S,L.PlaylistLevelType.MAIN)},O.followingBufferedFrag=function(S){return S?this.getBufferedFrag(S.end+.5):null},O.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},O.nextLevelSwitch=function(){var S=this.levels,T=this.media;if(T!=null&&T.readyState){var c,w=this.getAppendedFrag(T.currentTime);if(w&&w.start>1&&this.flushMainBuffer(0,w.start-1),!T.paused&&S){var y=this.hls.nextLoadLevel,b=S[y],U=this.fragLastKbps;U&&this.fragCurrent?c=this.fragCurrent.duration*b.maxBitrate/(1e3*U)+1:c=0}else c=0;var F=this.getBufferedFrag(T.currentTime+c);if(F){var E=this.followingBufferedFrag(F);if(E){this.abortCurrentFrag();var N=E.maxStartPTS?E.maxStartPTS:E.start,I=E.duration,g=Math.max(F.end,N+Math.min(Math.max(I-this.config.maxFragLookUpTolerance,I*.5),I*.75));this.flushMainBuffer(g,Number.POSITIVE_INFINITY)}}}},O.abortCurrentFrag=function(){var S=this.fragCurrent;this.fragCurrent=null,S!=null&&S.loader&&S.loader.abort(),this.state===j.State.KEY_LOADING&&(this.state=j.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},O.flushMainBuffer=function(S,T){C.prototype.flushMainBuffer.call(this,S,T,this.altAudio?"video":null)},O.onMediaAttached=function(S,T){C.prototype.onMediaAttached.call(this,S,T);var c=T.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)},O.onMediaDetaching=function(){var S=this.media;S&&(S.removeEventListener("playing",this.onvplaying),S.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),C.prototype.onMediaDetaching.call(this)},O.onMediaPlaying=function(){this.tick()},O.onMediaSeeked=function(){var S=this.media,T=S?S.currentTime:null;Object(X.isFiniteNumber)(T)&&this.log("Media seeked to "+T.toFixed(3)),this.tick()},O.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(K.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},O.onManifestParsed=function(S,T){var c=!1,w=!1,y;T.levels.forEach(function(b){y=b.audioCodec,y&&(y.indexOf("mp4a.40.2")!==-1&&(c=!0),y.indexOf("mp4a.40.5")!==-1&&(w=!0))}),this.audioCodecSwitch=c&&w&&!Object(B.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=T.levels,this.startFragRequested=!1},O.onLevelLoading=function(S,T){var c=this.levels;if(!c||this.state!==j.State.IDLE)return;var w=c[T.level];(!w.details||w.details.live&&this.levelLastLoaded!==T.level||this.waitForCdnTuneIn(w.details))&&(this.state=j.State.WAITING_LEVEL)},O.onLevelLoaded=function(S,T){var c,w=this.levels,y=T.level,b=T.details,U=b.totalduration;if(!w){this.warn("Levels were reset while loading level "+y);return}this.log("Level "+y+" loaded ["+b.startSN+","+b.endSN+"], cc ["+b.startCC+", "+b.endCC+"] duration:"+U);var F=this.fragCurrent;F&&(this.state===j.State.FRAG_LOADING||this.state===j.State.FRAG_LOADING_WAITING_RETRY)&&(F.level!==T.level&&F.loader&&(this.state=j.State.IDLE,F.loader.abort()));var E=w[y],N=0;if(b.live||(c=E.details)!==null&&c!==void 0&&c.live){if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed)return;N=this.alignPlaylists(b,E.details)}if(E.details=b,this.levelLastLoaded=y,this.hls.trigger(K.Events.LEVEL_UPDATED,{details:b,level:y}),this.state===j.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(b))return;this.state=j.State.IDLE}this.startFragRequested?b.live&&this.synchronizeToLiveEdge(b):this.setStartPosition(b,N),this.tick()},O._handleFragmentLoadProgress=function(S){var T,c=S.frag,w=S.part,y=S.payload,b=this.levels;if(!b){this.warn("Levels were reset while fragment load was in progress. Fragment "+c.sn+" of level "+c.level+" will not be buffered");return}var U=b[c.level],F=U.details;if(!F){this.warn("Dropping fragment "+c.sn+" of level "+c.level+" after level details were reset");return}var E=U.videoCodec,N=F.PTSKnown||!F.live,I=(T=c.initSegment)===null||T===void 0?void 0:T.data,g=this._getAudioCodec(U),H=this.transmuxer=this.transmuxer||new m.default(this.hls,L.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),$=w?w.index:-1,ie=$!==-1,oe=new p.ChunkMetadata(c.level,c.sn,c.stats.chunkCount,y.byteLength,$,ie),Ce=this.initPTS[c.cc];H.push(y,I,g,E,c,w,F.totalduration,N,oe,Ce)},O.onAudioTrackSwitching=function(S,T){var c=this.altAudio,w=!!T.url,y=T.id;if(!w){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var b=this.fragCurrent;b!=null&&b.loader&&(this.log("Switching to main audio track, cancel main fragment load"),b.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var U=this.hls;c&&U.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),U.trigger(K.Events.AUDIO_TRACK_SWITCHED,{id:y})}},O.onAudioTrackSwitched=function(S,T){var c=T.id,w=!!this.hls.audioTracks[c].url;if(w){var y=this.videoBuffer;y&&this.mediaBuffer!==y&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=y)}this.altAudio=w,this.tick()},O.onBufferCreated=function(S,T){var c=T.tracks,w,y,b=!1;for(var U in c){var F=c[U];if(F.id==="main"){if(y=U,w=F,U==="video"){var E=c[U];E&&(this.videoBuffer=E.buffer)}}else b=!0}b&&w?(this.log("Alternate track found, use "+y+".buffered to schedule main fragment loading"),this.mediaBuffer=w.buffer):this.mediaBuffer=this.media},O.onFragBuffered=function(S,T){var c=T.frag,w=T.part;if(c&&c.type!==L.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(c)){this.warn("Fragment "+c.sn+(w?" p: "+w.index:"")+" of level "+c.level+" finished buffering, but was aborted. state: "+this.state),this.state===j.State.PARSED&&(this.state=j.State.IDLE);return}var y=w?w.stats:c.stats;this.fragLastKbps=Math.round(8*y.total/(y.buffering.end-y.loading.first)),c.sn!=="initSegment"&&(this.fragPrevious=c),this.fragBufferedComplete(c,w)},O.onError=function(S,T){switch(T.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(L.PlaylistLevelType.MAIN,T);break;case l.ErrorDetails.LEVEL_LOAD_ERROR:case l.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==j.State.ERROR&&(T.fatal?(this.warn(""+T.details),this.state=j.State.ERROR):!T.levelRetry&&this.state===j.State.WAITING_LEVEL&&(this.state=j.State.IDLE));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(T.parent==="main"&&(this.state===j.State.PARSING||this.state===j.State.PARSED)){var c=!0,w=this.getFwdBufferInfo(this.media,L.PlaylistLevelType.MAIN);w&&w.len>.5&&(c=!this.reduceMaxBufferLength(w.len)),c&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},O.checkBuffer=function(){var S=this.media,T=this.gapController;if(!S||!T||!S.readyState)return;var c=G.BufferHelper.getBuffered(S);!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this.seekToStartPos()):T.poll(this.lastCurrentTime),this.lastCurrentTime=S.currentTime},O.onFragLoadEmergencyAborted=function(){this.state=j.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},O.onBufferFlushed=function(S,T){var c=T.type;if(c!==v.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var w=(c===v.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(w,c,L.PlaylistLevelType.MAIN)}},O.onLevelsUpdated=function(S,T){this.levels=T.levels},O.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},O.seekToStartPos=function(){var S=this.media,T=S.currentTime,c=this.startPosition;if(c>=0&&T<c){if(S.seeking){f.logger.log("could not seek to "+c+", already seeking at "+T);return}var w=G.BufferHelper.getBuffered(S),y=w.length?w.start(0):0,b=y-c;b>0&&(b<this.config.maxBufferHole||b<this.config.maxFragLookUpTolerance)&&(f.logger.log("adjusting start position by "+b+" to match buffer start"),c+=b,this.startPosition=c),this.log("seek to target start position "+c+" from current time "+T),S.currentTime=c}},O._getAudioCodec=function(S){var T=this.config.defaultAudioCodec||S.audioCodec;return this.audioCodecSwap&&T&&(this.log("Swapping audio codec"),T.indexOf("mp4a.40.5")!==-1?T="mp4a.40.2":T="mp4a.40.5"),T},O._loadBitrateTestFrag=function(S){var T=this;this._doFragLoad(S).then(function(c){var w=T.hls;if(!c||w.nextLoadLevel||T.fragContextChanged(S))return;T.fragLoadError=0,T.state=j.State.IDLE,T.startFragRequested=!1,T.bitrateTest=!1;var y=S.stats;y.parsing.start=y.parsing.end=y.buffering.start=y.buffering.end=self.performance.now(),w.trigger(K.Events.FRAG_LOADED,c)})},O._handleTransmuxComplete=function(S){var T,c="main",w=this.hls,y=S.remuxResult,b=S.chunkMeta,U=this.getCurrentContext(b);if(!U){this.warn("The loading context changed while buffering fragment "+b.sn+" of level "+b.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(b.level);return}var F=U.frag,E=U.part,N=U.level,I=y.video,g=y.text,H=y.id3,$=y.initSegment,ie=this.altAudio?void 0:y.audio;if(this.fragContextChanged(F))return;if(this.state=j.State.PARSING,$){$.tracks&&(this._bufferInitSegment(N,$.tracks,F,b),w.trigger(K.Events.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:c,tracks:$.tracks}));var oe=$.initPTS,Ce=$.timescale;Object(X.isFiniteNumber)(oe)&&(this.initPTS[F.cc]=oe,w.trigger(K.Events.INIT_PTS_FOUND,{frag:F,id:c,initPTS:oe,timescale:Ce}))}if(I&&y.independent!==!1){if(N.details){var ve=I.startPTS,Se=I.endPTS,Ae=I.startDTS,Oe=I.endDTS;if(E)E.elementaryStreams[I.type]={startPTS:ve,endPTS:Se,startDTS:Ae,endDTS:Oe};else if(I.firstKeyFrame&&I.independent&&(this.couldBacktrack=!0),I.dropped&&I.independent){var he=this.getLoadPosition()+this.config.maxBufferHole;if(he<ve){this.backtrack(F);return}F.setElementaryStreamInfo(I.type,F.start,Se,F.start,Oe,!0)}F.setElementaryStreamInfo(I.type,ve,Se,Ae,Oe),this.bufferFragmentData(I,F,E,b)}}else if(y.independent===!1){this.backtrack(F);return}if(ie){var ce=ie.startPTS,re=ie.endPTS,fe=ie.startDTS,se=ie.endDTS;E&&(E.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:ce,endPTS:re,startDTS:fe,endDTS:se}),F.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,ce,re,fe,se),this.bufferFragmentData(ie,F,E,b)}if(H!=null&&(T=H.samples)!==null&&T!==void 0&&T.length){var ke={frag:F,id:c,samples:H.samples};w.trigger(K.Events.FRAG_PARSING_METADATA,ke)}if(g){var Ne={frag:F,id:c,samples:g.samples};w.trigger(K.Events.FRAG_PARSING_USERDATA,Ne)}},O._bufferInitSegment=function(S,T,c,w){var y=this;if(this.state!==j.State.PARSING)return;this.audioOnly=!!T.audio&&!T.video,this.altAudio&&!this.audioOnly&&delete T.audio;var b=T.audio,U=T.video,F=T.audiovideo;if(b){var E=S.audioCodec,N=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(E&&(E.indexOf("mp4a.40.5")!==-1?E="mp4a.40.2":E="mp4a.40.5"),b.metadata.channelCount!==1&&N.indexOf("firefox")===-1&&(E="mp4a.40.5")),N.indexOf("android")!==-1&&b.container!=="audio/mpeg"&&(E="mp4a.40.2",this.log("Android: force audio codec to "+E)),S.audioCodec&&S.audioCodec!==E&&this.log('Swapping manifest audio codec "'+S.audioCodec+'" for "'+E+'"'),b.levelCodec=E,b.id="main",this.log("Init audio buffer, container:"+b.container+", codecs[selected/level/parsed]=["+(E||"")+"/"+(S.audioCodec||"")+"/"+b.codec+"]")}U&&(U.levelCodec=S.videoCodec,U.id="main",this.log("Init video buffer, container:"+U.container+", codecs[level/parsed]=["+(S.videoCodec||"")+"/"+U.codec+"]")),F&&this.log("Init audiovideo buffer, container:"+F.container+", codecs[level/parsed]=["+(S.attrs.CODECS||"")+"/"+F.codec+"]"),this.hls.trigger(K.Events.BUFFER_CODECS,T),Object.keys(T).forEach(function(I){var g=T[I],H=g.initSegment;H!=null&&H.byteLength&&y.hls.trigger(K.Events.BUFFER_APPENDING,{type:I,data:H,frag:c,part:null,chunkMeta:w,parent:c.type})}),this.tick()},O.backtrack=function(S){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(S);var T=this.fragmentTracker.backtrack(S);this.fragPrevious=null,this.nextLoadPosition=S.start,T?this.resetFragmentLoading(S):this.state=j.State.BACKTRACKING},O.checkFragmentChanged=function(){var S=this.media,T=null;if(S&&S.readyState>1&&S.seeking===!1){var c=S.currentTime;if(G.BufferHelper.isBuffered(S,c)?T=this.getAppendedFrag(c):G.BufferHelper.isBuffered(S,c+.1)&&(T=this.getAppendedFrag(c+.1)),T){var w=this.fragPlaying,y=T.level;(!w||T.sn!==w.sn||w.level!==y||T.urlId!==w.urlId)&&(this.hls.trigger(K.Events.FRAG_CHANGED,{frag:T}),(!w||w.level!==y)&&this.hls.trigger(K.Events.LEVEL_SWITCHED,{level:y}),this.fragPlaying=T)}}},u(D,[{key:"nextLevel",get:function(){var S=this.nextBufferedFrag;return S?S.level:-1}},{key:"currentLevel",get:function(){var S=this.media;if(S){var T=this.getAppendedFrag(S.currentTime);if(T)return T.level}return-1}},{key:"nextBufferedFrag",get:function(){var S=this.media;if(S){var T=this.getAppendedFrag(S.currentTime);return this.followingBufferedFrag(T)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),D}(j.default)},"./src/controller/subtitle-stream-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"SubtitleStreamController",function(){return a});var X=P("./src/events.ts"),j=P("./src/utils/logger.ts"),B=P("./src/utils/buffer-helper.ts"),K=P("./src/controller/fragment-finders.ts"),G=P("./src/utils/discontinuities.ts"),r=P("./src/controller/level-helper.ts"),L=P("./src/controller/fragment-tracker.ts"),v=P("./src/controller/base-stream-controller.ts"),m=P("./src/types/loader.ts"),p=P("./src/types/level.ts");function h(s,R){for(var _=0;_<R.length;_++){var C=R[_];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(s,C.key,C)}}function l(s,R,_){return R&&h(s.prototype,R),_&&h(s,_),s}function f(s,R){s.prototype=Object.create(R.prototype),s.prototype.constructor=s,o(s,R)}function o(s,R){return o=Object.setPrototypeOf||function(C,D){return C.__proto__=D,C},o(s,R)}var u=500,a=function(s){f(R,s);function R(C,D){var O;return O=s.call(this,C,D,"[subtitle-stream-controller]")||this,O.levels=[],O.currentTrackId=-1,O.tracksBuffered=[],O.mainDetails=null,O._registerListeners(),O}var _=R.prototype;return _.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},_._registerListeners=function(){var D=this.hls;D.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.on(X.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.on(X.Events.ERROR,this.onError,this),D.on(X.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.on(X.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.on(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.on(X.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.on(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},_._unregisterListeners=function(){var D=this.hls;D.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.off(X.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.off(X.Events.ERROR,this.onError,this),D.off(X.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.off(X.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.off(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.off(X.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.off(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},_.startLoad=function(){this.stopLoad(),this.state=v.State.IDLE,this.setInterval(u),this.tick()},_.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},_.onLevelLoaded=function(D,O){this.mainDetails=O.details},_.onSubtitleFragProcessed=function(D,O){var A=O.frag,S=O.success;if(this.fragPrevious=A,this.state=v.State.IDLE,!S)return;var T=this.tracksBuffered[this.currentTrackId];if(!T)return;for(var c,w=A.start,y=0;y<T.length;y++)if(w>=T[y].start&&w<=T[y].end){c=T[y];break}var b=A.start+A.duration;c?c.end=b:(c={start:w,end:b},T.push(c)),this.fragmentTracker.fragBuffered(A)},_.onBufferFlushing=function(D,O){var A=O.startOffset,S=O.endOffset;if(A===0&&S!==Number.POSITIVE_INFINITY){var T=this.currentTrackId,c=this.levels;if(!c.length||!c[T]||!c[T].details)return;var w=c[T].details,y=w.targetduration,b=S-y;if(b<=0)return;O.endOffsetSubtitles=Math.max(0,b),this.tracksBuffered.forEach(function(U){for(var F=0;F<U.length;){if(U[F].end<=b){U.shift();continue}else if(U[F].start<b)U[F].start=b;else break;F++}}),this.fragmentTracker.removeFragmentsInRange(A,b,m.PlaylistLevelType.SUBTITLE)}},_.onError=function(D,O){var A,S=O.frag;if(!S||S.type!==m.PlaylistLevelType.SUBTITLE)return;(A=this.fragCurrent)!==null&&A!==void 0&&A.loader&&this.fragCurrent.loader.abort(),this.state=v.State.IDLE},_.onSubtitleTracksUpdated=function(D,O){var A=this,S=O.subtitleTracks;this.tracksBuffered=[],this.levels=S.map(function(T){return new p.Level(T)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(T){A.tracksBuffered[T.id]=[]}),this.mediaBuffer=null},_.onSubtitleTrackSwitch=function(D,O){if(this.currentTrackId=O.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var A=this.levels[this.currentTrackId];A!=null&&A.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,A&&this.setInterval(u)},_.onSubtitleTrackLoaded=function(D,O){var A,S=O.details,T=O.id,c=this.currentTrackId,w=this.levels;if(!w.length)return;var y=w[c];if(T>=w.length||T!==c||!y)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,S.live||(A=y.details)!==null&&A!==void 0&&A.live){var b=this.mainDetails;if(S.deltaUpdateFailed||!b)return;var U=b.fragments[0];if(!y.details)S.hasProgramDateTime&&b.hasProgramDateTime?Object(G.alignMediaPlaylistByPDT)(S,b):U&&Object(r.addSliding)(S,U.start);else{var F=this.alignPlaylists(S,y.details);F===0&&U&&Object(r.addSliding)(S,U.start)}}if(y.details=S,this.levelLastLoaded=T,this.tick(),S.live&&!this.fragCurrent&&this.media&&this.state===v.State.IDLE){var E=Object(K.findFragmentByPTS)(null,S.fragments,this.media.currentTime,0);E||(this.warn("Subtitle playlist not aligned with playback"),y.details=void 0)}},_._handleFragmentLoadComplete=function(D){var O=D.frag,A=D.payload,S=O.decryptdata,T=this.hls;if(this.fragContextChanged(O))return;if(A&&A.byteLength>0&&S&&S.key&&S.iv&&S.method==="AES-128"){var c=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(A),S.key.buffer,S.iv.buffer).then(function(w){var y=performance.now();T.trigger(X.Events.FRAG_DECRYPTED,{frag:O,payload:w,stats:{tstart:c,tdecrypt:y}})})}},_.doTick=function(){if(!this.media){this.state=v.State.IDLE;return}if(this.state===v.State.IDLE){var D,O=this.currentTrackId,A=this.levels;if(!A.length||!A[O]||!A[O].details)return;var S=A[O].details,T=S.targetduration,c=this.config,w=this.media,y=B.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,w.currentTime-T,c.maxBufferHole),b=y.end,U=y.len,F=this.getMaxBufferLength()+T;if(U>F)return;console.assert(S,"Subtitle track details are defined on idle subtitle stream controller tick");var E=S.fragments,N=E.length,I=S.edge,g,H=this.fragPrevious;if(b<I){var $=c.maxFragLookUpTolerance;H&&S.hasProgramDateTime&&(g=Object(K.findFragmentByPDT)(E,H.endProgramDateTime,$)),g||(g=Object(K.findFragmentByPTS)(H,E,b,$),!g&&H&&H.start<E[0].start&&(g=E[0]))}else g=E[N-1];(D=g)!==null&&D!==void 0&&D.encrypted?(j.logger.log("Loading key for "+g.sn),this.state=v.State.KEY_LOADING,this.hls.trigger(X.Events.KEY_LOADING,{frag:g})):g&&this.fragmentTracker.getState(g)===L.FragmentState.NOT_LOADED&&this.loadFragment(g,S,b)}},_.loadFragment=function(D,O,A){this.fragCurrent=D,s.prototype.loadFragment.call(this,D,O,A)},l(R,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),R}(v.default)},"./src/controller/subtitle-track-controller.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/events.ts"),j=P("./src/utils/texttrack-utils.ts"),B=P("./src/controller/base-playlist-controller.ts"),K=P("./src/types/loader.ts");function G(h,l){for(var f=0;f<l.length;f++){var o=l[f];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(h,o.key,o)}}function r(h,l,f){return l&&G(h.prototype,l),f&&G(h,f),h}function L(h,l){h.prototype=Object.create(l.prototype),h.prototype.constructor=h,v(h,l)}function v(h,l){return v=Object.setPrototypeOf||function(o,u){return o.__proto__=u,o},v(h,l)}var m=function(h){L(l,h);function l(o){var u;return u=h.call(this,o,"[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 f=l.prototype;return f.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,h.prototype.destroy.call(this)},f.registerListeners=function(){var u=this.hls;u.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(X.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.on(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.on(X.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var u=this.hls;u.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(X.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.off(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.off(X.Events.ERROR,this.onError,this)},f.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)},f.pollTrackChange=function(u){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,u)},f.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=p(this.media.textTracks);u.forEach(function(a){Object(j.clearCurrentCues)(a)}),this.subtitleTrack=-1,this.media=null},f.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},f.onManifestParsed=function(u,a){this.tracks=a.subtitleTracks},f.onSubtitleTrackLoaded=function(u,a){var s=a.id,R=a.details,_=this.trackId,C=this.tracksInGroup[_];if(!C){this.warn("Invalid subtitle track id "+s);return}var D=C.details;C.details=a.details,this.log("subtitle track "+s+" loaded ["+R.startSN+"-"+R.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,a,D))},f.onLevelLoading=function(u,a){this.switchLevel(a.level)},f.onLevelSwitching=function(u,a){this.switchLevel(a.level)},f.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 R=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,_=this.tracks.filter(function(O){return!s||O.groupId===s});this.tracksInGroup=_;var C=this.findTrackId(R==null?void 0:R.name)||this.findTrackId();this.groupId=s;var D={subtitleTracks:_};this.log("Updating subtitle tracks, "+_.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(X.Events.SUBTITLE_TRACKS_UPDATED,D),C!==-1&&this.setSubtitleTrack(C,R)}},f.findTrackId=function(u){for(var a=this.tracksInGroup,s=0;s<a.length;s++){var R=a[s];if((!this.selectDefaultTrack||R.default)&&(!u||u===R.name))return R.id}return-1},f.onError=function(u,a){if(h.prototype.onError.call(this,u,a),a.fatal||!a.context)return;a.context.type===K.PlaylistContextType.SUBTITLE_TRACK&&a.context.id===this.trackId&&a.context.groupId===this.groupId&&this.retryLoadingOrFail(a)},f.loadPlaylist=function(u){var a=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(a)){var s=a.id,R=a.groupId,_=a.url;if(u)try{_=u.addDirectives(_)}catch(C){this.warn("Could not construct new URL with HLS Delivery Directives: "+C)}this.log("Loading subtitle playlist for id "+s),this.hls.trigger(X.Events.SUBTITLE_TRACK_LOADING,{url:_,id:s,groupId:R,deliveryDirectives:u||null})}},f.toggleTrackModes=function(u){var a=this,s=this.media,R=this.subtitleDisplay,_=this.trackId;if(!s)return;var C=p(s.textTracks),D=C.filter(function(S){return S.groupId===a.groupId});if(u===-1)[].slice.call(C).forEach(function(S){S.mode="disabled"});else{var O=D[_];O&&(O.mode="disabled")}var A=D[u];A&&(A.mode=R?"showing":"hidden")},f.setSubtitleTrack=function(u,a){var s,R=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=u;return}if(this.trackId!==u&&this.toggleTrackModes(u),this.trackId===u&&(u===-1||(s=R[u])!==null&&s!==void 0&&s.details)||u<-1||u>=R.length)return;this.clearTimer();var _=R[u];if(this.log("Switching to subtitle track "+u),this.trackId=u,_){var C=_.id,D=_.groupId,O=D===void 0?"":D,A=_.name,S=_.type,T=_.url;this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:C,groupId:O,name:A,type:S,url:T});var c=this.switchParams(_.url,a==null?void 0:a.details);this.loadPlaylist(c)}else this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:u})},f.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var u=-1,a=p(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)},r(l,[{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)}}]),l}(B.default);function p(h){for(var l=[],f=0;f<h.length;f++){var o=h[f];o.kind==="subtitles"&&o.label&&l.push(h[f])}return l}J.default=m},"./src/controller/timeline-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"TimelineController",function(){return p});var X=P("./src/polyfills/number.ts"),j=P("./src/events.ts"),B=P("./src/utils/cea-608-parser.ts"),K=P("./src/utils/output-filter.ts"),G=P("./src/utils/webvtt-parser.ts"),r=P("./src/utils/texttrack-utils.ts"),L=P("./src/utils/imsc1-ttml-parser.ts"),v=P("./src/types/loader.ts"),m=P("./src/utils/logger.ts"),p=function(){function o(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=f(),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 K.default(this,"textTrack1"),R=new K.default(this,"textTrack2"),_=new K.default(this,"textTrack3"),C=new K.default(this,"textTrack4");this.cea608Parser1=new B.default(1,s,R),this.cea608Parser2=new B.default(3,_,C)}a.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),a.on(j.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),a.on(j.Events.FRAG_LOADING,this.onFragLoading,this),a.on(j.Events.FRAG_LOADED,this.onFragLoaded,this),a.on(j.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),a.on(j.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),a.on(j.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.on(j.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),a.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var u=o.prototype;return u.destroy=function(){var s=this.hls;s.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.off(j.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.off(j.Events.FRAG_LOADING,this.onFragLoading,this),s.off(j.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(j.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.off(j.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.off(j.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.off(j.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},u.addCues=function(s,R,_,C,D){for(var O=!1,A=D.length;A--;){var S=D[A],T=l(S[0],S[1],R,_);if(T>=0&&(S[0]=Math.min(S[0],R),S[1]=Math.max(S[1],_),O=!0,T/(_-R)>.5))return}if(O||D.push([R,_]),this.config.renderTextTracksNatively){var c=this.captionsTracks[s];this.Cues.newCue(c,R,_,C)}else{var w=this.Cues.newCue(null,R,_,C);this.hls.trigger(j.Events.CUES_PARSED,{type:"captions",cues:w,track:s})}},u.onInitPtsFound=function(s,R){var _=this,C=R.frag,D=R.id,O=R.initPTS,A=R.timescale,S=this.unparsedVttFrags;D==="main"&&(this.initPTS[C.cc]=O,this.timescale[C.cc]=A),S.length&&(this.unparsedVttFrags=[],S.forEach(function(T){_.onFragLoaded(j.Events.FRAG_LOADED,T)}))},u.getExistingTrack=function(s){var R=this.media;if(R)for(var _=0;_<R.textTracks.length;_++){var C=R.textTracks[_];if(C[s])return C}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 R=this.captionsProperties,_=this.captionsTracks,C=this.media,D=R[s],O=D.label,A=D.languageCode,S=this.getExistingTrack(s);if(S)_[s]=S,Object(r.clearCurrentCues)(_[s]),Object(r.sendAddTrackEvent)(_[s],C);else{var T=this.createTextTrack("captions",O,A);T&&(T[s]=!0,_[s]=T)}},u.createNonNativeTrack=function(s){if(this.nonNativeCaptionsTracks[s])return;var R=this.captionsProperties[s];if(!R)return;var _=R.label,C={_id:s,label:_,kind:"captions",default:R.media?!!R.media.default:!1,closedCaptions:R.media};this.nonNativeCaptionsTracks[s]=C,this.hls.trigger(j.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[C]})},u.createTextTrack=function(s,R,_){var C=this.media;return C?C.addTextTrack(s,R,_):void 0},u.onMediaAttaching=function(s,R){this.media=R.media,this._cleanTracks()},u.onMediaDetaching=function(){var s=this.captionsTracks;Object.keys(s).forEach(function(R){Object(r.clearCurrentCues)(s[R]),delete s[R]}),this.nonNativeCaptionsTracks={}},u.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=f(),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 R=s.textTracks;if(R)for(var _=0;_<R.length;_++)Object(r.clearCurrentCues)(R[_])},u.onSubtitleTracksUpdated=function(s,R){var _=this;this.textTracks=[];var C=R.subtitleTracks||[],D=C.some(function(T){return T.textCodec===L.IMSC1_CODEC});if(this.config.enableWebVTT||D&&this.config.enableIMSC1){var O=this.tracks&&C&&this.tracks.length===C.length;if(this.tracks=C||[],this.config.renderTextTracksNatively){var A=this.media?this.media.textTracks:[];this.tracks.forEach(function(T,c){var w;if(c<A.length){for(var y=null,b=0;b<A.length;b++)if(h(A[b],T)){y=A[b];break}y&&(w=y)}w?Object(r.clearCurrentCues)(w):(w=_.createTextTrack("subtitles",T.name,T.lang),w&&(w.mode="disabled")),w&&(w.groupId=T.groupId,_.textTracks.push(w))})}else if(!O&&this.tracks&&this.tracks.length){var S=this.tracks.map(function(T){return{label:T.name,kind:T.type.toLowerCase(),default:T.default,subtitleTrack:T}});this.hls.trigger(j.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:S})}}},u.onManifestLoaded=function(s,R){var _=this;this.config.enableCEA708Captions&&R.captions&&R.captions.forEach(function(C){var D=/(?:CC|SERVICE)([1-4])/.exec(C.instreamId);if(!D)return;var O="textTrack"+D[1],A=_.captionsProperties[O];if(!A)return;A.label=C.name,C.lang&&(A.languageCode=C.lang),A.media=C})},u.onFragLoading=function(s,R){var _=this.cea608Parser1,C=this.cea608Parser2,D=this.lastSn,O=this.lastPartIndex;if(!this.enabled||!(_&&C))return;if(R.frag.type===v.PlaylistLevelType.MAIN){var A,S,T=R.frag.sn,c=(A=R==null||((S=R.part)===null||S===void 0)?void 0:S.index)!=null?A:-1;T===D+1||T===D&&c===O+1||(_.reset(),C.reset()),this.lastSn=T,this.lastPartIndex=c}},u.onFragLoaded=function(s,R){var _=R.frag,C=R.payload,D=this.initPTS,O=this.unparsedVttFrags;if(_.type===v.PlaylistLevelType.SUBTITLE)if(C.byteLength){if(!Object(X.isFiniteNumber)(D[_.cc])){O.push(R),D.length&&this.hls.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:_,error:new Error("Missing initial subtitle PTS")});return}var A=_.decryptdata;if(A==null||A.key==null||A.method!=="AES-128"){var S=this.tracks[_.level],T=this.vttCCs;T[_.cc]||(T[_.cc]={start:_.start,prevCC:this.prevCC,new:!0},this.prevCC=_.cc),S&&S.textCodec===L.IMSC1_CODEC?this._parseIMSC1(_,C):this._parseVTTs(_,C,T)}}else this.hls.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:_,error:new Error("Empty subtitle payload")})},u._parseIMSC1=function(s,R){var _=this,C=this.hls;Object(L.parseIMSC1)(R,this.initPTS[s.cc],this.timescale[s.cc],function(D){_._appendCues(D,s.level),C.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(D){m.logger.log("Failed to parse IMSC1: "+D),C.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:D})})},u._parseVTTs=function(s,R,_){var C=this,D=this.hls;Object(G.parseWebVTT)(R,this.initPTS[s.cc],this.timescale[s.cc],_,s.cc,s.start,function(O){C._appendCues(O,s.level),D.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(O){C._fallbackToIMSC1(s,R),m.logger.log("Failed to parse VTT cue: "+O),D.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:O})})},u._fallbackToIMSC1=function(s,R){var _=this,C=this.tracks[s.level];C.textCodec||Object(L.parseIMSC1)(R,this.initPTS[s.cc],this.timescale[s.cc],function(){C.textCodec=L.IMSC1_CODEC,_._parseIMSC1(s,R)},function(){C.textCodec="wvtt"})},u._appendCues=function(s,R){var _=this.hls;if(this.config.renderTextTracksNatively){var C=this.textTracks[R];if(C.mode==="disabled")return;s.forEach(function(A){return Object(r.addCueToTrack)(C,A)})}else{var D=this.tracks[R],O=D.default?"default":"subtitles"+R;_.trigger(j.Events.CUES_PARSED,{type:"subtitles",cues:s,track:O})}},u.onFragDecrypted=function(s,R){var _=R.frag;if(_.type===v.PlaylistLevelType.SUBTITLE){if(!Object(X.isFiniteNumber)(this.initPTS[_.cc])){this.unparsedVttFrags.push(R);return}this.onFragLoaded(j.Events.FRAG_LOADED,R)}},u.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},u.onFragParsingUserdata=function(s,R){var _=this.cea608Parser1,C=this.cea608Parser2;if(!this.enabled||!(_&&C))return;for(var D=0;D<R.samples.length;D++){var O=R.samples[D].bytes;if(O){var A=this.extractCea608Data(O);_.addData(R.samples[D].pts,A[0]),C.addData(R.samples[D].pts,A[1])}}},u.onBufferFlushing=function(s,R){var _=R.startOffset,C=R.endOffset,D=R.endOffsetSubtitles,O=R.type,A=this.media;if(!A||A.currentTime<C)return;if(!O||O==="video"){var S=this.captionsTracks;Object.keys(S).forEach(function(c){return Object(r.removeCuesInRange)(S[c],_,C)})}if(this.config.renderTextTracksNatively&&(_===0&&D!==void 0)){var T=this.textTracks;Object.keys(T).forEach(function(c){return Object(r.removeCuesInRange)(T[c],_,D)})}},u.extractCea608Data=function(s){for(var R=s[0]&31,_=2,C=[[],[]],D=0;D<R;D++){var O=s[_++],A=127&s[_++],S=127&s[_++],T=(4&O)!==0,c=3&O;if(A===0&&S===0)continue;T&&((c===0||c===1)&&(C[c].push(A),C[c].push(S)))}return C},o}();function h(o,u){return o&&o.label===u.name&&!(o.textTrack1||o.textTrack2)}function l(o,u,a,s){return Math.min(u,s)-Math.max(o,a)}function f(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return X});var X=function(){function j(K,G){this.subtle=void 0,this.aesIV=void 0,this.subtle=K,this.aesIV=G}var B=j.prototype;return B.decrypt=function(G,r){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},r,G)},j}()},"./src/crypt/aes-decryptor.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"removePadding",function(){return j}),P.d(J,"default",function(){return B});var X=P("./src/utils/typed-array.ts");function j(K){var G=K.byteLength,r=G&&new DataView(K.buffer).getUint8(G-1);return r?Object(X.sliceUint8)(K,0,G-r):K}var B=function(){function K(){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 G=K.prototype;return G.uint8ArrayToUint32Array_=function(L){for(var v=new DataView(L),m=new Uint32Array(4),p=0;p<4;p++)m[p]=v.getUint32(p*4);return m},G.initTable=function(){var L=this.sBox,v=this.invSBox,m=this.subMix,p=m[0],h=m[1],l=m[2],f=m[3],o=this.invSubMix,u=o[0],a=o[1],s=o[2],R=o[3],_=new Uint32Array(256),C=0,D=0,O=0;for(O=0;O<256;O++)O<128?_[O]=O<<1:_[O]=O<<1^283;for(O=0;O<256;O++){var A=D^D<<1^D<<2^D<<3^D<<4;A=A>>>8^A&255^99,L[C]=A,v[A]=C;var S=_[C],T=_[S],c=_[T],w=_[A]*257^A*16843008;p[C]=w<<24|w>>>8,h[C]=w<<16|w>>>16,l[C]=w<<8|w>>>24,f[C]=w,w=c*16843009^T*65537^S*257^C*16843008,u[A]=w<<24|w>>>8,a[A]=w<<16|w>>>16,s[A]=w<<8|w>>>24,R[A]=w,C?(C=S^_[_[_[c^S]]],D^=_[_[D]]):C=D=1}},G.expandKey=function(L){for(var v=this.uint8ArrayToUint32Array_(L),m=!0,p=0;p<v.length&&m;)m=v[p]===this.key[p],p++;if(m)return;this.key=v;var h=this.keySize=v.length;if(h!==4&&h!==6&&h!==8)throw new Error("Invalid aes key size="+h);var l=this.ksRows=(h+6+1)*4,f,o,u=this.keySchedule=new Uint32Array(l),a=this.invKeySchedule=new Uint32Array(l),s=this.sBox,R=this.rcon,_=this.invSubMix,C=_[0],D=_[1],O=_[2],A=_[3],S,T;for(f=0;f<l;f++){if(f<h){S=u[f]=v[f];continue}T=S,f%h===0?(T=T<<8|T>>>24,T=s[T>>>24]<<24|s[T>>>16&255]<<16|s[T>>>8&255]<<8|s[T&255],T^=R[f/h|0]<<24):h>6&&f%h===4&&(T=s[T>>>24]<<24|s[T>>>16&255]<<16|s[T>>>8&255]<<8|s[T&255]),u[f]=S=(u[f-h]^T)>>>0}for(o=0;o<l;o++)f=l-o,o&3?T=u[f]:T=u[f-4],o<4||f<=4?a[o]=T:a[o]=C[s[T>>>24]]^D[s[T>>>16&255]]^O[s[T>>>8&255]]^A[s[T&255]],a[o]=a[o]>>>0},G.networkToHostOrderSwap=function(L){return L<<24|(L&65280)<<8|(L&16711680)>>8|L>>>24},G.decrypt=function(L,v,m){for(var p=this.keySize+6,h=this.invKeySchedule,l=this.invSBox,f=this.invSubMix,o=f[0],u=f[1],a=f[2],s=f[3],R=this.uint8ArrayToUint32Array_(m),_=R[0],C=R[1],D=R[2],O=R[3],A=new Int32Array(L),S=new Int32Array(A.length),T,c,w,y,b,U,F,E,N,I,g,H,$,ie,oe=this.networkToHostOrderSwap;v<A.length;){for(N=oe(A[v]),I=oe(A[v+1]),g=oe(A[v+2]),H=oe(A[v+3]),b=N^h[0],U=H^h[1],F=g^h[2],E=I^h[3],$=4,ie=1;ie<p;ie++)T=o[b>>>24]^u[U>>16&255]^a[F>>8&255]^s[E&255]^h[$],c=o[U>>>24]^u[F>>16&255]^a[E>>8&255]^s[b&255]^h[$+1],w=o[F>>>24]^u[E>>16&255]^a[b>>8&255]^s[U&255]^h[$+2],y=o[E>>>24]^u[b>>16&255]^a[U>>8&255]^s[F&255]^h[$+3],b=T,U=c,F=w,E=y,$=$+4;T=l[b>>>24]<<24^l[U>>16&255]<<16^l[F>>8&255]<<8^l[E&255]^h[$],c=l[U>>>24]<<24^l[F>>16&255]<<16^l[E>>8&255]<<8^l[b&255]^h[$+1],w=l[F>>>24]<<24^l[E>>16&255]<<16^l[b>>8&255]<<8^l[U&255]^h[$+2],y=l[E>>>24]<<24^l[b>>16&255]<<16^l[U>>8&255]<<8^l[F&255]^h[$+3],S[v]=oe(T^_),S[v+1]=oe(y^C),S[v+2]=oe(w^D),S[v+3]=oe(c^O),_=N,C=I,D=g,O=H,v=v+4}return S.buffer},K}()},"./src/crypt/decrypter.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return v});var X=P("./src/crypt/aes-crypto.ts"),j=P("./src/crypt/fast-aes-key.ts"),B=P("./src/crypt/aes-decryptor.ts"),K=P("./src/utils/logger.ts"),G=P("./src/utils/mp4-tools.ts"),r=P("./src/utils/typed-array.ts"),L=16,v=function(){function m(h,l,f){var o=f===void 0?{}:f,u=o.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=l,this.removePKCS7Padding=a,a)try{var s=self.crypto;s&&(this.subtle=s.subtle||s.webkitSubtle)}catch(R){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var p=m.prototype;return p.destroy=function(){this.observer=null},p.isSync=function(){return this.config.enableSoftwareAES},p.flush=function(){var l=this.currentResult;if(!l){this.reset();return}var f=new Uint8Array(l);return this.reset(),this.removePKCS7Padding?Object(B.removePadding)(f):f},p.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},p.decrypt=function(l,f,o,u){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(l),f,o);var a=this.flush();a&&u(a.buffer)}else this.webCryptoDecrypt(new Uint8Array(l),f,o).then(u)},p.softwareDecrypt=function(l,f,o){var u=this.currentIV,a=this.currentResult,s=this.remainderData;this.logOnce("JS AES decrypt"),s&&(l=Object(G.appendUint8Array)(s,l),this.remainderData=null);var R=this.getValidChunk(l);if(!R.length)return null;u&&(o=u);var _=this.softwareDecrypter;_||(_=this.softwareDecrypter=new B.default),_.expandKey(f);var C=a;return this.currentResult=_.decrypt(R.buffer,0,o),this.currentIV=Object(r.sliceUint8)(R,-16).buffer,C||null},p.webCryptoDecrypt=function(l,f,o){var u=this,a=this.subtle;return(this.key!==f||!this.fastAesKey)&&(this.key=f,this.fastAesKey=new j.default(a,f)),this.fastAesKey.expandKey().then(function(s){if(!a)return Promise.reject(new Error("web crypto not initialized"));var R=new X.default(a,o);return R.decrypt(l.buffer,s)}).catch(function(s){return u.onWebCryptoError(s,l,f,o)})},p.onWebCryptoError=function(l,f,o,u){return K.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",l),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(f,o,u)},p.getValidChunk=function(l){var f=l,o=l.length-l.length%L;return o!==l.length&&(f=Object(r.sliceUint8)(l,0,o),this.remainderData=Object(r.sliceUint8)(l,o)),f},p.logOnce=function(l){if(!this.logEnabled)return;K.logger.log("[decrypter.ts]: "+l),this.logEnabled=!1},m}()},"./src/crypt/fast-aes-key.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return X});var X=function(){function j(K,G){this.subtle=void 0,this.key=void 0,this.subtle=K,this.key=G}var B=j.prototype;return B.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},j}()},"./src/demux/aacdemuxer.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/demux/base-audio-demuxer.ts"),j=P("./src/demux/adts.ts"),B=P("./src/utils/logger.ts"),K=P("./src/demux/id3.ts");function G(v,m){v.prototype=Object.create(m.prototype),v.prototype.constructor=v,r(v,m)}function r(v,m){return r=Object.setPrototypeOf||function(h,l){return h.__proto__=l,h},r(v,m)}var L=function(v){G(m,v);function m(h,l){var f;return f=v.call(this)||this,f.observer=void 0,f.config=void 0,f.observer=h,f.config=l,f}var p=m.prototype;return p.resetInitSegment=function(l,f,o){v.prototype.resetInitSegment.call(this,l,f,o),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:l,duration:o,inputTimeScale:9e4,dropped:0}},m.probe=function(l){if(!l)return!1;for(var f=K.getID3Data(l,0)||[],o=f.length,u=l.length;o<u;o++)if(j.probe(l,o))return B.logger.log("ADTS sync word found !"),!0;return!1},p.canParse=function(l,f){return j.canParse(l,f)},p.appendFrame=function(l,f,o){j.initTrackConfig(l,this.observer,f,o,l.manifestCodec);var u=j.appendFrame(l,f,o,this.initPTS,this.frameIndex);if(u&&u.missing===0)return u},m}(X.default);L.minProbeByteLength=9,J.default=L},"./src/demux/adts.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"getAudioConfig",function(){return K}),P.d(J,"isHeaderPattern",function(){return G}),P.d(J,"getHeaderLength",function(){return r}),P.d(J,"getFullFrameLength",function(){return L}),P.d(J,"canGetFrameLength",function(){return v}),P.d(J,"isHeader",function(){return m}),P.d(J,"canParse",function(){return p}),P.d(J,"probe",function(){return h}),P.d(J,"initTrackConfig",function(){return l}),P.d(J,"getFrameDuration",function(){return f}),P.d(J,"parseFrameHeader",function(){return o}),P.d(J,"appendFrame",function(){return u});var X=P("./src/utils/logger.ts"),j=P("./src/errors.ts"),B=P("./src/events.ts");function K(a,s,R,_){var C,D,O,A,S=navigator.userAgent.toLowerCase(),T=_,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];C=((s[R+2]&192)>>>6)+1;var w=(s[R+2]&60)>>>2;if(w>c.length-1){a.trigger(B.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+w});return}return O=(s[R+2]&1)<<2,O|=(s[R+3]&192)>>>6,X.logger.log("manifest codec:"+_+", ADTS type:"+C+", samplingIndex:"+w),/firefox/i.test(S)?w>=6?(C=5,A=new Array(4),D=w-3):(C=2,A=new Array(2),D=w):S.indexOf("android")!==-1?(C=2,A=new Array(2),D=w):(C=5,A=new Array(4),_&&(_.indexOf("mp4a.40.29")!==-1||_.indexOf("mp4a.40.5")!==-1)||!_&&w>=6?D=w-3:((_&&_.indexOf("mp4a.40.2")!==-1&&(w>=6&&O===1||/vivaldi/i.test(S))||!_&&O===1)&&(C=2,A=new Array(2)),D=w)),A[0]=C<<3,A[0]|=(w&14)>>1,A[1]|=(w&1)<<7,A[1]|=O<<3,C===5&&(A[1]|=(D&14)>>1,A[2]=(D&1)<<7,A[2]|=2<<2,A[3]=0),{config:A,samplerate:c[w],channelCount:O,codec:"mp4a.40."+C,manifestCodec:T}}function G(a,s){return a[s]===255&&(a[s+1]&246)===240}function r(a,s){return a[s+1]&1?7:9}function L(a,s){return(a[s+3]&3)<<11|a[s+4]<<3|(a[s+5]&224)>>>5}function v(a,s){return s+5<a.length}function m(a,s){return s+1<a.length&&G(a,s)}function p(a,s){return v(a,s)&&G(a,s)&&L(a,s)<=a.length-s}function h(a,s){if(m(a,s)){var R=r(a,s);if(s+R>=a.length)return!1;var _=L(a,s);if(_<=R)return!1;var C=s+_;return C===a.length||m(a,C)}return!1}function l(a,s,R,_,C){if(!a.samplerate){var D=K(s,R,_,C);if(!D)return;a.config=D.config,a.samplerate=D.samplerate,a.channelCount=D.channelCount,a.codec=D.codec,a.manifestCodec=D.manifestCodec,X.logger.log("parsed codec:"+a.codec+", rate:"+D.samplerate+", channels:"+D.channelCount)}}function f(a){return 1024*9e4/a}function o(a,s,R,_,C){var D=r(a,s),O=L(a,s);if(O-=D,O>0){var A=R+_*C;return{headerLength:D,frameLength:O,stamp:A}}}function u(a,s,R,_,C){var D=f(a.samplerate),O=o(s,R,_,C,D);if(O){var A=O.frameLength,S=O.headerLength,T=O.stamp,c=S+A,w=Math.max(0,R+c-s.length),y;w?(y=new Uint8Array(c-S),y.set(s.subarray(R+S,s.length),0)):y=s.subarray(R+S,R+c);var b={unit:y,pts:T};return w||a.samples.push(b),{sample:b,length:c,missing:w}}}},"./src/demux/base-audio-demuxer.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"initPTSFn",function(){return L});var X=P("./src/polyfills/number.ts"),j=P("./src/demux/id3.ts"),B=P("./src/demux/dummy-demuxed-track.ts"),K=P("./src/utils/mp4-tools.ts"),G=P("./src/utils/typed-array.ts"),r=function(){function v(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var m=v.prototype;return m.resetInitSegment=function(h,l,f){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},m.resetTimeStamp=function(){},m.resetContiguity=function(){},m.canParse=function(h,l){return!1},m.appendFrame=function(h,l,f){},m.demux=function(h,l){this.cachedData&&(h=Object(K.appendUint8Array)(this.cachedData,h),this.cachedData=null);var f=j.getID3Data(h,0),o=f?f.length:0,u,a,s=this._audioTrack,R=this._id3Track,_=f?j.getTimeStamp(f):void 0,C=h.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=L(_,l)),f&&f.length>0&&R.samples.push({pts:this.initPTS,dts:this.initPTS,data:f}),a=this.initPTS;o<C;){if(this.canParse(h,o)){var D=this.appendFrame(s,h,o);D?(this.frameIndex++,a=D.sample.pts,o+=D.length,u=o):o=C}else j.canParse(h,o)?(f=j.getID3Data(h,o),R.samples.push({pts:a,dts:a,data:f}),o+=f.length,u=o):o++;if(o===C&&u!==C){var O=Object(G.sliceUint8)(h,u);this.cachedData?this.cachedData=Object(K.appendUint8Array)(this.cachedData,O):this.cachedData=O}}return{audioTrack:s,avcTrack:Object(B.dummyTrack)(),id3Track:R,textTrack:Object(B.dummyTrack)()}},m.demuxSampleAes=function(h,l,f){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},m.flush=function(h){var l=this.cachedData;return l&&(this.cachedData=null,this.demux(l,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(B.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(B.dummyTrack)()}},m.destroy=function(){},v}(),L=function(m,p){return Object(X.isFiniteNumber)(m)?m*90:p*9e4};J.default=r},"./src/demux/chunk-cache.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return X});var X=function(){function B(){this.chunks=[],this.dataLength=0}var K=B.prototype;return K.push=function(r){this.chunks.push(r),this.dataLength+=r.length},K.flush=function(){var r=this.chunks,L=this.dataLength,v;if(r.length)r.length===1?v=r[0]:v=j(r,L);else return new Uint8Array(0);return this.reset(),v},K.reset=function(){this.chunks.length=0,this.dataLength=0},B}();function j(B,K){for(var G=new Uint8Array(K),r=0,L=0;L<B.length;L++){var v=B[L];G.set(v,r),r+=v.length}return G}},"./src/demux/dummy-demuxed-track.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"dummyTrack",function(){return X});function X(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/utils/logger.ts"),j=function(){function B(G){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=G,this.bytesAvailable=G.byteLength,this.word=0,this.bitsAvailable=0}var K=B.prototype;return K.loadWord=function(){var r=this.data,L=this.bytesAvailable,v=r.byteLength-L,m=new Uint8Array(4),p=Math.min(4,L);if(p===0)throw new Error("no bytes available");m.set(r.subarray(v,v+p)),this.word=new DataView(m.buffer).getUint32(0),this.bitsAvailable=p*8,this.bytesAvailable-=p},K.skipBits=function(r){var L;this.bitsAvailable>r?(this.word<<=r,this.bitsAvailable-=r):(r-=this.bitsAvailable,L=r>>3,r-=L>>3,this.bytesAvailable-=L,this.loadWord(),this.word<<=r,this.bitsAvailable-=r)},K.readBits=function(r){var L=Math.min(this.bitsAvailable,r),v=this.word>>>32-L;return r>32&&X.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=L,this.bitsAvailable>0?this.word<<=L:this.bytesAvailable>0&&this.loadWord(),L=r-L,L>0&&this.bitsAvailable?v<<L|this.readBits(L):v},K.skipLZ=function(){var r;for(r=0;r<this.bitsAvailable;++r)if((this.word&2147483648>>>r)!==0)return this.word<<=r,this.bitsAvailable-=r,r;return this.loadWord(),r+this.skipLZ()},K.skipUEG=function(){this.skipBits(1+this.skipLZ())},K.skipEG=function(){this.skipBits(1+this.skipLZ())},K.readUEG=function(){var r=this.skipLZ();return this.readBits(r+1)-1},K.readEG=function(){var r=this.readUEG();return 1&r?1+r>>>1:-1*(r>>>1)},K.readBoolean=function(){return this.readBits(1)===1},K.readUByte=function(){return this.readBits(8)},K.readUShort=function(){return this.readBits(16)},K.readUInt=function(){return this.readBits(32)},K.skipScalingList=function(r){for(var L=8,v=8,m,p=0;p<r;p++)v!==0&&(m=this.readEG(),v=(L+m+256)%256),L=v===0?L:v},K.readSPS=function(){var r=0,L=0,v=0,m=0,p,h,l,f=this.readUByte.bind(this),o=this.readBits.bind(this),u=this.readUEG.bind(this),a=this.readBoolean.bind(this),s=this.skipBits.bind(this),R=this.skipEG.bind(this),_=this.skipUEG.bind(this),C=this.skipScalingList.bind(this);f();var D=f();if(o(5),s(3),f(),_(),D===100||D===110||D===122||D===244||D===44||D===83||D===86||D===118||D===128){var O=u();if(O===3&&s(1),_(),_(),s(1),a())for(h=O!==3?8:12,l=0;l<h;l++)a()&&(l<6?C(16):C(64))}_();var A=u();if(A===0)u();else if(A===1)for(s(1),R(),R(),p=u(),l=0;l<p;l++)R();_(),s(1);var S=u(),T=u(),c=o(1);c===0&&s(1),s(1),a()&&(r=u(),L=u(),v=u(),m=u());var w=[1,1];if(a()&&a()){var y=f();switch(y){case 1:w=[1,1];break;case 2:w=[12,11];break;case 3:w=[10,11];break;case 4:w=[16,11];break;case 5:w=[40,33];break;case 6:w=[24,11];break;case 7:w=[20,11];break;case 8:w=[32,11];break;case 9:w=[80,33];break;case 10:w=[18,11];break;case 11:w=[15,11];break;case 12:w=[64,33];break;case 13:w=[160,99];break;case 14:w=[4,3];break;case 15:w=[3,2];break;case 16:w=[2,1];break;case 255:{w=[f()<<8|f(),f()<<8|f()];break}}}return{width:Math.ceil((S+1)*16-r*2-L*2),height:(2-c)*(T+1)*16-(c?2:4)*(v+m),pixelRatio:w}},K.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},B}();J.default=j},"./src/demux/id3.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"isHeader",function(){return X}),P.d(J,"isFooter",function(){return j}),P.d(J,"getID3Data",function(){return B}),P.d(J,"canParse",function(){return G}),P.d(J,"getTimeStamp",function(){return r}),P.d(J,"isTimeStampFrame",function(){return L}),P.d(J,"getID3Frames",function(){return m}),P.d(J,"decodeFrame",function(){return p}),P.d(J,"utf8ArrayToStr",function(){return u}),P.d(J,"testables",function(){return a});var X=function(C,D){return D+10<=C.length&&(C[D]===73&&C[D+1]===68&&C[D+2]===51&&(C[D+3]<255&&C[D+4]<255&&(C[D+6]<128&&C[D+7]<128&&C[D+8]<128&&C[D+9]<128)))},j=function(C,D){return D+10<=C.length&&(C[D]===51&&C[D+1]===68&&C[D+2]===73&&(C[D+3]<255&&C[D+4]<255&&(C[D+6]<128&&C[D+7]<128&&C[D+8]<128&&C[D+9]<128)))},B=function(C,D){for(var O=D,A=0;X(C,D);){A+=10;var S=K(C,D+6);A+=S,j(C,D+10)&&(A+=10),D+=A}return A>0?C.subarray(O,O+A):void 0},K=function(C,D){var O=0;return O=(C[D]&127)<<21,O|=(C[D+1]&127)<<14,O|=(C[D+2]&127)<<7,O|=C[D+3]&127,O},G=function(C,D){return X(C,D)&&K(C,D+6)+10<=C.length-D},r=function(C){for(var D=m(C),O=0;O<D.length;O++){var A=D[O];if(L(A))return o(A)}return},L=function(C){return C&&C.key==="PRIV"&&C.info==="com.apple.streaming.transportStreamTimestamp"},v=function(C){var D=String.fromCharCode(C[0],C[1],C[2],C[3]),O=K(C,4),A=10;return{type:D,size:O,data:C.subarray(A,A+O)}},m=function(C){for(var D=0,O=[];X(C,D);){var A=K(C,D+6);D+=10;for(var S=D+A;D+8<S;){var T=v(C.subarray(D)),c=p(T);c&&O.push(c),D+=T.size+10}j(C,D)&&(D+=10)}return O},p=function(C){return C.type==="PRIV"?h(C):C.type[0]==="W"?f(C):l(C)},h=function(C){if(C.size<2)return;var D=u(C.data,!0),O=new Uint8Array(C.data.subarray(D.length+1));return{key:C.type,info:D,data:O.buffer}},l=function(C){if(C.size<2)return;if(C.type==="TXXX"){var D=1,O=u(C.data.subarray(D),!0);D+=O.length+1;var A=u(C.data.subarray(D));return{key:C.type,info:O,data:A}}var S=u(C.data.subarray(1));return{key:C.type,data:S}},f=function(C){if(C.type==="WXXX"){if(C.size<2)return;var D=1,O=u(C.data.subarray(D),!0);D+=O.length+1;var A=u(C.data.subarray(D));return{key:C.type,info:O,data:A}}var S=u(C.data);return{key:C.type,data:S}},o=function(C){if(C.data.byteLength===8){var D=new Uint8Array(C.data),O=D[3]&1,A=(D[4]<<23)+(D[5]<<15)+(D[6]<<7)+D[7];return A/=45,O&&(A+=4772185884e-2),Math.round(A)}return},u=function(C,D){D===void 0&&(D=!1);var O=R();if(O){var A=O.decode(C);if(D){var S=A.indexOf("\0");return S!==-1?A.substring(0,S):A}return A.replace(/\0/g,"")}for(var T=C.length,c,w,y,b="",U=0;U<T;){if(c=C[U++],c===0&&D)return b;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:b+=String.fromCharCode(c);break;case 12:case 13:w=C[U++],b+=String.fromCharCode((c&31)<<6|w&63);break;case 14:w=C[U++],y=C[U++],b+=String.fromCharCode((c&15)<<12|(w&63)<<6|(y&63)<<0);break;default:}}return b},a={decodeTextFrame:l},s;function R(){return!s&&typeof self.TextDecoder!="undefined"&&(s=new self.TextDecoder("utf-8")),s}},"./src/demux/mp3demuxer.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/demux/base-audio-demuxer.ts"),j=P("./src/demux/id3.ts"),B=P("./src/utils/logger.ts"),K=P("./src/demux/mpegaudio.ts");function G(v,m){v.prototype=Object.create(m.prototype),v.prototype.constructor=v,r(v,m)}function r(v,m){return r=Object.setPrototypeOf||function(h,l){return h.__proto__=l,h},r(v,m)}var L=function(v){G(m,v);function m(){return v.apply(this,arguments)||this}var p=m.prototype;return p.resetInitSegment=function(l,f,o){v.prototype.resetInitSegment.call(this,l,f,o),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:l,duration:o,inputTimeScale:9e4,dropped:0}},m.probe=function(l){if(!l)return!1;for(var f=j.getID3Data(l,0)||[],o=f.length,u=l.length;o<u;o++)if(K.probe(l,o))return B.logger.log("MPEG Audio sync word found !"),!0;return!1},p.canParse=function(l,f){return K.canParse(l,f)},p.appendFrame=function(l,f,o){return this.initPTS===null?void 0:K.appendFrame(l,f,o,this.initPTS,this.frameIndex)},m}(X.default);L.minProbeByteLength=4,J.default=L},"./src/demux/mp4demuxer.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/utils/mp4-tools.ts"),j=P("./src/demux/dummy-demuxed-track.ts"),B=function(){function K(r,L){this.remainderData=null,this.config=void 0,this.config=L}var G=K.prototype;return G.resetTimeStamp=function(){},G.resetInitSegment=function(){},G.resetContiguity=function(){},K.probe=function(L){return Object(X.findBox)({data:L,start:0,end:Math.min(L.length,16384)},["moof"]).length>0},G.demux=function(L){var v=L,m=Object(j.dummyTrack)();if(this.config.progressive){this.remainderData&&(v=Object(X.appendUint8Array)(this.remainderData,L));var p=Object(X.segmentValidRange)(v);this.remainderData=p.remainder,m.samples=p.valid||new Uint8Array}else m.samples=v;return{audioTrack:Object(j.dummyTrack)(),avcTrack:m,id3Track:Object(j.dummyTrack)(),textTrack:Object(j.dummyTrack)()}},G.flush=function(){var L=Object(j.dummyTrack)();return L.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(j.dummyTrack)(),avcTrack:L,id3Track:Object(j.dummyTrack)(),textTrack:Object(j.dummyTrack)()}},G.demuxSampleAes=function(L,v,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},G.destroy=function(){},K}();B.minProbeByteLength=1024,J.default=B},"./src/demux/mpegaudio.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"appendFrame",function(){return r}),P.d(J,"parseHeader",function(){return L}),P.d(J,"isHeaderPattern",function(){return v}),P.d(J,"isHeader",function(){return m}),P.d(J,"canParse",function(){return p}),P.d(J,"probe",function(){return h});var X=null,j=[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],B=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],K=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],G=[0,1,1,4];function r(l,f,o,u,a){if(o+24>f.length)return;var s=L(f,o);if(s&&o+s.frameLength<=f.length){var R=s.samplesPerFrame*9e4/s.sampleRate,_=u+a*R,C={unit:f.subarray(o,o+s.frameLength),pts:_,dts:_};return l.config=[],l.channelCount=s.channelCount,l.samplerate=s.sampleRate,l.samples.push(C),{sample:C,length:s.frameLength,missing:0}}}function L(l,f){var o=l[f+1]>>3&3,u=l[f+1]>>1&3,a=l[f+2]>>4&15,s=l[f+2]>>2&3;if(o!==1&&a!==0&&a!==15&&s!==3){var R=l[f+2]>>1&1,_=l[f+3]>>6,C=o===3?3-u:u===3?3:4,D=j[C*14+a-1]*1e3,O=o===3?0:o===2?1:2,A=B[O*3+s],S=_===3?1:2,T=K[o][u],c=G[u],w=T*8*c,y=Math.floor(T*D/A+R)*c;if(X===null){var b=navigator.userAgent||"",U=b.match(/Chrome\/(\d+)/i);X=U?parseInt(U[1]):0}var F=!!X&&X<=87;return F&&u===2&&D>=224e3&&_===0&&(l[f+3]=l[f+3]|128),{sampleRate:A,channelCount:S,frameLength:y,samplesPerFrame:w}}}function v(l,f){return l[f]===255&&(l[f+1]&224)===224&&(l[f+1]&6)!==0}function m(l,f){return f+1<l.length&&v(l,f)}function p(l,f){var o=4;return v(l,f)&&o<=l.length-f}function h(l,f){if(f+1<l.length&&v(l,f)){var o=4,u=L(l,f),a=o;u!=null&&u.frameLength&&(a=u.frameLength);var s=f+a;return s===l.length||m(l,s)}return!1}},"./src/demux/sample-aes.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/crypt/decrypter.ts"),j=P("./src/demux/tsdemuxer.ts"),B=function(){function K(r,L,v){this.keyData=void 0,this.decrypter=void 0,this.keyData=v,this.decrypter=new X.default(r,L,{removePKCS7Padding:!1})}var G=K.prototype;return G.decryptBuffer=function(L,v){this.decrypter.decrypt(L,this.keyData.key.buffer,this.keyData.iv.buffer,v)},G.decryptAacSample=function(L,v,m,p){var h=L[v].unit,l=h.subarray(16,h.length-h.length%16),f=l.buffer.slice(l.byteOffset,l.byteOffset+l.length),o=this;this.decryptBuffer(f,function(u){var a=new Uint8Array(u);h.set(a,16),p||o.decryptAacSamples(L,v+1,m)})},G.decryptAacSamples=function(L,v,m){for(;;v++){if(v>=L.length){m();return}if(L[v].unit.length<32)continue;var p=this.decrypter.isSync();if(this.decryptAacSample(L,v,m,p),!p)return}},G.getAvcEncryptedData=function(L){for(var v=Math.floor((L.length-48)/160)*16+16,m=new Int8Array(v),p=0,h=32;h<=L.length-16;h+=160,p+=16)m.set(L.subarray(h,h+16),p);return m},G.getAvcDecryptedUnit=function(L,v){for(var m=new Uint8Array(v),p=0,h=32;h<=L.length-16;h+=160,p+=16)L.set(m.subarray(p,p+16),h);return L},G.decryptAvcSample=function(L,v,m,p,h,l){var f=Object(j.discardEPB)(h.data),o=this.getAvcEncryptedData(f),u=this;this.decryptBuffer(o.buffer,function(a){h.data=u.getAvcDecryptedUnit(f,a),l||u.decryptAvcSamples(L,v,m+1,p)})},G.decryptAvcSamples=function(L,v,m,p){if(L instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;v++,m=0){if(v>=L.length){p();return}for(var h=L[v].units;!(m>=h.length);m++){var l=h[m];if(l.data.length<=48||l.type!==1&&l.type!==5)continue;var f=this.decrypter.isSync();if(this.decryptAvcSample(L,v,m,p,l,f),!f)return}}},K}();J.default=B},"./src/demux/transmuxer-interface.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return h});var X=P("./node_modules/webworkify-webpack/index.js"),j=P.n(X),B=P("./src/events.ts"),K=P("./src/demux/transmuxer.ts"),G=P("./src/utils/logger.ts"),r=P("./src/errors.ts"),L=P("./src/utils/mediasource-helper.ts"),v=P("./node_modules/eventemitter3/index.js"),m=P.n(v),p=Object(L.getMediaSource)()||{isTypeSupported:function(){return!1}},h=function(){function l(o,u,a,s){var R=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=o,this.id=u,this.onTransmuxComplete=a,this.onFlush=s;var _=o.config,C=function(T,c){c=c||{},c.frag=R.frag,c.id=R.id,o.trigger(T,c)};this.observer=new v.EventEmitter,this.observer.on(B.Events.FRAG_DECRYPTED,C),this.observer.on(B.Events.ERROR,C);var D={mp4:p.isTypeSupported("video/mp4"),mpeg:p.isTypeSupported("audio/mpeg"),mp3:p.isTypeSupported('audio/mp4; codecs="mp3"')},O=navigator.vendor;if(_.enableWorker&&typeof Worker!="undefined"){G.logger.log("demuxing in webworker");var A;try{A=this.worker=X("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),A.addEventListener("message",this.onwmsg),A.onerror=function(S){o.trigger(B.Events.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(S.message+" ("+S.filename+":"+S.lineno+")")})},A.postMessage({cmd:"init",typeSupported:D,vendor:O,id:u,config:JSON.stringify(_)})}catch(S){G.logger.warn("Error in worker:",S),G.logger.error("Error while initializing DemuxerWorker, fallback to inline"),A&&self.URL.revokeObjectURL(A.objectURL),this.transmuxer=new K.default(this.observer,D,_,O,u),this.worker=null}}else this.transmuxer=new K.default(this.observer,D,_,O,u)}var f=l.prototype;return f.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},f.push=function(u,a,s,R,_,C,D,O,A,S){var T=this;A.transmuxing.start=self.performance.now();var c=this.transmuxer,w=this.worker,y=C?C.start:_.start,b=_.decryptdata,U=this.frag,F=!(U&&_.cc===U.cc),E=!(U&&A.level===U.level),N=U?A.sn-U.sn:-1,I=this.part?A.part-this.part.index:1,g=!E&&(N===1||N===0&&I===1),H=self.performance.now();(E||N||_.stats.parsing.start===0)&&(_.stats.parsing.start=H),C&&(I||!g)&&(C.stats.parsing.start=H);var $=new K.TransmuxState(F,g,O,E,y);if(!g||F){G.logger.log("[transmuxer-interface, "+_.type+"]: Starting new transmux session for sn: "+A.sn+" p: "+A.part+" level: "+A.level+" id: "+A.id+`
discontinuity: `+F+`
trackSwitch: `+E+`
contiguous: `+g+`
accurateTimeOffset: `+O+`
timeOffset: `+y);var ie=new K.TransmuxConfig(s,R,a,D,S);this.configureTransmuxer(ie)}if(this.frag=_,this.part=C,w)w.postMessage({cmd:"demux",data:u,decryptdata:b,chunkMeta:A,state:$},u instanceof ArrayBuffer?[u]:[]);else if(c){var oe=c.push(u,b,A,$);Object(K.isPromise)(oe)?oe.then(function(Ce){T.handleTransmuxComplete(Ce)}):this.handleTransmuxComplete(oe)}},f.flush=function(u){var a=this;u.transmuxing.start=self.performance.now();var s=this.transmuxer,R=this.worker;if(R)R.postMessage({cmd:"flush",chunkMeta:u});else if(s){var _=s.flush(u);Object(K.isPromise)(_)?_.then(function(C){a.handleFlushResult(C,u)}):this.handleFlushResult(_,u)}},f.handleFlushResult=function(u,a){var s=this;u.forEach(function(R){s.handleTransmuxComplete(R)}),this.onFlush(a)},f.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}}},f.configureTransmuxer=function(u){var a=this.worker,s=this.transmuxer;a?a.postMessage({cmd:"configure",config:u}):s&&s.configure(u)},f.handleTransmuxComplete=function(u){u.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(u)},l}()},"./src/demux/transmuxer-worker.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return r});var X=P("./src/demux/transmuxer.ts"),j=P("./src/events.ts"),B=P("./src/utils/logger.ts"),K=P("./node_modules/eventemitter3/index.js"),G=P.n(K);function r(h){var l=new K.EventEmitter,f=function(u,a){h.postMessage({event:u,data:a})};l.on(j.Events.FRAG_DECRYPTED,f),l.on(j.Events.ERROR,f),h.addEventListener("message",function(o){var u=o.data;switch(u.cmd){case"init":{var a=JSON.parse(u.config);h.transmuxer=new X.default(l,u.typeSupported,a,u.vendor,u.id),Object(B.enableLogs)(a.debug),f("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(X.isPromise)(s)?s.then(function(C){L(h,C)}):L(h,s);break}case"flush":{var R=u.chunkMeta,_=h.transmuxer.flush(R);Object(X.isPromise)(_)?_.then(function(C){m(h,C,R)}):m(h,_,R);break}default:break}})}function L(h,l){if(p(l.remuxResult))return;var f=[],o=l.remuxResult,u=o.audio,a=o.video;u&&v(f,u),a&&v(f,a),h.postMessage({event:"transmuxComplete",data:l},f)}function v(h,l){l.data1&&h.push(l.data1.buffer),l.data2&&h.push(l.data2.buffer)}function m(h,l,f){l.forEach(function(o){L(h,o)}),h.postMessage({event:"flush",data:f})}function p(h){return!h.audio&&!h.video&&!h.text&&!h.id3&&!h.initSegment}},"./src/demux/transmuxer.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return a}),P.d(J,"isPromise",function(){return _}),P.d(J,"TransmuxConfig",function(){return C}),P.d(J,"TransmuxState",function(){return D});var X=P("./src/events.ts"),j=P("./src/errors.ts"),B=P("./src/crypt/decrypter.ts"),K=P("./src/demux/aacdemuxer.ts"),G=P("./src/demux/mp4demuxer.ts"),r=P("./src/demux/tsdemuxer.ts"),L=P("./src/demux/mp3demuxer.ts"),v=P("./src/remux/mp4-remuxer.ts"),m=P("./src/remux/passthrough-remuxer.ts"),p=P("./src/demux/chunk-cache.ts"),h=P("./src/utils/mp4-tools.ts"),l=P("./src/utils/logger.ts"),f;try{f=self.performance.now.bind(self.performance)}catch(O){l.logger.debug("Unable to use Performance API on this environment"),f=self.Date.now}var o=[{demux:r.default,remux:v.default},{demux:G.default,remux:m.default},{demux:K.default,remux:v.default},{demux:L.default,remux:v.default}],u=1024;o.forEach(function(O){var A=O.demux;u=Math.max(u,A.minProbeByteLength)});var a=function(){function O(S,T,c,w,y){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 p.default,this.observer=S,this.typeSupported=T,this.config=c,this.vendor=w,this.id=y}var A=O.prototype;return A.configure=function(T){this.transmuxConfig=T,this.decrypter&&this.decrypter.reset()},A.push=function(T,c,w,y){var b=this,U=w.transmuxing;U.executeStart=f();var F=new Uint8Array(T),E=this.cache,N=this.config,I=this.currentTransmuxState,g=this.transmuxConfig;y&&(this.currentTransmuxState=y);var H=s(F,c);if(H&&H.method==="AES-128"){var $=this.getDecrypter();if(N.enableSoftwareAES){var ie=$.softwareDecrypt(F,H.key.buffer,H.iv.buffer);if(!ie)return U.executeEnd=f(),R(w);F=new Uint8Array(ie)}else return this.decryptionPromise=$.webCryptoDecrypt(F,H.key.buffer,H.iv.buffer).then(function(Pe){var je=b.push(Pe,null,w);return b.decryptionPromise=null,je}),this.decryptionPromise}var oe=y||I,Ce=oe.contiguous,ve=oe.discontinuity,Se=oe.trackSwitch,Ae=oe.accurateTimeOffset,Oe=oe.timeOffset,he=g.audioCodec,ce=g.videoCodec,re=g.defaultInitPts,fe=g.duration,se=g.initSegmentData;if((ve||Se)&&this.resetInitSegment(se,he,ce,fe),ve&&this.resetInitialTimestamp(re),Ce||this.resetContiguity(),this.needsProbing(F,ve,Se)){if(E.dataLength){var ke=E.flush();F=Object(h.appendUint8Array)(ke,F)}this.configureTransmuxer(F,g)}var Ne=this.transmux(F,H,Oe,Ae,w),Re=this.currentTransmuxState;return Re.contiguous=!0,Re.discontinuity=!1,Re.trackSwitch=!1,U.executeEnd=f(),Ne},A.flush=function(T){var c=this,w=T.transmuxing;w.executeStart=f();var y=this.decrypter,b=this.cache,U=this.currentTransmuxState,F=this.decryptionPromise;if(F)return F.then(function(){return c.flush(T)});var E=[],N=U.timeOffset;if(y){var I=y.flush();I&&E.push(this.push(I,null,T))}var g=b.dataLength;b.reset();var H=this.demuxer,$=this.remuxer;if(!H||!$)return g>=u&&this.observer.emit(X.Events.ERROR,X.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),w.executeEnd=f(),[R(T)];var ie=H.flush(N);return _(ie)?ie.then(function(oe){return c.flushRemux(E,oe,T),E}):(this.flushRemux(E,ie,T),E)},A.flushRemux=function(T,c,w){var y=c.audioTrack,b=c.avcTrack,U=c.id3Track,F=c.textTrack,E=this.currentTransmuxState,N=E.accurateTimeOffset,I=E.timeOffset;l.logger.log("[transmuxer.ts]: Flushed fragment "+w.sn+(w.part>-1?" p: "+w.part:"")+" of level "+w.level);var g=this.remuxer.remux(y,b,U,F,I,N,!0,this.id);T.push({remuxResult:g,chunkMeta:w}),w.transmuxing.executeEnd=f()},A.resetInitialTimestamp=function(T){var c=this.demuxer,w=this.remuxer;if(!c||!w)return;c.resetTimeStamp(T),w.resetTimeStamp(T)},A.resetContiguity=function(){var T=this.demuxer,c=this.remuxer;if(!T||!c)return;T.resetContiguity(),c.resetNextTimestamp()},A.resetInitSegment=function(T,c,w,y){var b=this.demuxer,U=this.remuxer;if(!b||!U)return;b.resetInitSegment(c,w,y),U.resetInitSegment(T,c,w)},A.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},A.transmux=function(T,c,w,y,b){var U;return c&&c.method==="SAMPLE-AES"?U=this.transmuxSampleAes(T,c,w,y,b):U=this.transmuxUnencrypted(T,w,y,b),U},A.transmuxUnencrypted=function(T,c,w,y){var b=this.demuxer.demux(T,c,!1,!this.config.progressive),U=b.audioTrack,F=b.avcTrack,E=b.id3Track,N=b.textTrack,I=this.remuxer.remux(U,F,E,N,c,w,!1,this.id);return{remuxResult:I,chunkMeta:y}},A.transmuxSampleAes=function(T,c,w,y,b){var U=this;return this.demuxer.demuxSampleAes(T,c,w).then(function(F){var E=U.remuxer.remux(F.audioTrack,F.avcTrack,F.id3Track,F.textTrack,w,y,!1,U.id);return{remuxResult:E,chunkMeta:b}})},A.configureTransmuxer=function(T,c){for(var w=this.config,y=this.observer,b=this.typeSupported,U=this.vendor,F=c.audioCodec,E=c.defaultInitPts,N=c.duration,I=c.initSegmentData,g=c.videoCodec,H,$=0,ie=o.length;$<ie;$++)if(o[$].demux.probe(T)){H=o[$];break}H||(l.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),H={demux:G.default,remux:m.default});var oe=this.demuxer,Ce=this.remuxer,ve=H.remux,Se=H.demux;(!Ce||!(Ce instanceof ve))&&(this.remuxer=new ve(y,w,b,U)),(!oe||!(oe instanceof Se))&&(this.demuxer=new Se(y,w,b),this.probe=Se.probe),this.resetInitSegment(I,F,g,N),this.resetInitialTimestamp(E)},A.needsProbing=function(T,c,w){return!this.demuxer||!this.remuxer||c||w},A.getDecrypter=function(){var T=this.decrypter;return T||(T=this.decrypter=new B.default(this.observer,this.config)),T},O}();function s(O,A){var S=null;return O.byteLength>0&&A!=null&&A.key!=null&&A.iv!==null&&A.method!=null&&(S=A),S}var R=function(A){return{remuxResult:{},chunkMeta:A}};function _(O){return"then"in O&&O.then instanceof Function}var C=function(A,S,T,c,w){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=A,this.videoCodec=S,this.initSegmentData=T,this.duration=c,this.defaultInitPts=w},D=function(A,S,T,c,w){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=A,this.contiguous=S,this.accurateTimeOffset=T,this.trackSwitch=c,this.timeOffset=w}},"./src/demux/tsdemuxer.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"discardEPB",function(){return R});var X=P("./src/demux/adts.ts"),j=P("./src/demux/mpegaudio.ts"),B=P("./src/demux/exp-golomb.ts"),K=P("./src/demux/id3.ts"),G=P("./src/demux/sample-aes.ts"),r=P("./src/events.ts"),L=P("./src/utils/mp4-tools.ts"),v=P("./src/utils/logger.ts"),m=P("./src/errors.ts"),p={video:1,audio:2,id3:3,text:4},h=function(){function _(D,O,A){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=D,this.config=O,this.typeSupported=A}_.probe=function(O){var A=_.syncOffset(O);return A<0?!1:(A&&v.logger.warn("MPEG2-TS detected but first sync word found @ offset "+A+", junk ahead ?"),!0)},_.syncOffset=function(O){for(var A=Math.min(1e3,O.length-3*188),S=0;S<A;){if(O[S]===71&&O[S+188]===71&&O[S+2*188]===71)return S;S++}return-1},_.createTrack=function(O,A){return{container:O==="video"||O==="audio"?"video/mp2t":void 0,type:O,id:p[O],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:O==="audio"?A:void 0}};var C=_.prototype;return C.resetInitSegment=function(O,A,S){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=_.createTrack("video",S),this._audioTrack=_.createTrack("audio",S),this._id3Track=_.createTrack("id3",S),this._txtTrack=_.createTrack("text",S),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=O,this.videoCodec=A,this._duration=S},C.resetTimeStamp=function(){},C.resetContiguity=function(){var O=this._audioTrack,A=this._avcTrack,S=this._id3Track;O&&(O.pesData=null),A&&(A.pesData=null),S&&(S.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},C.demux=function(O,A,S,T){S===void 0&&(S=!1),T===void 0&&(T=!1),S||(this.sampleAes=null);var c,w=this._avcTrack,y=this._audioTrack,b=this._id3Track,U=w.pid,F=w.pesData,E=y.pid,N=b.pid,I=y.pesData,g=b.pesData,H=!1,$=this.pmtParsed,ie=this._pmtId,oe=O.length;if(this.remainderData&&(O=Object(L.appendUint8Array)(this.remainderData,O),oe=O.length,this.remainderData=null),oe<188&&!T)return this.remainderData=O,{audioTrack:y,avcTrack:w,id3Track:b,textTrack:this._txtTrack};var Ce=Math.max(0,_.syncOffset(O));oe-=(oe+Ce)%188,oe<O.byteLength&&!T&&(this.remainderData=new Uint8Array(O.buffer,oe,O.buffer.byteLength-oe));for(var ve=Ce;ve<oe;ve+=188)if(O[ve]===71){var Se=!!(O[ve+1]&64),Ae=((O[ve+1]&31)<<8)+O[ve+2],Oe=(O[ve+3]&48)>>4,he=void 0;if(Oe>1){if(he=ve+5+O[ve+4],he===ve+188)continue}else he=ve+4;switch(Ae){case U:Se&&(F&&(c=u(F))&&this.parseAVCPES(c,!1),F={data:[],size:0}),F&&(F.data.push(O.subarray(he,ve+188)),F.size+=ve+188-he);break;case E:Se&&(I&&(c=u(I))&&(y.isAAC?this.parseAACPES(c):this.parseMPEGPES(c)),I={data:[],size:0}),I&&(I.data.push(O.subarray(he,ve+188)),I.size+=ve+188-he);break;case N:Se&&(g&&(c=u(g))&&this.parseID3PES(c),g={data:[],size:0}),g&&(g.data.push(O.subarray(he,ve+188)),g.size+=ve+188-he);break;case 0:Se&&(he+=O[he]+1),ie=this._pmtId=f(O,he);break;case ie:{Se&&(he+=O[he]+1);var ce=o(O,he,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,S);U=ce.avc,U>0&&(w.pid=U),E=ce.audio,E>0&&(y.pid=E,y.isAAC=ce.isAAC),N=ce.id3,N>0&&(b.pid=N),H&&!$&&(v.logger.log("reparse from beginning"),H=!1,ve=Ce-188),$=this.pmtParsed=!0;break}case 17:case 8191:break;default:H=!0;break}}else this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});w.pesData=F,y.pesData=I,b.pesData=g;var re={audioTrack:y,avcTrack:w,id3Track:b,textTrack:this._txtTrack};return T&&this.extractRemainingSamples(re),re},C.flush=function(){var O=this.remainderData;this.remainderData=null;var A;return O?A=this.demux(O,-1,!1,!0):A={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(A),this.sampleAes?this.decrypt(A,this.sampleAes):A},C.extractRemainingSamples=function(O){var A=O.audioTrack,S=O.avcTrack,T=O.id3Track,c=S.pesData,w=A.pesData,y=T.pesData,b;c&&(b=u(c))?(this.parseAVCPES(b,!0),S.pesData=null):S.pesData=c,w&&(b=u(w))?(A.isAAC?this.parseAACPES(b):this.parseMPEGPES(b),A.pesData=null):(w!=null&&w.size&&v.logger.log("last AAC PES packet truncated,might overlap between fragments"),A.pesData=w),y&&(b=u(y))?(this.parseID3PES(b),T.pesData=null):T.pesData=y},C.demuxSampleAes=function(O,A,S){var T=this.demux(O,S,!0,!this.config.progressive),c=this.sampleAes=new G.default(this.observer,this.config,A);return this.decrypt(T,c)},C.decrypt=function(O,A){return new Promise(function(S){var T=O.audioTrack,c=O.avcTrack;T.samples&&T.isAAC?A.decryptAacSamples(T.samples,0,function(){c.samples?A.decryptAvcSamples(c.samples,0,0,function(){S(O)}):S(O)}):c.samples&&A.decryptAvcSamples(c.samples,0,0,function(){S(O)})})},C.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},C.parseAVCPES=function(O,A){var S=this,T=this._avcTrack,c=this.parseAVCNALu(O.data),w=!1,y=this.avcSample,b,U=!1;O.data=null,y&&c.length&&!T.audFound&&(a(y,T),y=this.avcSample=l(!1,O.pts,O.dts,"")),c.forEach(function(F){switch(F.type){case 1:{b=!0,y||(y=S.avcSample=l(!0,O.pts,O.dts,"")),w&&(y.debug+="NDR "),y.frame=!0;var E=F.data;if(U&&E.length>4){var N=new B.default(E).readSliceType();(N===2||N===4||N===7||N===9)&&(y.key=!0)}break}case 5:b=!0,y||(y=S.avcSample=l(!0,O.pts,O.dts,"")),w&&(y.debug+="IDR "),y.key=!0,y.frame=!0;break;case 6:{b=!0,w&&y&&(y.debug+="SEI ");var I=new B.default(R(F.data));I.readUByte();for(var g=0,H=0,$=!1,ie=0;!$&&I.bytesAvailable>1;){g=0;do ie=I.readUByte(),g+=ie;while(ie===255);H=0;do ie=I.readUByte(),H+=ie;while(ie===255);if(g===4&&I.bytesAvailable!==0){$=!0;var oe=I.readUByte();if(oe===181){var Ce=I.readUShort();if(Ce===49){var ve=I.readUInt();if(ve===1195456820){var Se=I.readUByte();if(Se===3){for(var Ae=I.readUByte(),Oe=I.readUByte(),he=31&Ae,ce=[Ae,Oe],re=0;re<he;re++)ce.push(I.readUByte()),ce.push(I.readUByte()),ce.push(I.readUByte());s(S._txtTrack.samples,{type:3,pts:O.pts,bytes:ce})}}}}}else if(g===5&&I.bytesAvailable!==0){if($=!0,H>16){for(var fe=[],se=0;se<16;se++)fe.push(I.readUByte().toString(16)),(se===3||se===5||se===7||se===9)&&fe.push("-");for(var ke=H-16,Ne=new Uint8Array(ke),Re=0;Re<ke;Re++)Ne[Re]=I.readUByte();s(S._txtTrack.samples,{pts:O.pts,payloadType:g,uuid:fe.join(""),userData:Object(K.utf8ArrayToStr)(Ne),userDataBytes:Ne})}}else if(H<I.bytesAvailable)for(var Pe=0;Pe<H;Pe++)I.readUByte()}break}case 7:if(b=!0,U=!0,w&&y&&(y.debug+="SPS "),!T.sps){var je=new B.default(F.data),ue=je.readSPS();T.width=ue.width,T.height=ue.height,T.pixelRatio=ue.pixelRatio,T.sps=[F.data],T.duration=S._duration;for(var Ee=F.data.subarray(1,4),Le="avc1.",Ie=0;Ie<3;Ie++){var Ge=Ee[Ie].toString(16);Ge.length<2&&(Ge="0"+Ge),Le+=Ge}T.codec=Le}break;case 8:b=!0,w&&y&&(y.debug+="PPS "),T.pps||(T.pps=[F.data]);break;case 9:b=!1,T.audFound=!0,y&&a(y,T),y=S.avcSample=l(!1,O.pts,O.dts,w?"AUD ":"");break;case 12:b=!1;break;default:b=!1,y&&(y.debug+="unknown NAL "+F.type+" ");break}if(y&&b){var Xe=y.units;Xe.push(F)}}),A&&y&&(a(y,T),this.avcSample=null)},C.getLastNalUnit=function(){var O,A=this.avcSample,S;if(!A||A.units.length===0){var T=this._avcTrack.samples;A=T[T.length-1]}if((O=A)!==null&&O!==void 0&&O.units){var c=A.units;S=c[c.length-1]}return S},C.parseAVCNALu=function(O){var A=O.byteLength,S=this._avcTrack,T=S.naluState||0,c=T,w=[],y=0,b,U,F,E=-1,N=0;for(T===-1&&(E=0,N=O[0]&31,T=0,y=1);y<A;){if(b=O[y++],!T){T=b?0:1;continue}if(T===1){T=b?0:2;continue}if(!b)T=3;else if(b===1){if(E>=0){var I={data:O.subarray(E,y-T-1),type:N};w.push(I)}else{var g=this.getLastNalUnit();if(g&&(c&&y<=4-c&&(g.state&&(g.data=g.data.subarray(0,g.data.byteLength-c))),U=y-T-1,U>0)){var H=new Uint8Array(g.data.byteLength+U);H.set(g.data,0),H.set(O.subarray(0,U),g.data.byteLength),g.data=H,g.state=0}}y<A?(F=O[y]&31,E=y,N=F,T=0):T=-1}else T=0}if(E>=0&&T>=0){var $={data:O.subarray(E,A),type:N,state:T};w.push($)}if(w.length===0){var ie=this.getLastNalUnit();if(ie){var oe=new Uint8Array(ie.data.byteLength+O.byteLength);oe.set(ie.data,0),oe.set(O,ie.data.byteLength),ie.data=oe}}return S.naluState=T,w},C.parseAACPES=function(O){var A=0,S=this._audioTrack,T=this.aacOverFlow,c=O.data;if(T){this.aacOverFlow=null;var w=T.sample.unit.byteLength,y=Math.min(T.missing,w),b=w-y;T.sample.unit.set(c.subarray(0,y),b),S.samples.push(T.sample),A=T.missing}var U,F;for(U=A,F=c.length;U<F-1&&!X.isHeader(c,U);U++);if(U!==A){var E,N;if(U<F-1?(E="AAC PES did not start with ADTS header,offset:"+U,N=!1):(E="no ADTS header found in AAC PES",N=!0),v.logger.warn("parsing error:"+E),this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:N,reason:E}),N)return}X.initTrackConfig(S,this.observer,c,U,this.audioCodec);var I;if(O.pts!==void 0)I=O.pts;else if(T){var g=X.getFrameDuration(S.samplerate);I=T.sample.pts+g}else{v.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var H=0;U<F;)if(X.isHeader(c,U)){if(U+5<F){var $=X.appendFrame(S,c,U,I,H);if($)if($.missing)this.aacOverFlow=$;else{U+=$.length,H++;continue}}break}else U++},C.parseMPEGPES=function(O){var A=O.data,S=A.length,T=0,c=0,w=O.pts;if(w===void 0){v.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;c<S;)if(j.isHeader(A,c)){var y=j.appendFrame(this._audioTrack,A,c,w,T);if(y)c+=y.length,T++;else break}else c++},C.parseID3PES=function(O){if(O.pts===void 0){v.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(O)},_}();h.minProbeByteLength=188;function l(_,C,D,O){return{key:_,frame:!1,pts:C,dts:D,units:[],debug:O,length:0}}function f(_,C){return(_[C+10]&31)<<8|_[C+11]}function o(_,C,D,O){var A={audio:-1,avc:-1,id3:-1,isAAC:!0},S=(_[C+1]&15)<<8|_[C+2],T=C+3+S-4,c=(_[C+10]&15)<<8|_[C+11];for(C+=12+c;C<T;){var w=(_[C+1]&31)<<8|_[C+2];switch(_[C]){case 207:if(!O){v.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:A.audio===-1&&(A.audio=w);break;case 21:A.id3===-1&&(A.id3=w);break;case 219:if(!O){v.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:A.avc===-1&&(A.avc=w);break;case 3:case 4:D?A.audio===-1&&(A.audio=w,A.isAAC=!1):v.logger.log("MPEG audio found, not supported in this browser");break;case 36:v.logger.warn("Unsupported HEVC stream type found");break;default:break}C+=((_[C+3]&15)<<8|_[C+4])+5}return A}function u(_){var C=0,D,O,A,S,T,c=_.data;if(!_||_.size===0)return null;for(;c[0].length<19&&c.length>1;){var w=new Uint8Array(c[0].length+c[1].length);w.set(c[0]),w.set(c[1],c[0].length),c[0]=w,c.splice(1,1)}D=c[0];var y=(D[0]<<16)+(D[1]<<8)+D[2];if(y===1){if(O=(D[4]<<8)+D[5],O&&O>_.size-6)return null;var b=D[7];b&192&&(S=(D[9]&14)*536870912+(D[10]&255)*4194304+(D[11]&254)*16384+(D[12]&255)*128+(D[13]&254)/2,b&64?(T=(D[14]&14)*536870912+(D[15]&255)*4194304+(D[16]&254)*16384+(D[17]&255)*128+(D[18]&254)/2,S-T>60*9e4&&(v.logger.warn(Math.round((S-T)/9e4)+"s delta between PTS and DTS, align them"),S=T)):T=S),A=D[8];var U=A+9;if(_.size<=U)return null;_.size-=U;for(var F=new Uint8Array(_.size),E=0,N=c.length;E<N;E++){D=c[E];var I=D.byteLength;if(U)if(U>I){U-=I;continue}else D=D.subarray(U),I-=U,U=0;F.set(D,C),C+=I}return O&&(O-=A+3),{data:F,pts:S,dts:T,len:O}}return null}function a(_,C){if(_.units.length&&_.frame){if(_.pts===void 0){var D=C.samples,O=D.length;if(O){var A=D[O-1];_.pts=A.pts,_.dts=A.dts}else{C.dropped++;return}}C.samples.push(_)}_.debug.length&&v.logger.log(_.pts+"/"+_.dts+":"+_.debug)}function s(_,C){var D=_.length;if(D>0){if(C.pts>=_[D-1].pts)_.push(C);else for(var O=D-1;O>=0;O--)if(C.pts<_[O].pts){_.splice(O,0,C);break}}else _.push(C)}function R(_){for(var C=_.byteLength,D=[],O=1;O<C-2;)_[O]===0&&_[O+1]===0&&_[O+2]===3?(D.push(O+2),O+=2):O++;if(D.length===0)return _;var A=C-D.length,S=new Uint8Array(A),T=0;for(O=0;O<A;T++,O++)T===D[0]&&(T++,D.shift()),S[O]=_[T];return S}J.default=h},"./src/errors.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"ErrorTypes",function(){return X}),P.d(J,"ErrorDetails",function(){return j});var X;(function(B){B.NETWORK_ERROR="networkError",B.MEDIA_ERROR="mediaError",B.KEY_SYSTEM_ERROR="keySystemError",B.MUX_ERROR="muxError",B.OTHER_ERROR="otherError"})(X||(X={}));var j;(function(B){B.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",B.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",B.KEY_SYSTEM_NO_SESSION="keySystemNoSession",B.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",B.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",B.MANIFEST_LOAD_ERROR="manifestLoadError",B.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",B.MANIFEST_PARSING_ERROR="manifestParsingError",B.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",B.LEVEL_EMPTY_ERROR="levelEmptyError",B.LEVEL_LOAD_ERROR="levelLoadError",B.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",B.LEVEL_SWITCH_ERROR="levelSwitchError",B.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",B.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",B.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",B.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",B.FRAG_LOAD_ERROR="fragLoadError",B.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",B.FRAG_DECRYPT_ERROR="fragDecryptError",B.FRAG_PARSING_ERROR="fragParsingError",B.REMUX_ALLOC_ERROR="remuxAllocError",B.KEY_LOAD_ERROR="keyLoadError",B.KEY_LOAD_TIMEOUT="keyLoadTimeOut",B.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",B.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",B.BUFFER_APPEND_ERROR="bufferAppendError",B.BUFFER_APPENDING_ERROR="bufferAppendingError",B.BUFFER_STALLED_ERROR="bufferStalledError",B.BUFFER_FULL_ERROR="bufferFullError",B.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",B.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",B.INTERNAL_EXCEPTION="internalException",B.INTERNAL_ABORTED="aborted",B.UNKNOWN="unknown"})(j||(j={}))},"./src/events.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"Events",function(){return X});var X;(function(j){j.MEDIA_ATTACHING="hlsMediaAttaching",j.MEDIA_ATTACHED="hlsMediaAttached",j.MEDIA_DETACHING="hlsMediaDetaching",j.MEDIA_DETACHED="hlsMediaDetached",j.BUFFER_RESET="hlsBufferReset",j.BUFFER_CODECS="hlsBufferCodecs",j.BUFFER_CREATED="hlsBufferCreated",j.BUFFER_APPENDING="hlsBufferAppending",j.BUFFER_APPENDED="hlsBufferAppended",j.BUFFER_EOS="hlsBufferEos",j.BUFFER_FLUSHING="hlsBufferFlushing",j.BUFFER_FLUSHED="hlsBufferFlushed",j.MANIFEST_LOADING="hlsManifestLoading",j.MANIFEST_LOADED="hlsManifestLoaded",j.MANIFEST_PARSED="hlsManifestParsed",j.LEVEL_SWITCHING="hlsLevelSwitching",j.LEVEL_SWITCHED="hlsLevelSwitched",j.LEVEL_LOADING="hlsLevelLoading",j.LEVEL_LOADED="hlsLevelLoaded",j.LEVEL_UPDATED="hlsLevelUpdated",j.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",j.LEVELS_UPDATED="hlsLevelsUpdated",j.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",j.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",j.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",j.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",j.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",j.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",j.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",j.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",j.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",j.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",j.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",j.CUES_PARSED="hlsCuesParsed",j.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",j.INIT_PTS_FOUND="hlsInitPtsFound",j.FRAG_LOADING="hlsFragLoading",j.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",j.FRAG_LOADED="hlsFragLoaded",j.FRAG_DECRYPTED="hlsFragDecrypted",j.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",j.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",j.FRAG_PARSING_METADATA="hlsFragParsingMetadata",j.FRAG_PARSED="hlsFragParsed",j.FRAG_BUFFERED="hlsFragBuffered",j.FRAG_CHANGED="hlsFragChanged",j.FPS_DROP="hlsFpsDrop",j.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",j.ERROR="hlsError",j.DESTROYING="hlsDestroying",j.KEY_LOADING="hlsKeyLoading",j.KEY_LOADED="hlsKeyLoaded",j.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",j.BACK_BUFFER_REACHED="hlsBackBufferReached"})(X||(X={}))},"./src/hls.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return _});var X=P("./node_modules/url-toolkit/src/url-toolkit.js"),j=P.n(X),B=P("./src/loader/playlist-loader.ts"),K=P("./src/loader/key-loader.ts"),G=P("./src/controller/id3-track-controller.ts"),r=P("./src/controller/latency-controller.ts"),L=P("./src/controller/level-controller.ts"),v=P("./src/controller/fragment-tracker.ts"),m=P("./src/controller/stream-controller.ts"),p=P("./src/is-supported.ts"),h=P("./src/utils/logger.ts"),l=P("./src/config.ts"),f=P("./node_modules/eventemitter3/index.js"),o=P.n(f),u=P("./src/events.ts"),a=P("./src/errors.ts");function s(C,D){for(var O=0;O<D.length;O++){var A=D[O];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(C,A.key,A)}}function R(C,D,O){return D&&s(C.prototype,D),O&&s(C,O),C}var _=function(){C.isSupported=function(){return Object(p.isSupported)()};function C(O){O===void 0&&(O={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new f.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 A=this.config=Object(l.mergeConfig)(C.DefaultConfig,O);this.userConfig=O,Object(h.enableLogs)(A.debug),this._autoLevelCapping=-1,A.progressive&&Object(l.enableStreamingMode)(A);var S=A.abrController,T=A.bufferController,c=A.capLevelController,w=A.fpsController,y=this.abrController=new S(this),b=this.bufferController=new T(this),U=this.capLevelController=new c(this),F=new w(this),E=new B.default(this),N=new K.default(this),I=new G.default(this),g=this.levelController=new L.default(this),H=new v.FragmentTracker(this),$=this.streamController=new m.default(this,H);U.setStreamController($),F.setStreamController($);var ie=[g,$];this.networkControllers=ie;var oe=[E,N,y,b,U,F,I,H];this.audioTrackController=this.createController(A.audioTrackController,null,ie),this.createController(A.audioStreamController,H,ie),this.subtitleTrackController=this.createController(A.subtitleTrackController,null,ie),this.createController(A.subtitleStreamController,H,ie),this.createController(A.timelineController,null,oe),this.emeController=this.createController(A.emeController,null,oe),this.cmcdController=this.createController(A.cmcdController,null,oe),this.latencyController=this.createController(r.default,null,oe),this.coreComponents=oe}var D=C.prototype;return D.createController=function(A,S,T){if(A){var c=S?new A(this,S):new A(this);return T&&T.push(c),c}return null},D.on=function(A,S,T){T===void 0&&(T=this),this._emitter.on(A,S,T)},D.once=function(A,S,T){T===void 0&&(T=this),this._emitter.once(A,S,T)},D.removeAllListeners=function(A){this._emitter.removeAllListeners(A)},D.off=function(A,S,T,c){T===void 0&&(T=this),this._emitter.off(A,S,T,c)},D.listeners=function(A){return this._emitter.listeners(A)},D.emit=function(A,S,T){return this._emitter.emit(A,S,T)},D.trigger=function(A,S){if(this.config.debug)return this.emit(A,A,S);try{return this.emit(A,A,S)}catch(T){h.logger.error("An internal error happened while handling event "+A+'. Error message: "'+T.message+'". Here is a stacktrace:',T),this.trigger(u.Events.ERROR,{type:a.ErrorTypes.OTHER_ERROR,details:a.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:A,error:T})}return!1},D.listenerCount=function(A){return this._emitter.listenerCount(A)},D.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(A){return A.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(A){return A.destroy()}),this.coreComponents.length=0},D.attachMedia=function(A){h.logger.log("attachMedia"),this._media=A,this.trigger(u.Events.MEDIA_ATTACHING,{media:A})},D.detachMedia=function(){h.logger.log("detachMedia"),this.trigger(u.Events.MEDIA_DETACHING,void 0),this._media=null},D.loadSource=function(A){this.stopLoad();var S=this.media,T=this.url,c=this.url=X.buildAbsoluteURL(self.location.href,A,{alwaysNormalize:!0});h.logger.log("loadSource:"+c),S&&T&&T!==c&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(S)),this.trigger(u.Events.MANIFEST_LOADING,{url:A})},D.startLoad=function(A){A===void 0&&(A=-1),h.logger.log("startLoad("+A+")"),this.networkControllers.forEach(function(S){S.startLoad(A)})},D.stopLoad=function(){h.logger.log("stopLoad"),this.networkControllers.forEach(function(A){A.stopLoad()})},D.swapAudioCodec=function(){h.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},D.recoverMediaError=function(){h.logger.log("recoverMediaError");var A=this._media;this.detachMedia(),A&&this.attachMedia(A)},D.removeLevel=function(A,S){S===void 0&&(S=0),this.levelController.removeLevel(A,S)},R(C,[{key:"levels",get:function(){var A=this.levelController.levels;return A||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(A){h.logger.log("set currentLevel:"+A),this.loadLevel=A,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(A){h.logger.log("set nextLevel:"+A),this.levelController.manualLevel=A,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(A){h.logger.log("set loadLevel:"+A),this.levelController.manualLevel=A}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(A){this.levelController.nextLoadLevel=A}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(A){h.logger.log("set firstLevel:"+A),this.levelController.firstLevel=A}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(A){h.logger.log("set startLevel:"+A),A!==-1&&(A=Math.max(A,this.minAutoLevel)),this.levelController.startLevel=A}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(A){var S=!!A;S!==this.config.capLevelToPlayerSize&&(S?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=S)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(A){this._autoLevelCapping!==A&&(h.logger.log("set autoLevelCapping:"+A),this._autoLevelCapping=A)}},{key:"bandwidthEstimate",get:function(){var A=this.abrController.bwEstimator;return A?A.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var A=this.levels,S=this.config.minAutoBitrate;if(!A)return 0;for(var T=A.length,c=0;c<T;c++)if(A[c].maxBitrate>S)return c;return 0}},{key:"maxAutoLevel",get:function(){var A=this.levels,S=this.autoLevelCapping,T;return S===-1&&A&&A.length?T=A.length-1:T=S,T}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(A){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,A)}},{key:"audioTracks",get:function(){var A=this.audioTrackController;return A?A.audioTracks:[]}},{key:"audioTrack",get:function(){var A=this.audioTrackController;return A?A.audioTrack:-1},set:function(A){var S=this.audioTrackController;S&&(S.audioTrack=A)}},{key:"subtitleTracks",get:function(){var A=this.subtitleTrackController;return A?A.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var A=this.subtitleTrackController;return A?A.subtitleTrack:-1},set:function(A){var S=this.subtitleTrackController;S&&(S.subtitleTrack=A)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var A=this.subtitleTrackController;return A?A.subtitleDisplay:!1},set:function(A){var S=this.subtitleTrackController;S&&(S.subtitleDisplay=A)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(A){this.config.lowLatencyMode=A}},{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 C.defaultConfig?C.defaultConfig:l.hlsDefaultConfig},set:function(A){C.defaultConfig=A}}]),C}();_.defaultConfig=void 0},"./src/is-supported.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"isSupported",function(){return B}),P.d(J,"changeTypeSupported",function(){return K});var X=P("./src/utils/mediasource-helper.ts");function j(){return self.SourceBuffer||self.WebKitSourceBuffer}function B(){var G=Object(X.getMediaSource)();if(!G)return!1;var r=j(),L=G&&typeof G.isTypeSupported=="function"&&G.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),v=!r||r.prototype&&typeof r.prototype.appendBuffer=="function"&&typeof r.prototype.remove=="function";return!!L&&!!v}function K(){var G,r=j();return typeof(r==null||((G=r.prototype)===null||G===void 0)?void 0:G.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return h}),P.d(J,"LoadError",function(){return f});var X=P("./src/polyfills/number.ts"),j=P("./src/errors.ts");function B(o,u){o.prototype=Object.create(u.prototype),o.prototype.constructor=o,v(o,u)}function K(o){var u=typeof Map=="function"?new Map:void 0;return K=function(s){if(s===null||!L(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,R)}function R(){return G(s,arguments,m(this).constructor)}return R.prototype=Object.create(s.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),v(R,s)},K(o)}function G(o,u,a){return r()?G=Reflect.construct:G=function(R,_,C){var D=[null];D.push.apply(D,_);var O=Function.bind.apply(R,D),A=new O;return C&&v(A,C.prototype),A},G.apply(null,arguments)}function r(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(o){return!1}}function L(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function v(o,u){return v=Object.setPrototypeOf||function(s,R){return s.__proto__=R,s},v(o,u)}function m(o){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},m(o)}var p=Math.pow(2,17),h=function(){function o(a){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=a}var u=o.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,R){var _=this,C=s.url;if(!C)return Promise.reject(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,networkDetails:null},"Fragment does not have a "+(C?"part list":"url")));this.abort();var D=this.config,O=D.fLoader,A=D.loader;return new Promise(function(S,T){_.loader&&_.loader.destroy();var c=_.loader=s.loader=O?new O(D):new A(D),w=l(s),y={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:p};s.stats=c.stats,c.load(w,y,{onSuccess:function(U,F,E,N){_.resetLoader(s,c),S({frag:s,part:null,payload:U.data,networkDetails:N})},onError:function(U,F,E){_.resetLoader(s,c),T(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,response:U,networkDetails:E}))},onAbort:function(U,F,E){_.resetLoader(s,c),T(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,networkDetails:E}))},onTimeout:function(U,F,E){_.resetLoader(s,c),T(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,networkDetails:E}))},onProgress:function(U,F,E,N){R&&R({frag:s,part:null,payload:E,networkDetails:N})}})})},u.loadPart=function(s,R,_){var C=this;this.abort();var D=this.config,O=D.fLoader,A=D.loader;return new Promise(function(S,T){C.loader&&C.loader.destroy();var c=C.loader=s.loader=O?new O(D):new A(D),w=l(s,R),y={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:p};R.stats=c.stats,c.load(w,y,{onSuccess:function(U,F,E,N){C.resetLoader(s,c),C.updateStatsFromPart(s,R);var I={frag:s,part:R,payload:U.data,networkDetails:N};_(I),S(I)},onError:function(U,F,E){C.resetLoader(s,c),T(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,part:R,response:U,networkDetails:E}))},onAbort:function(U,F,E){s.stats.aborted=R.stats.aborted,C.resetLoader(s,c),T(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,part:R,networkDetails:E}))},onTimeout:function(U,F,E){C.resetLoader(s,c),T(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,part:R,networkDetails:E}))}})})},u.updateStatsFromPart=function(s,R){var _=s.stats,C=R.stats,D=C.total;if(_.loaded+=C.loaded,D){var O=Math.round(s.duration/R.duration),A=Math.min(Math.round(_.loaded/D),O),S=O-A,T=S*Math.round(_.loaded/A);_.total=_.loaded+T}else _.total=Math.max(_.loaded,_.total);var c=_.loading,w=C.loading;c.start?c.first+=w.first-w.start:(c.start=w.start,c.first=w.first),c.end=w.end},u.resetLoader=function(s,R){s.loader=null,this.loader===R&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),R.destroy()},o}();function l(o,u){u===void 0&&(u=null);var a=u||o,s={frag:o,part:u,responseType:"arraybuffer",url:a.url,headers:{},rangeStart:0,rangeEnd:0},R=a.byteRangeStartOffset,_=a.byteRangeEndOffset;return Object(X.isFiniteNumber)(R)&&Object(X.isFiniteNumber)(_)&&(s.rangeStart=R,s.rangeEnd=_),s}var f=function(o){B(u,o);function u(a){for(var s,R=arguments.length,_=new Array(R>1?R-1:0),C=1;C<R;C++)_[C-1]=arguments[C];return s=o.call.apply(o,[this].concat(_))||this,s.data=void 0,s.data=a,s}return u}(K(Error))},"./src/loader/fragment.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"ElementaryStreamTypes",function(){return h}),P.d(J,"BaseSegment",function(){return l}),P.d(J,"Fragment",function(){return f}),P.d(J,"Part",function(){return o});var X=P("./src/polyfills/number.ts"),j=P("./node_modules/url-toolkit/src/url-toolkit.js"),B=P.n(j),K=P("./src/utils/logger.ts"),G=P("./src/loader/level-key.ts"),r=P("./src/loader/load-stats.ts");function L(u,a){u.prototype=Object.create(a.prototype),u.prototype.constructor=u,v(u,a)}function v(u,a){return v=Object.setPrototypeOf||function(R,_){return R.__proto__=_,R},v(u,a)}function m(u,a){for(var s=0;s<a.length;s++){var R=a[s];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(u,R.key,R)}}function p(u,a,s){return a&&m(u.prototype,a),s&&m(u,s),u}var h;(function(u){u.AUDIO="audio",u.VIDEO="video",u.AUDIOVIDEO="audiovideo"})(h||(h={}));var l=function(){function u(s){var R;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(R={},R[h.AUDIO]=null,R[h.VIDEO]=null,R[h.AUDIOVIDEO]=null,R),this.baseurl=s}var a=u.prototype;return a.setByteRange=function(R,_){var C=R.split("@",2),D=[];C.length===1?D[0]=_?_.byteRangeEndOffset:0:D[0]=parseInt(C[1]),D[1]=parseInt(C[0])+D[0],this._byteRange=D},p(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(j.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(R){this._url=R}}]),u}(),f=function(u){L(a,u);function a(R,_){var C;return C=u.call(this,_)||this,C._decryptdata=null,C.rawProgramDateTime=null,C.programDateTime=null,C.tagList=[],C.duration=0,C.sn=0,C.levelkey=void 0,C.type=void 0,C.loader=null,C.level=-1,C.cc=0,C.startPTS=void 0,C.endPTS=void 0,C.appendedPTS=void 0,C.startDTS=void 0,C.endDTS=void 0,C.start=0,C.deltaPTS=void 0,C.maxStartPTS=void 0,C.minEndPTS=void 0,C.stats=new r.LoadStats,C.urlId=0,C.data=void 0,C.bitrateTest=!1,C.title=null,C.initSegment=null,C.type=R,C}var s=a.prototype;return s.createInitializationVector=function(_){for(var C=new Uint8Array(16),D=12;D<16;D++)C[D]=_>>8*(15-D)&255;return C},s.setDecryptDataFromLevelKey=function(_,C){var D=_;return(_==null?void 0:_.method)==="AES-128"&&_.uri&&!_.iv&&(D=G.LevelKey.fromURI(_.uri),D.method=_.method,D.iv=this.createInitializationVector(C),D.keyFormat="identity"),D},s.setElementaryStreamInfo=function(_,C,D,O,A,S){S===void 0&&(S=!1);var T=this.elementaryStreams,c=T[_];if(!c){T[_]={startPTS:C,endPTS:D,startDTS:O,endDTS:A,partial:S};return}c.startPTS=Math.min(c.startPTS,C),c.endPTS=Math.max(c.endPTS,D),c.startDTS=Math.min(c.startDTS,O),c.endDTS=Math.max(c.endDTS,A)},s.clearElementaryStreamInfo=function(){var _=this.elementaryStreams;_[h.AUDIO]=null,_[h.VIDEO]=null,_[h.AUDIOVIDEO]=null},p(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&&K.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(X.isFiniteNumber)(this.programDateTime))return null;var _=Object(X.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}(l),o=function(u){L(a,u);function a(s,R,_,C,D){var O;O=u.call(this,_)||this,O.fragOffset=0,O.duration=0,O.gap=!1,O.independent=!1,O.relurl=void 0,O.fragment=void 0,O.index=void 0,O.stats=new r.LoadStats,O.duration=s.decimalFloatingPoint("DURATION"),O.gap=s.bool("GAP"),O.independent=s.bool("INDEPENDENT"),O.relurl=s.enumeratedString("URI"),O.fragment=R,O.index=C;var A=s.enumeratedString("BYTERANGE");return A&&O.setByteRange(A,D),D&&(O.fragOffset=D.fragOffset+D.duration),O}return p(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 R=this.elementaryStreams;return!!(R.audio||R.video||R.audiovideo)}}]),a}(l)},"./src/loader/key-loader.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return K});var X=P("./src/events.ts"),j=P("./src/errors.ts"),B=P("./src/utils/logger.ts"),K=function(){function G(L){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=L,this._registerListeners()}var r=G.prototype;return r._registerListeners=function(){this.hls.on(X.Events.KEY_LOADING,this.onKeyLoading,this)},r._unregisterListeners=function(){this.hls.off(X.Events.KEY_LOADING,this.onKeyLoading)},r.destroy=function(){this._unregisterListeners();for(var v in this.loaders){var m=this.loaders[v];m&&m.destroy()}this.loaders={}},r.onKeyLoading=function(v,m){var p=m.frag,h=p.type,l=this.loaders[h];if(!p.decryptdata){B.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var f=p.decryptdata.uri;if(f!==this.decrypturl||this.decryptkey===null){var o=this.hls.config;if(l&&(B.logger.warn("abort previous key loader for type:"+h),l.abort()),!f){B.logger.warn("key uri is falsy");return}var u=o.loader,a=p.loader=this.loaders[h]=new u(o);this.decrypturl=f,this.decryptkey=null;var s={url:f,frag:p,responseType:"arraybuffer"},R={timeout:o.fragLoadingTimeOut,maxRetry:0,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout,highWaterMark:0},_={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};a.load(s,R,_)}else this.decryptkey&&(p.decryptdata.key=this.decryptkey,this.hls.trigger(X.Events.KEY_LOADED,{frag:p}))},r.loadsuccess=function(v,m,p){var h=p.frag;if(!h.decryptdata){B.logger.error("after key load, decryptdata unset");return}this.decryptkey=h.decryptdata.key=new Uint8Array(v.data),h.loader=null,delete this.loaders[h.type],this.hls.trigger(X.Events.KEY_LOADED,{frag:h})},r.loaderror=function(v,m){var p=m.frag,h=p.loader;h&&h.abort(),delete this.loaders[p.type],this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:p,response:v})},r.loadtimeout=function(v,m){var p=m.frag,h=p.loader;h&&h.abort(),delete this.loaders[p.type],this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:p})},G}()},"./src/loader/level-details.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"LevelDetails",function(){return G});var X=P("./src/polyfills/number.ts");function j(r,L){for(var v=0;v<L.length;v++){var m=L[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(r,m.key,m)}}function B(r,L,v){return L&&j(r.prototype,L),v&&j(r,v),r}var K=10,G=function(){function r(v){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=v}var L=r.prototype;return L.reloaded=function(m){if(!m){this.advanced=!0,this.updated=!0;return}var p=this.lastPartSn-m.lastPartSn,h=this.lastPartIndex-m.lastPartIndex;this.updated=this.endSN!==m.endSN||!!h||!!p,this.advanced=this.endSN>m.endSN||p>0||p===0&&h>0,this.updated||this.advanced?this.misses=Math.floor(m.misses*.6):this.misses=m.misses+1,this.availabilityDelay=m.availabilityDelay},B(r,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(X.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||K}},{key:"drift",get:function(){var m=this.driftEndTime-this.driftStartTime;if(m>0){var p=this.driftEnd-this.driftStart;return p*1e3/m}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var m;return(m=this.fragments)!==null&&m!==void 0&&m.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 m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),r}()},"./src/loader/level-key.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"LevelKey",function(){return G});var X=P("./node_modules/url-toolkit/src/url-toolkit.js"),j=P.n(X);function B(r,L){for(var v=0;v<L.length;v++){var m=L[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(r,m.key,m)}}function K(r,L,v){return L&&B(r.prototype,L),v&&B(r,v),r}var G=function(){r.fromURL=function(v,m){return new r(v,m)},r.fromURI=function(v){return new r(v)};function r(L,v){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,v?this._uri=Object(X.buildAbsoluteURL)(L,v,{alwaysNormalize:!0}):this._uri=L}return K(r,[{key:"uri",get:function(){return this._uri}}]),r}()},"./src/loader/load-stats.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"LoadStats",function(){return X});var X=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(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return a});var X=P("./src/polyfills/number.ts"),j=P("./node_modules/url-toolkit/src/url-toolkit.js"),B=P.n(j),K=P("./src/loader/fragment.ts"),G=P("./src/loader/level-details.ts"),r=P("./src/loader/level-key.ts"),L=P("./src/utils/attr-list.ts"),v=P("./src/utils/logger.ts"),m=P("./src/utils/codecs.ts"),p=/#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,l=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),f=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),o=/\.(mp4|m4s|m4v|m4a)$/i;function u(D){var O,A;return o.test((O=(A=j.parseURL(D))===null||A===void 0?void 0:A.path)!=null?O:"")}var a=function(){function D(){}return D.findGroup=function(A,S){for(var T=0;T<A.length;T++){var c=A[T];if(c.id===S)return c}},D.convertAVC1ToAVCOTI=function(A){var S=A.split(".");if(S.length>2){var T=S.shift()+".";return T+=parseInt(S.shift()).toString(16),T+=("000"+parseInt(S.shift()).toString(16)).substr(-4),T}return A},D.resolve=function(A,S){return j.buildAbsoluteURL(S,A,{alwaysNormalize:!0})},D.parseMasterPlaylist=function(A,S){var T=[],c={},w=!1;p.lastIndex=0;for(var y;(y=p.exec(A))!=null;)if(y[1]){var b=new L.AttrList(y[1]),U={attrs:b,bitrate:b.decimalInteger("AVERAGE-BANDWIDTH")||b.decimalInteger("BANDWIDTH"),name:b.NAME,url:D.resolve(y[2],S)},F=b.decimalResolution("RESOLUTION");F&&(U.width=F.width,U.height=F.height),s((b.CODECS||"").split(/[ ,]+/).filter(function(N){return N}),U),U.videoCodec&&U.videoCodec.indexOf("avc1")!==-1&&(U.videoCodec=D.convertAVC1ToAVCOTI(U.videoCodec)),T.push(U)}else if(y[3]){var E=new L.AttrList(y[3]);E["DATA-ID"]&&(w=!0,c[E["DATA-ID"]]=E)}return{levels:T,sessionData:w?c:null}},D.parseMasterPlaylistMedia=function(A,S,T,c){c===void 0&&(c=[]);var w,y=[],b=0;for(h.lastIndex=0;(w=h.exec(A))!==null;){var U=new L.AttrList(w[1]);if(U.TYPE===T){var F={attrs:U,bitrate:0,id:b++,groupId:U["GROUP-ID"],instreamId:U["INSTREAM-ID"],name:U.NAME||U.LANGUAGE||"",type:T,default:U.bool("DEFAULT"),autoselect:U.bool("AUTOSELECT"),forced:U.bool("FORCED"),lang:U.LANGUAGE,url:U.URI?D.resolve(U.URI,S):""};if(c.length){var E=D.findGroup(c,F.groupId)||c[0];R(F,E,"audioCodec"),R(F,E,"textCodec")}y.push(F)}}return y},D.parseLevelPlaylist=function(A,S,T,c,w){var y=new G.LevelDetails(S),b=y.fragments,U=null,F=0,E=0,N=0,I=0,g=null,H=new K.Fragment(c,S),$,ie,oe,Ce=-1,ve=!1;for(l.lastIndex=0,y.m3u8=A;($=l.exec(A))!==null;){ve&&(ve=!1,H=new K.Fragment(c,S),H.start=N,H.sn=F,H.cc=I,H.level=T,U&&(H.initSegment=U,H.rawProgramDateTime=U.rawProgramDateTime));var Se=$[1];if(Se){H.duration=parseFloat(Se);var Ae=(" "+$[2]).slice(1);H.title=Ae||null,H.tagList.push(Ae?["INF",Se,Ae]:["INF",Se])}else if($[3])Object(X.isFiniteNumber)(H.duration)&&(H.start=N,oe&&(H.levelkey=oe),H.sn=F,H.level=T,H.cc=I,H.urlId=w,b.push(H),H.relurl=(" "+$[3]).slice(1),C(H,g),g=H,N+=H.duration,F++,E=0,ve=!0);else if($[4]){var Oe=(" "+$[4]).slice(1);g?H.setByteRange(Oe,g):H.setByteRange(Oe)}else if($[5])H.rawProgramDateTime=(" "+$[5]).slice(1),H.tagList.push(["PROGRAM-DATE-TIME",H.rawProgramDateTime]),Ce===-1&&(Ce=b.length);else{if($=$[0].match(f),!$){v.logger.warn("No matches on slow regex match for level playlist!");continue}for(ie=1;ie<$.length&&!(typeof $[ie]!="undefined");ie++);var he=(" "+$[ie]).slice(1),ce=(" "+$[ie+1]).slice(1),re=$[ie+2]?(" "+$[ie+2]).slice(1):"";switch(he){case"PLAYLIST-TYPE":y.type=ce.toUpperCase();break;case"MEDIA-SEQUENCE":F=y.startSN=parseInt(ce);break;case"SKIP":{var fe=new L.AttrList(ce),se=fe.decimalInteger("SKIPPED-SEGMENTS");if(Object(X.isFiniteNumber)(se)){y.skippedSegments=se;for(var ke=se;ke--;)b.unshift(null);F+=se}var Ne=fe.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ne&&(y.recentlyRemovedDateranges=Ne.split(" "));break}case"TARGETDURATION":y.targetduration=parseFloat(ce);break;case"VERSION":y.version=parseInt(ce);break;case"EXTM3U":break;case"ENDLIST":y.live=!1;break;case"#":(ce||re)&&H.tagList.push(re?[ce,re]:[ce]);break;case"DIS":I++;case"GAP":H.tagList.push([he]);break;case"BITRATE":H.tagList.push([he,ce]);break;case"DISCONTINUITY-SEQ":I=parseInt(ce);break;case"KEY":{var Re,Pe=new L.AttrList(ce),je=Pe.enumeratedString("METHOD"),ue=Pe.URI,Ee=Pe.hexadecimalInteger("IV"),Le=Pe.enumeratedString("KEYFORMATVERSIONS"),Ie=Pe.enumeratedString("KEYID"),Ge=(Re=Pe.enumeratedString("KEYFORMAT"))!=null?Re:"identity",Xe=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Xe.indexOf(Ge)>-1){v.logger.warn("Keyformat "+Ge+" is not supported from the manifest");continue}else if(Ge!=="identity")continue;je&&(oe=r.LevelKey.fromURL(S,ue),ue&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(je)>=0&&(oe.method=je,oe.keyFormat=Ge,Ie&&(oe.keyID=Ie),Le&&(oe.keyFormatVersions=Le),oe.iv=Ee));break}case"START":{var Je=new L.AttrList(ce),Qe=Je.decimalFloatingPoint("TIME-OFFSET");Object(X.isFiniteNumber)(Qe)&&(y.startTimeOffset=Qe);break}case"MAP":{var at=new L.AttrList(ce);H.relurl=at.URI,at.BYTERANGE&&H.setByteRange(at.BYTERANGE),H.level=T,H.sn="initSegment",oe&&(H.levelkey=oe),H.initSegment=null,U=H,ve=!0;break}case"SERVER-CONTROL":{var qe=new L.AttrList(ce);y.canBlockReload=qe.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=qe.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&qe.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=qe.optionalFloat("PART-HOLD-BACK",0),y.holdBack=qe.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var tt=new L.AttrList(ce);y.partTarget=tt.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Be=y.partList;Be||(Be=y.partList=[]);var ut=E>0?Be[Be.length-1]:void 0,ot=E++,Ue=new K.Part(new L.AttrList(ce),H,S,ot,ut);Be.push(Ue),H.duration+=Ue.duration;break}case"PRELOAD-HINT":{var He=new L.AttrList(ce);y.preloadHint=He;break}case"RENDITION-REPORT":{var Te=new L.AttrList(ce);y.renditionReports=y.renditionReports||[],y.renditionReports.push(Te);break}default:v.logger.warn("line parsed but not handled: "+$);break}}}g&&!g.relurl?(b.pop(),N-=g.duration,y.partList&&(y.fragmentHint=g)):y.partList&&(C(H,g),H.cc=I,y.fragmentHint=H);var me=b.length,be=b[0],ae=b[me-1];if(N+=y.skippedSegments*y.targetduration,N>0&&me&&ae){y.averagetargetduration=N/me;var le=ae.sn;y.endSN=le!=="initSegment"?le:0,be&&(y.startCC=be.cc,be.initSegment||y.fragments.every(function(de){return de.relurl&&u(de.relurl)})&&(v.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),H=new K.Fragment(c,S),H.relurl=ae.relurl,H.level=T,H.sn="initSegment",be.initSegment=H,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(N+=y.fragmentHint.duration),y.totalduration=N,y.endCC=I,Ce>0&&_(b,Ce),y},D}();function s(D,O){["video","audio","text"].forEach(function(A){var S=D.filter(function(c){return Object(m.isCodecType)(c,A)});if(S.length){var T=S.filter(function(c){return c.lastIndexOf("avc1",0)===0||c.lastIndexOf("mp4a",0)===0});O[A+"Codec"]=T.length>0?T[0]:S[0],D=D.filter(function(c){return S.indexOf(c)===-1})}}),O.unknownCodecs=D}function R(D,O,A){var S=O[A];S&&(D[A]=S)}function _(D,O){for(var A=D[O],S=O;S--;){var T=D[S];if(!T)return;T.programDateTime=A.programDateTime-T.duration*1e3,A=T}}function C(D,O){D.rawProgramDateTime?D.programDateTime=Date.parse(D.rawProgramDateTime):O!=null&&O.programDateTime&&(D.programDateTime=O.endProgramDateTime),Object(X.isFiniteNumber)(D.programDateTime)||(D.programDateTime=null,D.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/polyfills/number.ts"),j=P("./src/events.ts"),B=P("./src/errors.ts"),K=P("./src/utils/logger.ts"),G=P("./src/utils/mp4-tools.ts"),r=P("./src/loader/m3u8-parser.ts"),L=P("./src/types/loader.ts"),v=P("./src/utils/attr-list.ts");function m(l){var f=l.type;switch(f){case L.PlaylistContextType.AUDIO_TRACK:return L.PlaylistLevelType.AUDIO;case L.PlaylistContextType.SUBTITLE_TRACK:return L.PlaylistLevelType.SUBTITLE;default:return L.PlaylistLevelType.MAIN}}function p(l,f){var o=l.url;return(o===void 0||o.indexOf("data:")===0)&&(o=f.url),o}var h=function(){function l(o){this.hls=void 0,this.loaders=Object.create(null),this.hls=o,this.registerListeners()}var f=l.prototype;return f.registerListeners=function(){var u=this.hls;u.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(j.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.on(j.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.unregisterListeners=function(){var u=this.hls;u.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(j.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(j.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.off(j.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.createInternalLoader=function(u){var a=this.hls.config,s=a.pLoader,R=a.loader,_=s||R,C=new _(a);return u.loader=C,this.loaders[u.type]=C,C},f.getInternalLoader=function(u){return this.loaders[u.type]},f.resetInternalLoader=function(u){this.loaders[u]&&delete this.loaders[u]},f.destroyInternalLoaders=function(){for(var u in this.loaders){var a=this.loaders[u];a&&a.destroy(),this.resetInternalLoader(u)}},f.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},f.onManifestLoading=function(u,a){var s=a.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:L.PlaylistContextType.MANIFEST,url:s,deliveryDirectives:null})},f.onLevelLoading=function(u,a){var s=a.id,R=a.level,_=a.url,C=a.deliveryDirectives;this.load({id:s,groupId:null,level:R,responseType:"text",type:L.PlaylistContextType.LEVEL,url:_,deliveryDirectives:C})},f.onAudioTrackLoading=function(u,a){var s=a.id,R=a.groupId,_=a.url,C=a.deliveryDirectives;this.load({id:s,groupId:R,level:null,responseType:"text",type:L.PlaylistContextType.AUDIO_TRACK,url:_,deliveryDirectives:C})},f.onSubtitleTrackLoading=function(u,a){var s=a.id,R=a.groupId,_=a.url,C=a.deliveryDirectives;this.load({id:s,groupId:R,level:null,responseType:"text",type:L.PlaylistContextType.SUBTITLE_TRACK,url:_,deliveryDirectives:C})},f.load=function(u){var a,s=this.hls.config,R=this.getInternalLoader(u);if(R){var _=R.context;if(_&&_.url===u.url){K.logger.trace("[playlist-loader]: playlist request ongoing");return}K.logger.log("[playlist-loader]: aborting previous loader for type: "+u.type),R.abort()}var C,D,O,A;switch(u.type){case L.PlaylistContextType.MANIFEST:C=s.manifestLoadingMaxRetry,D=s.manifestLoadingTimeOut,O=s.manifestLoadingRetryDelay,A=s.manifestLoadingMaxRetryTimeout;break;case L.PlaylistContextType.LEVEL:case L.PlaylistContextType.AUDIO_TRACK:case L.PlaylistContextType.SUBTITLE_TRACK:C=0,D=s.levelLoadingTimeOut;break;default:C=s.levelLoadingMaxRetry,D=s.levelLoadingTimeOut,O=s.levelLoadingRetryDelay,A=s.levelLoadingMaxRetryTimeout;break}if(R=this.createInternalLoader(u),(a=u.deliveryDirectives)!==null&&a!==void 0&&a.part){var S;if(u.type===L.PlaylistContextType.LEVEL&&u.level!==null?S=this.hls.levels[u.level].details:u.type===L.PlaylistContextType.AUDIO_TRACK&&u.id!==null?S=this.hls.audioTracks[u.id].details:u.type===L.PlaylistContextType.SUBTITLE_TRACK&&u.id!==null&&(S=this.hls.subtitleTracks[u.id].details),S){var T=S.partTarget,c=S.targetduration;T&&c&&(D=Math.min(Math.max(T*3,c*.8)*1e3,D))}}var w={timeout:D,maxRetry:C,retryDelay:O,maxRetryDelay:A,highWaterMark:0},y={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};R.load(u,w,y)},f.loadsuccess=function(u,a,s,R){if(R===void 0&&(R=null),s.isSidxRequest){this.handleSidxRequest(u,s),this.handlePlaylistLoaded(u,a,s,R);return}this.resetInternalLoader(s.type);var _=u.data;if(_.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,s,"no EXTM3U delimiter",R);return}a.parsing.start=performance.now(),_.indexOf("#EXTINF:")>0||_.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(u,a,s,R):this.handleMasterPlaylist(u,a,s,R)},f.loaderror=function(u,a,s){s===void 0&&(s=null),this.handleNetworkError(a,s,!1,u)},f.loadtimeout=function(u,a,s){s===void 0&&(s=null),this.handleNetworkError(a,s,!0)},f.handleMasterPlaylist=function(u,a,s,R){var _=this.hls,C=u.data,D=p(u,s),O=r.default.parseMasterPlaylist(C,D),A=O.levels,S=O.sessionData;if(!A.length){this.handleManifestParsingError(u,s,"no level found in manifest",R);return}var T=A.map(function(F){return{id:F.attrs.AUDIO,audioCodec:F.audioCodec}}),c=A.map(function(F){return{id:F.attrs.SUBTITLES,textCodec:F.textCodec}}),w=r.default.parseMasterPlaylistMedia(C,D,"AUDIO",T),y=r.default.parseMasterPlaylistMedia(C,D,"SUBTITLES",c),b=r.default.parseMasterPlaylistMedia(C,D,"CLOSED-CAPTIONS");if(w.length){var U=w.some(function(F){return!F.url});!U&&A[0].audioCodec&&!A[0].attrs.AUDIO&&(K.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),w.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new v.AttrList({}),bitrate:0,url:""}))}_.trigger(j.Events.MANIFEST_LOADED,{levels:A,audioTracks:w,subtitles:y,captions:b,url:D,stats:a,networkDetails:R,sessionData:S})},f.handleTrackOrLevelPlaylist=function(u,a,s,R){var _=this.hls,C=s.id,D=s.level,O=s.type,A=p(u,s),S=Object(X.isFiniteNumber)(C)?C:0,T=Object(X.isFiniteNumber)(D)?D:S,c=m(s),w=r.default.parseLevelPlaylist(u.data,A,T,c,S);if(!w.fragments.length){_.trigger(j.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:A,reason:"no fragments found in level",level:typeof s.level=="number"?s.level:void 0});return}if(O===L.PlaylistContextType.MANIFEST){var y={attrs:new v.AttrList({}),bitrate:0,details:w,name:"",url:A};_.trigger(j.Events.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:A,stats:a,networkDetails:R,sessionData:null})}if(a.parsing.end=performance.now(),w.needSidxRanges){var b,U=(b=w.fragments[0].initSegment)===null||b===void 0?void 0:b.url;this.load({url:U,isSidxRequest:!0,type:O,level:D,levelDetails:w,id:C,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}s.levelDetails=w,this.handlePlaylistLoaded(u,a,s,R)},f.handleSidxRequest=function(u,a){var s=Object(G.parseSegmentIndex)(new Uint8Array(u.data));if(!s)return;var R=s.references,_=a.levelDetails;R.forEach(function(C,D){var O=C.info,A=_.fragments[D];A.byteRange.length===0&&A.setByteRange(String(1+O.end-O.start)+"@"+String(O.start)),A.initSegment&&A.initSegment.setByteRange(String(s.moovEndOffset)+"@0")})},f.handleManifestParsingError=function(u,a,s,R){this.hls.trigger(j.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:a.type===L.PlaylistContextType.MANIFEST,url:u.url,reason:s,response:u,context:a,networkDetails:R})},f.handleNetworkError=function(u,a,s,R){s===void 0&&(s=!1),K.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 _=B.ErrorDetails.UNKNOWN,C=!1,D=this.getInternalLoader(u);switch(u.type){case L.PlaylistContextType.MANIFEST:_=s?B.ErrorDetails.MANIFEST_LOAD_TIMEOUT:B.ErrorDetails.MANIFEST_LOAD_ERROR,C=!0;break;case L.PlaylistContextType.LEVEL:_=s?B.ErrorDetails.LEVEL_LOAD_TIMEOUT:B.ErrorDetails.LEVEL_LOAD_ERROR,C=!1;break;case L.PlaylistContextType.AUDIO_TRACK:_=s?B.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:B.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,C=!1;break;case L.PlaylistContextType.SUBTITLE_TRACK:_=s?B.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:B.ErrorDetails.SUBTITLE_LOAD_ERROR,C=!1;break}D&&this.resetInternalLoader(u.type);var O={type:B.ErrorTypes.NETWORK_ERROR,details:_,fatal:C,url:u.url,loader:D,context:u,networkDetails:a};R&&(O.response=R),this.hls.trigger(j.Events.ERROR,O)},f.handlePlaylistLoaded=function(u,a,s,R){var _=s.type,C=s.level,D=s.id,O=s.groupId,A=s.loader,S=s.levelDetails,T=s.deliveryDirectives;if(!(S!=null&&S.targetduration)){this.handleManifestParsingError(u,s,"invalid target duration",R);return}if(!A)return;S.live&&(A.getCacheAge&&(S.ageHeader=A.getCacheAge()||0),(!A.getCacheAge||isNaN(S.ageHeader))&&(S.ageHeader=0));switch(_){case L.PlaylistContextType.MANIFEST:case L.PlaylistContextType.LEVEL:this.hls.trigger(j.Events.LEVEL_LOADED,{details:S,level:C||0,id:D||0,stats:a,networkDetails:R,deliveryDirectives:T});break;case L.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(j.Events.AUDIO_TRACK_LOADED,{details:S,id:D||0,groupId:O||"",stats:a,networkDetails:R,deliveryDirectives:T});break;case L.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(j.Events.SUBTITLE_TRACK_LOADED,{details:S,id:D||0,groupId:O||"",stats:a,networkDetails:R,deliveryDirectives:T});break}},l}();J.default=h},"./src/polyfills/number.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"isFiniteNumber",function(){return X}),P.d(J,"MAX_SAFE_INTEGER",function(){return j});var X=Number.isFinite||function(B){return typeof B=="number"&&isFinite(B)},j=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ne,J,P){"use strict";P.r(J);var X=function(){function j(){}return j.getSilentFrame=function(K,G){switch(K){case"mp4a.40.2":if(G===1)return new Uint8Array([0,200,0,128,35,128]);if(G===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(G===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(G===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(G===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(G===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(G===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(G===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(G===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},j}();J.default=X},"./src/remux/mp4-generator.ts":function(ne,J,P){"use strict";P.r(J);var X=Math.pow(2,32)-1,j=function(){function B(){}return B.init=function(){B.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 G;for(G in B.types)B.types.hasOwnProperty(G)&&(B.types[G]=[G.charCodeAt(0),G.charCodeAt(1),G.charCodeAt(2),G.charCodeAt(3)]);var r=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]),L=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]);B.HDLR_TYPES={video:r,audio:L};var v=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),m=new Uint8Array([0,0,0,0,0,0,0,0]);B.STTS=B.STSC=B.STCO=m,B.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),B.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),B.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),B.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var p=new Uint8Array([105,115,111,109]),h=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);B.FTYP=B.box(B.types.ftyp,p,l,p,h),B.DINF=B.box(B.types.dinf,B.box(B.types.dref,v))},B.box=function(G){for(var r=8,L=arguments.length,v=new Array(L>1?L-1:0),m=1;m<L;m++)v[m-1]=arguments[m];for(var p=v.length,h=p;p--;)r+=v[p].byteLength;var l=new Uint8Array(r);for(l[0]=r>>24&255,l[1]=r>>16&255,l[2]=r>>8&255,l[3]=r&255,l.set(G,4),p=0,r=8;p<h;p++)l.set(v[p],r),r+=v[p].byteLength;return l},B.hdlr=function(G){return B.box(B.types.hdlr,B.HDLR_TYPES[G])},B.mdat=function(G){return B.box(B.types.mdat,G)},B.mdhd=function(G,r){r*=G;var L=Math.floor(r/(X+1)),v=Math.floor(r%(X+1));return B.box(B.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,G>>24&255,G>>16&255,G>>8&255,G&255,L>>24,L>>16&255,L>>8&255,L&255,v>>24,v>>16&255,v>>8&255,v&255,85,196,0,0]))},B.mdia=function(G){return B.box(B.types.mdia,B.mdhd(G.timescale,G.duration),B.hdlr(G.type),B.minf(G))},B.mfhd=function(G){return B.box(B.types.mfhd,new Uint8Array([0,0,0,0,G>>24,G>>16&255,G>>8&255,G&255]))},B.minf=function(G){return G.type==="audio"?B.box(B.types.minf,B.box(B.types.smhd,B.SMHD),B.DINF,B.stbl(G)):B.box(B.types.minf,B.box(B.types.vmhd,B.VMHD),B.DINF,B.stbl(G))},B.moof=function(G,r,L){return B.box(B.types.moof,B.mfhd(G),B.traf(L,r))},B.moov=function(G){for(var r=G.length,L=[];r--;)L[r]=B.trak(G[r]);return B.box.apply(null,[B.types.moov,B.mvhd(G[0].timescale,G[0].duration)].concat(L).concat(B.mvex(G)))},B.mvex=function(G){for(var r=G.length,L=[];r--;)L[r]=B.trex(G[r]);return B.box.apply(null,[B.types.mvex].concat(L))},B.mvhd=function(G,r){r*=G;var L=Math.floor(r/(X+1)),v=Math.floor(r%(X+1)),m=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,G>>24&255,G>>16&255,G>>8&255,G&255,L>>24,L>>16&255,L>>8&255,L&255,v>>24,v>>16&255,v>>8&255,v&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 B.box(B.types.mvhd,m)},B.sdtp=function(G){var r=G.samples||[],L=new Uint8Array(4+r.length),v,m;for(v=0;v<r.length;v++)m=r[v].flags,L[v+4]=m.dependsOn<<4|m.isDependedOn<<2|m.hasRedundancy;return B.box(B.types.sdtp,L)},B.stbl=function(G){return B.box(B.types.stbl,B.stsd(G),B.box(B.types.stts,B.STTS),B.box(B.types.stsc,B.STSC),B.box(B.types.stsz,B.STSZ),B.box(B.types.stco,B.STCO))},B.avc1=function(G){var r=[],L=[],v,m,p;for(v=0;v<G.sps.length;v++)m=G.sps[v],p=m.byteLength,r.push(p>>>8&255),r.push(p&255),r=r.concat(Array.prototype.slice.call(m));for(v=0;v<G.pps.length;v++)m=G.pps[v],p=m.byteLength,L.push(p>>>8&255),L.push(p&255),L=L.concat(Array.prototype.slice.call(m));var h=B.box(B.types.avcC,new Uint8Array([1,r[3],r[4],r[5],252|3,224|G.sps.length].concat(r).concat([G.pps.length]).concat(L))),l=G.width,f=G.height,o=G.pixelRatio[0],u=G.pixelRatio[1];return B.box(B.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,l>>8&255,l&255,f>>8&255,f&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,B.box(B.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),B.box(B.types.pasp,new Uint8Array([o>>24,o>>16&255,o>>8&255,o&255,u>>24,u>>16&255,u>>8&255,u&255])))},B.esds=function(G){var r=G.config.length;return new Uint8Array([0,0,0,0,3,23+r,0,1,0,4,15+r,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([r]).concat(G.config).concat([6,1,2]))},B.mp4a=function(G){var r=G.samplerate;return B.box(B.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,G.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]),B.box(B.types.esds,B.esds(G)))},B.mp3=function(G){var r=G.samplerate;return B.box(B.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,G.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]))},B.stsd=function(G){return G.type==="audio"?!G.isAAC&&G.codec==="mp3"?B.box(B.types.stsd,B.STSD,B.mp3(G)):B.box(B.types.stsd,B.STSD,B.mp4a(G)):B.box(B.types.stsd,B.STSD,B.avc1(G))},B.tkhd=function(G){var r=G.id,L=G.duration*G.timescale,v=G.width,m=G.height,p=Math.floor(L/(X+1)),h=Math.floor(L%(X+1));return B.box(B.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,r&255,0,0,0,0,p>>24,p>>16&255,p>>8&255,p&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,v>>8&255,v&255,0,0,m>>8&255,m&255,0,0]))},B.traf=function(G,r){var L=B.sdtp(G),v=G.id,m=Math.floor(r/(X+1)),p=Math.floor(r%(X+1));return B.box(B.types.traf,B.box(B.types.tfhd,new Uint8Array([0,0,0,0,v>>24,v>>16&255,v>>8&255,v&255])),B.box(B.types.tfdt,new Uint8Array([1,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,p>>24,p>>16&255,p>>8&255,p&255])),B.trun(G,L.length+16+20+8+16+8+8),L)},B.trak=function(G){return G.duration=G.duration||4294967295,B.box(B.types.trak,B.tkhd(G),B.mdia(G))},B.trex=function(G){var r=G.id;return B.box(B.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},B.trun=function(G,r){var L=G.samples||[],v=L.length,m=12+16*v,p=new Uint8Array(m),h,l,f,o,u,a;for(r+=8+m,p.set([0,0,15,1,v>>>24&255,v>>>16&255,v>>>8&255,v&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255],0),h=0;h<v;h++)l=L[h],f=l.duration,o=l.size,u=l.flags,a=l.cts,p.set([f>>>24&255,f>>>16&255,f>>>8&255,f&255,o>>>24&255,o>>>16&255,o>>>8&255,o&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 B.box(B.types.trun,p)},B.initSegment=function(G){B.types||B.init();var r=B.moov(G),L=new Uint8Array(B.FTYP.byteLength+r.byteLength);return L.set(B.FTYP),L.set(r,B.FTYP.byteLength),L},B}();j.types=void 0,j.HDLR_TYPES=void 0,j.STTS=void 0,j.STSC=void 0,j.STCO=void 0,j.STSZ=void 0,j.VMHD=void 0,j.SMHD=void 0,j.STSD=void 0,j.FTYP=void 0,j.DINF=void 0,J.default=j},"./src/remux/mp4-remuxer.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return a}),P.d(J,"normalizePts",function(){return s});var X=P("./src/polyfills/number.ts"),j=P("./src/remux/aac-helper.ts"),B=P("./src/remux/mp4-generator.ts"),K=P("./src/events.ts"),G=P("./src/errors.ts"),r=P("./src/utils/logger.ts"),L=P("./src/types/loader.ts"),v=P("./src/utils/timescale-conversion.ts");function m(){return m=Object.assign||function(D){for(var O=1;O<arguments.length;O++){var A=arguments[O];for(var S in A)Object.prototype.hasOwnProperty.call(A,S)&&(D[S]=A[S])}return D},m.apply(this,arguments)}var p=10*1e3,h=1024,l=1152,f=null,o=null,u=!1,a=function(){function D(A,S,T,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=A,this.config=S,this.typeSupported=T,this.ISGenerated=!1,f===null){var w=navigator.userAgent||"",y=w.match(/Chrome\/(\d+)/i);f=y?parseInt(y[1]):0}if(o===null){var b=navigator.userAgent.match(/Safari\/(\d+)/i);o=b?parseInt(b[1]):0}u=!!f&&f<75||!!o&&o<600}var O=D.prototype;return O.destroy=function(){},O.resetTimeStamp=function(S){r.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=S},O.resetNextTimestamp=function(){r.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},O.resetInitSegment=function(){r.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},O.getVideoStartPts=function(S){var T=!1,c=S.reduce(function(w,y){var b=y.pts-w;return b<-4294967296?(T=!0,s(w,y.pts)):b>0?w:y.pts},S[0].pts);return T&&r.logger.debug("PTS rollover detected"),c},O.remux=function(S,T,c,w,y,b,U,F){var E,N,I,g,H,$,ie=y,oe=y,Ce=S.pid>-1,ve=T.pid>-1,Se=T.samples.length,Ae=S.samples.length>0,Oe=Se>1,he=(!Ce||Ae)&&(!ve||Oe)||this.ISGenerated||U;if(he){this.ISGenerated||(I=this.generateIS(S,T,y));var ce=this.isVideoContiguous,re=-1;if(Oe&&(re=R(T.samples),!ce&&this.config.forceKeyFrameOnDiscontinuity))if($=!0,re>0){r.logger.warn("[mp4-remuxer]: Dropped "+re+" out of "+Se+" video samples due to a missing keyframe");var fe=this.getVideoStartPts(T.samples);T.samples=T.samples.slice(re),T.dropped+=re,oe+=(T.samples[0].pts-fe)/(T.timescale||9e4)}else re===-1&&(r.logger.warn("[mp4-remuxer]: No keyframe found out of "+Se+" video samples"),$=!1);if(this.ISGenerated){if(Ae&&Oe){var se=this.getVideoStartPts(T.samples),ke=s(S.samples[0].pts,se)-se,Ne=ke/T.inputTimeScale;ie+=Math.max(0,Ne),oe+=Math.max(0,-Ne)}if(Ae){if(S.samplerate||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),I=this.generateIS(S,T,y)),N=this.remuxAudio(S,ie,this.isAudioContiguous,b,ve||Oe||F===L.PlaylistLevelType.AUDIO?oe:void 0),Oe){var Re=N?N.endPTS-N.startPTS:0;T.inputTimeScale||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),I=this.generateIS(S,T,y)),E=this.remuxVideo(T,oe,ce,Re)}}else Oe&&(E=this.remuxVideo(T,oe,ce,0));E&&(E.firstKeyFrame=re,E.independent=re!==-1)}}return this.ISGenerated&&(c.samples.length&&(H=this.remuxID3(c,y)),w.samples.length&&(g=this.remuxText(w,y))),{audio:N,video:E,initSegment:I,independent:$,text:g,id3:H}},O.generateIS=function(S,T,c){var w=S.samples,y=T.samples,b=this.typeSupported,U={},F=!Object(X.isFiniteNumber)(this._initPTS),E="audio/mp4",N,I,g;if(F&&(N=I=Infinity),S.config&&w.length&&(S.timescale=S.samplerate,S.isAAC||(b.mpeg?(E="audio/mpeg",S.codec=""):b.mp3&&(S.codec="mp3")),U.audio={id:"audio",container:E,codec:S.codec,initSegment:!S.isAAC&&b.mpeg?new Uint8Array(0):B.default.initSegment([S]),metadata:{channelCount:S.channelCount}},F&&(g=S.inputTimeScale,N=I=w[0].pts-Math.round(g*c))),T.sps&&T.pps&&y.length&&(T.timescale=T.inputTimeScale,U.video={id:"main",container:"video/mp4",codec:T.codec,initSegment:B.default.initSegment([T]),metadata:{width:T.width,height:T.height}},F)){g=T.inputTimeScale;var H=this.getVideoStartPts(y),$=Math.round(g*c);I=Math.min(I,s(y[0].dts,H)-$),N=Math.min(N,H-$)}if(Object.keys(U).length)return this.ISGenerated=!0,F&&(this._initPTS=N,this._initDTS=I),{tracks:U,initPTS:N,timescale:g}},O.remuxVideo=function(S,T,c,w){var y=S.inputTimeScale,b=S.samples,U=[],F=b.length,E=this._initPTS,N=this.nextAvcDts,I=8,g,H,$,ie=Number.POSITIVE_INFINITY,oe=Number.NEGATIVE_INFINITY,Ce=0,ve=!1;if(!c||N===null){var Se=T*y,Ae=b[0].pts-s(b[0].dts,b[0].pts);N=Se-Ae}for(var Oe=0;Oe<F;Oe++){var he=b[Oe];if(he.pts=s(he.pts-E,N),he.dts=s(he.dts-E,N),he.dts>he.pts){var ce=9e4*.2;Ce=Math.max(Math.min(Ce,he.pts-he.dts),-1*ce)}he.dts<b[Oe>0?Oe-1:Oe].dts&&(ve=!0)}ve&&b.sort(function(wt,St){var ct=wt.dts-St.dts,Ut=wt.pts-St.pts;return ct||Ut}),H=b[0].dts,$=b[b.length-1].dts;var re=Math.round(($-H)/(F-1));if(Ce<0){if(Ce<re*-2){r.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(v.toMsFromMpegTsClock)(-re,!0)+" ms");for(var fe=Ce,se=0;se<F;se++)b[se].dts=fe=Math.max(fe,b[se].pts-re),b[se].pts=Math.max(fe,b[se].pts)}else{r.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(v.toMsFromMpegTsClock)(Ce,!0)+" ms to overcome this issue");for(var ke=0;ke<F;ke++)b[ke].dts=b[ke].dts+Ce}H=b[0].dts}if(c){var Ne=H-N,Re=Ne>re,Pe=Ne<-1;if(Re||Pe){Re?r.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(Ne,!0)+" ms ("+Ne+"dts) hole between fragments detected, filling it"):r.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(-Ne,!0)+" ms ("+Ne+"dts) overlapping between fragments detected"),H=N;var je=b[0].pts-Ne;b[0].dts=H,b[0].pts=je,r.logger.log("Video: First PTS/DTS adjusted: "+Object(v.toMsFromMpegTsClock)(je,!0)+"/"+Object(v.toMsFromMpegTsClock)(H,!0)+", delta: "+Object(v.toMsFromMpegTsClock)(Ne,!0)+" ms")}}u&&(H=Math.max(0,H));for(var ue=0,Ee=0,Le=0;Le<F;Le++){for(var Ie=b[Le],Ge=Ie.units,Xe=Ge.length,Je=0,Qe=0;Qe<Xe;Qe++)Je+=Ge[Qe].data.length;Ee+=Je,ue+=Xe,Ie.length=Je,Ie.dts=Math.max(Ie.dts,H),Ie.pts=Math.max(Ie.pts,Ie.dts,0),ie=Math.min(Ie.pts,ie),oe=Math.max(Ie.pts,oe)}$=b[F-1].dts;var at=Ee+4*ue+8,qe;try{qe=new Uint8Array(at)}catch(wt){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:G.ErrorTypes.MUX_ERROR,details:G.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:at,reason:"fail allocating video mdat "+at});return}var tt=new DataView(qe.buffer);tt.setUint32(0,at),qe.set(B.default.types.mdat,4);for(var Be=0;Be<F;Be++){for(var ut=b[Be],ot=ut.units,Ue=0,He=0,Te=ot.length;He<Te;He++){var me=ot[He],be=me.data,ae=me.data.byteLength;tt.setUint32(I,ae),I+=4,qe.set(be,I),I+=ae,Ue+=4+ae}if(Be<F-1)g=b[Be+1].dts-ut.dts;else{var le=this.config,de=ut.dts-b[Be>0?Be-1:Be].dts;if(le.stretchShortVideoTrack&&this.nextAudioPts!==null){var ge=Math.floor(le.maxBufferHole*y),we=(w?ie+w*y:this.nextAudioPts)-ut.pts;we>ge?(g=we-de,g<0&&(g=de),r.logger.log("[mp4-remuxer]: It is approximately "+we/90+" ms to the next segment; using duration "+g/90+" ms for the last video frame.")):g=de}else g=de}var Fe=Math.round(ut.pts-ut.dts);U.push(new _(ut.key,g,Ue,Fe))}if(U.length&&f&&f<70){var ze=U[0].flags;ze.dependsOn=2,ze.isNonSync=0}console.assert(g!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=N=$+g,this.isVideoContiguous=!0;var st=B.default.moof(S.sequenceNumber++,H,m({},S,{samples:U})),mt="video",ft={data1:st,data2:qe,startPTS:ie/y,endPTS:(oe+g)/y,startDTS:H/y,endDTS:N/y,type:mt,hasAudio:!1,hasVideo:!0,nb:U.length,dropped:S.dropped};return S.samples=[],S.dropped=0,console.assert(qe.length,"MDAT length must not be zero"),ft},O.remuxAudio=function(S,T,c,w,y){var b=S.inputTimeScale,U=S.samplerate?S.samplerate:b,F=b/U,E=S.isAAC?h:l,N=E*F,I=this._initPTS,g=!S.isAAC&&this.typeSupported.mpeg,H=[],$=S.samples,ie=g?0:8,oe=this.nextAudioPts||-1,Ce=T*b;if(this.isAudioContiguous=c=c||$.length&&oe>0&&(w&&Math.abs(Ce-oe)<9e3||Math.abs(s($[0].pts-I,Ce)-oe)<20*N),$.forEach(function(be){be.pts=s(be.pts-I,Ce)}),!c||oe<0){if($=$.filter(function(be){return be.pts>=0}),!$.length)return;y===0?oe=0:w?oe=Math.max(0,Ce):oe=$[0].pts}if(S.isAAC)for(var ve=y!==void 0,Se=this.config.maxAudioFramesDrift,Ae=0,Oe=oe;Ae<$.length;Ae++){var he=$[Ae],ce=he.pts,re=ce-Oe,fe=Math.abs(1e3*re/b);if(re<=-Se*N&&ve)Ae===0&&(r.logger.warn("Audio frame @ "+(ce/b).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*re/b)+" ms."),this.nextAudioPts=oe=Oe=ce);else if(re>=Se*N&&fe<p&&ve){var se=Math.round(re/N);Oe=ce-se*N,Oe<0&&(se--,Oe+=N),Ae===0&&(this.nextAudioPts=oe=Oe),r.logger.warn("[mp4-remuxer]: Injecting "+se+" audio frame @ "+(Oe/b).toFixed(3)+"s due to "+Math.round(1e3*re/b)+" ms gap.");for(var ke=0;ke<se;ke++){var Ne=Math.max(Oe,0),Re=j.default.getSilentFrame(S.manifestCodec||S.codec,S.channelCount);Re||(r.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Re=he.unit.subarray()),$.splice(Ae,0,{unit:Re,pts:Ne}),Oe+=N,Ae++}}he.pts=Oe,Oe+=N}for(var Pe=null,je=null,ue,Ee=0,Le=$.length;Le--;)Ee+=$[Le].unit.byteLength;for(var Ie=0,Ge=$.length;Ie<Ge;Ie++){var Xe=$[Ie],Je=Xe.unit,Qe=Xe.pts;if(je!==null){var at=H[Ie-1];at.duration=Math.round((Qe-je)/F)}else if(c&&S.isAAC&&(Qe=oe),Pe=Qe,Ee>0){Ee+=ie;try{ue=new Uint8Array(Ee)}catch(be){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:G.ErrorTypes.MUX_ERROR,details:G.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ee,reason:"fail allocating audio mdat "+Ee});return}if(!g){var qe=new DataView(ue.buffer);qe.setUint32(0,Ee),ue.set(B.default.types.mdat,4)}}else return;ue.set(Je,ie);var tt=Je.byteLength;ie+=tt,H.push(new _(!0,E,tt,0)),je=Qe}var Be=H.length;if(!Be)return;var ut=H[H.length-1];this.nextAudioPts=oe=je+F*ut.duration;var ot=g?new Uint8Array(0):B.default.moof(S.sequenceNumber++,Pe/F,m({},S,{samples:H}));S.samples=[];var Ue=Pe/b,He=oe/b,Te="audio",me={data1:ot,data2:ue,startPTS:Ue,endPTS:He,startDTS:Ue,endDTS:He,type:Te,hasAudio:!0,hasVideo:!1,nb:Be};return this.isAudioContiguous=!0,console.assert(ue.length,"MDAT length must not be zero"),me},O.remuxEmptyAudio=function(S,T,c,w){var y=S.inputTimeScale,b=S.samplerate?S.samplerate:y,U=y/b,F=this.nextAudioPts,E=(F!==null?F:w.startDTS*y)+this._initDTS,N=w.endDTS*y+this._initDTS,I=U*h,g=Math.ceil((N-E)/I),H=j.default.getSilentFrame(S.manifestCodec||S.codec,S.channelCount);if(r.logger.warn("[mp4-remuxer]: remux empty Audio"),!H){r.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var $=[],ie=0;ie<g;ie++){var oe=E+ie*I;$.push({unit:H,pts:oe,dts:oe})}return S.samples=$,this.remuxAudio(S,T,c,!1)},O.remuxID3=function(S,T){var c=S.samples.length;if(!c)return;for(var w=S.inputTimeScale,y=this._initPTS,b=this._initDTS,U=0;U<c;U++){var F=S.samples[U];F.pts=s(F.pts-y,T*w)/w,F.dts=s(F.dts-b,T*w)/w}var E=S.samples;return S.samples=[],{samples:E}},O.remuxText=function(S,T){var c=S.samples.length;if(!c)return;for(var w=S.inputTimeScale,y=this._initPTS,b=0;b<c;b++){var U=S.samples[b];U.pts=s(U.pts-y,T*w)/w}S.samples.sort(function(E,N){return E.pts-N.pts});var F=S.samples;return S.samples=[],{samples:F}},D}();function s(D,O){var A;if(O===null)return D;for(O<D?A=-8589934592:A=8589934592;Math.abs(D-O)>4294967296;)D+=A;return D}function R(D){for(var O=0;O<D.length;O++)if(D[O].key)return O;return-1}var _=function(O,A,S,T){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=A,this.size=S,this.cts=T,this.flags=new C(O)},C=function(O){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=O?2:1,this.isNonSync=O?0:1}},"./src/remux/passthrough-remuxer.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/polyfills/number.ts"),j=P("./src/utils/mp4-tools.ts"),B=P("./src/loader/fragment.ts"),K=P("./src/utils/logger.ts"),G=function(){function v(){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 m=v.prototype;return m.destroy=function(){},m.resetTimeStamp=function(h){this.initPTS=h,this.lastEndDTS=null},m.resetNextTimestamp=function(){this.lastEndDTS=null},m.resetInitSegment=function(h,l,f){this.audioCodec=l,this.videoCodec=f,this.generateInitSegment(h),this.emitInitSegment=!0},m.generateInitSegment=function(h){var l=this.audioCodec,f=this.videoCodec;if(!h||!h.byteLength){this.initTracks=void 0,this.initData=void 0;return}var o=this.initData=Object(j.parseInitSegment)(h);l||(l=L(o.audio,B.ElementaryStreamTypes.AUDIO)),f||(f=L(o.video,B.ElementaryStreamTypes.VIDEO));var u={};o.audio&&o.video?u.audiovideo={container:"video/mp4",codec:l+","+f,initSegment:h,id:"main"}:o.audio?u.audio={container:"audio/mp4",codec:l,initSegment:h,id:"audio"}:o.video?u.video={container:"video/mp4",codec:f,initSegment:h,id:"main"}:K.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=u},m.remux=function(h,l,f,o,u){var a=this.initPTS,s=this.lastEndDTS,R={audio:void 0,video:void 0,text:o,id3:f,initSegment:void 0};Object(X.isFiniteNumber)(s)||(s=this.lastEndDTS=u||0);var _=l.samples;if(!_||!_.length)return R;var C={initPTS:void 0,timescale:1},D=this.initData;if((!D||!D.length)&&(this.generateInitSegment(_),D=this.initData),!D||!D.length)return K.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),R;this.emitInitSegment&&(C.tracks=this.initTracks,this.emitInitSegment=!1),Object(X.isFiniteNumber)(a)||(this.initPTS=C.initPTS=a=r(D,_,s));var O=Object(j.getDuration)(_,D),A=s,S=O+A;Object(j.offsetStartDTS)(D,_,a),O>0?this.lastEndDTS=S:(K.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var T=!!D.audio,c=!!D.video,w="";T&&(w+="audio"),c&&(w+="video");var y={data1:_,startPTS:A,startDTS:A,endPTS:S,endDTS:S,type:w,hasAudio:T,hasVideo:c,nb:1,dropped:0};return R.audio=y.type==="audio"?y:void 0,R.video=y.type!=="audio"?y:void 0,R.text=o,R.id3=f,R.initSegment=C,R},v}(),r=function(m,p,h){return Object(j.getStartDTS)(m,p)-h};function L(v,m){var p=v==null?void 0:v.codec;return p&&p.length>4?p:p==="hvc1"?"hvc1.1.c.L120.90":p==="av01"?"av01.0.04M.08":p==="avc1"||m===B.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}J.default=G},"./src/task-loop.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return X});var X=function(){function j(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var B=j.prototype;return B.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},B.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},B.onHandlerDestroyed=function(){},B.hasInterval=function(){return!!this._tickInterval},B.hasNextTick=function(){return!!this._tickTimer},B.setInterval=function(G){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,G),!0)},B.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},B.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},B.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},B.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},B.doTick=function(){},j}()},"./src/types/cmcd.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"CMCDVersion",function(){return X}),P.d(J,"CMCDObjectType",function(){return j}),P.d(J,"CMCDStreamingFormat",function(){return B}),P.d(J,"CMCDStreamType",function(){return K});var X=1,j;(function(G){G.MANIFEST="m",G.AUDIO="a",G.VIDEO="v",G.MUXED="av",G.INIT="i",G.CAPTION="c",G.TIMED_TEXT="tt",G.KEY="k",G.OTHER="o"})(j||(j={}));var B;(function(G){G.DASH="d",G.HLS="h",G.SMOOTH="s",G.OTHER="o"})(B||(B={}));var K;(function(G){G.VOD="v",G.LIVE="l"})(K||(K={}))},"./src/types/level.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"HlsSkip",function(){return B}),P.d(J,"getSkipValue",function(){return K}),P.d(J,"HlsUrlParameters",function(){return G}),P.d(J,"Level",function(){return r});function X(L,v){for(var m=0;m<v.length;m++){var p=v[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(L,p.key,p)}}function j(L,v,m){return v&&X(L.prototype,v),m&&X(L,m),L}var B;(function(L){L.No="",L.Yes="YES",L.v2="v2"})(B||(B={}));function K(L,v){var m=L.canSkipUntil,p=L.canSkipDateRanges,h=L.endSN,l=v!==void 0?v-h:0;return m&&l<m?p?B.v2:B.Yes:B.No}var G=function(){function L(m,p,h){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=m,this.part=p,this.skip=h}var v=L.prototype;return v.addDirectives=function(p){var h=new self.URL(p);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()},L}(),r=function(){function L(v){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=[v.url],this.attrs=v.attrs,this.bitrate=v.bitrate,v.details&&(this.details=v.details),this.id=v.id||0,this.name=v.name,this.width=v.width||0,this.height=v.height||0,this.audioCodec=v.audioCodec,this.videoCodec=v.videoCodec,this.unknownCodecs=v.unknownCodecs,this.codecSet=[v.videoCodec,v.audioCodec].filter(function(m){return m}).join(",").replace(/\.[^.,]+/g,"")}return j(L,[{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(m){var p=m%this.url.length;this._urlId!==p&&(this.details=void 0,this._urlId=p)}}]),L}()},"./src/types/loader.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"PlaylistContextType",function(){return X}),P.d(J,"PlaylistLevelType",function(){return j});var X;(function(B){B.MANIFEST="manifest",B.LEVEL="level",B.AUDIO_TRACK="audioTrack",B.SUBTITLE_TRACK="subtitleTrack"})(X||(X={}));var j;(function(B){B.MAIN="main",B.AUDIO="audio",B.SUBTITLE="subtitle"})(j||(j={}))},"./src/types/transmuxer.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"ChunkMetadata",function(){return X});var X=function(K,G,r,L,v,m){L===void 0&&(L=0),v===void 0&&(v=-1),m===void 0&&(m=!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=j(),this.buffering={audio:j(),video:j(),audiovideo:j()},this.level=K,this.sn=G,this.id=r,this.size=L,this.part=v,this.partial=m};function j(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"AttrList",function(){return B});var X=/^(\d+)x(\d+)$/,j=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,B=function(){function K(r){typeof r=="string"&&(r=K.parseAttrList(r));for(var L in r)r.hasOwnProperty(L)&&(this[L]=r[L])}var G=K.prototype;return G.decimalInteger=function(L){var v=parseInt(this[L],10);return v>Number.MAX_SAFE_INTEGER?Infinity:v},G.hexadecimalInteger=function(L){if(this[L]){var v=(this[L]||"0x").slice(2);v=(v.length&1?"0":"")+v;for(var m=new Uint8Array(v.length/2),p=0;p<v.length/2;p++)m[p]=parseInt(v.slice(p*2,p*2+2),16);return m}else return null},G.hexadecimalIntegerAsNumber=function(L){var v=parseInt(this[L],16);return v>Number.MAX_SAFE_INTEGER?Infinity:v},G.decimalFloatingPoint=function(L){return parseFloat(this[L])},G.optionalFloat=function(L,v){var m=this[L];return m?parseFloat(m):v},G.enumeratedString=function(L){return this[L]},G.bool=function(L){return this[L]==="YES"},G.decimalResolution=function(L){var v=X.exec(this[L]);return v===null?void 0:{width:parseInt(v[1],10),height:parseInt(v[2],10)}},K.parseAttrList=function(L){var v,m={},p='"';for(j.lastIndex=0;(v=j.exec(L))!==null;){var h=v[2];h.indexOf(p)===0&&h.lastIndexOf(p)===h.length-1&&(h=h.slice(1,-1)),m[v[1]]=h}return m},K}()},"./src/utils/binary-search.ts":function(ne,J,P){"use strict";P.r(J);var X={search:function(B,K){for(var G=0,r=B.length-1,L=null,v=null;G<=r;){L=(G+r)/2|0,v=B[L];var m=K(v);if(m>0)G=L+1;else if(m<0)r=L-1;else return v}return null}};J.default=X},"./src/utils/buffer-helper.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"BufferHelper",function(){return B});var X=P("./src/utils/logger.ts"),j={length:0,start:function(){return 0},end:function(){return 0}},B=function(){function K(){}return K.isBuffered=function(r,L){try{if(r){for(var v=K.getBuffered(r),m=0;m<v.length;m++)if(L>=v.start(m)&&L<=v.end(m))return!0}}catch(p){}return!1},K.bufferInfo=function(r,L,v){try{if(r){var m=K.getBuffered(r),p=[],h;for(h=0;h<m.length;h++)p.push({start:m.start(h),end:m.end(h)});return this.bufferedInfo(p,L,v)}}catch(l){}return{len:0,start:L,end:L,nextStart:void 0}},K.bufferedInfo=function(r,L,v){L=Math.max(0,L),r.sort(function(C,D){var O=C.start-D.start;return O||D.end-C.end});var m=[];if(v)for(var p=0;p<r.length;p++){var h=m.length;if(h){var l=m[h-1].end;r[p].start-l<v?r[p].end>l&&(m[h-1].end=r[p].end):m.push(r[p])}else m.push(r[p])}else m=r;for(var f=0,o,u=L,a=L,s=0;s<m.length;s++){var R=m[s].start,_=m[s].end;if(L+v>=R&&L<_)u=R,a=_,f=a-L;else if(L+v<R){o=R;break}}return{len:f,start:u||0,end:a||0,nextStart:o}},K.getBuffered=function(r){try{return r.buffered}catch(L){return X.logger.log("failed to get media.buffered",L),j}},K}()},"./src/utils/cea-608-parser.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"Row",function(){return a}),P.d(J,"CaptionScreen",function(){return s});var X=P("./src/utils/logger.ts"),j={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},B=function(S){var T=S;return j.hasOwnProperty(S)&&(T=j[S]),String.fromCharCode(T)},K=15,G=100,r={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},L={17:2,18:4,21:6,22:8,23:10,19:13,20:15},v={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},m={25:2,26:4,29:6,30:8,31:10,27:13,28:15},p=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],h;(function(A){A[A.ERROR=0]="ERROR",A[A.TEXT=1]="TEXT",A[A.WARNING=2]="WARNING",A[A.INFO=2]="INFO",A[A.DEBUG=3]="DEBUG",A[A.DATA=3]="DATA"})(h||(h={}));var l=function(){function A(){this.time=null,this.verboseLevel=h.ERROR}var S=A.prototype;return S.log=function(c,w){this.verboseLevel>=c&&X.logger.log(this.time+" ["+c+"] "+w)},A}(),f=function(S){for(var T=[],c=0;c<S.length;c++)T.push(S[c].toString(16));return T},o=function(){function A(T,c,w,y,b){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=T||"white",this.underline=c||!1,this.italics=w||!1,this.background=y||"black",this.flash=b||!1}var S=A.prototype;return S.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},S.setStyles=function(c){for(var w=["foreground","underline","italics","background","flash"],y=0;y<w.length;y++){var b=w[y];c.hasOwnProperty(b)&&(this[b]=c[b])}},S.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},S.equals=function(c){return this.foreground===c.foreground&&this.underline===c.underline&&this.italics===c.italics&&this.background===c.background&&this.flash===c.flash},S.copy=function(c){this.foreground=c.foreground,this.underline=c.underline,this.italics=c.italics,this.background=c.background,this.flash=c.flash},S.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},A}(),u=function(){function A(T,c,w,y,b,U){this.uchar=void 0,this.penState=void 0,this.uchar=T||" ",this.penState=new o(c,w,y,b,U)}var S=A.prototype;return S.reset=function(){this.uchar=" ",this.penState.reset()},S.setChar=function(c,w){this.uchar=c,this.penState.copy(w)},S.setPenState=function(c){this.penState.copy(c)},S.equals=function(c){return this.uchar===c.uchar&&this.penState.equals(c.penState)},S.copy=function(c){this.uchar=c.uchar,this.penState.copy(c.penState)},S.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},A}(),a=function(){function A(T){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<G;c++)this.chars.push(new u);this.logger=T,this.pos=0,this.currPenState=new o}var S=A.prototype;return S.equals=function(c){for(var w=!0,y=0;y<G;y++)if(!this.chars[y].equals(c.chars[y])){w=!1;break}return w},S.copy=function(c){for(var w=0;w<G;w++)this.chars[w].copy(c.chars[w])},S.isEmpty=function(){for(var c=!0,w=0;w<G;w++)if(!this.chars[w].isEmpty()){c=!1;break}return c},S.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>G&&(this.logger.log(h.DEBUG,"Too large cursor position "+this.pos),this.pos=G)},S.moveCursor=function(c){var w=this.pos+c;if(c>1)for(var y=this.pos+1;y<w+1;y++)this.chars[y].setPenState(this.currPenState);this.setCursor(w)},S.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},S.insertChar=function(c){c>=144&&this.backSpace();var w=B(c);if(this.pos>=G){this.logger.log(h.ERROR,"Cannot insert "+c.toString(16)+" ("+w+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(w,this.currPenState),this.moveCursor(1)},S.clearFromPos=function(c){var w;for(w=c;w<G;w++)this.chars[w].reset()},S.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},S.clearToEndOfRow=function(){this.clearFromPos(this.pos)},S.getTextString=function(){for(var c=[],w=!0,y=0;y<G;y++){var b=this.chars[y].uchar;b!==" "&&(w=!1),c.push(b)}return w?"":c.join("")},S.setPenStyles=function(c){this.currPenState.setStyles(c);var w=this.chars[this.pos];w.setPenState(this.currPenState)},A}(),s=function(){function A(T){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<K;c++)this.rows.push(new a(T));this.logger=T,this.currRow=K-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var S=A.prototype;return S.reset=function(){for(var c=0;c<K;c++)this.rows[c].clear();this.currRow=K-1},S.equals=function(c){for(var w=!0,y=0;y<K;y++)if(!this.rows[y].equals(c.rows[y])){w=!1;break}return w},S.copy=function(c){for(var w=0;w<K;w++)this.rows[w].copy(c.rows[w])},S.isEmpty=function(){for(var c=!0,w=0;w<K;w++)if(!this.rows[w].isEmpty()){c=!1;break}return c},S.backSpace=function(){var c=this.rows[this.currRow];c.backSpace()},S.clearToEndOfRow=function(){var c=this.rows[this.currRow];c.clearToEndOfRow()},S.insertChar=function(c){var w=this.rows[this.currRow];w.insertChar(c)},S.setPen=function(c){var w=this.rows[this.currRow];w.setPenStyles(c)},S.moveCursor=function(c){var w=this.rows[this.currRow];w.moveCursor(c)},S.setCursor=function(c){this.logger.log(h.INFO,"setCursor: "+c);var w=this.rows[this.currRow];w.setCursor(c)},S.setPAC=function(c){this.logger.log(h.INFO,"pacData = "+JSON.stringify(c));var w=c.row-1;if(this.nrRollUpRows&&w<this.nrRollUpRows-1&&(w=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==w){for(var y=0;y<K;y++)this.rows[y].clear();var b=this.currRow+1-this.nrRollUpRows,U=this.lastOutputScreen;if(U){var F=U.rows[b].cueStartTime,E=this.logger.time;if(F&&E!==null&&F<E)for(var N=0;N<this.nrRollUpRows;N++)this.rows[w-this.nrRollUpRows+N+1].copy(U.rows[b+N])}}this.currRow=w;var I=this.rows[this.currRow];if(c.indent!==null){var g=c.indent,H=Math.max(g-1,0);I.setCursor(c.indent),c.color=I.chars[H].penState.foreground}var $={foreground:c.color,underline:c.underline,italics:c.italics,background:"black",flash:!1};this.setPen($)},S.setBkgData=function(c){this.logger.log(h.INFO,"bkgData = "+JSON.stringify(c)),this.backSpace(),this.setPen(c),this.insertChar(32)},S.setRollUpRows=function(c){this.nrRollUpRows=c},S.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,w=this.rows.splice(c,1)[0];w.clear(),this.rows.splice(this.currRow,0,w),this.logger.log(h.INFO,"Rolling up")},S.getDisplayText=function(c){c=c||!1;for(var w=[],y="",b=-1,U=0;U<K;U++){var F=this.rows[U].getTextString();F&&(b=U+1,c?w.push("Row "+b+": '"+F+"'"):w.push(F.trim()))}return w.length>0&&(c?y="["+w.join(" | ")+"]":y=w.join(`
`)),y},S.getTextAndFormat=function(){return this.rows},A}(),R=function(){function A(T,c,w){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=T,this.outputFilter=c,this.mode=null,this.verbose=0,this.displayedMemory=new s(w),this.nonDisplayedMemory=new s(w),this.lastOutputScreen=new s(w),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=w}var S=A.prototype;return S.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},S.getHandler=function(){return this.outputFilter},S.setHandler=function(c){this.outputFilter=c},S.setPAC=function(c){this.writeScreen.setPAC(c)},S.setBkgData=function(c){this.writeScreen.setBkgData(c)},S.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},S.insertChars=function(c){for(var w=0;w<c.length;w++)this.writeScreen.insertChar(c[w]);var y=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(h.INFO,y+": "+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())},S.ccRCL=function(){this.logger.log(h.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},S.ccBS=function(){if(this.logger.log(h.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},S.ccAOF=function(){},S.ccAON=function(){},S.ccDER=function(){this.logger.log(h.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},S.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)},S.ccFON=function(){this.logger.log(h.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},S.ccRDC=function(){this.logger.log(h.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},S.ccTR=function(){this.logger.log(h.INFO,"TR"),this.setMode("MODE_TEXT")},S.ccRTD=function(){this.logger.log(h.INFO,"RTD"),this.setMode("MODE_TEXT")},S.ccEDM=function(){this.logger.log(h.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},S.ccCR=function(){this.logger.log(h.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},S.ccENM=function(){this.logger.log(h.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},S.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)},S.ccTO=function(c){this.logger.log(h.INFO,"TO("+c+") - Tab Offset"),this.writeScreen.moveCursor(c)},S.ccMIDROW=function(c){var w={flash:!1};if(w.underline=c%2===1,w.italics=c>=46,w.italics)w.foreground="white";else{var y=Math.floor(c/2)-16,b=["white","green","blue","cyan","red","yellow","magenta"];w.foreground=b[y]}this.logger.log(h.INFO,"MIDROW: "+JSON.stringify(w)),this.writeScreen.setPen(w)},S.outputDataUpdate=function(c){c===void 0&&(c=!1);var w=this.logger.time;if(w===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=w:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,w,this.lastOutputScreen),c&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:w),this.lastOutputScreen.copy(this.displayedMemory))},S.cueSplitAtTime=function(c){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,c,this.displayedMemory),this.cueStartTime=c))},A}(),_=function(){function A(T,c,w){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var y=new l;this.channels=[null,new R(T,c,y),new R(T+1,w,y)],this.cmdHistory=O(),this.logger=y}var S=A.prototype;return S.getHandler=function(c){return this.channels[c].getHandler()},S.setHandler=function(c,w){this.channels[c].setHandler(w)},S.addData=function(c,w){var y,b,U,F=!1;this.logger.time=c;for(var E=0;E<w.length;E+=2){if(b=w[E]&127,U=w[E+1]&127,b===0&&U===0)continue;if(this.logger.log(h.DATA,"["+f([w[E],w[E+1]])+"] -> ("+f([b,U])+")"),y=this.parseCmd(b,U),y||(y=this.parseMidrow(b,U)),y||(y=this.parsePAC(b,U)),y||(y=this.parseBackgroundAttributes(b,U)),!y&&(F=this.parseChars(b,U),F)){var N=this.currentChannel;if(N&&N>0){var I=this.channels[N];I.insertChars(F)}else this.logger.log(h.WARNING,"No channel found yet. TEXT-MODE?")}!y&&!F&&this.logger.log(h.WARNING,"Couldn't parse cleaned data "+f([b,U])+" orig: "+f([w[E],w[E+1]]))}},S.parseCmd=function(c,w){var y=this.cmdHistory,b=(c===20||c===28||c===21||c===29)&&w>=32&&w<=47,U=(c===23||c===31)&&w>=33&&w<=35;if(!(b||U))return!1;if(D(c,w,y))return C(null,null,y),this.logger.log(h.DEBUG,"Repeated command ("+f([c,w])+") is dropped"),!0;var F=c===20||c===21||c===23?1:2,E=this.channels[F];return c===20||c===21||c===28||c===29?w===32?E.ccRCL():w===33?E.ccBS():w===34?E.ccAOF():w===35?E.ccAON():w===36?E.ccDER():w===37?E.ccRU(2):w===38?E.ccRU(3):w===39?E.ccRU(4):w===40?E.ccFON():w===41?E.ccRDC():w===42?E.ccTR():w===43?E.ccRTD():w===44?E.ccEDM():w===45?E.ccCR():w===46?E.ccENM():w===47&&E.ccEOC():E.ccTO(w-32),C(c,w,y),this.currentChannel=F,!0},S.parseMidrow=function(c,w){var y=0;if((c===17||c===25)&&w>=32&&w<=47){if(c===17?y=1:y=2,y!==this.currentChannel)return this.logger.log(h.ERROR,"Mismatch channel in midrow parsing"),!1;var b=this.channels[y];return b?(b.ccMIDROW(w),this.logger.log(h.DEBUG,"MIDROW ("+f([c,w])+")"),!0):!1}return!1},S.parsePAC=function(c,w){var y,b=this.cmdHistory,U=(c>=17&&c<=23||c>=25&&c<=31)&&w>=64&&w<=127,F=(c===16||c===24)&&w>=64&&w<=95;if(!(U||F))return!1;if(D(c,w,b))return C(null,null,b),!0;var E=c<=23?1:2;w>=64&&w<=95?y=E===1?r[c]:v[c]:y=E===1?L[c]:m[c];var N=this.channels[E];return N?(N.setPAC(this.interpretPAC(y,w)),C(c,w,b),this.currentChannel=E,!0):!1},S.interpretPAC=function(c,w){var y,b={color:null,italics:!1,indent:null,underline:!1,row:c};return w>95?y=w-96:y=w-64,b.underline=(y&1)===1,y<=13?b.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(y/2)]:y<=15?(b.italics=!0,b.color="white"):b.indent=Math.floor((y-16)/2)*4,b},S.parseChars=function(c,w){var y,b=null,U=null;if(c>=25?(y=2,U=c-8):(y=1,U=c),U>=17&&U<=19){var F;U===17?F=w+80:U===18?F=w+112:F=w+144,this.logger.log(h.INFO,"Special char '"+B(F)+"' in channel "+y),b=[F]}else c>=32&&c<=127&&(b=w===0?[c]:[c,w]);if(b){var E=f(b);this.logger.log(h.DEBUG,"Char codes = "+E.join(",")),C(c,w,this.cmdHistory)}return b},S.parseBackgroundAttributes=function(c,w){var y=(c===16||c===24)&&w>=32&&w<=47,b=(c===23||c===31)&&w>=45&&w<=47;if(!(y||b))return!1;var U,F={};c===16||c===24?(U=Math.floor((w-32)/2),F.background=p[U],w%2===1&&(F.background=F.background+"_semi")):w===45?F.background="transparent":(F.foreground="black",w===47&&(F.underline=!0));var E=c<=23?1:2,N=this.channels[E];return N.setBkgData(F),C(c,w,this.cmdHistory),!0},S.reset=function(){for(var c=0;c<Object.keys(this.channels).length;c++){var w=this.channels[c];w&&w.reset()}this.cmdHistory=O()},S.cueSplitAtTime=function(c){for(var w=0;w<this.channels.length;w++){var y=this.channels[w];y&&y.cueSplitAtTime(c)}},A}();function C(A,S,T){T.a=A,T.b=S}function D(A,S,T){return T.a===A&&T.b===S}function O(){return{a:null,b:null}}J.default=_},"./src/utils/codecs.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"isCodecType",function(){return j}),P.d(J,"isCodecSupportedInMp4",function(){return B});var X={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 j(K,G){var r=X[G];return!!r&&r[K.slice(0,4)]===!0}function B(K,G){return MediaSource.isTypeSupported((G||"video")+'/mp4;codecs="'+K+'"')}},"./src/utils/cues.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/utils/vttparser.ts"),j=P("./src/utils/webvtt-parser.ts"),B=P("./src/utils/texttrack-utils.ts"),K=/\s/,G={newCue:function(L,v,m,p){for(var h=[],l,f,o,u,a,s=self.VTTCue||self.TextTrackCue,R=0;R<p.rows.length;R++)if(l=p.rows[R],o=!0,u=0,a="",!l.isEmpty()){for(var _=0;_<l.chars.length;_++)K.test(l.chars[_].uchar)&&o?u++:(a+=l.chars[_].uchar,o=!1);l.cueStartTime=v,v===m&&(m+=1e-4),u>=16?u--:u++;var C=Object(X.fixLineBreaks)(a.trim()),D=Object(j.generateCueId)(v,m,C);(!L||!L.cues||!L.cues.getCueById(D))&&(f=new s(v,m,C),f.id=D,f.line=R+1,f.align="left",f.position=10+Math.min(80,Math.floor(u*8/32)*10),h.push(f))}return L&&h.length&&(h.sort(function(O,A){return O.line==="auto"||A.line==="auto"?0:O.line>8&&A.line>8?A.line-O.line:O.line-A.line}),h.forEach(function(O){return Object(B.addCueToTrack)(L,O)})),h}};J.default=G},"./src/utils/discontinuities.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"findFirstFragWithCC",function(){return K}),P.d(J,"shouldAlignOnDiscontinuities",function(){return G}),P.d(J,"findDiscontinuousReferenceFrag",function(){return r}),P.d(J,"adjustSlidingStart",function(){return v}),P.d(J,"alignStream",function(){return m}),P.d(J,"alignPDT",function(){return h}),P.d(J,"alignFragmentByPDTDelta",function(){return l}),P.d(J,"alignMediaPlaylistByPDT",function(){return f});var X=P("./src/polyfills/number.ts"),j=P("./src/utils/logger.ts"),B=P("./src/controller/level-helper.ts");function K(o,u){for(var a=null,s=0,R=o.length;s<R;s++){var _=o[s];if(_&&_.cc===u){a=_;break}}return a}function G(o,u,a){return!!(u.details&&(a.endCC>a.startCC||o&&o.cc<a.startCC))}function r(o,u){var a=o.fragments,s=u.fragments;if(!s.length||!a.length){j.logger.log("No fragments to align");return}var R=K(a,s[0].cc);if(!R||R&&!R.startPTS){j.logger.log("No frag in previous level to align on");return}return R}function L(o,u){if(o){var a=o.start+u;o.start=o.startPTS=a,o.endPTS=a+o.duration}}function v(o,u){for(var a=u.fragments,s=0,R=a.length;s<R;s++)L(a[s],o);u.fragmentHint&&L(u.fragmentHint,o),u.alignedSliding=!0}function m(o,u,a){if(!u)return;p(o,a,u),!a.alignedSliding&&u.details&&h(a,u.details),!a.alignedSliding&&u.details&&!a.skippedSegments&&Object(B.adjustSliding)(u.details,a)}function p(o,u,a){if(G(o,a,u)){var s=r(a.details,u);s&&Object(X.isFiniteNumber)(s.start)&&(j.logger.log("Adjusting PTS using last level due to CC increase within current level "+u.url),v(s.start,u))}}function h(o,u){if(!u.fragments.length||!o.hasProgramDateTime||!u.hasProgramDateTime)return;var a=u.fragments[0].programDateTime,s=o.fragments[0].programDateTime,R=(s-a)/1e3+u.fragments[0].start;R&&Object(X.isFiniteNumber)(R)&&(j.logger.log("Adjusting PTS using programDateTime delta "+(s-a)+"ms, sliding:"+R.toFixed(3)+" "+o.url+" "),v(R,o))}function l(o,u){var a=o.programDateTime;if(!a)return;var s=(a-u)/1e3;o.start=o.startPTS=s,o.endPTS=s+o.duration}function f(o,u){if(!u.fragments.length||!o.hasProgramDateTime||!u.hasProgramDateTime)return;var a=u.fragments[0].programDateTime,s=u.fragments[0].start,R=a-s*1e3;o.fragments.forEach(function(_){l(_,R)}),o.fragmentHint&&l(o.fragmentHint,R),o.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/utils/ewma.ts"),j=function(){function B(G,r,L){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=L,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new X.default(G),this.fast_=new X.default(r)}var K=B.prototype;return K.update=function(r,L){var v=this.slow_,m=this.fast_;this.slow_.halfLife!==r&&(this.slow_=new X.default(r,v.getEstimate(),v.getTotalWeight())),this.fast_.halfLife!==L&&(this.fast_=new X.default(L,m.getEstimate(),m.getTotalWeight()))},K.sample=function(r,L){r=Math.max(r,this.minDelayMs_);var v=8*L,m=r/1e3,p=v/m;this.fast_.sample(m,p),this.slow_.sample(m,p)},K.canEstimate=function(){var r=this.fast_;return r&&r.getTotalWeight()>=this.minWeight_},K.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},K.destroy=function(){},B}();J.default=j},"./src/utils/ewma.ts":function(ne,J,P){"use strict";P.r(J);var X=function(){function j(K,G,r){G===void 0&&(G=0),r===void 0&&(r=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=K,this.alpha_=K?Math.exp(Math.log(.5)/K):0,this.estimate_=G,this.totalWeight_=r}var B=j.prototype;return B.sample=function(G,r){var L=Math.pow(this.alpha_,G);this.estimate_=r*(1-L)+L*this.estimate_,this.totalWeight_+=G},B.getTotalWeight=function(){return this.totalWeight_},B.getEstimate=function(){if(this.alpha_){var G=1-Math.pow(this.alpha_,this.totalWeight_);if(G)return this.estimate_/G}return this.estimate_},j}();J.default=X},"./src/utils/fetch-loader.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"fetchSupported",function(){return l});var X=P("./src/polyfills/number.ts"),j=P("./src/loader/load-stats.ts"),B=P("./src/demux/chunk-cache.ts");function K(s,R){s.prototype=Object.create(R.prototype),s.prototype.constructor=s,m(s,R)}function G(s){var R=typeof Map=="function"?new Map:void 0;return G=function(C){if(C===null||!v(C))return C;if(typeof C!="function")throw new TypeError("Super expression must either be null or a function");if(typeof R!="undefined"){if(R.has(C))return R.get(C);R.set(C,D)}function D(){return r(C,arguments,p(this).constructor)}return D.prototype=Object.create(C.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),m(D,C)},G(s)}function r(s,R,_){return L()?r=Reflect.construct:r=function(D,O,A){var S=[null];S.push.apply(S,O);var T=Function.bind.apply(D,S),c=new T;return A&&m(c,A.prototype),c},r.apply(null,arguments)}function L(){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 v(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function m(s,R){return m=Object.setPrototypeOf||function(C,D){return C.__proto__=D,C},m(s,R)}function p(s){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(_){return _.__proto__||Object.getPrototypeOf(_)},p(s)}function h(){return h=Object.assign||function(s){for(var R=1;R<arguments.length;R++){var _=arguments[R];for(var C in _)Object.prototype.hasOwnProperty.call(_,C)&&(s[C]=_[C])}return s},h.apply(this,arguments)}function l(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(s){}return!1}var f=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 j.LoadStats}var R=s.prototype;return R.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},R.abortInternal=function(){var C=this.response;(!C||!C.ok)&&(this.stats.aborted=!0,this.controller.abort())},R.abort=function(){var C;this.abortInternal(),(C=this.callbacks)!==null&&C!==void 0&&C.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},R.load=function(C,D,O){var A=this,S=this.stats;if(S.loading.start)throw new Error("Loader can only be used once.");S.loading.start=self.performance.now();var T=o(C,this.controller.signal),c=O.onProgress,w=C.responseType==="arraybuffer",y=w?"byteLength":"length";this.context=C,this.config=D,this.callbacks=O,this.request=this.fetchSetup(C,T),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){A.abortInternal(),O.onTimeout(S,C,A.response)},D.timeout),self.fetch(this.request).then(function(b){if(A.response=A.loader=b,!b.ok){var U=b.status,F=b.statusText;throw new a(F||"fetch, bad network response",U,b)}return S.loading.first=Math.max(self.performance.now(),S.loading.start),S.total=parseInt(b.headers.get("Content-Length")||"0"),c&&Object(X.isFiniteNumber)(D.highWaterMark)?A.loadProgressively(b,S,C,D.highWaterMark,c):w?b.arrayBuffer():b.text()}).then(function(b){var U=A.response;self.clearTimeout(A.requestTimeout),S.loading.end=Math.max(self.performance.now(),S.loading.first),S.loaded=S.total=b[y];var F={url:U.url,data:b};c&&!Object(X.isFiniteNumber)(D.highWaterMark)&&c(S,C,b,U),O.onSuccess(F,S,C,U)}).catch(function(b){if(self.clearTimeout(A.requestTimeout),S.aborted)return;var U=b.code||0;O.onError({code:U,text:b.message},C,b.details)})},R.getCacheAge=function(){var C=null;if(this.response){var D=this.response.headers.get("age");C=D?parseFloat(D):null}return C},R.loadProgressively=function(C,D,O,A,S){A===void 0&&(A=0);var T=new B.default,c=C.body.getReader(),w=function y(){return c.read().then(function(b){if(b.done)return T.dataLength&&S(D,O,T.flush(),C),Promise.resolve(new ArrayBuffer(0));var U=b.value,F=U.length;return D.loaded+=F,F<A||T.dataLength?(T.push(U),T.dataLength>=A&&S(D,O,T.flush(),C)):S(D,O,U,C),y()}).catch(function(){return Promise.reject()})};return w()},s}();function o(s,R){var _={method:"GET",mode:"cors",credentials:"same-origin",signal:R,headers:new self.Headers(h({},s.headers))};return s.rangeEnd&&_.headers.set("Range","bytes="+s.rangeStart+"-"+String(s.rangeEnd-1)),_}function u(s,R){return new self.Request(s.url,R)}var a=function(s){K(R,s);function R(_,C,D){var O;return O=s.call(this,_)||this,O.code=void 0,O.details=void 0,O.code=C,O.details=D,O}return R}(G(Error));J.default=f},"./src/utils/imsc1-ttml-parser.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"IMSC1_CODEC",function(){return v}),P.d(J,"parseIMSC1",function(){return l});var X=P("./src/utils/mp4-tools.ts"),j=P("./src/utils/vttparser.ts"),B=P("./src/utils/vttcue.ts"),K=P("./src/demux/id3.ts"),G=P("./src/utils/timescale-conversion.ts"),r=P("./src/utils/webvtt-parser.ts");function L(){return L=Object.assign||function(A){for(var S=1;S<arguments.length;S++){var T=arguments[S];for(var c in T)Object.prototype.hasOwnProperty.call(T,c)&&(A[c]=T[c])}return A},L.apply(this,arguments)}var v="stpp.ttml.im1t",m=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,p=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,h={left:"start",center:"center",right:"end",start:"start",end:"end"};function l(A,S,T,c,w){var y=Object(X.findBox)(new Uint8Array(A),["mdat"]);if(y.length===0){w(new Error("Could not parse IMSC1 mdat"));return}var b=y[0],U=Object(K.utf8ArrayToStr)(new Uint8Array(A,b.start,b.end-b.start)),F=Object(G.toTimescaleFromScale)(S,1,T);try{c(f(U,F))}catch(E){w(E)}}function f(A,S){var T=new DOMParser,c=T.parseFromString(A,"text/xml"),w=c.getElementsByTagName("tt")[0];if(!w)throw new Error("Invalid ttml");var y={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},b=Object.keys(y).reduce(function(I,g){return I[g]=w.getAttribute("ttp:"+g)||y[g],I},{}),U=w.getAttribute("xml:space")!=="preserve",F=u(o(w,"styling","style")),E=u(o(w,"layout","region")),N=o(w,"body","[begin]");return[].map.call(N,function(I){var g=a(I,U);if(!g||!I.hasAttribute("begin"))return null;var H=C(I.getAttribute("begin"),b),$=C(I.getAttribute("dur"),b),ie=C(I.getAttribute("end"),b);if(H===null)throw _(I);if(ie===null){if($===null)throw _(I);ie=H+$}var oe=new B.default(H-S,ie-S,g);oe.id=Object(r.generateCueId)(oe.startTime,oe.endTime,oe.text);var Ce=E[I.getAttribute("region")],ve=F[I.getAttribute("style")];oe.position=10,oe.size=80;var Se=s(Ce,ve),Ae=Se.textAlign;if(Ae){var Oe=h[Ae];Oe&&(oe.lineAlign=Oe),oe.align=Ae}return L(oe,Se),oe}).filter(function(I){return I!==null})}function o(A,S,T){var c=A.getElementsByTagName(S)[0];return c?[].slice.call(c.querySelectorAll(T)):[]}function u(A){return A.reduce(function(S,T){var c=T.getAttribute("xml:id");return c&&(S[c]=T),S},{})}function a(A,S){return[].slice.call(A.childNodes).reduce(function(T,c,w){var y;return c.nodeName==="br"&&w?T+`
`:(y=c.childNodes)!==null&&y!==void 0&&y.length?a(c,S):S?T+c.textContent.trim().replace(/\s+/g," "):T+c.textContent},"")}function s(A,S){var T="http://www.w3.org/ns/ttml#styling",c=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return c.reduce(function(w,y){var b=R(S,T,y)||R(A,T,y);return b&&(w[y]=b),w},{})}function R(A,S,T){return A.hasAttributeNS(S,T)?A.getAttributeNS(S,T):null}function _(A){return new Error("Could not parse ttml timestamp "+A)}function C(A,S){if(!A)return null;var T=Object(j.parseTimeStamp)(A);return T===null&&(m.test(A)?T=D(A,S):p.test(A)&&(T=O(A,S))),T}function D(A,S){var T=m.exec(A),c=(T[4]|0)+(T[5]|0)/S.subFrameRate;return(T[1]|0)*3600+(T[2]|0)*60+(T[3]|0)+c/S.frameRate}function O(A,S){var T=p.exec(A),c=Number(T[1]),w=T[2];switch(w){case"h":return c*3600;case"m":return c*60;case"ms":return c*1e3;case"f":return c/S.frameRate;case"t":return c/S.tickRate}return c}},"./src/utils/logger.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"enableLogs",function(){return r}),P.d(J,"logger",function(){return L});var X=function(){},j={trace:X,debug:X,log:X,warn:X,info:X,error:X},B=j;function K(v){var m=self.console[v];return m?m.bind(self.console,"["+v+"] >"):X}function G(v){for(var m=arguments.length,p=new Array(m>1?m-1:0),h=1;h<m;h++)p[h-1]=arguments[h];p.forEach(function(l){B[l]=v[l]?v[l].bind(v):K(l)})}function r(v){if(self.console&&v===!0||typeof v=="object"){G(v,"debug","log","info","warn","error");try{B.log()}catch(m){B=j}}else B=j}var L=B},"./src/utils/mediakeys-helper.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"KeySystems",function(){return X}),P.d(J,"requestMediaKeySystemAccess",function(){return j});var X;(function(B){B.WIDEVINE="com.widevine.alpha",B.PLAYREADY="com.microsoft.playready"})(X||(X={}));var j=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"getMediaSource",function(){return X});function X(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"bin2str",function(){return G}),P.d(J,"readUint16",function(){return r}),P.d(J,"readUint32",function(){return L}),P.d(J,"writeUint32",function(){return v}),P.d(J,"findBox",function(){return m}),P.d(J,"parseSegmentIndex",function(){return p}),P.d(J,"parseInitSegment",function(){return h}),P.d(J,"getStartDTS",function(){return l}),P.d(J,"getDuration",function(){return f}),P.d(J,"computeRawDurationFromSamples",function(){return o}),P.d(J,"offsetStartDTS",function(){return u}),P.d(J,"segmentValidRange",function(){return a}),P.d(J,"appendUint8Array",function(){return s});var X=P("./src/utils/typed-array.ts"),j=P("./src/loader/fragment.ts"),B=Math.pow(2,32)-1,K=[].push;function G(R){return String.fromCharCode.apply(null,R)}function r(R,_){"data"in R&&(_+=R.start,R=R.data);var C=R[_]<<8|R[_+1];return C<0?65536+C:C}function L(R,_){"data"in R&&(_+=R.start,R=R.data);var C=R[_]<<24|R[_+1]<<16|R[_+2]<<8|R[_+3];return C<0?4294967296+C:C}function v(R,_,C){"data"in R&&(_+=R.start,R=R.data),R[_]=C>>24,R[_+1]=C>>16&255,R[_+2]=C>>8&255,R[_+3]=C&255}function m(R,_){var C=[];if(!_.length)return C;var D,O,A;"data"in R?(D=R.data,O=R.start,A=R.end):(D=R,O=0,A=D.byteLength);for(var S=O;S<A;){var T=L(D,S),c=G(D.subarray(S+4,S+8)),w=T>1?S+T:A;if(c===_[0])if(_.length===1)C.push({data:D,start:S+8,end:w});else{var y=m({data:D,start:S+8,end:w},_.slice(1));y.length&&K.apply(C,y)}S=w}return C}function p(R){var _=m(R,["moov"]),C=_[0],D=C?C.end:null,O=m(R,["sidx"]);if(!O||!O[0])return null;var A=[],S=O[0],T=S.data[0],c=T===0?8:16,w=L(S,c);c+=4;var y=0,b=0;T===0?c+=8:c+=16,c+=2;var U=S.end+b,F=r(S,c);c+=2;for(var E=0;E<F;E++){var N=c,I=L(S,N);N+=4;var g=I&2147483647,H=(I&2147483648)>>>31;if(H===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var $=L(S,N);N+=4,A.push({referenceSize:g,subsegmentDuration:$,info:{duration:$/w,start:U,end:U+g-1}}),U+=g,N+=4,c=N}return{earliestPresentationTime:y,timescale:w,version:T,referencesCount:F,references:A,moovEndOffset:D}}function h(R){for(var _=[],C=m(R,["moov","trak"]),D=0;D<C.length;D++){var O=C[D],A=m(O,["tkhd"])[0];if(A){var S=A.data[A.start],T=S===0?12:20,c=L(A,T),w=m(O,["mdia","mdhd"])[0];if(w){S=w.data[w.start],T=S===0?12:20;var y=L(w,T),b=m(O,["mdia","hdlr"])[0];if(b){var U=G(b.data.subarray(b.start+8,b.start+12)),F={soun:j.ElementaryStreamTypes.AUDIO,vide:j.ElementaryStreamTypes.VIDEO}[U];if(F){var E=m(O,["mdia","minf","stbl","stsd"])[0],N=void 0;E&&(N=G(E.data.subarray(E.start+12,E.start+16))),_[c]={timescale:y,type:F},_[F]={timescale:y,id:c,codec:N}}}}}}var I=m(R,["moov","mvex","trex"]);return I.forEach(function(g){var H=L(g,4),$=_[H];$&&($.default={duration:L(g,12),flags:L(g,20)})}),_}function l(R,_){return m(_,["moof","traf"]).reduce(function(C,D){var O=m(D,["tfdt"])[0],A=O.data[O.start],S=m(D,["tfhd"]).reduce(function(T,c){var w=L(c,4),y=R[w];if(y){var b=L(O,4);A===1&&(b*=Math.pow(2,32),b+=L(O,8));var U=y.timescale||9e4,F=b/U;if(isFinite(F)&&(T===null||F<T))return F}return T},null);return S!==null&&isFinite(S)&&(C===null||S<C)?S:C},null)||0}function f(R,_){for(var C=0,D=0,O=0,A=m(R,["moof","traf"]),S=0;S<A.length;S++){var T=A[S],c=m(T,["tfhd"])[0],w=L(c,4),y=_[w];if(!y)continue;var b=y.default,U=L(c,0)|(b==null?void 0:b.flags),F=b==null?void 0:b.duration;U&8&&(U&2?F=L(c,12):F=L(c,8));for(var E=y.timescale||9e4,N=m(T,["trun"]),I=0;I<N.length;I++){if(F){var g=L(N[I],4);C=F*g}else C=o(N[I]);y.type===j.ElementaryStreamTypes.VIDEO?D+=C/E:y.type===j.ElementaryStreamTypes.AUDIO&&(O+=C/E)}}if(D===0&&O===0){var H=p(R);if(H!=null&&H.references)return H.references.reduce(function($,ie){return $+ie.info.duration||0},0)}return D||O}function o(R){var _=L(R,0),C=8;_&1&&(C+=4),_&4&&(C+=4);for(var D=0,O=L(R,4),A=0;A<O;A++){if(_&256){var S=L(R,C);D+=S,C+=4}_&512&&(C+=4),_&1024&&(C+=4),_&2048&&(C+=4)}return D}function u(R,_,C){m(_,["moof","traf"]).forEach(function(D){m(D,["tfhd"]).forEach(function(O){var A=L(O,4),S=R[A];if(!S)return;var T=S.timescale||9e4;m(D,["tfdt"]).forEach(function(c){var w=c.data[c.start],y=L(c,4);if(w===0)v(c,4,y-C*T);else{y*=Math.pow(2,32),y+=L(c,8),y-=C*T,y=Math.max(y,0);var b=Math.floor(y/(B+1)),U=Math.floor(y%(B+1));v(c,4,b),v(c,8,U)}})})})}function a(R){var _={valid:null,remainder:null},C=m(R,["moof"]);if(C){if(C.length<2)return _.remainder=R,_}else return _;var D=C[C.length-1];return _.valid=Object(X.sliceUint8)(R,0,D.start-8),_.remainder=Object(X.sliceUint8)(R,D.start-8),_}function s(R,_){var C=new Uint8Array(R.length+_.length);return C.set(R),C.set(_,R.length),C}},"./src/utils/output-filter.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return X});var X=function(){function j(K,G){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=K,this.trackName=G}var B=j.prototype;return B.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},B.newCue=function(G,r,L){(this.startTime===null||this.startTime>G)&&(this.startTime=G),this.endTime=r,this.screen=L,this.timelineController.createCaptionsTrack(this.trackName)},B.reset=function(){this.cueRanges=[]},j}()},"./src/utils/texttrack-utils.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"sendAddTrackEvent",function(){return j}),P.d(J,"addCueToTrack",function(){return B}),P.d(J,"clearCurrentCues",function(){return K}),P.d(J,"removeCuesInRange",function(){return G}),P.d(J,"getCuesInRange",function(){return L});var X=P("./src/utils/logger.ts");function j(v,m){var p;try{p=new Event("addtrack")}catch(h){p=document.createEvent("Event"),p.initEvent("addtrack",!1,!1)}p.track=v,m.dispatchEvent(p)}function B(v,m){var p=v.mode;if(p==="disabled"&&(v.mode="hidden"),v.cues&&!v.cues.getCueById(m.id))try{if(v.addCue(m),!v.cues.getCueById(m.id))throw new Error("addCue is failed for: "+m)}catch(l){X.logger.debug("[texttrack-utils]: "+l);var h=new self.TextTrackCue(m.startTime,m.endTime,m.text);h.id=m.id,v.addCue(h)}p==="disabled"&&(v.mode=p)}function K(v){var m=v.mode;if(m==="disabled"&&(v.mode="hidden"),v.cues)for(var p=v.cues.length;p--;)v.removeCue(v.cues[p]);m==="disabled"&&(v.mode=m)}function G(v,m,p){var h=v.mode;if(h==="disabled"&&(v.mode="hidden"),v.cues&&v.cues.length>0)for(var l=L(v.cues,m,p),f=0;f<l.length;f++)v.removeCue(l[f]);h==="disabled"&&(v.mode=h)}function r(v,m){if(m<v[0].startTime)return 0;var p=v.length-1;if(m>v[p].endTime)return-1;for(var h=0,l=p;h<=l;){var f=Math.floor((l+h)/2);if(m<v[f].startTime)l=f-1;else if(m>v[f].startTime&&h<p)h=f+1;else return f}return v[h].startTime-m<m-v[l].startTime?h:l}function L(v,m,p){var h=[],l=r(v,m);if(l>-1)for(var f=l,o=v.length;f<o;f++){var u=v[f];if(u.startTime>=m&&u.endTime<=p)h.push(u);else if(u.startTime>p)return h}return h}},"./src/utils/time-ranges.ts":function(ne,J,P){"use strict";P.r(J);var X={toString:function(B){for(var K="",G=B.length,r=0;r<G;r++)K+="["+B.start(r).toFixed(3)+","+B.end(r).toFixed(3)+"]";return K}};J.default=X},"./src/utils/timescale-conversion.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"toTimescaleFromBase",function(){return j}),P.d(J,"toTimescaleFromScale",function(){return B}),P.d(J,"toMsFromMpegTsClock",function(){return K}),P.d(J,"toMpegTsClockFromTimescale",function(){return G});var X=9e4;function j(r,L,v,m){v===void 0&&(v=1),m===void 0&&(m=!1);var p=r*L*v;return m?Math.round(p):p}function B(r,L,v,m){return v===void 0&&(v=1),m===void 0&&(m=!1),j(r,L,1/v,m)}function K(r,L){return L===void 0&&(L=!1),j(r,1e3,1/X,L)}function G(r,L){return L===void 0&&(L=1),j(r,X,1/L)}},"./src/utils/typed-array.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"sliceUint8",function(){return X});function X(j,B,K){return Uint8Array.prototype.slice?j.slice(B,K):new Uint8Array(Array.prototype.slice.call(j,B,K))}},"./src/utils/vttcue.ts":function(ne,J,P){"use strict";P.r(J),J.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var X=["","lr","rl"],j=["start","middle","end","left","right"];function B(v,m){if(typeof m!="string")return!1;if(!Array.isArray(v))return!1;var p=m.toLowerCase();return~v.indexOf(p)?p:!1}function K(v){return B(X,v)}function G(v){return B(j,v)}function r(v){for(var m=arguments.length,p=new Array(m>1?m-1:0),h=1;h<m;h++)p[h-1]=arguments[h];for(var l=1;l<arguments.length;l++){var f=arguments[l];for(var o in f)v[o]=f[o]}return v}function L(v,m,p){var h=this,l={enumerable:!0};h.hasBeenReset=!1;var f="",o=!1,u=v,a=m,s=p,R=null,_="",C=!0,D="auto",O="start",A=50,S="middle",T=50,c="middle";Object.defineProperty(h,"id",r({},l,{get:function(){return f},set:function(y){f=""+y}})),Object.defineProperty(h,"pauseOnExit",r({},l,{get:function(){return o},set:function(y){o=!!y}})),Object.defineProperty(h,"startTime",r({},l,{get:function(){return u},set:function(y){if(typeof y!="number")throw new TypeError("Start time must be set to a number.");u=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"endTime",r({},l,{get:function(){return a},set:function(y){if(typeof y!="number")throw new TypeError("End time must be set to a number.");a=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"text",r({},l,{get:function(){return s},set:function(y){s=""+y,this.hasBeenReset=!0}})),Object.defineProperty(h,"region",r({},l,{get:function(){return R},set:function(y){R=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"vertical",r({},l,{get:function(){return _},set:function(y){var b=K(y);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");_=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"snapToLines",r({},l,{get:function(){return C},set:function(y){C=!!y,this.hasBeenReset=!0}})),Object.defineProperty(h,"line",r({},l,{get:function(){return D},set:function(y){if(typeof y!="number"&&y!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");D=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"lineAlign",r({},l,{get:function(){return O},set:function(y){var b=G(y);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");O=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"position",r({},l,{get:function(){return A},set:function(y){if(y<0||y>100)throw new Error("Position must be between 0 and 100.");A=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",r({},l,{get:function(){return S},set:function(y){var b=G(y);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");S=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",r({},l,{get:function(){return T},set:function(y){if(y<0||y>100)throw new Error("Size must be between 0 and 100.");T=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",r({},l,{get:function(){return c},set:function(y){var b=G(y);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");c=b,this.hasBeenReset=!0}})),h.displayState=void 0}return L.prototype.getCueAsHTML=function(){var v=self.WebVTT;return v.convertCueToDOMTree(self,this.text)},L}()},"./src/utils/vttparser.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"parseTimeStamp",function(){return B}),P.d(J,"fixLineBreaks",function(){return m}),P.d(J,"VTTParser",function(){return p});var X=P("./src/utils/vttcue.ts"),j=function(){function h(){}var l=h.prototype;return l.decode=function(o,u){if(!o)return"";if(typeof o!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(o))},h}();function B(h){function l(o,u,a,s){return(o|0)*3600+(u|0)*60+(a|0)+parseFloat(s||0)}var f=h.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return f?parseFloat(f[2])>59?l(f[2],f[3],0,f[4]):l(f[1],f[2],f[3],f[4]):null}var K=function(){function h(){this.values=Object.create(null)}var l=h.prototype;return l.set=function(o,u){!this.get(o)&&u!==""&&(this.values[o]=u)},l.get=function(o,u,a){return a?this.has(o)?this.values[o]:u[a]:this.has(o)?this.values[o]:u},l.has=function(o){return o in this.values},l.alt=function(o,u,a){for(var s=0;s<a.length;++s)if(u===a[s]){this.set(o,u);break}},l.integer=function(o,u){/^-?\d+$/.test(u)&&this.set(o,parseInt(u,10))},l.percent=function(o,u){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(u)){var a=parseFloat(u);if(a>=0&&a<=100)return this.set(o,a),!0}return!1},h}();function G(h,l,f,o){var u=o?h.split(o):[h];for(var a in u){if(typeof u[a]!="string")continue;var s=u[a].split(f);if(s.length!==2)continue;var R=s[0],_=s[1];l(R,_)}}var r=new X.default(0,0,""),L=r.align==="middle"?"middle":"center";function v(h,l,f){var o=h;function u(){var R=B(h);if(R===null)throw new Error("Malformed timestamp: "+o);return h=h.replace(/^[^\sa-zA-Z-]+/,""),R}function a(R,_){var C=new K;G(R,function(A,S){var T;switch(A){case"region":for(var c=f.length-1;c>=0;c--)if(f[c].id===S){C.set(A,f[c].region);break}break;case"vertical":C.alt(A,S,["rl","lr"]);break;case"line":T=S.split(","),C.integer(A,T[0]),C.percent(A,T[0])&&C.set("snapToLines",!1),C.alt(A,T[0],["auto"]),T.length===2&&C.alt("lineAlign",T[1],["start",L,"end"]);break;case"position":T=S.split(","),C.percent(A,T[0]),T.length===2&&C.alt("positionAlign",T[1],["start",L,"end","line-left","line-right","auto"]);break;case"size":C.percent(A,S);break;case"align":C.alt(A,S,["start",L,"end","left","right"]);break}},/:/,/\s/),_.region=C.get("region",null),_.vertical=C.get("vertical","");var D=C.get("line","auto");D==="auto"&&r.line===-1&&(D=-1),_.line=D,_.lineAlign=C.get("lineAlign","start"),_.snapToLines=C.get("snapToLines",!0),_.size=C.get("size",100),_.align=C.get("align",L);var O=C.get("position","auto");O==="auto"&&r.position===50&&(O=_.align==="start"||_.align==="left"?0:_.align==="end"||_.align==="right"?100:50),_.position=O}function s(){h=h.replace(/^\s+/,"")}if(s(),l.startTime=u(),s(),h.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);h=h.substr(3),s(),l.endTime=u(),s(),a(h,l)}function m(h){return h.replace(/<br(?: \/)?>/gi,`
`)}var p=function(){function h(){this.state="INITIAL",this.buffer="",this.decoder=new j,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var l=h.prototype;return l.parse=function(o){var u=this;o&&(u.buffer+=u.decoder.decode(o,{stream:!0}));function a(){var O=u.buffer,A=0;for(O=m(O);A<O.length&&O[A]!=="\r"&&O[A]!==`
`;)++A;var S=O.substr(0,A);return O[A]==="\r"&&++A,O[A]===`
`&&++A,u.buffer=O.substr(A),S}function s(O){G(O,function(A,S){},/:/)}try{var R="";if(u.state==="INITIAL"){if(!/\r\n|\n/.test(u.buffer))return this;R=a();var _=R.match(/^()?WEBVTT([ \t].*)?$/);if(!_||!_[0])throw new Error("Malformed WebVTT signature.");u.state="HEADER"}for(var C=!1;u.buffer;){if(!/\r\n|\n/.test(u.buffer))return this;C?C=!1:R=a();switch(u.state){case"HEADER":/:/.test(R)?s(R):R||(u.state="ID");continue;case"NOTE":R||(u.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(R)){u.state="NOTE";break}if(!R)continue;if(u.cue=new X.default(0,0,""),u.state="CUE",R.indexOf("-->")===-1){u.cue.id=R;continue}case"CUE":if(!u.cue){u.state="BADCUE";continue}try{v(R,u.cue,u.regionList)}catch(O){u.cue=null,u.state="BADCUE";continue}u.state="CUETEXT";continue;case"CUETEXT":{var D=R.indexOf("-->")!==-1;if(!R||D&&(C=!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+=R}continue;case"BADCUE":R||(u.state="ID")}}}catch(O){u.state==="CUETEXT"&&u.cue&&u.oncue&&u.oncue(u.cue),u.cue=null,u.state=u.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},l.flush=function(){var o=this;try{if((o.cue||o.state==="HEADER")&&(o.buffer+=`
`,o.parse()),o.state==="INITIAL"||o.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(u){o.onparsingerror&&o.onparsingerror(u)}return o.onflush&&o.onflush(),this},h}()},"./src/utils/webvtt-parser.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"generateCueId",function(){return p}),P.d(J,"parseWebVTT",function(){return l});var X=P("./src/polyfills/number.ts"),j=P("./src/utils/vttparser.ts"),B=P("./src/demux/id3.ts"),K=P("./src/utils/timescale-conversion.ts"),G=P("./src/remux/mp4-remuxer.ts"),r=/\r\n|\n\r|\n|\r/g,L=function(o,u,a){return a===void 0&&(a=0),o.substr(a,u.length)===u},v=function(o){var u=parseInt(o.substr(-3)),a=parseInt(o.substr(-6,2)),s=parseInt(o.substr(-9,2)),R=o.length>9?parseInt(o.substr(0,o.indexOf(":"))):0;if(!Object(X.isFiniteNumber)(u)||!Object(X.isFiniteNumber)(a)||!Object(X.isFiniteNumber)(s)||!Object(X.isFiniteNumber)(R))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+o);return u+=1e3*a,u+=60*1e3*s,u+=60*60*1e3*R,u},m=function(o){for(var u=5381,a=o.length;a;)u=u*33^o.charCodeAt(--a);return(u>>>0).toString()};function p(f,o,u){return m(f.toString())+m(o.toString())+m(u)}var h=function(o,u,a){var s=o[u],R=o[s.prevCC];if(!R||!R.new&&s.new){o.ccOffset=o.presentationOffset=s.start,s.new=!1;return}for(;(_=R)!==null&&_!==void 0&&_.new;){var _;o.ccOffset+=s.start-R.start,s.new=!1,s=R,R=o[s.prevCC]}o.presentationOffset=a};function l(f,o,u,a,s,R,_,C){var D=new j.VTTParser,O=Object(B.utf8ArrayToStr)(new Uint8Array(f)).trim().replace(r,`
`).split(`
`),A=[],S=Object(K.toMpegTsClockFromTimescale)(o,u),T="00:00.000",c=0,w=0,y,b=!0,U=!1;D.oncue=function(F){var E=a[s],N=a.ccOffset,I=(c-S)/9e4;if(E!=null&&E.new&&(w!==void 0?N=a.ccOffset=E.start:h(a,s,I)),I&&(N=I-a.presentationOffset),U){var g=F.endTime-F.startTime,H=Object(G.normalizePts)((F.startTime+N-w)*9e4,R*9e4)/9e4;F.startTime=H,F.endTime=H+g}var $=F.text.trim();F.text=decodeURIComponent(encodeURIComponent($)),F.id||(F.id=p(F.startTime,F.endTime,$)),F.endTime>0&&A.push(F)},D.onparsingerror=function(F){y=F},D.onflush=function(){if(y){C(y);return}_(A)},O.forEach(function(F){if(b)if(L(F,"X-TIMESTAMP-MAP=")){b=!1,U=!0,F.substr(16).split(",").forEach(function(E){L(E,"LOCAL:")?T=E.substr(6):L(E,"MPEGTS:")&&(c=parseInt(E.substr(7)))});try{w=v(T)/1e3}catch(E){U=!1,y=E}return}else F===""&&(b=!1);D.parse(F+`
`)}),D.flush()}},"./src/utils/xhr-loader.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/utils/logger.ts"),j=P("./src/loader/load-stats.ts"),B=/^age:\s*[\d.]+\s*$/m,K=function(){function G(L){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=L?L.xhrSetup:null,this.stats=new j.LoadStats,this.retryDelay=0}var r=G.prototype;return r.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},r.abortInternal=function(){var v=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),v&&(v.onreadystatechange=null,v.onprogress=null,v.readyState!==4&&(this.stats.aborted=!0,v.abort()))},r.abort=function(){var v;this.abortInternal(),(v=this.callbacks)!==null&&v!==void 0&&v.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},r.load=function(v,m,p){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=v,this.config=m,this.callbacks=p,this.retryDelay=m.retryDelay,this.loadInternal()},r.loadInternal=function(){var v=this.config,m=this.context;if(!v)return;var p=this.loader=new self.XMLHttpRequest,h=this.stats;h.loading.first=0,h.loaded=0;var l=this.xhrSetup;try{if(l)try{l(p,m.url)}catch(u){p.open("GET",m.url,!0),l(p,m.url)}p.readyState||p.open("GET",m.url,!0);var f=this.context.headers;if(f)for(var o in f)p.setRequestHeader(o,f[o])}catch(u){this.callbacks.onError({code:p.status,text:u.message},m,p);return}m.rangeEnd&&p.setRequestHeader("Range","bytes="+m.rangeStart+"-"+(m.rangeEnd-1)),p.onreadystatechange=this.readystatechange.bind(this),p.onprogress=this.loadprogress.bind(this),p.responseType=m.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),v.timeout),p.send()},r.readystatechange=function(){var v=this.context,m=this.loader,p=this.stats;if(!v||!m)return;var h=m.readyState,l=this.config;if(p.aborted)return;if(h>=2)if(self.clearTimeout(this.requestTimeout),p.loading.first===0&&(p.loading.first=Math.max(self.performance.now(),p.loading.start)),h===4){m.onreadystatechange=null,m.onprogress=null;var f=m.status;if(f>=200&&f<300){p.loading.end=Math.max(self.performance.now(),p.loading.first);var o,u;if(v.responseType==="arraybuffer"?(o=m.response,u=o.byteLength):(o=m.responseText,u=o.length),p.loaded=p.total=u,!this.callbacks)return;var a=this.callbacks.onProgress;if(a&&a(p,v,o,m),!this.callbacks)return;var s={url:m.responseURL,data:o};this.callbacks.onSuccess(s,p,v,m)}else p.retry>=l.maxRetry||f>=400&&f<499?(X.logger.error(f+" while loading "+v.url),this.callbacks.onError({code:f,text:m.statusText},v,m)):(X.logger.warn(f+" while loading "+v.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,l.maxRetryDelay),p.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),l.timeout)},r.loadtimeout=function(){X.logger.warn("timeout while loading "+this.context.url);var v=this.callbacks;v&&(this.abortInternal(),v.onTimeout(this.stats,this.context,this.loader))},r.loadprogress=function(v){var m=this.stats;m.loaded=v.loaded,v.lengthComputable&&(m.total=v.total)},r.getCacheAge=function(){var v=null;if(this.loader&&B.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");v=m?parseFloat(m):null}return v},G}();J.default=K}}).default})},vHTk:function(nt,xe,Z){nt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);