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.
441 lines
1.2 MiB
441 lines
1.2 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[184,5,7],{"+NIl":function(at,ge,J){(function(ie){ie(J("VrN/"))})(function(ie){"use strict";ie.defineMode("stex",function($,M){"use strict";function Y(u,a){u.cmdState.push(a)}function F(u){return u.cmdState.length>0?u.cmdState[u.cmdState.length-1]:null}function U(u){var a=u.cmdState.pop();a&&a.closeBracket()}function G(u){for(var a=u.cmdState,f=a.length-1;f>=0;f--){var l=a[f];if(l.name=="DEFAULT")continue;return l}return{styleIdentifier:function(){return null}}}function W(u,a,f){return function(){this.name=u,this.bracketNo=0,this.style=a,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 i={};i.importmodule=W("importmodule","tag",["string","builtin"]),i.documentclass=W("documentclass","tag",["","atom"]),i.usepackage=W("usepackage","tag",["atom"]),i.begin=W("begin","tag",["atom"]),i.end=W("end","tag",["atom"]),i.label=W("label","tag",["atom"]),i.ref=W("ref","tag",["atom"]),i.eqref=W("eqref","tag",["atom"]),i.cite=W("cite","tag",["atom"]),i.bibitem=W("bibitem","tag",["atom"]),i.Bibitem=W("Bibitem","tag",["atom"]),i.RBibitem=W("RBibitem","tag",["atom"]),i.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(u,a){u.f=a}function g(u,a){var f;if(u.match(/^\\[a-zA-Z@]+/)){var l=u.current().slice(1);return f=i.hasOwnProperty(l)?i[l]:i.DEFAULT,f=new f,Y(a,f),D(a,m),f.style}if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/\\]/))return"tag";if(u.match("\\["))return D(a,function(o,s){return d(o,s,"\\]")}),"keyword";if(u.match("\\("))return D(a,function(o,s){return d(o,s,"\\)")}),"keyword";if(u.match("$$"))return D(a,function(o,s){return d(o,s,"$$")}),"keyword";if(u.match("$"))return D(a,function(o,s){return d(o,s,"$")}),"keyword";var h=u.next();if(h=="%")return u.skipToEnd(),"comment";if(h=="}"||h=="]"){if(f=F(a),f)f.closeBracket(h),D(a,m);else return"error";return"bracket"}else return h=="{"||h=="["?(f=i.DEFAULT,f=new f,Y(a,f),"bracket"):/\d/.test(h)?(u.eatWhile(/[\w.%]/),"atom"):(u.eatWhile(/[\w\-_]/),f=G(a),f.name=="begin"&&(f.argument=u.current()),f.styleIdentifier())}function d(u,a,f){if(u.eatSpace())return null;if(f&&u.match(f))return D(a,g),"keyword";if(u.match(/^\\[a-zA-Z@]+/))return"tag";if(u.match(/^[a-zA-Z]+/))return"variable-2";if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/]/))return"tag";if(u.match(/^[\^_&]/))return"tag";if(u.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(u.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var l=u.next();return l=="{"||l=="}"||l=="["||l=="]"||l=="("||l==")"?"bracket":l=="%"?(u.skipToEnd(),"comment"):"error"}function m(u,a){var f=u.peek(),l;return f=="{"||f=="["?(l=F(a),l.openBracket(f),u.eat(f),D(a,g),"bracket"):/[ \t\r]/.test(f)?(u.eat(f),null):(D(a,g),U(a),g(u,a))}return{startState:function(){var u=M.inMathMode?function(a,f){return d(a,f)}:g;return{cmdState:[],f:u}},copyState:function(u){return{cmdState:u.cmdState.slice(),f:u.f}},token:function(u,a){return a.f(u,a)},blankLine:function(u){u.f=g,u.cmdState.length=0},lineComment:"%"}}),ie.defineMIME("text/x-stex","stex"),ie.defineMIME("text/x-latex","stex")})},"+ua5":function(at,ge,J){},"/cxE":function(at,ge,J){"use strict";J.d(ge,"f",function(){return M}),J.d(ge,"g",function(){return Y}),J.d(ge,"h",function(){return F}),J.d(ge,"e",function(){return G}),J.d(ge,"b",function(){return W}),J.d(ge,"c",function(){return i}),J.d(ge,"d",function(){return D}),J.d(ge,"a",function(){return g});class ie{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(d){setTimeout(()=>{throw d.stack?new Error(d.message+`
|
|
|
|
`+d.stack):d},0)}}emit(d){this.listeners.forEach(m=>{m(d)})}onUnexpectedError(d){this.unexpectedErrorHandler(d),this.emit(d)}onUnexpectedExternalError(d){this.unexpectedErrorHandler(d)}}const $=new ie;function M(d){G(d)||$.onUnexpectedError(d);return}function Y(d){G(d)||$.onUnexpectedExternalError(d);return}function F(d){if(d instanceof Error){let{name:m,message:u}=d;const a=d.stacktrace||d.stack;return{$isError:!0,name:m,message:u,stack:a}}return d}const U="Canceled";function G(d){return d instanceof Error&&d.name===U&&d.message===U}function W(){const d=new Error(U);return d.name=d.message,d}function i(d){return d?new Error(`Illegal argument: ${d}`):new Error("Illegal argument")}function D(d){return d?new Error(`Illegal state: ${d}`):new Error("Illegal state")}class g extends Error{constructor(d){super("NotSupported");d&&(this.message=d)}}},"19Vz":function(at,ge,J){(function(ie){ie(J("VrN/"))})(function(ie){ie.defineOption("placeholder","",function(W,i,D){var g=D&&D!=ie.Init;if(i&&!g)W.on("blur",F),W.on("change",U),W.on("swapDoc",U),ie.on(W.getInputField(),"compositionupdate",W.state.placeholderCompose=function(){Y(W)}),U(W);else if(!i&&g){W.off("blur",F),W.off("change",U),W.off("swapDoc",U),ie.off(W.getInputField(),"compositionupdate",W.state.placeholderCompose),$(W);var d=W.getWrapperElement();d.className=d.className.replace(" CodeMirror-empty","")}i&&!W.hasFocus()&&F(W)});function $(W){W.state.placeholder&&(W.state.placeholder.parentNode.removeChild(W.state.placeholder),W.state.placeholder=null)}function M(W){$(W);var i=W.state.placeholder=document.createElement("pre");i.style.cssText="height: 0; overflow: visible",i.style.direction=W.getOption("direction"),i.className="CodeMirror-placeholder CodeMirror-line-like";var D=W.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),i.appendChild(D),W.display.lineSpace.insertBefore(i,W.display.lineSpace.firstChild)}function Y(W){setTimeout(function(){var i=!1,D=W.getInputField();D.nodeName=="TEXTAREA"?i=!D.value:W.lineCount()==1&&(i=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),i?M(W):$(W)},20)}function F(W){G(W)&&M(W)}function U(W){var i=W.getWrapperElement(),D=G(W);i.className=i.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?M(W):$(W)}function G(W){return W.lineCount()===1&&W.getLine(0)===""}})},"1eCo":function(at,ge,J){(function(ie){ie(J("VrN/"))})(function(ie){"use strict";var $={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},M={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ie.defineMode("xml",function(Y,F){var U=Y.indentUnit,G={},W=F.htmlMode?$:M;for(var i in W)G[i]=W[i];for(var i in F)G[i]=F[i];var D,g;function d(p,T){function v(B){return T.tokenize=B,B(p,T)}var y=p.next();if(y=="<")return p.eat("!")?p.eat("[")?p.match("CDATA[")?v(a("atom","]]>")):null:p.match("--")?v(a("comment","-->")):p.match("DOCTYPE",!0,!0)?(p.eatWhile(/[\w\._\-]/),v(f(1))):null:p.eat("?")?(p.eatWhile(/[\w\._\-]/),T.tokenize=a("meta","?>"),"meta"):(D=p.eat("/")?"closeTag":"openTag",T.tokenize=m,"tag bracket");if(y=="&"){var N;return p.eat("#")?p.eat("x")?N=p.eatWhile(/[a-fA-F\d]/)&&p.eat(";"):N=p.eatWhile(/[\d]/)&&p.eat(";"):N=p.eatWhile(/[\w\.\-:]/)&&p.eat(";"),N?"atom":"error"}else return p.eatWhile(/[^&<]/),null}d.isInText=!0;function m(p,T){var v=p.next();if(v==">"||v=="/"&&p.eat(">"))return T.tokenize=d,D=v==">"?"endTag":"selfcloseTag","tag bracket";if(v=="=")return D="equals",null;if(v=="<"){T.tokenize=d,T.state=s,T.tagName=T.tagStart=null;var y=T.tokenize(p,T);return y?y+" tag error":"tag error"}else return/[\'\"]/.test(v)?(T.tokenize=u(v),T.stringStartCol=p.column(),T.tokenize(p,T)):(p.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function u(p){var T=function(v,y){for(;!v.eol();)if(v.next()==p){y.tokenize=m;break}return"string"};return T.isInAttribute=!0,T}function a(p,T){return function(v,y){for(;!v.eol();){if(v.match(T)){y.tokenize=d;break}v.next()}return p}}function f(p){return function(T,v){for(var y;(y=T.next())!=null;){if(y=="<")return v.tokenize=f(p+1),v.tokenize(T,v);if(y==">")if(p==1){v.tokenize=d;break}else return v.tokenize=f(p-1),v.tokenize(T,v)}return"meta"}}function l(p,T,v){this.prev=p.context,this.tagName=T,this.indent=p.indented,this.startOfLine=v,(G.doNotIndent.hasOwnProperty(T)||p.context&&p.context.noIndent)&&(this.noIndent=!0)}function h(p){p.context&&(p.context=p.context.prev)}function o(p,T){for(var v;;){if(!p.context)return;if(v=p.context.tagName,!G.contextGrabbers.hasOwnProperty(v)||!G.contextGrabbers[v].hasOwnProperty(T))return;h(p)}}function s(p,T,v){return p=="openTag"?(v.tagStart=T.column(),A):p=="closeTag"?_:s}function A(p,T,v){return p=="word"?(v.tagName=T.current(),g="tag",O):G.allowMissingTagName&&p=="endTag"?(g="tag bracket",O(p,T,v)):(g="error",A)}function _(p,T,v){if(p=="word"){var y=T.current();return v.context&&v.context.tagName!=y&&G.implicitlyClosed.hasOwnProperty(v.context.tagName)&&h(v),v.context&&v.context.tagName==y||G.matchClosing===!1?(g="tag",S):(g="tag error",L)}else return G.allowMissingTagName&&p=="endTag"?(g="tag bracket",S(p,T,v)):(g="error",L)}function S(p,T,v){return p!="endTag"?(g="error",S):(h(v),s)}function L(p,T,v){return g="error",S(p,T,v)}function O(p,T,v){if(p=="word")return g="attribute",C;if(p=="endTag"||p=="selfcloseTag"){var y=v.tagName,N=v.tagStart;return v.tagName=v.tagStart=null,p=="selfcloseTag"||G.autoSelfClosers.hasOwnProperty(y)?o(v,y):(o(v,y),v.context=new l(v,y,N==v.indented)),s}return g="error",O}function C(p,T,v){return p=="equals"?w:(G.allowMissing||(g="error"),O(p,T,v))}function w(p,T,v){return p=="string"?x:p=="word"&&G.allowUnquoted?(g="string",O):(g="error",O(p,T,v))}function x(p,T,v){return p=="string"?x:O(p,T,v)}return{startState:function(p){var T={tokenize:d,state:s,indented:p||0,tagName:null,tagStart:null,context:null};return p!=null&&(T.baseIndent=p),T},token:function(p,T){if(!T.tagName&&p.sol()&&(T.indented=p.indentation()),p.eatSpace())return null;D=null;var v=T.tokenize(p,T);return(v||D)&&v!="comment"&&(g=null,T.state=T.state(D||v,p,T),g&&(v=g=="error"?v+" error":g)),v},indent:function(p,T,v){var y=p.context;if(p.tokenize.isInAttribute)return p.tagStart==p.indented?p.stringStartCol+1:p.indented+U;if(y&&y.noIndent)return ie.Pass;if(p.tokenize!=m&&p.tokenize!=d)return v?v.match(/^(\s*)/)[0].length:0;if(p.tagName)return G.multilineTagIndentPastTag!==!1?p.tagStart+p.tagName.length+2:p.tagStart+U*(G.multilineTagIndentFactor||1);if(G.alignCDATA&&/<!\[CDATA\[/.test(T))return 0;var N=T&&/^<(\/)?([\w_:\.-]*)/.exec(T);if(N&&N[1])for(;y;)if(y.tagName==N[2]){y=y.prev;break}else if(G.implicitlyClosed.hasOwnProperty(y.tagName))y=y.prev;else break;else if(N)for(;y;){var B=G.contextGrabbers[y.tagName];if(B&&B.hasOwnProperty(N[2]))y=y.prev;else break}for(;y&&y.prev&&!y.startOfLine;)y=y.prev;return y?y.indent+U:p.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:G.htmlMode?"html":"xml",helperType:G.htmlMode?"html":"xml",skipAttribute:function(p){p.state==w&&(p.state=O)},xmlCurrentTag:function(p){return p.tagName?{name:p.tagName,close:p.type=="closeTag"}:null},xmlCurrentContext:function(p){for(var T=[],v=p.context;v;v=v.prev)v.tagName&&T.push(v.tagName);return T.reverse()}}}),ie.defineMIME("text/xml","xml"),ie.defineMIME("application/xml","xml"),ie.mimeModes.hasOwnProperty("text/html")||ie.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(at,ge,J){"use strict";J.d(ge,"a",function(){return $});class ie{constructor(M){this.element=M,this.next=ie.Undefined,this.prev=ie.Undefined}}ie.Undefined=new ie(void 0);class ${constructor(){this._first=ie.Undefined,this._last=ie.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ie.Undefined}clear(){let M=this._first;for(;M!==ie.Undefined;){const Y=M.next;M.prev=ie.Undefined,M.next=ie.Undefined,M=Y}this._first=ie.Undefined,this._last=ie.Undefined,this._size=0}unshift(M){return this._insert(M,!1)}push(M){return this._insert(M,!0)}_insert(M,Y){const F=new ie(M);if(this._first===ie.Undefined)this._first=F,this._last=F;else if(Y){const G=this._last;this._last=F,F.prev=G,G.next=F}else{const G=this._first;this._first=F,F.next=G,G.prev=F}this._size+=1;let U=!1;return()=>{U||(U=!0,this._remove(F))}}shift(){if(this._first===ie.Undefined)return;{const M=this._first.element;return this._remove(this._first),M}}pop(){if(this._last===ie.Undefined)return;{const M=this._last.element;return this._remove(this._last),M}}_remove(M){if(M.prev!==ie.Undefined&&M.next!==ie.Undefined){const Y=M.prev;Y.next=M.next,M.next.prev=Y}else M.prev===ie.Undefined&&M.next===ie.Undefined?(this._first=ie.Undefined,this._last=ie.Undefined):M.next===ie.Undefined?(this._last=this._last.prev,this._last.next=ie.Undefined):M.prev===ie.Undefined&&(this._first=this._first.next,this._first.prev=ie.Undefined);this._size-=1}*[Symbol.iterator](){let M=this._first;for(;M!==ie.Undefined;)yield M.element,M=M.next}}},"3/fG":function(at,ge,J){"use strict";J.d(ge,"a",function(){return $});function ie(M,Y){let F;return Y.length===0?F=M:F=M.replace(/\{(\d+)\}/g,function(U,G){const W=G[0];return typeof Y[W]!="undefined"?Y[W]:U}),F}function $(M,Y,...F){return ie(Y,F)}},"30zm":function(at,ge,J){"use strict";var ie=J("k1fw"),$=J("tJVT"),M=J("PpiC"),Y=J("B9cy"),F=J("Ol7k"),U=J("lUTK"),G=J("BvKs"),W=J("q1tI"),i=J.n(W),D=J("Ty5D"),g=J("55Ip"),d=J("9kvl"),m=J("m3rI"),u=J("kzJb"),a=J.n(u),f=G.a.SubMenu,l=F.a.Sider,h=F.a.Content,o=function(A){var _,S,L,O,C=A.messages,w=A.globalSetting,x=A.loading,p=A.user,T=A.dispatch,v=Object(M.a)(A,["messages","globalSetting","loading","user","dispatch"]),y=Object(D.i)(),N=p.userInfo,B=Object(D.h)(),R=C.tidingsList,j=C.privateMessage,P=C.unreadInfo,b=Object(W.useState)({per_page:10,page:1}),X=Object($.a)(b,2),ee=X[0],ae=X[1];Object(W.useEffect)(function(){le()},[y.userId]);var le=function(){T({type:"messages/unreadMessageInfo",payload:Object(ie.a)(Object(ie.a)({},ee),y)})};return i.a.createElement("section",{className:a.a.wrap},i.a.createElement("div",{className:a.a.avatarWrap},i.a.createElement("div",{className:a.a.avatar},i.a.createElement("div",{className:a.a.updateAvatarWrap},i.a.createElement("img",{className:a.a.img,src:m.a.IMG_SERVER+"/images/"+(N==null?void 0:N.image_url)}))),i.a.createElement("div",{className:a.a.name_role},i.a.createElement("div",{className:a.a.name,title:N==null?void 0:N.username},(N==null||((_=N.username)===null||_===void 0)?void 0:_.length)>6?(N==null||((S=N.username)===null||S===void 0)?void 0:S.substr(0,6))+"...":N==null?void 0:N.username),i.a.createElement("div",{className:a.a.role},((L=p.userInfo)===null||L===void 0?void 0:L.user_identity)=="\u8001\u5E08"?i.a.createElement("img",{src:J("ccQJ"),width:56,height:21,style:{position:"relative",top:-2}}):(O=p.userInfo)===null||O===void 0?void 0:O.user_identity))),i.a.createElement("div",{className:a.a.manage},i.a.createElement("ul",{className:"pl0 pt20"},i.a.createElement(g.a,{to:"/messages/".concat(N==null?void 0:N.login,"/user_tidings")},i.a.createElement("li",{className:"".concat(a.a.item," ").concat(B.pathname.indexOf("user_tidings")>-1&&a.a.active,`
|
|
`)},i.a.createElement("span",null,i.a.createElement("i",{className:"iconfont icon-tpixiaoxitixing font16 ".concat(a.a.colorGary)}),"\u6D88\u606F"),!!(P!=null&&P.unread_tiding_count)&&i.a.createElement("span",{className:a.a.newTip},P==null?void 0:P.unread_tiding_count))))))};ge.a=Object(d.a)(function(s){var A=s.messages,_=s.loading,S=s.user,L=s.globalSetting;return{messages:A,globalSetting:L,user:S,loading:_.effects}})(o)},"55Ip":function(at,ge,J){"use strict";J.d(ge,"a",function(){return o});var ie=J("Ty5D"),$=J("dI71"),M=J("q1tI"),Y=J.n(M),F=J("YS25"),U=J("17x9"),G=J.n(U),W=J("wx14"),i=J("zLVn"),D=J("9R94"),g=function(w){Object($.a)(x,w);function x(){for(var T,v=arguments.length,y=new Array(v),N=0;N<v;N++)y[N]=arguments[N];return T=w.call.apply(w,[this].concat(y))||this,T.history=Object(F.a)(T.props),T}var p=x.prototype;return p.render=function(){return Y.a.createElement(ie.c,{history:this.history,children:this.props.children})},x}(Y.a.Component),d=function(w){Object($.a)(x,w);function x(){for(var T,v=arguments.length,y=new Array(v),N=0;N<v;N++)y[N]=arguments[N];return T=w.call.apply(w,[this].concat(y))||this,T.history=Object(F.b)(T.props),T}var p=x.prototype;return p.render=function(){return Y.a.createElement(ie.c,{history:this.history,children:this.props.children})},x}(Y.a.Component),m=function(x,p){return typeof x=="function"?x(p):x},u=function(x,p){return typeof x=="string"?Object(F.c)(x,null,null,p):x},a=function(x){return x},f=Y.a.forwardRef;typeof f=="undefined"&&(f=a);function l(w){return!!(w.metaKey||w.altKey||w.ctrlKey||w.shiftKey)}var h=f(function(w,x){var p=w.innerRef,T=w.navigate,v=w.onClick,y=Object(i.a)(w,["innerRef","navigate","onClick"]),N=y.target,B=Object(W.a)({},y,{onClick:function(j){try{v&&v(j)}catch(P){throw j.preventDefault(),P}!j.defaultPrevented&&j.button===0&&(!N||N==="_self")&&!l(j)&&(j.preventDefault(),T())}});return a!==f?B.ref=x||p:B.ref=p,Y.a.createElement("a",B)}),o=f(function(w,x){var p=w.component,T=p===void 0?h:p,v=w.replace,y=w.to,N=w.innerRef,B=Object(i.a)(w,["component","replace","to","innerRef"]);return Y.a.createElement(ie.e.Consumer,null,function(R){R||Object(D.a)(!1);var j=R.history,P=u(m(y,R.location),R.location),b=P?j.createHref(P):"",X=Object(W.a)({},B,{href:b,navigate:function(){var ae=m(y,R.location),le=v?j.replace:j.push;le(ae)}});return a!==f?X.ref=x||N:X.innerRef=N,Y.a.createElement(T,X)})});if(!1)var s,A;var _=function(x){return x},S=Y.a.forwardRef;typeof S=="undefined"&&(S=_);function L(){for(var w=arguments.length,x=new Array(w),p=0;p<w;p++)x[p]=arguments[p];return x.filter(function(T){return T}).join(" ")}var O=S(function(w,x){var p=w["aria-current"],T=p===void 0?"page":p,v=w.activeClassName,y=v===void 0?"active":v,N=w.activeStyle,B=w.className,R=w.exact,j=w.isActive,P=w.location,b=w.sensitive,X=w.strict,ee=w.style,ae=w.to,le=w.innerRef,Re=Object(i.a)(w,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return Y.a.createElement(ie.e.Consumer,null,function(Ee){Ee||Object(D.a)(!1);var Te=P||Ee.location,Ae=u(m(ae,Te),Te),Oe=Ae.pathname,ce=Oe&&Oe.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ue=ce?Object(ie.f)(Te.pathname,{path:ce,exact:R,sensitive:b,strict:X}):null,Pe=!!(j?j(ue,Te):ue),qe=Pe?L(B,y):B,ze=Pe?Object(W.a)({},ee,{},N):ee,et=Object(W.a)({"aria-current":Pe&&T||null,className:qe,style:ze,to:Ae},Re);return _!==S?et.ref=x||le:et.innerRef=le,Y.a.createElement(o,et)})});if(!1)var C},"5VLF":function(at,ge,J){"use strict";var ie,$;function M(Y,F,U){var G=function(W,i){return Y.js_beautify(W,i)};return G.js=Y.js_beautify,G.css=F.css_beautify,G.html=U.html_beautify,G.js_beautify=Y.js_beautify,G.css_beautify=F.css_beautify,G.html_beautify=U.html_beautify,G}!(ie=[J("6UM0"),J("TXwP"),J("psGv")],$=function(Y,F,U){return M(Y,F,U)}.apply(ge,ie),$!==void 0&&(at.exports=$))},"5Y4S":function(at,ge,J){"use strict";J.d(ge,"a",function(){return M});var ie=J("MNsG");const $=ie.b.performance&&typeof ie.b.performance.now=="function";class M{constructor(Y){this._highResolution=$&&Y,this._startTime=this._now(),this._stopTime=-1}static create(Y=!0){return new M(Y)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?ie.b.performance.now():Date.now()}}},"6UM0":function(at,ge,J){var ie,$;(function(){var M;(function(){"use strict";var F=[function(i,D,g){var d=g(1).Beautifier,m=g(5).Options;function u(a,f){var l=new d(a,f);return l.beautify()}i.exports=u,i.exports.defaultOptions=function(){return new m}},function(i,D,g){var d=g(2).Output,m=g(3).Token,u=g(4),a=g(5).Options,f=g(7).Tokenizer,l=g(7).line_starters,h=g(7).positionable_operators,o=g(7).TOKEN;function s(b,X){return X.indexOf(b)!==-1}function A(b){return b.replace(/^\s+/g,"")}function _(b){for(var X={},ee=0;ee<b.length;ee++)X[b[ee].replace(/-/g,"_")]=b[ee];return X}function S(b,X){return b&&b.type===o.RESERVED&&b.text===X}function L(b,X){return b&&b.type===o.RESERVED&&s(b.text,X)}var O=["case","return","do","if","throw","else","await","break","continue","async"],C=["before-newline","after-newline","preserve-newline"],w=_(C),x=[w.before_newline,w.preserve_newline],p={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function T(b,X){if(X.multiline_frame||X.mode===p.ForInitializer||X.mode===p.Conditional)return;b.remove_indent(X.start_line_index)}function v(b){b=b.replace(u.allLineBreaks,`
|
|
`);for(var X=[],ee=b.indexOf(`
|
|
`);ee!==-1;)X.push(b.substring(0,ee)),b=b.substring(ee+1),ee=b.indexOf(`
|
|
`);return b.length&&X.push(b),X}function y(b){return b===p.ArrayLiteral}function N(b){return s(b,[p.Expression,p.ForInitializer,p.Conditional])}function B(b,X){for(var ee=0;ee<b.length;ee++){var ae=b[ee].trim();if(ae.charAt(0)!==X)return!1}return!0}function R(b,X){for(var ee=0,ae=b.length,le;ee<ae;ee++)if(le=b[ee],le&&le.indexOf(X)!==0)return!1;return!0}function j(b,X){X=X||{},this._source_text=b||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new a(X)}j.prototype.create_flags=function(b,X){var ee=0;b&&(ee=b.indentation_level,!this._output.just_added_newline()&&b.line_indent_level>ee&&(ee=b.line_indent_level));var ae={mode:X,parent:b,last_token:b?b.last_token:new m(o.START_BLOCK,""),last_word:b?b.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:ee,alignment:0,line_indent_level:b?b.line_indent_level:ee,start_line_index:this._output.get_line_number(),ternary_depth:0};return ae},j.prototype._reset=function(b){var X=b.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new d(this._options,X),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(p.BlockStatement);var ee=new f(b,this._options);return this._tokens=ee.tokenize(),b},j.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var b,X=this._reset(this._source_text),ee=this._options.eol;this._options.eol==="auto"&&(ee=`
|
|
`,X&&u.lineBreak.test(X||"")&&(ee=X.match(u.lineBreak)[0]));for(var ae=this._tokens.next();ae;)this.handle_token(ae),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ae,ae=this._tokens.next();return b=this._output.get_code(ee),b},j.prototype.handle_token=function(b,X){b.type===o.START_EXPR?this.handle_start_expr(b):b.type===o.END_EXPR?this.handle_end_expr(b):b.type===o.START_BLOCK?this.handle_start_block(b):b.type===o.END_BLOCK?this.handle_end_block(b):b.type===o.WORD?this.handle_word(b):b.type===o.RESERVED?this.handle_word(b):b.type===o.SEMICOLON?this.handle_semicolon(b):b.type===o.STRING?this.handle_string(b):b.type===o.EQUALS?this.handle_equals(b):b.type===o.OPERATOR?this.handle_operator(b):b.type===o.COMMA?this.handle_comma(b):b.type===o.BLOCK_COMMENT?this.handle_block_comment(b,X):b.type===o.COMMENT?this.handle_comment(b,X):b.type===o.DOT?this.handle_dot(b):b.type===o.EOF?this.handle_eof(b):b.type===o.UNKNOWN?this.handle_unknown(b,X):this.handle_unknown(b,X)},j.prototype.handle_whitespace_and_comments=function(b,X){var ee=b.newlines,ae=this._options.keep_array_indentation&&y(this._flags.mode);if(b.comments_before)for(var le=b.comments_before.next();le;)this.handle_whitespace_and_comments(le,X),this.handle_token(le,X),le=b.comments_before.next();if(ae)for(var Re=0;Re<ee;Re+=1)this.print_newline(Re>0,X);else if(this._options.max_preserve_newlines&&ee>this._options.max_preserve_newlines&&(ee=this._options.max_preserve_newlines),this._options.preserve_newlines&&ee>1){this.print_newline(!1,X);for(var Ee=1;Ee<ee;Ee+=1)this.print_newline(!0,X)}};var P=["async","break","continue","return","throw","yield"];j.prototype.allow_wrap_or_preserved_newline=function(b,X){if(X=X===void 0?!1:X,this._output.just_added_newline())return;var ee=this._options.preserve_newlines&&b.newlines||X,ae=s(this._flags.last_token.text,h)||s(b.text,h);if(ae){var le=s(this._flags.last_token.text,h)&&s(this._options.operator_position,x)||s(b.text,h);ee=ee&&le}if(ee)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(L(this._flags.last_token,P))return;this._output.set_wrap_point()}},j.prototype.print_newline=function(b,X){if(!X&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==o.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var ee=this._tokens.peek();this._flags.mode===p.Statement&&!(this._flags.if_block&&S(ee,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(b)&&(this._flags.multiline_frame=!0)},j.prototype.print_token_line_indentation=function(b){this._output.just_added_newline()&&(this._options.keep_array_indentation&&b.newlines&&(b.text==="["||y(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(b.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},j.prototype.print_token=function(b){if(this._output.raw){this._output.add_raw_token(b);return}if(this._options.comma_first&&b.previous&&b.previous.type===o.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var X=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(X),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(b),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(b),this._output.non_breaking_space=!0,this._output.add_token(b.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},j.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},j.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},j.prototype.set_mode=function(b){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,b),this._flags=this.create_flags(this._previous_flags,b),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},j.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===p.Statement&&T(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},j.prototype.start_of_object_property=function(){return this._flags.parent.mode===p.ObjectLiteral&&this._flags.mode===p.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"]))},j.prototype.start_of_statement=function(b){var X=!1;return X=X||L(this._flags.last_token,["var","let","const"])&&b.type===o.WORD,X=X||S(this._flags.last_token,"do"),X=X||!(this._flags.parent.mode===p.ObjectLiteral&&this._flags.mode===p.Statement)&&L(this._flags.last_token,P)&&!b.newlines,X=X||S(this._flags.last_token,"else")&&!(S(b,"if")&&!b.comments_before),X=X||this._flags.last_token.type===o.END_EXPR&&(this._previous_flags.mode===p.ForInitializer||this._previous_flags.mode===p.Conditional),X=X||this._flags.last_token.type===o.WORD&&this._flags.mode===p.BlockStatement&&!this._flags.in_case&&!(b.text==="--"||b.text==="++")&&this._last_last_text!=="function"&&b.type!==o.WORD&&b.type!==o.RESERVED,X=X||this._flags.mode===p.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"])),X?(this.set_mode(p.Statement),this.indent(),this.handle_whitespace_and_comments(b,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b,L(b,["do","for","if","while"])),!0):!1},j.prototype.handle_start_expr=function(b){this.start_of_statement(b)||this.handle_whitespace_and_comments(b);var X=p.Expression;if(b.text==="["){if(this._flags.last_token.type===o.WORD||this._flags.last_token.text===")"){L(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(b),this.set_mode(X),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}X=p.ArrayLiteral,y(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),s(this._flags.last_token.type,[o.START_EXPR,o.END_EXPR,o.WORD,o.OPERATOR,o.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===o.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,X=p.ForInitializer):s(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,X=p.Conditional):s(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&b.whitespace_before===""?this._output.space_before_token=!1:(s(this._flags.last_token.text,l)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===o.EQUALS||this._flags.last_token.type===o.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b);else if(this._flags.last_token.type===o.WORD){this._output.space_before_token=!1;var ee=this._tokens.peek(-3);if(this._options.space_after_named_function&&ee){var ae=this._tokens.peek(-4);L(ee,["async","function"])||ee.text==="*"&&L(ae,["async","function"])?this._output.space_before_token=!0:this._flags.mode===p.ObjectLiteral?(ee.text==="{"||ee.text===","||ee.text==="*"&&(ae.text==="{"||ae.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(b);(this._flags.last_token.type===o.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===p.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===o.START_BLOCK?this.print_newline():(this._flags.last_token.type===o.END_EXPR||this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===o.COMMA)&&this.allow_wrap_or_preserved_newline(b,b.newlines),this.print_token(b),this.set_mode(X),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},j.prototype.handle_end_expr=function(b){for(;this._flags.mode===p.Statement;)this.restore_mode();this.handle_whitespace_and_comments(b),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(b,b.text==="]"&&y(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===o.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(b),this.restore_mode(),T(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===p.Conditional&&(this._previous_flags.mode=p.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},j.prototype.handle_start_block=function(b){this.handle_whitespace_and_comments(b);var X=this._tokens.peek(),ee=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===o.END_EXPR?(this.set_mode(p.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(p.BlockStatement):ee&&(s(ee.text,[":",","])&&s(X.type,[o.STRING,o.WORD,o.RESERVED])||s(X.text,["get","set","..."])&&s(ee.type,[o.WORD,o.RESERVED]))?s(this._last_last_text,["class","interface"])&&!s(ee.text,[":",","])?this.set_mode(p.BlockStatement):this.set_mode(p.ObjectLiteral):this._flags.last_token.type===o.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(p.BlockStatement):s(this._flags.last_token.type,[o.EQUALS,o.START_EXPR,o.COMMA,o.OPERATOR])||L(this._flags.last_token,["return","throw","import","default"])?this.set_mode(p.ObjectLiteral):this.set_mode(p.BlockStatement),this._flags.last_token&&(L(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ae=!X.comments_before&&X.text==="}",le=ae&&this._flags.last_word==="function"&&this._flags.last_token.type===o.END_EXPR;if(this._options.brace_preserve_inline){var Re=0,Ee=null;this._flags.inline_frame=!0;do if(Re+=1,Ee=this._tokens.peek(Re-1),Ee.newlines){this._flags.inline_frame=!1;break}while(Ee.type!==o.EOF&&!(Ee.type===o.END_BLOCK&&Ee.opened===b))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&b.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==o.OPERATOR&&(le||this._flags.last_token.type===o.EQUALS||L(this._flags.last_token,O)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(y(this._previous_flags.mode)&&(this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.COMMA)&&((this._flags.last_token.type===o.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(b),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==o.OPERATOR&&this._flags.last_token.type!==o.START_EXPR&&(this._flags.last_token.type===o.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(b),this.indent(),!ae&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},j.prototype.handle_end_block=function(b){for(this.handle_whitespace_and_comments(b);this._flags.mode===p.Statement;)this.restore_mode();var X=this._flags.last_token.type===o.START_BLOCK;this._flags.inline_frame&&!X?this._output.space_before_token=!0:this._options.brace_style==="expand"?X||this.print_newline():X||(y(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(b)},j.prototype.handle_word=function(b){if(b.type===o.RESERVED){if(s(b.text,["set","get"])&&this._flags.mode!==p.ObjectLiteral)b.type=o.WORD;else if(b.text==="import"&&s(this._tokens.peek().text,["(","."]))b.type=o.WORD;else if(s(b.text,["as","from"])&&!this._flags.import_block)b.type=o.WORD;else if(this._flags.mode===p.ObjectLiteral){var X=this._tokens.peek();X.text===":"&&(b.type=o.WORD)}}if(this.start_of_statement(b)?L(this._flags.last_token,["var","let","const"])&&b.type===o.WORD&&(this._flags.declaration_statement=!0):b.newlines&&!N(this._flags.mode)&&(this._flags.last_token.type!==o.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==o.EQUALS&&(this._options.preserve_newlines||!L(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(b),this.print_newline()):this.handle_whitespace_and_comments(b),this._flags.do_block&&!this._flags.do_while)if(S(b,"while")){this._output.space_before_token=!0,this.print_token(b),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&S(b,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===p.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&L(b,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(b),this._flags.in_case=!0;return}if((this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.EQUALS||this._flags.last_token.type===o.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b)),S(b,"function")){(s(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(s(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===o.OPERATOR))&&(!this._output.just_added_blankline()&&!b.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD?L(this._flags.last_token,["get","set","new","export"])||L(this._flags.last_token,P)?this._output.space_before_token=!0:S(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===o.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(N(this._flags.mode)||y(this._flags.mode))||this.print_newline(),this.print_token(b),this._flags.last_word=b.text;return}var ee="NONE";if(this._flags.last_token.type===o.END_BLOCK?this._previous_flags.inline_frame?ee="SPACE":L(b,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&b.newlines?ee="NEWLINE":(ee="SPACE",this._output.space_before_token=!0):ee="NEWLINE":this._flags.last_token.type===o.SEMICOLON&&this._flags.mode===p.BlockStatement?ee="NEWLINE":this._flags.last_token.type===o.SEMICOLON&&N(this._flags.mode)?ee="SPACE":this._flags.last_token.type===o.STRING?ee="NEWLINE":this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD||this._flags.last_token.text==="*"&&(s(this._last_last_text,["function","yield"])||this._flags.mode===p.ObjectLiteral&&s(this._last_last_text,["{",","]))?ee="SPACE":this._flags.last_token.type===o.START_BLOCK?this._flags.inline_frame?ee="SPACE":ee="NEWLINE":this._flags.last_token.type===o.END_EXPR&&(this._output.space_before_token=!0,ee="NEWLINE"),L(b,l)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?ee="SPACE":ee="NEWLINE"),L(b,["else","catch","finally"]))if((!(this._flags.last_token.type===o.END_BLOCK&&this._previous_flags.mode===p.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&b.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ae=this._output.current_line;ae.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else ee==="NEWLINE"?L(this._flags.last_token,O)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&L(b,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==o.END_EXPR?(this._flags.last_token.type!==o.START_EXPR||!L(b,["var","let","const"]))&&this._flags.last_token.text!==":"&&(S(b,"if")&&S(b.previous,"else")?this._output.space_before_token=!0:this.print_newline()):L(b,l)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&y(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():ee==="SPACE"&&(this._output.space_before_token=!0);b.previous&&(b.previous.type===o.WORD||b.previous.type===o.RESERVED)&&(this._output.space_before_token=!0),this.print_token(b),this._flags.last_word=b.text,b.type===o.RESERVED&&(b.text==="do"?this._flags.do_block=!0:b.text==="if"?this._flags.if_block=!0:b.text==="import"?this._flags.import_block=!0:this._flags.import_block&&S(b,"from")&&(this._flags.import_block=!1))},j.prototype.handle_semicolon=function(b){this.start_of_statement(b)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(b);for(var X=this._tokens.peek();this._flags.mode===p.Statement&&!(this._flags.if_block&&S(X,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(b)},j.prototype.handle_string=function(b){b.text.startsWith("`")&&b.newlines===0&&b.whitespace_before===""&&(b.previous.text===")"||this._flags.last_token.type===o.WORD)||(this.start_of_statement(b)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(b),this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.EQUALS||this._flags.last_token.type===o.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b):b.text.startsWith("`")&&this._flags.last_token.type===o.END_EXPR&&(b.previous.text==="]"||b.previous.text===")")&&b.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(b)},j.prototype.handle_equals=function(b){this.start_of_statement(b)||this.handle_whitespace_and_comments(b),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(b),this._output.space_before_token=!0},j.prototype.handle_comma=function(b){this.handle_whitespace_and_comments(b,!0),this.print_token(b),this._output.space_before_token=!0,this._flags.declaration_statement?(N(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(b)):this._flags.mode===p.ObjectLiteral||this._flags.mode===p.Statement&&this._flags.parent.mode===p.ObjectLiteral?(this._flags.mode===p.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(b)},j.prototype.handle_operator=function(b){var X=b.text==="*"&&(L(this._flags.last_token,["function","yield"])||s(this._flags.last_token.type,[o.START_BLOCK,o.COMMA,o.END_BLOCK,o.SEMICOLON])),ee=s(b.text,["-","+"])&&(s(this._flags.last_token.type,[o.START_BLOCK,o.START_EXPR,o.EQUALS,o.OPERATOR])||s(this._flags.last_token.text,l)||this._flags.last_token.text===",");if(!this.start_of_statement(b)){var ae=!X;this.handle_whitespace_and_comments(b,ae)}if(b.text==="*"&&this._flags.last_token.type===o.DOT){this.print_token(b);return}if(b.text==="::"){this.print_token(b);return}if(this._flags.last_token.type===o.OPERATOR&&s(this._options.operator_position,x)&&this.allow_wrap_or_preserved_newline(b),b.text===":"&&this._flags.in_case){this.print_token(b),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==o.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 le=!0,Re=!0,Ee=!1;if(b.text===":"?this._flags.ternary_depth===0?le=!1:(this._flags.ternary_depth-=1,Ee=!0):b.text==="?"&&(this._flags.ternary_depth+=1),!ee&&!X&&this._options.preserve_newlines&&s(b.text,h)){var Te=b.text===":",Ae=Te&&Ee,Oe=Te&&!Ee;switch(this._options.operator_position){case w.before_newline:this._output.space_before_token=!Oe,this.print_token(b),(!Te||Ae)&&this.allow_wrap_or_preserved_newline(b),this._output.space_before_token=!0;return;case w.after_newline:this._output.space_before_token=!0,!Te||Ae?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(b):this._output.space_before_token=!1,this.print_token(b),this._output.space_before_token=!0;return;case w.preserve_newline:Oe||this.allow_wrap_or_preserved_newline(b),le=!(this._output.just_added_newline()||Oe),this._output.space_before_token=le,this.print_token(b),this._output.space_before_token=!0;return}}if(X){this.allow_wrap_or_preserved_newline(b),le=!1;var ce=this._tokens.peek();Re=ce&&s(ce.type,[o.WORD,o.RESERVED])}else if(b.text==="...")this.allow_wrap_or_preserved_newline(b),le=this._flags.last_token.type===o.START_BLOCK,Re=!1;else if(s(b.text,["--","++","!","~"])||ee){if((this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR)&&this.allow_wrap_or_preserved_newline(b),le=!1,Re=!1,b.newlines&&(b.text==="--"||b.text==="++"||b.text==="~")){var ue=L(this._flags.last_token,O)&&b.newlines;ue&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ue,!0)}this._flags.last_token.text===";"&&N(this._flags.mode)&&(le=!0),this._flags.last_token.type===o.RESERVED?le=!0:this._flags.last_token.type===o.END_EXPR?le=!(this._flags.last_token.text==="]"&&(b.text==="--"||b.text==="++")):this._flags.last_token.type===o.OPERATOR&&(le=s(b.text,["--","-","++","+"])&&s(this._flags.last_token.text,["--","-","++","+"]),s(b.text,["+","-"])&&s(this._flags.last_token.text,["--","++"])&&(Re=!0)),(this._flags.mode===p.BlockStatement&&!this._flags.inline_frame||this._flags.mode===p.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||le,this.print_token(b),this._output.space_before_token=Re},j.prototype.handle_block_comment=function(b,X){if(this._output.raw){this._output.add_raw_token(b),b.directives&&b.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(b.directives){this.print_newline(!1,X),this.print_token(b),b.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!u.newline.test(b.text)&&!b.newlines){this._output.space_before_token=!0,this.print_token(b),this._output.space_before_token=!0;return}else this.print_block_commment(b,X)},j.prototype.print_block_commment=function(b,X){var ee=v(b.text),ae,le=!1,Re=!1,Ee=b.whitespace_before,Te=Ee.length;if(this.print_newline(!1,X),this.print_token_line_indentation(b),this._output.add_token(ee[0]),this.print_newline(!1,X),ee.length>1){for(ee=ee.slice(1),le=B(ee,"*"),Re=R(ee,Ee),le&&(this._flags.alignment=1),ae=0;ae<ee.length;ae++)le?(this.print_token_line_indentation(b),this._output.add_token(A(ee[ae]))):Re&&ee[ae]?(this.print_token_line_indentation(b),this._output.add_token(ee[ae].substring(Te))):(this._output.current_line.set_indent(-1),this._output.add_token(ee[ae])),this.print_newline(!1,X);this._flags.alignment=0}},j.prototype.handle_comment=function(b,X){b.newlines?this.print_newline(!1,X):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(b),this.print_newline(!1,X)},j.prototype.handle_dot=function(b){this.start_of_statement(b)||this.handle_whitespace_and_comments(b,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),L(this._flags.last_token,O)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(b,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(b)},j.prototype.handle_unknown=function(b,X){this.print_token(b),b.text[b.text.length-1]===`
|
|
`&&this.print_newline(!1,X)},j.prototype.handle_eof=function(b){for(;this._flags.mode===p.Statement;)this.restore_mode();this.handle_whitespace_and_comments(b)},i.exports.Beautifier=j},function(i){function D(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}D.prototype.clone_empty=function(){var m=new D(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},D.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},D.prototype.has_match=function(m){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(m))return!0;return!1},D.prototype.set_indent=function(m,u){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.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)},D.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},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(m){this.__items.push(m);var u=m.lastIndexOf(`
|
|
`);u!==-1?this.__character_count=m.length-u:this.__character_count+=m.length},D.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function g(m,u){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),u=u||"",m.indent_level>0&&(u=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}g.prototype.get_indent_size=function(m,u){var a=this.__base_string_length;return u=u||0,m<0&&(a=0),a+=m*this.__indent_size,a+=u,a},g.prototype.get_indent_string=function(m,u){var a=this.__base_string;return u=u||0,m<0&&(m=0,a=""),u+=m*this.__indent_size,this.__ensure_cache(u),a+=this.__cache[u],a},g.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var m=this.__cache.length,u=0,a="";this.__indent_size&&m>=this.__indent_size&&(u=Math.floor(m/this.__indent_size),m-=u*this.__indent_size,a=new Array(u+1).join(this.__indent_string)),m&&(a+=new Array(m+1).join(" ")),this.__cache.push(a)};function d(m,u){this.__indent_cache=new g(m,u),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}d.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},d.prototype.get_line_number=function(){return this.__lines.length},d.prototype.get_indent_string=function(m,u){return this.__indent_cache.get_indent_string(m,u)},d.prototype.get_indent_size=function(m,u){return this.__indent_cache.get_indent_size(m,u)},d.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},d.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},d.prototype.get_code=function(m){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
|
|
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
|
|
`);return m!==`
|
|
`&&(a=a.replace(/[\n]/g,m)),a},d.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},d.prototype.set_indent=function(m,u){return m=m||0,u=u||0,this.next_line.set_indent(m,u),this.__lines.length>1?(this.current_line.set_indent(m,u),!0):(this.current_line.set_indent(),!1)},d.prototype.add_raw_token=function(m){for(var u=0;u<m.newlines;u++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},d.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},d.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(" "))},d.prototype.remove_indent=function(m){for(var u=this.__lines.length;m<u;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},d.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},d.prototype.just_added_newline=function(){return this.current_line.is_empty()},d.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},d.prototype.ensure_empty_line_above=function(m,u){for(var a=this.__lines.length-2;a>=0;){var f=this.__lines[a];if(f.is_empty())break;if(f.item(0).indexOf(m)!==0&&f.item(-1)!==u){this.__lines.splice(a+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},i.exports.Output=d},function(i){function D(g,d,m,u){this.type=g,this.text=d,this.comments_before=null,this.newlines=m||0,this.whitespace_before=u||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}i.exports.Token=D},function(i,D){var g="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",d="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",u="\\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",a="(?:\\\\u[0-9a-fA-F]{4}|["+g+m+"])",f="(?:\\\\u[0-9a-fA-F]{4}|["+d+m+u+"])*";D.identifier=new RegExp(a+f,"g"),D.identifierStart=new RegExp(a),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+d+m+u+"])+");var l=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;D.newline=/[\n\r\u2028\u2029]/,D.lineBreak=new RegExp(`\r
|
|
|`+D.newline.source),D.allLineBreaks=new RegExp(D.lineBreak.source,"g")},function(i,D,g){var d=g(6).Options,m=["before-newline","after-newline","preserve-newline"];function u(a){d.call(this,a,"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 l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var h=0;h<l.length;h++)l[h]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=l[h];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",m),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}u.prototype=new d,i.exports.Options=u},function(i){function D(m,u){this.raw_options=g(m,u),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}D.prototype._get_array=function(m,u){var a=this.raw_options[m],f=u||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(f=a.concat()):typeof a=="string"&&(f=a.split(/[^a-zA-Z0-9_\/\-]+/)),f},D.prototype._get_boolean=function(m,u){var a=this.raw_options[m],f=a===void 0?!!u:!!a;return f},D.prototype._get_characters=function(m,u){var a=this.raw_options[m],f=u||"";return typeof a=="string"&&(f=a.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),f},D.prototype._get_number=function(m,u){var a=this.raw_options[m];u=parseInt(u,10),isNaN(u)&&(u=0);var f=parseInt(a,10);return isNaN(f)&&(f=u),f},D.prototype._get_selection=function(m,u,a){var f=this._get_selection_list(m,u,a);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[m]+"'");return f[0]},D.prototype._get_selection_list=function(m,u,a){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[u[0]],!this._is_valid_selection(a,u))throw new Error("Invalid Default Value!");var f=this._get_array(m,a);if(!this._is_valid_selection(f,u))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[m]+"'");return f},D.prototype._is_valid_selection=function(m,u){return m.length&&u.length&&!m.some(function(a){return u.indexOf(a)===-1})};function g(m,u){var a={};m=d(m);var f;for(f in m)f!==u&&(a[f]=m[f]);if(u&&m[u])for(f in m[u])a[f]=m[u][f];return a}function d(m){var u={},a;for(a in m){var f=a.replace(/-/g,"_");u[f]=m[a]}return u}i.exports.Options=D,i.exports.normalizeOpts=d,i.exports.mergeOpts=g},function(i,D,g){var d=g(8).InputScanner,m=g(9).Tokenizer,u=g(9).TOKEN,a=g(13).Directives,f=g(4),l=g(12).Pattern,h=g(14).TemplatablePattern;function o(B,R){return R.indexOf(B)!==-1}var s={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:u.START,RAW:u.RAW,EOF:u.EOF},A=new a(/\/\*/,/\*\//),_=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,S=/[0-9]/,L=/[^\d\.]/,O=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),C=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";C=C.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),C="\\?\\.(?!\\d) "+C,C=C.replace(/ /g,"|");var w=new RegExp(C),x="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),p=x.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),T=new RegExp("^(?:"+p.join("|")+")$"),v,y=function(B,R){m.call(this,B,R),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var j=new l(this._input),P=new h(this._input).read_options(this._options);this.__patterns={template:P,identifier:P.starting_with(f.identifier).matching(f.identifierMatch),number:j.matching(_),punct:j.matching(w),comment:j.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:j.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:j.matching(/<!--/),html_comment_end:j.matching(/-->/),include:j.starting_with(/#include/).until_after(f.lineBreak),shebang:j.starting_with(/#!/).until_after(f.lineBreak),xml:j.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:P.until(/['\\\n\r\u2028\u2029]/),double_quote:P.until(/["\\\n\r\u2028\u2029]/),template_text:P.until(/[`\\$]/),template_expression:P.until(/[`}\\]/)}};y.prototype=new m,y.prototype._is_comment=function(B){return B.type===s.COMMENT||B.type===s.BLOCK_COMMENT||B.type===s.UNKNOWN},y.prototype._is_opening=function(B){return B.type===s.START_BLOCK||B.type===s.START_EXPR},y.prototype._is_closing=function(B,R){return(B.type===s.END_BLOCK||B.type===s.END_EXPR)&&R&&(B.text==="]"&&R.text==="["||B.text===")"&&R.text==="("||B.text==="}"&&R.text==="{")},y.prototype._reset=function(){v=!1},y.prototype._get_next_token=function(B,R){var j=null;this._readWhitespace();var P=this._input.peek();return P===null?this._create_token(s.EOF,""):(j=j||this._read_non_javascript(P),j=j||this._read_string(P),j=j||this._read_word(B),j=j||this._read_singles(P),j=j||this._read_comment(P),j=j||this._read_regexp(P,B),j=j||this._read_xml(P,B),j=j||this._read_punctuation(),j=j||this._create_token(s.UNKNOWN,this._input.next()),j)},y.prototype._read_word=function(B){var R;if(R=this.__patterns.identifier.read(),R!=="")return R=R.replace(f.allLineBreaks,`
|
|
`),!(B.type===s.DOT||B.type===s.RESERVED&&(B.text==="set"||B.text==="get"))&&T.test(R)?(R==="in"||R==="of")&&(B.type===s.WORD||B.type===s.STRING)?this._create_token(s.OPERATOR,R):this._create_token(s.RESERVED,R):this._create_token(s.WORD,R);if(R=this.__patterns.number.read(),R!=="")return this._create_token(s.WORD,R)},y.prototype._read_singles=function(B){var R=null;return B==="("||B==="["?R=this._create_token(s.START_EXPR,B):B===")"||B==="]"?R=this._create_token(s.END_EXPR,B):B==="{"?R=this._create_token(s.START_BLOCK,B):B==="}"?R=this._create_token(s.END_BLOCK,B):B===";"?R=this._create_token(s.SEMICOLON,B):B==="."&&L.test(this._input.peek(1))?R=this._create_token(s.DOT,B):B===","&&(R=this._create_token(s.COMMA,B)),R&&this._input.next(),R},y.prototype._read_punctuation=function(){var B=this.__patterns.punct.read();if(B!=="")return B==="="?this._create_token(s.EQUALS,B):B==="?."?this._create_token(s.DOT,B):this._create_token(s.OPERATOR,B)},y.prototype._read_non_javascript=function(B){var R="";if(B==="#"){if(this._is_first_token()&&(R=this.__patterns.shebang.read(),R))return this._create_token(s.UNKNOWN,R.trim()+`
|
|
`);if(R=this.__patterns.include.read(),R)return this._create_token(s.UNKNOWN,R.trim()+`
|
|
`);B=this._input.next();var j="#";if(this._input.hasNext()&&this._input.testChar(S)){do B=this._input.next(),j+=B;while(this._input.hasNext()&&B!=="#"&&B!=="=");return B==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(j+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(j+="{}",this._input.next(),this._input.next())),this._create_token(s.WORD,j)}this._input.back()}else if(B==="<"&&this._is_first_token()){if(R=this.__patterns.html_comment_start.read(),R){for(;this._input.hasNext()&&!this._input.testChar(f.newline);)R+=this._input.next();return v=!0,this._create_token(s.COMMENT,R)}}else if(v&&B==="-"&&(R=this.__patterns.html_comment_end.read(),R))return v=!1,this._create_token(s.COMMENT,R);return null},y.prototype._read_comment=function(B){var R=null;if(B==="/"){var j="";if(this._input.peek(1)==="*"){j=this.__patterns.block_comment.read();var P=A.get_directives(j);P&&P.ignore==="start"&&(j+=A.readIgnored(this._input)),j=j.replace(f.allLineBreaks,`
|
|
`),R=this._create_token(s.BLOCK_COMMENT,j),R.directives=P}else this._input.peek(1)==="/"&&(j=this.__patterns.comment.read(),R=this._create_token(s.COMMENT,j))}return R},y.prototype._read_string=function(B){if(B==="`"||B==="'"||B==='"'){var R=this._input.next();return this.has_char_escapes=!1,B==="`"?R+=this._read_string_recursive("`",!0,"${"):R+=this._read_string_recursive(B),this.has_char_escapes&&this._options.unescape_strings&&(R=N(R)),this._input.peek()===B&&(R+=this._input.next()),R=R.replace(f.allLineBreaks,`
|
|
`),this._create_token(s.STRING,R)}return null},y.prototype._allow_regexp_or_xml=function(B){return B.type===s.RESERVED&&o(B.text,["return","case","throw","else","do","typeof","yield"])||B.type===s.END_EXPR&&B.text===")"&&B.opened.previous.type===s.RESERVED&&o(B.opened.previous.text,["if","while","for"])||o(B.type,[s.COMMENT,s.START_EXPR,s.START_BLOCK,s.START,s.END_BLOCK,s.OPERATOR,s.EQUALS,s.EOF,s.SEMICOLON,s.COMMA])},y.prototype._read_regexp=function(B,R){if(B==="/"&&this._allow_regexp_or_xml(R)){for(var j=this._input.next(),P=!1,b=!1;this._input.hasNext()&&(P||b||this._input.peek()!==B)&&!this._input.testChar(f.newline);)j+=this._input.peek(),P?P=!1:(P=this._input.peek()==="\\",this._input.peek()==="["?b=!0:this._input.peek()==="]"&&(b=!1)),this._input.next();return this._input.peek()===B&&(j+=this._input.next(),j+=this._input.read(f.identifier)),this._create_token(s.STRING,j)}return null},y.prototype._read_xml=function(B,R){if(this._options.e4x&&B==="<"&&this._allow_regexp_or_xml(R)){var j="",P=this.__patterns.xml.read_match();if(P){for(var b=P[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),X=b.indexOf("{")===0,ee=0;P;){var ae=!!P[1],le=P[2],Re=!!P[P.length-1]||le.slice(0,8)==="![CDATA[";if(!Re&&(le===b||X&&le.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ae?--ee:++ee),j+=P[0],ee<=0)break;P=this.__patterns.xml.read_match()}return P||(j+=this._input.match(/[\s\S]*/g)[0]),j=j.replace(f.allLineBreaks,`
|
|
`),this._create_token(s.STRING,j)}}return null};function N(B){for(var R="",j=0,P=new d(B),b=null;P.hasNext();)if(b=P.match(/([\s]|[^\\]|\\\\)+/g),b&&(R+=b[0]),P.peek()==="\\"){if(P.next(),P.peek()==="x")b=P.match(/x([0-9A-Fa-f]{2})/g);else if(P.peek()==="u")b=P.match(/u([0-9A-Fa-f]{4})/g);else{R+="\\",P.hasNext()&&(R+=P.next());continue}if(!b)return B;if(j=parseInt(b[1],16),j>126&&j<=255&&b[0].indexOf("x")===0)return B;if(j>=0&&j<32){R+="\\"+b[0];continue}else j===34||j===39||j===92?R+="\\"+String.fromCharCode(j):R+=String.fromCharCode(j)}return R}y.prototype._read_string_recursive=function(B,R,j){var P,b;B==="'"?b=this.__patterns.single_quote:B==='"'?b=this.__patterns.double_quote:B==="`"?b=this.__patterns.template_text:B==="}"&&(b=this.__patterns.template_expression);for(var X=b.read(),ee="";this._input.hasNext();){if(ee=this._input.next(),ee===B||!R&&f.newline.test(ee)){this._input.back();break}else ee==="\\"&&this._input.hasNext()?(P=this._input.peek(),P==="x"||P==="u"?this.has_char_escapes=!0:P==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),ee+=this._input.next()):j&&(j==="${"&&ee==="$"&&this._input.peek()==="{"&&(ee+=this._input.next()),j===ee&&(B==="`"?ee+=this._read_string_recursive("}",R,"`"):ee+=this._read_string_recursive("`",R,"${"),this._input.hasNext()&&(ee+=this._input.next())));ee+=b.read(),X+=ee}return X},i.exports.Tokenizer=y,i.exports.TOKEN=s,i.exports.positionable_operators=O.slice(),i.exports.line_starters=x.slice()},function(i){var D=RegExp.prototype.hasOwnProperty("sticky");function g(d){this.__input=d||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var d=null;return this.hasNext()&&(d=this.__input.charAt(this.__position),this.__position+=1),d},g.prototype.peek=function(d){var m=null;return d=d||0,d+=this.__position,d>=0&&d<this.__input_length&&(m=this.__input.charAt(d)),m},g.prototype.__match=function(d,m){d.lastIndex=m;var u=d.exec(this.__input);return u&&!(D&&d.sticky)&&(u.index!==m&&(u=null)),u},g.prototype.test=function(d,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(d,m):!1},g.prototype.testChar=function(d,m){var u=this.peek(m);return d.lastIndex=0,u!==null&&d.test(u)},g.prototype.match=function(d){var m=this.__match(d,this.__position);return m?this.__position+=m[0].length:m=null,m},g.prototype.read=function(d,m,u){var a="",f;return d&&(f=this.match(d),f&&(a+=f[0])),m&&(f||!d)&&(a+=this.readUntil(m,u)),a},g.prototype.readUntil=function(d,m){var u="",a=this.__position;d.lastIndex=this.__position;var f=d.exec(this.__input);return f?(a=f.index,m&&(a+=f[0].length)):a=this.__input_length,u=this.__input.substring(this.__position,a),this.__position=a,u},g.prototype.readUntilAfter=function(d){return this.readUntil(d,!0)},g.prototype.get_regexp=function(d,m){var u=null,a="g";return m&&D&&(a="y"),typeof d=="string"&&d!==""?u=new RegExp(d,a):d&&(u=new RegExp(d.source,a)),u},g.prototype.get_literal_regexp=function(d){return RegExp(d.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(d){var m=this.__position,u=this.readUntilAfter(d);return this.__position=m,u},g.prototype.lookBack=function(d){var m=this.__position-1;return m>=d.length&&this.__input.substring(m-d.length,m).toLowerCase()===d},i.exports.InputScanner=g},function(i,D,g){var d=g(8).InputScanner,m=g(3).Token,u=g(10).TokenStream,a=g(11).WhitespacePattern,f={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(h,o){this._input=new d(h),this._options=o||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new a(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new u,this._reset();for(var h,o=new m(f.START,""),s=null,A=[],_=new u;o.type!==f.EOF;){for(h=this._get_next_token(o,s);this._is_comment(h);)_.add(h),h=this._get_next_token(o,s);_.isEmpty()||(h.comments_before=_,_=new u),h.parent=s,this._is_opening(h)?(A.push(s),s=h):s&&this._is_closing(h,s)&&(h.opened=s,s.closed=h,s=A.pop(),h.parent=s),h.previous=o,o.next=h,this.__tokens.add(h),o=h}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(h,o){this._readWhitespace();var s=this._input.read(/.+/g);return s?this._create_token(f.RAW,s):this._create_token(f.EOF,"")},l.prototype._is_comment=function(h){return!1},l.prototype._is_opening=function(h){return!1},l.prototype._is_closing=function(h,o){return!1},l.prototype._create_token=function(h,o){var s=new m(h,o,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return s},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},i.exports.Tokenizer=l,i.exports.TOKEN=f},function(i){function D(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}D.prototype.restart=function(){this.__position=0},D.prototype.isEmpty=function(){return this.__tokens_length===0},D.prototype.hasNext=function(){return this.__position<this.__tokens_length},D.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__tokens[this.__position],this.__position+=1),g},D.prototype.peek=function(g){var d=null;return g=g||0,g+=this.__position,g>=0&&g<this.__tokens_length&&(d=this.__tokens[g]),d},D.prototype.add=function(g){this.__parent_token&&(g.parent=this.__parent_token),this.__tokens.push(g),this.__tokens_length+=1},i.exports.TokenStream=D},function(i,D,g){var d=g(12).Pattern;function m(u,a){d.call(this,u,a),a?this._line_regexp=this._input.get_regexp(a._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}m.prototype=new d,m.prototype.__set_whitespace_patterns=function(u,a){u+="\\t ",a+="\\n\\r",this._match_pattern=this._input.get_regexp("["+u+a+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+a+"]")},m.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var u=this._input.read(this._match_pattern);if(u===" ")this.whitespace_before_token=" ";else if(u){var a=this.__split(this._newline_regexp,u);this.newline_count=a.length-1,this.whitespace_before_token=a[this.newline_count]}return u},m.prototype.matching=function(u,a){var f=this._create();return f.__set_whitespace_patterns(u,a),f._update(),f},m.prototype._create=function(){return new m(this._input,this)},m.prototype.__split=function(u,a){u.lastIndex=0;for(var f=0,l=[],h=u.exec(a);h;)l.push(a.substring(f,h.index)),f=h.index+h[0].length,h=u.exec(a);return f<a.length?l.push(a.substring(f,a.length)):l.push(""),l},i.exports.WhitespacePattern=m},function(i){function D(g,d){this._input=g,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,d&&(this._starting_pattern=this._input.get_regexp(d._starting_pattern,!0),this._match_pattern=this._input.get_regexp(d._match_pattern,!0),this._until_pattern=this._input.get_regexp(d._until_pattern),this._until_after=d._until_after)}D.prototype.read=function(){var g=this._input.read(this._starting_pattern);return(!this._starting_pattern||g)&&(g+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),g},D.prototype.read_match=function(){return this._input.match(this._match_pattern)},D.prototype.until_after=function(g){var d=this._create();return d._until_after=!0,d._until_pattern=this._input.get_regexp(g),d._update(),d},D.prototype.until=function(g){var d=this._create();return d._until_after=!1,d._until_pattern=this._input.get_regexp(g),d._update(),d},D.prototype.starting_with=function(g){var d=this._create();return d._starting_pattern=this._input.get_regexp(g,!0),d._update(),d},D.prototype.matching=function(g){var d=this._create();return d._match_pattern=this._input.get_regexp(g,!0),d._update(),d},D.prototype._create=function(){return new D(this._input,this)},D.prototype._update=function(){},i.exports.Pattern=D},function(i){function D(g,d){g=typeof g=="string"?g:g.source,d=typeof d=="string"?d:d.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+d,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+d,"g")}D.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var d={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(g);m;)d[m[1]]=m[2],m=this.__directive_pattern.exec(g);return d},D.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},i.exports.Directives=D},function(i,D,g){var d=g(12).Pattern,m={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function u(a,f){d.call(this,a,f),this.__template_pattern=null,this._disabled=Object.assign({},m),this._excluded=Object.assign({},m),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 l=new d(a);this.__patterns={handlebars_comment:l.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:l.starting_with(/{{{/).until_after(/}}}/),handlebars:l.starting_with(/{{/).until_after(/}}/),php:l.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:l.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:l.starting_with(/{%/).until_after(/%}/),django_value:l.starting_with(/{{/).until_after(/}}/),django_comment:l.starting_with(/{#/).until_after(/#}/),smarty:l.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:l.starting_with(/{\*/).until_after(/\*}/),smarty_literal:l.starting_with(/{literal}/).until_after(/{\/literal}/)}}u.prototype=new d,u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){this.__set_templated_pattern()},u.prototype.disable=function(a){var f=this._create();return f._disabled[a]=!0,f._update(),f},u.prototype.read_options=function(a){var f=this._create();for(var l in m)f._disabled[l]=a.templating.indexOf(l)===-1;return f._update(),f},u.prototype.exclude=function(a){var f=this._create();return f._excluded[a]=!0,f._update(),f},u.prototype.read=function(){var a="";this._match_pattern?a=this._input.read(this._starting_pattern):a=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),a+=f,f=this._read_template();return this._until_after&&(a+=this._input.readUntilAfter(this._until_pattern)),a},u.prototype.__set_templated_pattern=function(){var a=[];this._disabled.php||a.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||a.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||a.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(a.push(this.__patterns.django._starting_pattern.source),a.push(this.__patterns.django_value._starting_pattern.source),a.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||a.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&a.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+a.join("|")+")")},u.prototype._read_template=function(){var a="",f=this._input.peek();if(f==="<"){var l=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&l==="?"&&(a=a||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&l==="%"&&(a=a||this.__patterns.erb.read())}else f==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(a=a||this.__patterns.handlebars_comment.read(),a=a||this.__patterns.handlebars_unescaped.read(),a=a||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(a=a||this.__patterns.django_value.read()),this._excluded.django||(a=a||this.__patterns.django_comment.read(),a=a||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(a=a||this.__patterns.smarty_comment.read(),a=a||this.__patterns.smarty_literal.read(),a=a||this.__patterns.smarty.read()));return a},i.exports.TemplatablePattern=u}],U={};function G(i){var D=U[i];if(D!==void 0)return D.exports;var g=U[i]={exports:{}};return F[i](g,g.exports,G),g.exports}var W=G(0);M=W})();var Y=M;!(ie=[],$=function(){return{js_beautify:Y}}.apply(ge,ie),$!==void 0&&(at.exports=$))})()},"746U":function(at,ge,J){"use strict";J.d(ge,"f",function(){return ie}),J.d(ge,"l",function(){return $}),J.d(ge,"k",function(){return M}),J.d(ge,"j",function(){return Y}),J.d(ge,"g",function(){return F}),J.d(ge,"m",function(){return U}),J.d(ge,"h",function(){return G}),J.d(ge,"n",function(){return W}),J.d(ge,"c",function(){return i}),J.d(ge,"a",function(){return D}),J.d(ge,"i",function(){return g}),J.d(ge,"o",function(){return d}),J.d(ge,"e",function(){return a}),J.d(ge,"d",function(){return f}),J.d(ge,"p",function(){return l}),J.d(ge,"b",function(){return h});function ie(o){return Array.isArray(o)}function $(o){return typeof o=="string"}function M(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)&&!(o instanceof RegExp)&&!(o instanceof Date)}function Y(o){return typeof o=="number"&&!isNaN(o)}function F(o){return o===!0||o===!1}function U(o){return typeof o=="undefined"}function G(o){return!W(o)}function W(o){return U(o)||o===null}function i(o,s){if(!o)throw new Error(s?`Unexpected type, expected '${s}'`:"Unexpected type")}function D(o){if(W(o))throw new Error("Assertion Failed: argument is undefined or null");return o}function g(o){return typeof o=="function"}function d(o,s){const A=Math.min(o.length,s.length);for(let _=0;_<A;_++)m(o[_],s[_])}function m(o,s){if($(s)){if(typeof o!==s)throw new Error(`argument does not match constraint: typeof ${s}`)}else if(g(s)){try{if(o instanceof s)return}catch(A){}if(!W(o)&&o.constructor===s)return;if(s.length===1&&s.call(void 0,o)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function u(o){let s=[],A=Object.getPrototypeOf(o);for(;Object.prototype!==A;)s=s.concat(Object.getOwnPropertyNames(A)),A=Object.getPrototypeOf(A);return s}function a(o){const s=[];for(const A of u(o))typeof o[A]=="function"&&s.push(A);return s}function f(o,s){const A=S=>function(){const L=Array.prototype.slice.call(arguments,0);return s(S,L)};let _={};for(const S of o)_[S]=A(S);return _}function l(o){return o===null?void 0:o}function h(o,s="Unreachable"){throw new Error(s)}},"7Cbv":function(at,ge,J){"use strict";var ie=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),$=new Uint8Array(16);function M(){if(!ie)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ie($)}var Y=/^(?:[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 F(m){return typeof m=="string"&&Y.test(m)}for(var U=F,G=[],W=0;W<256;++W)G.push((W+256).toString(16).substr(1));function i(m){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=(G[m[u+0]]+G[m[u+1]]+G[m[u+2]]+G[m[u+3]]+"-"+G[m[u+4]]+G[m[u+5]]+"-"+G[m[u+6]]+G[m[u+7]]+"-"+G[m[u+8]]+G[m[u+9]]+"-"+G[m[u+10]]+G[m[u+11]]+G[m[u+12]]+G[m[u+13]]+G[m[u+14]]+G[m[u+15]]).toLowerCase();if(!U(a))throw TypeError("Stringified UUID is invalid");return a}var D=i;function g(m,u,a){m=m||{};var f=m.random||(m.rng||M)();if(f[6]=f[6]&15|64,f[8]=f[8]&63|128,u){a=a||0;for(var l=0;l<16;++l)u[a+l]=f[l];return u}return D(f)}var d=ge.a=g},"7ahc":function(at,ge,J){"use strict";J.d(ge,"a",function(){return A});var ie=J("k1fw"),$=J("0Owb"),M=J("+L6B"),Y=J("2/Rp"),F=J("y8nQ"),U=J("Vl3Y"),G=J("tJVT"),W=J("OaEy"),i=J("2fM7"),D=J("q1tI"),g=J.n(D),d=J("VrN/"),m=J.n(d),u=J("p77/"),a=J.n(u),f=J("c5Ni"),l=J.n(f),h=i.a.Option,o={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"]};ge.b=function(_){var S=_.callback,L=_.onCancel,O=Object(D.useState)("python"),C=Object(G.a)(O,2),w=C[0],x=C[1];function p(v){x(s[v][1])}function T(v){S(v)}return g.a.createElement(U.a,Object($.a)({},o,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:T}),g.a.createElement(U.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},g.a.createElement(i.a,{onChange:p},Object.keys(s).map(function(v){return g.a.createElement(h,{key:v,value:v},s[v][0])}))),g.a.createElement(U.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},g.a.createElement(A,{mode:w})),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(Y.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(Y.a,{type:"ghost",onClick:L},"\u53D6\u6D88")))};function A(_){var S=_.value,L=_.onChange,O=_.mode,C=_.options,w=C===void 0?{}:C,x=Object(D.useRef)(),p=Object(D.useState)(),T=Object(G.a)(p,2),v=T[0],y=T[1];return Object(D.useEffect)(function(){if(v){function N(B){var R=B.getValue();L&&L(R)}return v.on("change",N),function(){v.off("change",N)}}},[v,L]),Object(D.useEffect)(function(){v&&v.setOption("mode",O)},[v,O]),Object(D.useEffect)(function(){v&&((S!==v.getValue()||S==="")&&setTimeout(function(){v.setValue(S||" ")},300))},[v,S]),Object(D.useEffect)(function(){if(x.current&&!v){var N=m.a.fromTextArea(x.current,Object(ie.a)({mode:O,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},w));y(N)}},[x.current,v]),g.a.createElement("div",{className:"my-codemirror-container"},g.a.createElement("textarea",{ref:x}))}},"8EBN":function(at,ge,J){(function(ie){ie(J("VrN/"))})(function(ie){"use strict";ie.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var $=0;$<ie.modeInfo.length;$++){var M=ie.modeInfo[$];M.mimes&&(M.mime=M.mimes[0])}ie.findModeByMIME=function(Y){Y=Y.toLowerCase();for(var F=0;F<ie.modeInfo.length;F++){var U=ie.modeInfo[F];if(U.mime==Y)return U;if(U.mimes){for(var G=0;G<U.mimes.length;G++)if(U.mimes[G]==Y)return U}}if(/\+xml$/.test(Y))return ie.findModeByMIME("application/xml");if(/\+json$/.test(Y))return ie.findModeByMIME("application/json")},ie.findModeByExtension=function(Y){Y=Y.toLowerCase();for(var F=0;F<ie.modeInfo.length;F++){var U=ie.modeInfo[F];if(U.ext){for(var G=0;G<U.ext.length;G++)if(U.ext[G]==Y)return U}}},ie.findModeByFileName=function(Y){for(var F=0;F<ie.modeInfo.length;F++){var U=ie.modeInfo[F];if(U.file&&U.file.test(Y))return U}var G=Y.lastIndexOf("."),W=G>-1&&Y.substring(G+1,Y.length);if(W)return ie.findModeByExtension(W)},ie.findModeByName=function(Y){Y=Y.toLowerCase();for(var F=0;F<ie.modeInfo.length;F++){var U=ie.modeInfo[F];if(U.name.toLowerCase()==Y)return U;if(U.alias){for(var G=0;G<U.alias.length;G++)if(U.alias[G].toLowerCase()==Y)return U}}}})},"8HAY":function(at,ge,J){"use strict";J.d(ge,"a",function(){return F}),J.d(ge,"b",function(){return U}),J.d(ge,"d",function(){return G}),J.d(ge,"e",function(){return W}),J.d(ge,"c",function(){return i});var ie=J("MI8n"),$=J("pmY6"),M=J("3/fG"),Y=function(D,g,d,m){function u(a){return a instanceof d?a:new d(function(f){f(a)})}return new(d||(d=Promise))(function(a,f){function l(s){try{o(m.next(s))}catch(A){f(A)}}function h(s){try{o(m.throw(s))}catch(A){f(A)}}function o(s){s.done?a(s.value):u(s.value).then(l,h)}o((m=m.apply(D,g||[])).next())})};class F extends $.a{constructor(D,g="",d="",m=!0,u){super();this._onDidChange=this._register(new ie.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=D,this._label=g,this._cssClass=d,this._enabled=m,this._actionCallback=u}get id(){return this._id}get label(){return this._label}set label(D){this._setLabel(D)}_setLabel(D){this._label!==D&&(this._label=D,this._onDidChange.fire({label:D}))}get tooltip(){return this._tooltip||""}set tooltip(D){this._setTooltip(D)}_setTooltip(D){this._tooltip!==D&&(this._tooltip=D,this._onDidChange.fire({tooltip:D}))}get class(){return this._cssClass}set class(D){this._setClass(D)}_setClass(D){this._cssClass!==D&&(this._cssClass=D,this._onDidChange.fire({class:D}))}get enabled(){return this._enabled}set enabled(D){this._setEnabled(D)}_setEnabled(D){this._enabled!==D&&(this._enabled=D,this._onDidChange.fire({enabled:D}))}get checked(){return this._checked}set checked(D){this._setChecked(D)}_setChecked(D){this._checked!==D&&(this._checked=D,this._onDidChange.fire({checked:D}))}run(D,g){return Y(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(D))})}}class U extends $.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new ie.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new ie.b),this.onDidRun=this._onDidRun.event}run(D,g){return Y(this,void 0,void 0,function*(){if(!D.enabled)return;this._onBeforeRun.fire({action:D});let d;try{yield this.runAction(D,g)}catch(m){d=m}this._onDidRun.fire({action:D,error:d})})}runAction(D,g){return Y(this,void 0,void 0,function*(){yield D.run(g)})}}class G extends F{constructor(D){super(G.ID,D,D?"separator text":"separator");this.checked=!1,this.enabled=!1}}G.ID="vs.actions.separator";class W{constructor(D,g,d,m){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=D,this.label=g,this.class=m,this._actions=d}get actions(){return this._actions}dispose(){}run(){return Y(this,void 0,void 0,function*(){})}}class i extends F{constructor(){super(i.ID,M.a("submenu.empty","(empty)"),void 0,!1)}}i.ID="vs.actions.empty"},"8hTe":function(at,ge,J){at.exports={button:"button___1wy9m"}},"9Bee":function(at,ge,J){"use strict";var ie=J("DYRE"),$=J("zeV3"),M=J("+L6B"),Y=J("2/Rp"),F=J("k1fw"),U=J("9og8"),G=J("tJVT"),W=J("WmNS"),i=J.n(W),D=J("q1tI"),g=J.n(D),d=J("vg9a"),m=J("DlQD"),u=J.n(m),a=J("rUJ1");function f(V,E){var I=V.match(/^(\s+)(?:```)/);if(I===null)return E;var H=I[1];return E.split(`
|
|
`).map(function(q){var z=q.match(/^\s+/);if(z===null)return q;var me=Object(G.a)(z,1),je=me[0];return je.length>=H.length?q.slice(H.length):q}).join(`
|
|
`)}var l=[],h=["<ul>"],o=new u.a.Renderer,s=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function A(){l.length=0,h=["<ul>"]}var _={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(V,E,I,H){if(E>=V.length||V[E].level<=I)return E;var q=V[E];H.push("<li><a href='#"+q.anchor+"'>"+q.text+"</a>"),E++;var z=[];return E=S(V,E,q.level,z),z.length>0&&(H.push("<ul>"),z.forEach(function(me){H.push(me)}),H.push("</ul>")),H.push("</li>"),E=S(V,E,I,H),E}function L(){return S(l,0,0,h),h.push("</ul>"),h.join("")}var O={heading:function(E){var I=s.exec(E);if(I)return{type:"heading",raw:I[0],depth:I[1].length,text:I[2]}},fences:function(E){var I=this.rules.block.fences.exec(E);if(I){var H=I[0],q=f(H,I[3]||""),z=I[2]?I[2].trim():I[2];if(["latex","katex","math"].indexOf(z)>=0){var me=x(),je=q;q=me,p[me]={type:"block",expression:je}}return{type:"code",raw:H,lang:z,text:q}}}},C=/(?:\${2})([^\n`]+?)(?:\${2})/gi,w=0,x=function(){return"__special_katext_id_".concat(w++,"__")},p={};function T(){return p}function v(){w=0,p={}}function y(V){return V=V.replace(C,function(E,I){var H=x();return p[H]={type:"inline",expression:I},H}),V}var N=o.listitem;o.listitem=function(V){return N(y(V))};var B=o.paragraph;o.paragraph=function(V){return B(y(V))};var R=o.tablecell;o.tablecell=function(V,E){return R(y(V),E)},o.code=function(V,E,I){var H=(E||"").match(/\S*/)[0];return H?["latex","katex","math"].indexOf(H)>=0?"<p class='editormd-tex'>".concat(V,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(E,'">').concat(I?V:Object(a.escape)(V,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(I?V:Object(a.escape)(V,!0))+"</code></pre>"},o.heading=function(V,E,I){var H=this.options.headerPrefix+I.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return l.push({anchor:H,level:E,text:V}),"<h"+E+' id="'+H+'">'+V+"</h"+E+">"},u.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),u.a.use({tokenizer:O,renderer:o});var j=u.a,P=J("SJMd"),b=J("ulZh"),X=J.n(b),ee=J("m3rI"),ae=J("Oy/b"),le=J("p5ED"),Re=J("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 Ee=function(V,E){return(Ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,H){I.__proto__=H}||function(I,H){for(var q in H)Object.prototype.hasOwnProperty.call(H,q)&&(I[q]=H[q])})(V,E)};function Te(V,E){function I(){this.constructor=V}Ee(V,E),V.prototype=E===null?Object.create(E):(I.prototype=E.prototype,new I)}function Ae(V,E,I,H){return new(I||(I=Promise))(function(q,z){function me(gt){try{it(H.next(gt))}catch(We){z(We)}}function je(gt){try{it(H.throw(gt))}catch(We){z(We)}}function it(gt){var We;gt.done?q(gt.value):(We=gt.value,We instanceof I?We:new I(function(Tt){Tt(We)})).then(me,je)}it((H=H.apply(V,E||[])).next())})}function Oe(V,E){var I,H,q,z,me={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return z={next:je(0),throw:je(1),return:je(2)},typeof Symbol=="function"&&(z[Symbol.iterator]=function(){return this}),z;function je(it){return function(gt){return function(We){if(I)throw new TypeError("Generator is already executing.");for(;me;)try{if(I=1,H&&(q=2&We[0]?H.return:We[0]?H.throw||((q=H.return)&&q.call(H),0):H.next)&&!(q=q.call(H,We[1])).done)return q;switch(H=0,q&&(We=[2&We[0],q.value]),We[0]){case 0:case 1:q=We;break;case 4:return me.label++,{value:We[1],done:!1};case 5:me.label++,H=We[1],We=[0];continue;case 7:We=me.ops.pop(),me.trys.pop();continue;default:if(!(q=me.trys,(q=q.length>0&&q[q.length-1])||We[0]!==6&&We[0]!==2)){me=0;continue}if(We[0]===3&&(!q||We[1]>q[0]&&We[1]<q[3])){me.label=We[1];break}if(We[0]===6&&me.label<q[1]){me.label=q[1],q=We;break}if(q&&me.label<q[2]){me.label=q[2],me.ops.push(We);break}q[2]&&me.ops.pop(),me.trys.pop();continue}We=E.call(V,me)}catch(Tt){We=[6,Tt],H=0}finally{I=q=0}if(5&We[0])throw We[1];return{value:We[0]?We[1]:void 0,done:!0}}([it,gt])}}}function ce(){for(var V=0,E=0,I=arguments.length;E<I;E++)V+=arguments[E].length;var H=Array(V),q=0;for(E=0;E<I;E++)for(var z=arguments[E],me=0,je=z.length;me<je;me++,q++)H[q]=z[me];return H}var ue=function(){function V(){}return V.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},V.setAttributes=function(E,I){for(var H=0,q=I;H<q.length;H++){var z=q[H],me=z[0],je=z[1];E.setAttribute(me,je)}},V.createRect=function(E,I,H){var q=document.createElementNS("http://www.w3.org/2000/svg","rect");return q.setAttribute("width",E.toString()),q.setAttribute("height",I.toString()),H&&V.setAttributes(q,H),q},V.createLine=function(E,I,H,q,z){var me=document.createElementNS("http://www.w3.org/2000/svg","line");return me.setAttribute("x1",E.toString()),me.setAttribute("y1",I.toString()),me.setAttribute("x2",H.toString()),me.setAttribute("y2",q.toString()),z&&V.setAttributes(me,z),me},V.createPolygon=function(E,I){var H=document.createElementNS("http://www.w3.org/2000/svg","polygon");return H.setAttribute("points",E),I&&V.setAttributes(H,I),H},V.createCircle=function(E,I){var H=document.createElementNS("http://www.w3.org/2000/svg","circle");return H.setAttribute("cx",(E/2).toString()),H.setAttribute("cy",(E/2).toString()),H.setAttribute("r",E.toString()),I&&V.setAttributes(H,I),H},V.createEllipse=function(E,I,H){var q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return q.setAttribute("cx",(E/2).toString()),q.setAttribute("cy",(I/2).toString()),q.setAttribute("rx",(E/2).toString()),q.setAttribute("ry",(I/2).toString()),H&&V.setAttributes(q,H),q},V.createGroup=function(E){var I=document.createElementNS("http://www.w3.org/2000/svg","g");return E&&V.setAttributes(I,E),I},V.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},V.createMarker=function(E,I,H,q,z,me,je){var it=document.createElementNS("http://www.w3.org/2000/svg","marker");return V.setAttributes(it,[["id",E],["orient",I],["markerWidth",H.toString()],["markerHeight",q.toString()],["refX",z.toString()],["refY",me.toString()]]),it.appendChild(je),it},V.createText=function(E){var I=document.createElementNS("http://www.w3.org/2000/svg","text");return I.setAttribute("x","0"),I.setAttribute("y","0"),E&&V.setAttributes(I,E),I},V.createTSpan=function(E,I){var H=document.createElementNS("http://www.w3.org/2000/svg","tspan");return H.textContent=E,I&&V.setAttributes(H,I),H},V.createImage=function(E){var I=document.createElementNS("http://www.w3.org/2000/svg","image");return E&&V.setAttributes(I,E),I},V.createPoint=function(E,I){var H=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return H.x=E,H.y=I,H},V.createPath=function(E,I){var H=document.createElementNS("http://www.w3.org/2000/svg","path");return H.setAttribute("d",E),I&&V.setAttributes(H,I),H},V}(),Pe=function(){function V(){}return V.addKey=function(E){V.key=E},Object.defineProperty(V,"isLicensed",{get:function(){return!!V.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(V.key)},enumerable:!1,configurable:!0}),V}(),qe=function(){function V(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return V.prototype.rasterize=function(E,I,H){var q=this;return new Promise(function(z){var me=H!==void 0?H:document.createElement("canvas");E===null&&(q.markersOnly=!0,q.naturalSize=!1);var je=document.createElementNS("http://www.w3.org/2000/svg","svg");je.setAttribute("xmlns","http://www.w3.org/2000/svg"),je.setAttribute("width",I.width.baseVal.valueAsString),je.setAttribute("height",I.height.baseVal.valueAsString),je.setAttribute("viewBox","0 0 "+I.viewBox.baseVal.width.toString()+" "+I.viewBox.baseVal.height.toString()),je.innerHTML=I.innerHTML,q.naturalSize===!0?(je.width.baseVal.value=E.naturalWidth,je.height.baseVal.value=E.naturalHeight):q.width!==void 0&&q.height!==void 0&&(je.width.baseVal.value=q.width,je.height.baseVal.value=q.height),me.width=je.width.baseVal.value,me.height=je.height.baseVal.value;var it=je.outerHTML,gt=me.getContext("2d");q.markersOnly!==!0&>.drawImage(E,0,0,me.width,me.height);var We=window.URL,Tt=new Image(me.width,me.height);Tt.setAttribute("crossOrigin","anonymous");var Gt=new Blob([it],{type:"image/svg+xml"}),qt=We.createObjectURL(Gt);Tt.onload=function(){gt.drawImage(Tt,0,0),We.revokeObjectURL(qt);var Hi=me.toDataURL(q.imageType,q.imageQuality);z(Hi)},Tt.src=qt})},V}(),ze=function(){},et=function(){function V(E){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+E+"_"}return Object.defineProperty(V.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(V.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(V.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),V.prototype.addClass=function(E){return this.styleSheet===void 0&&this.addStyleSheet(),E.name=""+this.classNamePrefix+E.localName,this.classes.push(E),this.styleSheet.sheet.insertRule("."+E.name+" {"+E.style+"}",this.styleSheet.sheet.cssRules.length),E},V.prototype.addRule=function(E){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(E),this.styleSheet.sheet.insertRule(E.selector+" {"+E.style+"}",this.styleSheet.sheet.cssRules.length)},V.prototype.addStyleSheet=function(){var E;this.styleSheet=document.createElement("style"),((E=this.styleSheetRoot)!==null&&E!==void 0?E:document.head).appendChild(this.styleSheet),this.addRule(new nt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new nt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new nt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Ie("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Ie("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},V.prototype.removeStyleSheet=function(){var E;this.styleSheet&&(((E=this.styleSheetRoot)!==null&&E!==void 0?E:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},V}(),nt=function(V,E){this.selector=V,this.style=E},Ie=function(V,E){this.localName=V,this.style=E},Me=function(){function V(E,I,H,q,z){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=E,this.displayMode=I,this.markerItems=H,this.uiStyleSettings=q,this.styles=z,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return V.prototype.show=function(E){var I=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=E,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var H=document.createElement("div");H.className=this.toolbarBlockStyleClass.name,H.style.whiteSpace="nowrap",this.uiContainer.appendChild(H),this.addActionButton(H,'<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(H,'<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(H,'<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(H,'<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(H,'<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(H,'<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(H,'<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(H,'<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(z){var me=document.createElement("div");me.className=""+I.toolbarButtonStyleClass.name,me.setAttribute("data-type-name",z.typeName),me.innerHTML=z.icon,me.addEventListener("click",function(){I.markerToolbarButtonClicked(me,z)}),I.buttons.push(me),I.markerButtons.push(me)}),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 q=document.createElement("div");q.className=this.toolbarBlockStyleClass.name,q.style.whiteSpace="nowrap",q.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(q),this.addActionButton(q,'<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(q,'<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()},V.prototype.addButtonClickListener=function(E){this.buttonClickListeners.push(E)},V.prototype.removeButtonClickListener=function(E){this.buttonClickListeners.indexOf(E)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(E),1)},V.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},V.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var E=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var I=0;I<this.markerButtons.length;I++)I<E||I===E&&this.markerButtons.length-1===E?this.markerButtonBlock.appendChild(this.markerButtons[I]):(I===E&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[I]))}},V.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")},V.prototype.resetButtonStyles=function(){var E=this;this.buttons.forEach(function(I){I.className=I.className.replace(E.uiStyleSettings.toolbarButtonStyleColorsClassName?E.uiStyleSettings.toolbarButtonStyleColorsClassName:E.toolbarButtonStyleColorsClass.name,"").trim(),I.className=I.className.replace(E.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?E.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:E.toolbarActiveButtonStyleColorsClass.name,"").trim(),I.className+=" "+(E.uiStyleSettings.toolbarButtonStyleColorsClassName?E.uiStyleSettings.toolbarButtonStyleColorsClassName:E.toolbarButtonStyleColorsClass.name)})},V.prototype.addActionButton=function(E,I,H){var q=this,z=document.createElement("div");switch(z.className=""+this.toolbarButtonStyleClass.name,z.innerHTML=I,z.setAttribute("data-action",H),z.addEventListener("click",function(){q.actionToolbarButtonClicked(z,H)}),H){case"select":z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":z.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":z.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":z.style.fill=this.uiStyleSettings.closeButtonColor}E.appendChild(z),this.buttons.push(z)},V.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ie("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 Ie("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ie("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Ie("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 Ie("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var E=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ie("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*E)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*E)+`px;
|
|
padding: `+E+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ie("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ie("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new nt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new nt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},V.prototype.markerToolbarButtonClicked=function(E,I){this.setActiveButton(E),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(H){return H("marker",I)}),this.markerButtonOverflowBlock.style.display="none"},V.prototype.actionToolbarButtonClicked=function(E,I){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(H){return H("action",I)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},V.prototype.setActiveButton=function(E){this.resetButtonStyles(),E.className=E.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),E.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},V.prototype.setActiveMarkerButton=function(E){var I=this.markerButtons.find(function(H){return H.getAttribute("data-type-name")===E});I&&this.setActiveButton(I)},V.prototype.setCurrentMarker=function(E){var I=this;this.currentMarker=E,this.buttons.filter(function(H){return/delete|notes/.test(H.getAttribute("data-action"))}).forEach(function(H){I.currentMarker===void 0?(H.style.fillOpacity="0.4",H.style.pointerEvents="none"):(H.style.fillOpacity="1",H.style.pointerEvents="all")})},V}(),Ge=function(){function V(E,I,H,q){this.panels=[],this.panelButtons=[],this.markerjsContainer=E,this.displayMode=I,this.uiStyleSettings=H,this.styles=q,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return V.prototype.addStyles=function(){var E;this.toolboxStyleClass=this.styles.addClass(new Ie("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 Ie("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var I=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ie("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ie("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ie("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 Ie("toolbox-panel-row_colors",`
|
|
background-color: `+((E=this.uiStyleSettings.toolboxBackgroundColor)!==null&&E!==void 0?E:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ie("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*I)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*I)+`px;
|
|
padding: `+I+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Ie("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ie("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new nt("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new nt("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},V.prototype.show=function(E){var I;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=E,this.uiContainer.className=this.toolboxStyleClass.name+" "+((I=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&I!==void 0?I:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},V.prototype.setPanelButtons=function(E){var I,H,q=this;this.panels=E,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((I=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&I!==void 0?I:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((H=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&H!==void 0?H:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(z){var me;z.uiStyleSettings=q.uiStyleSettings;var je=document.createElement("div");je.className=q.toolboxButtonStyleClass.name+" "+((me=q.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&me!==void 0?me:q.toolboxButtonStyleColorsClass.name),je.innerHTML=z.icon,je.title=z.title,je.addEventListener("click",function(){q.panelButtonClick(z)}),q.panelButtons.push(je),q.buttonRow.appendChild(je)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},V.prototype.panelButtonClick=function(E){var I=this,H=-1;if(E!==this.activePanel){H=this.panels.indexOf(E),this.panelRow.innerHTML="";var q=E.getUi();q.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(q),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=E}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){I.displayMode==="inline"?I.panelRow.style.display="none":I.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(z,me){var je,it;z.className=I.toolboxButtonStyleClass.name+" "+(me===H?""+((je=I.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&je!==void 0?je:I.toolboxActiveButtonStyleColorsClass.name):""+((it=I.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&it!==void 0?it:I.toolboxButtonStyleColorsClass.name))})},V}(),se=function(V,E){this.title=V,this.icon=E},be=function(V){function E(I,H,q,z){var me=V.call(this,I,z||'<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 me.colors=[],me.addTransparent=!1,me.colorBoxes=[],me.colors=H,me.currentColor=q,me.setCurrentColor=me.setCurrentColor.bind(me),me.getColorBox=me.getColorBox.bind(me),me}return Te(E,V),E.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.overflow="hidden",H.style.whiteSpace="nowrap",this.colors.forEach(function(q){var z=I.getColorBox(q);H.appendChild(z),I.colorBoxes.push(z)}),H},E.prototype.getColorBox=function(I){var H=this,q=this.uiStyleSettings.toolbarHeight/4,z=this.uiStyleSettings.toolbarHeight-q,me=document.createElement("div");me.style.display="inline-block",me.style.boxSizing="content-box",me.style.width=z-2+"px",me.style.height=z-2+"px",me.style.padding="1px",me.style.marginRight="2px",me.style.marginBottom="2px",me.style.borderWidth="2px",me.style.borderStyle="solid",me.style.borderRadius=(z+2)/2+"px",me.style.borderColor=I===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",me.addEventListener("click",function(){H.setCurrentColor(I,me)});var je=document.createElement("div");return je.style.display="inline-block",je.style.width=z-2+"px",je.style.height=z-2+"px",je.style.backgroundColor=I,je.style.borderRadius=z/2+"px",I==="transparent"&&(je.style.fill=this.uiStyleSettings.toolboxAccentColor,je.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>`),me.appendChild(je),me},E.prototype.setCurrentColor=function(I,H){var q=this;this.currentColor=I,this.colorBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(I)},E}(se),xe=function(){function V(E,I,H){this._state="new",this._isSelected=!1,this._container=E,this._overlayContainer=I,this.globalSettings=H,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(V.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),V.prototype.ownsTarget=function(E){return!1},Object.defineProperty(V.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),V.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},V.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},V.prototype.pointerDown=function(E,I){},V.prototype.dblClick=function(E,I){},V.prototype.manipulate=function(E){},V.prototype.pointerUp=function(E){this.stateChanged()},V.prototype.dispose=function(){},V.prototype.addMarkerVisualToContainer=function(E){this.container.childNodes.length>0?this.container.insertBefore(E,this.container.childNodes[0]):this.container.appendChild(E)},V.prototype.getState=function(){return{typeName:V.typeName,state:this.state,notes:this.notes}},V.prototype.restoreState=function(E){this._state=E.state,this.notes=E.notes},V.prototype.scale=function(E,I){},V.prototype.colorChanged=function(E){this.onColorChanged&&this.onColorChanged(E),this.stateChanged()},V.prototype.fillColorChanged=function(E){this.onFillColorChanged&&this.onFillColorChanged(E),this.stateChanged()},V.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var E=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),E.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(E)&&this.onStateChanged(this)}},V.typeName="MarkerBase",V}(),Se=function(){function V(){this.findGripByVisual=this.findGripByVisual.bind(this)}return V.prototype.findGripByVisual=function(E){return this.topLeft.ownsTarget(E)?this.topLeft:this.topCenter.ownsTarget(E)?this.topCenter:this.topRight.ownsTarget(E)?this.topRight:this.centerLeft.ownsTarget(E)?this.centerLeft:this.centerRight.ownsTarget(E)?this.centerRight:this.bottomLeft.ownsTarget(E)?this.bottomLeft:this.bottomCenter.ownsTarget(E)?this.bottomCenter:this.bottomRight.ownsTarget(E)?this.bottomRight:void 0},V}(),Be=function(){function V(){this.GRIP_SIZE=10,this.visual=ue.createGroup(),this.visual.appendChild(ue.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ue.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return V.prototype.ownsTarget=function(E){return E===this.visual||E===this.visual.childNodes[0]||E===this.visual.childNodes[1]},V}(),He=function(){function V(){}return V.toITransformMatrix=function(E){return{a:E.a,b:E.b,c:E.c,d:E.d,e:E.e,f:E.f}},V.toSVGMatrix=function(E,I){return E.a=I.a,E.b=I.b,E.c=I.c,E.d=I.d,E.e=I.e,E.f=I.f,E},V}(),Xe=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.left=0,z.top=0,z.width=0,z.height=0,z.defaultSize={x:50,y:20},z.offsetX=0,z.offsetY=0,z.rotationAngle=0,z.CB_DISTANCE=10,z._suppressMarkerCreateEvent=!1,z.container.transform.baseVal.appendItem(ue.createTransform()),z.setupControlBox(),z}return Te(E,V),Object.defineProperty(E.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"visual",{get:function(){return this._visual},set:function(I){this._visual=I;var H=ue.createTransform();this._visual.transform.baseVal.appendItem(H)},enumerable:!1,configurable:!0}),E.prototype.ownsTarget=function(I){return!!V.prototype.ownsTarget.call(this,I)||!!(this.controlGrips.findGripByVisual(I)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(I))},E.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.state==="new"&&(this.left=I.x,this.top=I.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var q=this.unrotatePoint(I);if(this.manipulationStartX=q.x,this.manipulationStartY=q.y,this.offsetX=q.x-this.left,this.offsetY=q.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(H),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(H)){this.activeGrip=this.rotatorGrip;var z=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=z.x-this.width/2,this.top=z.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var me=this.container.transform.baseVal.getItem(0);me.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(me,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},E.prototype.pointerUp=function(I){var H=this.state;V.prototype.pointerUp.call(this,I),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(I),this._state="select",H==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},E.prototype.moveVisual=function(I){this.visual.style.transform="translate("+I.x+"px, "+I.y+"px)"},E.prototype.manipulate=function(I){var H=this.unrotatePoint(I);this.state==="creating"?this.resize(I):this.state==="move"?(this.left=this.manipulationStartLeft+(H.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(H.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(H):this.state==="rotate"&&this.rotate(I)},E.prototype.resize=function(I){var H=this.manipulationStartLeft,q=this.manipulationStartWidth,z=this.manipulationStartTop,me=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:H=this.manipulationStartLeft+I.x-this.manipulationStartX,q=this.manipulationStartWidth+this.manipulationStartLeft-H;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:q=this.manipulationStartWidth+I.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:z=this.manipulationStartTop+I.y-this.manipulationStartY,me=this.manipulationStartHeight+this.manipulationStartTop-z;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:me=this.manipulationStartHeight+I.y-this.manipulationStartY}q>=0?(this.left=H,this.width=q):(this.left=H+q,this.width=-q),me>=0?(this.top=z,this.height=me):(this.top=z+me,this.height=-me),this.setSize()},E.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},E.prototype.rotate=function(I){if(Math.abs(I.x-this.centerX)>.1){var H=Math.sign(I.x-this.centerX);this.rotationAngle=180*Math.atan((I.y-this.centerY)/(I.x-this.centerX))/Math.PI+90*H,this.applyRotation()}},E.prototype.applyRotation=function(){var I=this.container.transform.baseVal.getItem(0);I.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(I,0)},E.prototype.rotatePoint=function(I){if(this.rotationAngle===0)return I;var H=this.container.getCTM(),q=ue.createPoint(I.x,I.y);return{x:(q=q.matrixTransform(H)).x,y:q.y}},E.prototype.unrotatePoint=function(I){if(this.rotationAngle===0)return I;var H=this.container.getCTM();H=H.inverse();var q=ue.createPoint(I.x,I.y);return{x:(q=q.matrixTransform(H)).x,y:q.y}},E.prototype.select=function(){V.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},E.prototype.deselect=function(){V.prototype.deselect.call(this),this.controlBox.style.display="none"},E.prototype.setupControlBox=function(){this.controlBox=ue.createGroup();var I=ue.createTransform();I.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(I),this.container.appendChild(this.controlBox),this.controlRect=ue.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=ue.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 Se,this.addControlGrips(),this.controlBox.style.display="none"},E.prototype.adjustControlBox=function(){var I=this.controlBox.transform.baseVal.getItem(0);I.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(I,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()},E.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()},E.prototype.createGrip=function(){var I=new Be;return I.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(I.visual),I},E.prototype.positionGrips=function(){var I=this.controlGrips.topLeft.GRIP_SIZE,H=-I/2,q=H,z=(this.width+this.CB_DISTANCE)/2-I/2,me=(this.height+this.CB_DISTANCE)/2-I/2,je=this.height+this.CB_DISTANCE-I/2,it=this.width+this.CB_DISTANCE-I/2;this.positionGrip(this.controlGrips.topLeft.visual,H,q),this.positionGrip(this.controlGrips.topCenter.visual,z,q),this.positionGrip(this.controlGrips.topRight.visual,it,q),this.positionGrip(this.controlGrips.centerLeft.visual,H,me),this.positionGrip(this.controlGrips.centerRight.visual,it,me),this.positionGrip(this.controlGrips.bottomLeft.visual,H,je),this.positionGrip(this.controlGrips.bottomCenter.visual,z,je),this.positionGrip(this.controlGrips.bottomRight.visual,it,je),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,z,q-3*this.CB_DISTANCE)},E.prototype.positionGrip=function(I,H,q){var z=I.transform.baseVal.getItem(0);z.setTranslate(H,q),I.transform.baseVal.replaceItem(z,0)},E.prototype.hideControlBox=function(){this.controlBox.style.display="none"},E.prototype.showControlBox=function(){this.controlBox.style.display=""},E.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:He.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:He.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},V.prototype.getState.call(this))},E.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I);var H=I;this.left=H.left,this.top=H.top,this.width=H.width,this.height=H.height,this.rotationAngle=H.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(He.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,H.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(He.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,H.containerTransformMatrix))},E.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H);var q=this.rotatePoint({x:this.left,y:this.top}),z=this.unrotatePoint({x:q.x*I,y:q.y*H});this.left=z.x,this.top=z.y,this.width=this.width*I,this.height=this.height*H,this.adjustControlBox()},E}(xe),Ve=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.fillColor="transparent",z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.opacity=1,z.setStrokeColor=z.setStrokeColor.bind(z),z.setFillColor=z.setFillColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.createVisual=z.createVisual.bind(z),z}return Te(E,V),E.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.visual)},E.prototype.createVisual=function(){this.visual=ue.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)},E.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},E.prototype.manipulate=function(I){V.prototype.manipulate.call(this,I)},E.prototype.resize=function(I){V.prototype.resize.call(this,I),this.setSize()},E.prototype.setSize=function(){V.prototype.setSize.call(this),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},E.prototype.pointerUp=function(I){V.prototype.pointerUp.call(this,I),this.setSize()},E.prototype.setStrokeColor=function(I){this.strokeColor=I,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(I),this.stateChanged()},E.prototype.setFillColor=function(I){this.fillColor=I,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},E.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},E.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},E.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},V.prototype.getState.call(this))},E.prototype.restoreState=function(I){var H=I;this.fillColor=H.fillColor,this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.opacity=H.opacity,this.createVisual(),V.prototype.restoreState.call(this,I),this.setSize()},E.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H),this.setSize()},E.title="Rectangle marker",E}(Xe),lt=function(V){function E(I,H,q,z){var me=V.call(this,I,z||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return me.widths=[],me.widthBoxes=[],me.widths=H,me.currentWidth=q,me.setCurrentWidth=me.setCurrentWidth.bind(me),me}return Te(E,V),E.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",this.widths.forEach(function(q){var z=document.createElement("div");z.style.display="flex",z.style.flexGrow="2",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.borderColor=q===I.currentWidth?I.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){I.setCurrentWidth(q,z)}),H.appendChild(z);var me=document.createElement("div");me.innerText=q.toString(),me.style.marginRight="5px",z.appendChild(me);var je=document.createElement("div");je.style.minHeight="20px",je.style.flexGrow="2",je.style.display="flex",je.style.alignItems="center";var it=document.createElement("hr");it.style.minWidth="20px",it.style.border="0px",it.style.borderTop=q+"px solid "+I.uiStyleSettings.toolboxColor,it.style.flexGrow="2",je.appendChild(it),z.appendChild(je),I.widthBoxes.push(z)}),H},E.prototype.setCurrentWidth=function(I,H){var q=this;this.currentWidth=I,this.widthBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},E}(se),$e=function(V){function E(I,H,q,z){var me=V.call(this,I,z||'<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 me.styles=[],me.styleBoxes=[],me.styles=H,me.currentStyle=q,me.setCurrentStyle=me.setCurrentStyle.bind(me),me}return Te(E,V),E.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",this.styles.forEach(function(q){var z=document.createElement("div");z.style.display="flex",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.overflow="hidden",z.style.maxWidth=100/I.styles.length-5+"%",z.style.borderColor=q===I.currentStyle?I.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){I.setCurrentStyle(q,z)}),H.appendChild(z);var me=document.createElement("div");me.style.minHeight="20px",me.style.flexGrow="2",me.style.overflow="hidden";var je=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+I.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(q!==""?'stroke-dasharray="'+q+'"':"")+` />
|
|
</svg>`;me.innerHTML=je,z.appendChild(me),I.styleBoxes.push(z)}),H},E.prototype.setCurrentStyle=function(I,H){var q=this;this.currentStyle=I,this.styleBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},E}(se),Qe=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.strokePanel=new be("Line color",q.defaultColorSet,q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new lt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new $e("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return Te(E,V),Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var I=V.prototype.getState.call(this);return I.typeName=E.typeName,I},E.typeName="FrameMarker",E.title="Frame marker",E.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',E}(Ve),De=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},ct=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.x1=0,z.y1=0,z.x2=0,z.y2=0,z.defaultLength=50,z.manipulationStartX=0,z.manipulationStartY=0,z.manipulationStartX1=0,z.manipulationStartY1=0,z.manipulationStartX2=0,z.manipulationStartY2=0,z.setupControlBox(),z}return Te(E,V),E.prototype.ownsTarget=function(I){return!!V.prototype.ownsTarget.call(this,I)||!(!this.grip1.ownsTarget(I)&&!this.grip2.ownsTarget(I))},E.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.manipulationStartX=I.x,this.manipulationStartY=I.y,this.state==="new"&&(this.x1=I.x,this.y1=I.y,this.x2=I.x,this.y2=I.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(H)?this.activeGrip=this.grip1:this.grip2.ownsTarget(H)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},E.prototype.pointerUp=function(I){var H=this.state;V.prototype.pointerUp.call(this,I),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(I),this._state="select",H==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},E.prototype.adjustVisual=function(){},E.prototype.manipulate=function(I){this.state==="creating"?this.resize(I):this.state==="move"?(this.x1=this.manipulationStartX1+I.x-this.manipulationStartX,this.y1=this.manipulationStartY1+I.y-this.manipulationStartY,this.x2=this.manipulationStartX2+I.x-this.manipulationStartX,this.y2=this.manipulationStartY2+I.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(I)},E.prototype.resize=function(I){switch(this.activeGrip){case this.grip1:this.x1=I.x,this.y1=I.y;break;case this.grip2:case void 0:this.x2=I.x,this.y2=I.y}this.adjustVisual(),this.adjustControlBox()},E.prototype.select=function(){V.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},E.prototype.deselect=function(){V.prototype.deselect.call(this),this.controlBox.style.display="none"},E.prototype.setupControlBox=function(){this.controlBox=ue.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},E.prototype.adjustControlBox=function(){this.positionGrips()},E.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},E.prototype.createGrip=function(){var I=new Be;return I.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(I.visual),I},E.prototype.positionGrips=function(){var I=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-I/2,this.y1-I/2),this.positionGrip(this.grip2.visual,this.x2-I/2,this.y2-I/2)},E.prototype.positionGrip=function(I,H,q){var z=I.transform.baseVal.getItem(0);z.setTranslate(H,q),I.transform.baseVal.replaceItem(z,0)},E.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},V.prototype.getState.call(this))},E.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I);var H=I;this.x1=H.x1,this.y1=H.y1,this.x2=H.x2,this.y2=H.y2},E.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H),this.x1=this.x1*I,this.y1=this.y1*H,this.x2=this.x2*I,this.y2=this.y2*H,this.adjustVisual(),this.adjustControlBox()},E}(xe),ut=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.setStrokeColor=z.setStrokeColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.strokePanel=new be("Line color",q.defaultColorSet,q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new lt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new $e("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return Te(E,V),E.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.selectorLine&&I!==this.visibleLine)},E.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorLine=ue.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ue.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)},E.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},E.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()),ue.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},E.prototype.setStrokeColor=function(I){this.strokeColor=I,this.adjustVisual(),this.colorChanged(I)},E.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.adjustVisual()},E.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.adjustVisual(),this.stateChanged()},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var I=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},V.prototype.getState.call(this));return I.typeName=E.typeName,I},E.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I);var H=I;this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.createVisual(),this.adjustVisual()},E.typeName="LineMarker",E.title="Line marker",E.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',E}(ct),ke=function(V){function E(I,H,q,z){var me=V.call(this,I,z||'<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 me.fonts=[],me.fontBoxes=[],me.fonts=H,me.currentFont=q,me.setCurrentFont=me.setCurrentFont.bind(me),me}return Te(E,V),E.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.overflow="hidden",H.style.flexGrow="2",this.fonts.forEach(function(q){var z=document.createElement("div");z.style.display="inline-block",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.overflow="hidden",z.style.maxWidth=100/I.fonts.length-5+"%",z.style.borderColor=q===I.currentFont?I.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){I.setCurrentFont(q,z)}),H.appendChild(z);var me=document.createElement("div");me.style.display="flex",me.style.minHeight="20px",me.style.flexGrow="2",me.style.fontFamily=q,me.style.overflow="hidden";var je=document.createElement("div");je.style.whiteSpace="nowrap",je.style.overflow="hidden",je.style.textOverflow="ellipsis",je.innerHTML="The quick brown fox jumps over the lazy dog",me.appendChild(je),z.appendChild(me),I.fontBoxes.push(z)}),H},E.prototype.setCurrentFont=function(I,H){var q=this;this.currentFont=I,this.fontBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},E}(se),Ne=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.color="transparent",z.padding=5,z.DEFAULT_TEXT="your text here",z.text=z.DEFAULT_TEXT,z.isMoved=!1,z.color=q.defaultColor,z.fontFamily=q.defaultFontFamily,z.defaultSize={x:100,y:30},z.setColor=z.setColor.bind(z),z.setFont=z.setFont.bind(z),z.renderText=z.renderText.bind(z),z.sizeText=z.sizeText.bind(z),z.textEditDivClicked=z.textEditDivClicked.bind(z),z.showTextEditor=z.showTextEditor.bind(z),z.setSize=z.setSize.bind(z),z.positionTextEditor=z.positionTextEditor.bind(z),z.colorPanel=new be("Color",q.defaultColorSet,q.defaultColor),z.colorPanel.onColorChanged=z.setColor,z.fontFamilyPanel=new ke("Font",q.defaultFontFamilies,q.defaultFontFamily),z.fontFamilyPanel.onFontChanged=z.setFont,z}return Te(E,V),E.prototype.ownsTarget=function(I){if(V.prototype.ownsTarget.call(this,I)||I===this.visual||I===this.textElement||I===this.bgRectangle)return!0;var H=!1;return this.textElement.childNodes.forEach(function(q){q===I&&(H=!0)}),H},E.prototype.createVisual=function(){this.visual=ue.createGroup(),this.bgRectangle=ue.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ue.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},E.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.isMoved=!1,this.pointerDownPoint=I,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},E.prototype.renderText=function(){var I=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(H){I.textElement.appendChild(ue.createTSpan(H.trim()===""?" ":H.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},E.prototype.getTextScale=function(){var I=this.textElement.getBBox(),H=1;if(I.width>0&&I.height>0){var q=(1*this.width-this.width*this.padding*2/100)/I.width,z=(1*this.height-this.height*this.padding*2/100)/I.height;H=Math.min(q,z)}return H},E.prototype.getTextPosition=function(I){var H=this.textElement.getBBox(),q=0,z=0;return H.width>0&&H.height>0&&(q=(this.width-H.width*I)/2,z=this.height/2-H.height*I/2),{x:q,y:z}},E.prototype.sizeText=function(){var I=this.textElement.getBBox(),H=this.getTextScale(),q=this.getTextPosition(H);q.y-=I.y*H,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+q.x+"px, "+q.y+"px) scale("+H+", "+H+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(q.x,q.y),this.textElement.transform.baseVal.getItem(1).setScale(H,H))},E.prototype.manipulate=function(I){V.prototype.manipulate.call(this,I),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(I.x-this.pointerDownPoint.x)>5||Math.abs(I.y-this.pointerDownPoint.y)>5)},E.prototype.resize=function(I){V.prototype.resize.call(this,I),this.isMoved=!0,this.setSize(),this.sizeText()},E.prototype.setSize=function(){V.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},E.prototype.pointerUp=function(I){var H=this.state;H==="creating"&&(this._suppressMarkerCreateEvent=!0),V.prototype.pointerUp.call(this,I),this.setSize(),(H==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},E.prototype.showTextEditor=function(){var I=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(H){H.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var H=Number.parseFloat(I.textEditor.style.fontSize);I.textEditor.clientWidth>=Number.parseInt(I.textEditor.style.maxWidth)&&H>.9;)H-=.1,I.textEditor.style.fontSize=Math.max(H,.9)+"em"}),this.textEditor.addEventListener("keyup",function(H){H.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(H){if(H.clipboardData){var q=H.clipboardData.getData("text"),z=window.getSelection();if(!z.rangeCount)return!1;z.deleteFromDocument(),z.getRangeAt(0).insertNode(document.createTextNode(q)),H.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){I.textEditDivClicked(I.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},E.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var I=this.getTextScale(),H=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),q=this.textElement.getBBox(),z={x:q.width*I,y:q.height*I};H.x-=z.x/2,H.y-=z.y/2,this.textEditor.style.top=H.y+"px",this.textEditor.style.left=H.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-H.x+"px",this.textEditor.style.fontSize=Math.max(16*I,12)+"px",this.textElement.style.display="none"}},E.prototype.textEditDivClicked=function(I){this.text=I.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},E.prototype.select=function(){V.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},E.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),V.prototype.deselect.call(this)},E.prototype.dblClick=function(I,H){V.prototype.dblClick.call(this,I,H),this.showTextEditor()},E.prototype.setColor=function(I){this.textElement&&ue.setAttributes(this.textElement,[["fill",I]]),this.color=I,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(I)},E.prototype.setFont=function(I){this.textElement&&ue.setAttributes(this.textElement,[["font-family",I]]),this.fontFamily=I,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},E.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},E.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var I=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},V.prototype.getState.call(this));return I.typeName=E.typeName,I},E.prototype.restoreState=function(I){var H=I;this.color=H.color,this.fontFamily=H.fontFamily,this.padding=H.padding,this.text=H.text,this.createVisual(),V.prototype.restoreState.call(this,I),this.setSize()},E.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H),this.setSize(),this.sizeText(),this.positionTextEditor()},E.typeName="TextMarker",E.title="Text marker",E.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>',E}(Xe),_e=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.color="transparent",z.lineWidth=3,z.drawing=!1,z.pixelRatio=1,z.color=q.defaultColor,z.lineWidth=q.defaultStrokeWidth,z.pixelRatio=q.freehandPixelRatio,z.setColor=z.setColor.bind(z),z.addCanvas=z.addCanvas.bind(z),z.finishCreation=z.finishCreation.bind(z),z.setLineWidth=z.setLineWidth.bind(z),z.colorPanel=new be("Color",q.defaultColorSet,q.defaultColor),z.colorPanel.onColorChanged=z.setColor,z.lineWidthPanel=new lt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.lineWidthPanel.onWidthChanged=z.setLineWidth,z}return Te(E,V),E.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.drawingImage)},E.prototype.createVisual=function(){this.visual=ue.createGroup(),this.drawingImage=ue.createImage(),this.visual.appendChild(this.drawingImage);var I=ue.createTransform();this.visual.transform.baseVal.appendItem(I),this.addMarkerVisualToContainer(this.visual)},E.prototype.pointerDown=function(I,H){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(I.x,I.y),this.drawing=!0):V.prototype.pointerDown.call(this,I,H)},E.prototype.manipulate=function(I){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(I.x,I.y),this.canvasContext.stroke()):V.prototype.manipulate.call(this,I)},E.prototype.resize=function(I){V.prototype.resize.call(this,I),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},E.prototype.pointerUp=function(I){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):V.prototype.pointerUp.call(this,I)},E.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)},E.prototype.select=function(){this.state==="creating"&&this.finishCreation(),V.prototype.select.call(this)},E.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),V.prototype.deselect.call(this)},E.prototype.finishCreation=function(){for(var I=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),H=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],q=H[0],z=H[1],me=H[2],je=H[3],it=!1,gt=0;gt<this.canvasElement.height;gt++)for(var We=0;We<this.canvasElement.width;We++)I.data[gt*this.canvasElement.width*4+4*We+3]>0&&(it=!0,gt<z&&(z=gt),We<q&&(q=We),gt>je&&(je=gt),We>me&&(me=We));if(it){this.left=q/this.pixelRatio,this.top=z/this.pixelRatio,this.width=(me-q)/this.pixelRatio,this.height=(je-z)/this.pixelRatio;var Tt=document.createElement("canvas");Tt.width=me-q,Tt.height=je-z,Tt.getContext("2d").putImageData(this.canvasContext.getImageData(q,z,me-q,je-z),0,0),this.drawingImgUrl=Tt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},E.prototype.setDrawingImage=function(){ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},E.prototype.setColor=function(I){this.color=I,this.colorChanged(I)},E.prototype.setLineWidth=function(I){this.lineWidth=I},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var I=Object.assign({drawingImgUrl:this.drawingImgUrl},V.prototype.getState.call(this));return I.typeName=E.typeName,I},E.prototype.restoreState=function(I){this.createVisual(),V.prototype.restoreState.call(this,I),this.drawingImgUrl=I.drawingImgUrl,this.setDrawingImage()},E.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H),this.setDrawingImage()},E.typeName="FreehandMarker",E.title="Freehand marker",E.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>',E}(Xe),fe=function(V){function E(I,H,q){var z=V.call(this,I,q||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return z.typeBoxes=[],z.currentType=H,z.setCurrentType=z.setCurrentType.bind(z),z}return Te(E,V),E.prototype.getUi=function(){var I=this,H=document.createElement("div");H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2";for(var q=function(je){var it="both";switch(je){case 0:it="both";break;case 1:it="start";break;case 2:it="end";break;case 3:it="none"}var gt=document.createElement("div");if(gt.style.display="flex",gt.style.flexGrow="2",gt.style.alignItems="center",gt.style.justifyContent="space-between",gt.style.padding="5px",gt.style.borderWidth="2px",gt.style.borderStyle="solid",gt.style.borderColor=it===z.currentType?z.uiStyleSettings.toolboxAccentColor:"transparent",gt.addEventListener("click",function(){I.setCurrentType(it,gt)}),H.appendChild(gt),it==="both"||it==="start"){var We=document.createElement("div");We.style.display="flex",We.style.alignItems="center",We.style.minHeight="20px",We.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="`+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,We.style.marginLeft="5px",gt.appendChild(We)}var Tt=document.createElement("div");Tt.style.display="flex",Tt.style.alignItems="center",Tt.style.minHeight="20px",Tt.style.flexGrow="2";var Gt=document.createElement("hr");if(Gt.style.minWidth="20px",Gt.style.border="0px",Gt.style.borderTop="3px solid "+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee"),Gt.style.flexGrow="2",Tt.appendChild(Gt),gt.appendChild(Tt),it==="both"||it==="end"){var qt=document.createElement("div");qt.style.display="flex",qt.style.alignItems="center",qt.style.minHeight="20px",qt.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="`+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,qt.style.marginRight="5px",gt.appendChild(qt)}z.typeBoxes.push(gt)},z=this,me=0;me<4;me++)q(me);return H},E.prototype.setCurrentType=function(I,H){var q=this;this.currentType=I,this.typeBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings!==void 0?q.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},E}(se),ve=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.arrowType="end",z.arrowBaseHeight=10,z.arrowBaseWidth=10,z.getArrowPoints=z.getArrowPoints.bind(z),z.setArrowType=z.setArrowType.bind(z),z.arrowTypePanel=new fe("Arrow type","end"),z.arrowTypePanel.onArrowTypeChanged=z.setArrowType,z}return Te(E,V),E.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.arrow1&&I!==this.arrow2)},E.prototype.getArrowPoints=function(I,H){var q=this.arrowBaseWidth+2*this.strokeWidth,z=this.arrowBaseHeight+2*this.strokeWidth;return I-q/2+","+(H+z/2)+" "+I+","+(H-z/2)+" "+(I+q/2)+","+(H+z/2)},E.prototype.createTips=function(){this.arrow1=ue.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ue.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow2)},E.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.state==="creating"&&this.createTips()},E.prototype.adjustVisual=function(){if(V.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",ue.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ue.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var I=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),H=this.arrow1.transform.baseVal.getItem(0);H.setRotate(I,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(H,0);var q=this.arrow2.transform.baseVal.getItem(0);q.setRotate(I+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(q,0)}},E.prototype.setArrowType=function(I){this.arrowType=I,this.adjustVisual(),this.stateChanged()},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var I=Object.assign({arrowType:this.arrowType},V.prototype.getState.call(this));return I.typeName=E.typeName,I},E.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I);var H=I;this.arrowType=H.arrowType,this.createTips(),this.adjustVisual()},E.typeName="ArrowMarker",E.title="Arrow marker",E.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',E}(ut),ne=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.fillColor=q.defaultFillColor,z.strokeWidth=0,z.fillPanel=new be("Color",q.defaultColorSet,q.defaultFillColor),z.fillPanel.onColorChanged=z.setFillColor,z}return Te(E,V),Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var I=V.prototype.getState.call(this);return I.typeName=E.typeName,I},E.typeName="CoverMarker",E.title="Cover marker",E.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',E}(Ve),re=function(V){function E(I,H,q,z){var me=V.call(this,I,z||'<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 me.opacities=[],me.opacityBoxes=[],me.opacities=H,me.currentOpacity=q,me.setCurrentOpacity=me.setCurrentOpacity.bind(me),me}return Te(E,V),E.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",H.style.justifyContent="space-between",this.opacities.forEach(function(q){var z=document.createElement("div");z.style.display="flex",z.style.alignItems="center",z.style.justifyContent="center",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.borderColor=q===I.currentOpacity?I.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){I.setCurrentOpacity(q,z)}),H.appendChild(z);var me=document.createElement("div");me.innerText=100*q+"%",z.appendChild(me),I.opacityBoxes.push(z)}),H},E.prototype.setCurrentOpacity=function(I,H){var q=this;this.currentOpacity=I,this.opacityBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},E}(se),oe=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.setOpacity=z.setOpacity.bind(z),z.fillColor=q.defaultHighlightColor,z.strokeWidth=0,z.opacity=q.defaultHighlightOpacity,z.fillPanel=new be("Color",q.defaultColorSet,z.fillColor),z.fillPanel.onColorChanged=z.setFillColor,z.opacityPanel=new re("Opacity",q.defaultOpacitySteps,z.opacity),z.opacityPanel.onOpacityChanged=z.setOpacity,z}return Te(E,V),E.prototype.setOpacity=function(I){this.opacity=I,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var I=V.prototype.getState.call(this);return I.typeName=E.typeName,I},E.typeName="HighlightMarker",E.title="Highlight marker",E.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>',E}(ne),de='<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>',ye=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.bgColor="transparent",z.tipPosition={x:0,y:0},z.tipBase1Position={x:0,y:0},z.tipBase2Position={x:0,y:0},z.tipMoving=!1,z.color=q.defaultStrokeColor,z.bgColor=q.defaultFillColor,z.fontFamily=q.defaultFontFamily,z.defaultSize={x:100,y:30},z.setBgColor=z.setBgColor.bind(z),z.getTipPoints=z.getTipPoints.bind(z),z.positionTip=z.positionTip.bind(z),z.setTipPoints=z.setTipPoints.bind(z),z.colorPanel=new be("Text color",q.defaultColorSet,z.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>'),z.colorPanel.onColorChanged=z.setColor,z.bgColorPanel=new be("Fill color",q.defaultColorSet,z.bgColor,de),z.bgColorPanel.onColorChanged=z.setBgColor,z.fontFamilyPanel=new ke("Font",q.defaultFontFamilies,q.defaultFontFamily),z.fontFamilyPanel.onFontChanged=z.setFont,z.tipGrip=new Be,z.tipGrip.visual.transform.baseVal.appendItem(ue.createTransform()),z.controlBox.appendChild(z.tipGrip.visual),z}return Te(E,V),E.prototype.ownsTarget=function(I){return V.prototype.ownsTarget.call(this,I)||this.tipGrip.ownsTarget(I)||this.tip===I},E.prototype.createTip=function(){ue.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ue.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},E.prototype.pointerDown=function(I,H){this.state==="new"&&V.prototype.pointerDown.call(this,I,H),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(H)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):V.prototype.pointerDown.call(this,I,H)},E.prototype.pointerUp=function(I){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,V.prototype.pointerUp.call(this,I);else{var H=this.state==="creating";V.prototype.pointerUp.call(this,I),this.setTipPoints(H),this.positionTip()}},E.prototype.manipulate=function(I){if(this.tipMoving){var H=this.unrotatePoint(I);this.tipPosition={x:H.x-this.manipulationStartLeft,y:H.y-this.manipulationStartTop},this.positionTip()}else V.prototype.manipulate.call(this,I)},E.prototype.setBgColor=function(I){this.bgRectangle&&this.tip&&(ue.setAttributes(this.bgRectangle,[["fill",I]]),ue.setAttributes(this.tip,[["fill",I]])),this.bgColor=I,this.fillColorChanged(I)},E.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},E.prototype.setTipPoints=function(I){I===void 0&&(I=!1);var H=Math.min(this.height/2,15),q=this.height/5;I&&(this.tipPosition={x:H+q/2,y:this.height+20});var z=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?z<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(q=this.width/5,H=Math.min(this.width/2,15),this.tipBase1Position={x:H,y:0},this.tipBase2Position={x:H+q,y:0}):(this.tipBase1Position={x:0,y:H},this.tipBase2Position={x:0,y:H+q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?z<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(q=this.width/5,H=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-H-q,y:0},this.tipBase2Position={x:this.width-H,y:0}):(this.tipBase1Position={x:this.width,y:H},this.tipBase2Position={x:this.width,y:H+q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?z<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(q=this.width/5,H=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-H-q,y:this.height},this.tipBase2Position={x:this.width-H,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-H-q},this.tipBase2Position={x:this.width,y:this.height-H}):z<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(q=this.width/5,H=Math.min(this.width/2,15),this.tipBase1Position={x:H,y:this.height},this.tipBase2Position={x:H+q,y:this.height}):(this.tipBase1Position={x:0,y:this.height-H},this.tipBase2Position={x:0,y:this.height-H-q})},E.prototype.resize=function(I){V.prototype.resize.call(this,I),this.positionTip()},E.prototype.positionTip=function(){ue.setAttributes(this.tip,[["points",this.getTipPoints()]]);var I=this.tipGrip.visual.transform.baseVal.getItem(0);I.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(I,0)},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),E.prototype.select=function(){this.positionTip(),V.prototype.select.call(this)},E.prototype.getState=function(){var I=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},V.prototype.getState.call(this));return I.typeName=E.typeName,I},E.prototype.restoreState=function(I){var H=I;this.bgColor=H.bgColor,this.tipPosition=H.tipPosition,V.prototype.restoreState.call(this,I),this.createTip(),this.setTipPoints()},E.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H),this.tipPosition={x:this.tipPosition.x*I,y:this.tipPosition.y*H},this.positionTip()},E.typeName="CalloutMarker",E.title="Callout marker",E.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>',E}(Ne),Le=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.fillColor="transparent",z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.opacity=1,z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.fillColor=q.defaultFillColor,z.setStrokeColor=z.setStrokeColor.bind(z),z.setFillColor=z.setFillColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.setOpacity=z.setOpacity.bind(z),z.createVisual=z.createVisual.bind(z),z.strokePanel=new be("Line color",ce(q.defaultColorSet,["transparent"]),q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.fillPanel=new be("Fill color",ce(q.defaultColorSet,["transparent"]),z.fillColor,de),z.fillPanel.onColorChanged=z.setFillColor,z.strokeWidthPanel=new lt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new $e("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z.opacityPanel=new re("Opacity",q.defaultOpacitySteps,z.opacity),z.opacityPanel.onOpacityChanged=z.setOpacity,z}return Te(E,V),E.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.visual)},E.prototype.createVisual=function(){this.visual=ue.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)},E.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},E.prototype.manipulate=function(I){V.prototype.manipulate.call(this,I)},E.prototype.resize=function(I){V.prototype.resize.call(this,I),this.setSize()},E.prototype.setSize=function(){V.prototype.setSize.call(this),ue.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},E.prototype.pointerUp=function(I){V.prototype.pointerUp.call(this,I),this.setSize()},E.prototype.setStrokeColor=function(I){this.strokeColor=I,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(I),this.stateChanged()},E.prototype.setFillColor=function(I){this.fillColor=I,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(I),this.stateChanged()},E.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},E.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},E.prototype.setOpacity=function(I){this.opacity=I,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var I=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},V.prototype.getState.call(this));return I.typeName=E.typeName,I},E.prototype.restoreState=function(I){var H=I;this.fillColor=H.fillColor,this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.opacity=H.opacity,this.createVisual(),V.prototype.restoreState.call(this,I),this.setSize()},E.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H),this.setSize()},E.typeName="EllipseMarker",E.title="Ellipse marker",E.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>',E}(Xe),Ue=function(V){function E(I,H,q){return V.call(this,I,H,q)||this}return Te(E,V),Object.defineProperty(E.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),E.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.tip1&&I!==this.tip2)},E.prototype.createTips=function(){this.tip1=ue.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(ue.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ue.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(ue.createTransform()),this.visual.appendChild(this.tip2)},E.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.state==="creating"&&this.createTips()},E.prototype.adjustVisual=function(){if(V.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ue.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()]]),ue.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 I=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),H=this.tip1.transform.baseVal.getItem(0);H.setRotate(I,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(H,0);var q=this.tip2.transform.baseVal.getItem(0);q.setRotate(I+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(q,0)}},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var I=V.prototype.getState.call(this);return I.typeName=E.typeName,I},E.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I),this.createTips(),this.adjustVisual()},E.typeName="MeasurementMarker",E.title="Measurement marker",E.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>',E}(ut),Je=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.strokePanel.colors=q.defaultColorSet,z.fillColor="transparent",z}return Te(E,V),Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var I=V.prototype.getState.call(this);return I.typeName=E.typeName,I},E.typeName="EllipseFrameMarker",E.title="Ellipse frame marker",E.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>',E}(Le),dt=function(){function V(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(V.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),V.prototype.addUndoStep=function(E){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(E)||(this.undoStack.push(E),JSON.stringify(this.lastRedoStep)!==JSON.stringify(E)&&this.redoStack.splice(0,this.redoStack.length))},V.prototype.replaceLastUndoStep=function(E){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=E)},V.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},V.prototype.undo=function(){if(this.undoStack.length>1){var E=this.undoStack.pop();return E!==void 0&&this.redoStack.push(E),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},V.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},V}(),rt=function(V){function E(I,H,q){var z=V.call(this,I,H,q)||this;return z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.curveX=0,z.curveY=0,z.manipulationStartCurveX=0,z.manipulationStartCurveY=0,z.setStrokeColor=z.setStrokeColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.positionGrips=z.positionGrips.bind(z),z.addControlGrips=z.addControlGrips.bind(z),z.adjustVisual=z.adjustVisual.bind(z),z.setupControlBox=z.setupControlBox.bind(z),z.resize=z.resize.bind(z),z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.strokePanel=new be("Line color",q.defaultColorSet,q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new lt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new $e("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return Te(E,V),E.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.selectorCurve&&I!==this.visibleCurve&&!this.curveGrip.ownsTarget(I))},E.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},E.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorCurve=ue.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ue.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)},E.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=I.x,this.curveY=I.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(H)&&(this.activeGrip=this.curveGrip,this._state="resize")},E.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ue.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},E.prototype.setupControlBox=function(){V.prototype.setupControlBox.call(this),this.curveControlLine1=ue.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ue.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)},E.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,V.prototype.addControlGrips.call(this)},E.prototype.positionGrips=function(){V.prototype.positionGrips.call(this);var I=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-I/2,this.curveY-I/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()))},E.prototype.manipulate=function(I){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+I.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+I.y-this.manipulationStartY),V.prototype.manipulate.call(this,I)},E.prototype.resize=function(I){this.activeGrip===this.curveGrip&&(this.curveX=I.x,this.curveY=I.y),V.prototype.resize.call(this,I),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},E.prototype.setStrokeColor=function(I){this.strokeColor=I,this.adjustVisual(),this.colorChanged(I)},E.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.adjustVisual()},E.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.adjustVisual()},E.prototype.scale=function(I,H){this.curveX=this.curveX*I,this.curveY=this.curveY*H,V.prototype.scale.call(this,I,H)},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var I=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},V.prototype.getState.call(this));return I.typeName=E.typeName,I},E.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I);var H=I;this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.curveX=H.curveX,this.curveY=H.curveY,this.createVisual(),this.adjustVisual()},E.typeName="CurveMarker",E.title="Curve marker",E.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>',E}(ct),mt=function(){function V(E,I){I===void 0&&(I=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=E,this.cancelable=I}return Object.defineProperty(V.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),V.prototype.preventDefault=function(){this._defaultPrevented=!0},V}(),yt=function(V){function E(I,H,q){var z=V.call(this,I,!1)||this;return z.dataUrl=H,z.state=q,z}return Te(E,V),E}(mt),tt=function(V){function E(I,H,q){q===void 0&&(q=!1);var z=V.call(this,I,q)||this;return z.marker=H,z}return Te(E,V),E}(mt),Ut=function(){function V(){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 V.prototype.addEventListener=function(E,I){this[E].push(I)},V.prototype.removeEventListener=function(E,I){var H=this[E].indexOf(I);H>-1&&this[E].splice(H,1)},V}(),Ct=function(){function V(E){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new De,this._isOpen=!1,this.undoRedoManager=new dt,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=V.instanceCounter++,this.styles=new et(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=E,this.targetRoot=document.body,this.width=E.clientWidth,this.height=E.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(V.prototype,"ALL_MARKER_TYPES",{get:function(){return[Qe,_e,ve,Ne,Je,Le,oe,ye,Ue,ne,ut,rt]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Qe,_e,ve,Ne,Le,oe,ye]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Qe,_e,ve,Ne,oe]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(E){var I=this;this._availableMarkerTypes.splice(0),E.forEach(function(H){if(typeof H=="string"){var q=I.ALL_MARKER_TYPES.find(function(z){return z.typeName===H});q!==void 0&&I._availableMarkerTypes.push(q)}else I._availableMarkerTypes.push(H)})},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(E){this._zoomLevel=E,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(V.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),V.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Pe.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},V.prototype.show=function(){var E=this;this.styles.styleSheetRoot===void 0&&ze.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ze.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(I){return I(new mt(E))})},V.prototype.render=function(){return Ae(this,void 0,void 0,function(){var E;return Oe(this,function(I){switch(I.label){case 0:return this.setCurrentMarker(),(E=new qe).naturalSize=this.renderAtNaturalSize,E.imageType=this.renderImageType,E.imageQuality=this.renderImageQuality,E.markersOnly=this.renderMarkersOnly,E.width=this.renderWidth,E.height=this.renderHeight,[4,E.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return I.sent(),[4,E.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,I.sent()]}})})},V.prototype.close=function(E){var I=this;if(E===void 0&&(E=!1),this.isOpen){var H=!1;E||this.eventListeners.beforeclose.forEach(function(q){var z=new mt(I,!0);q(z),z.defaultPrevented&&(H=!0)}),H||(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(q){return q(new mt(I))}),this.detachEvents(),this._isOpen=!1)}},V.prototype.addMarkersToToolbar=function(){for(var E,I=[],H=0;H<arguments.length;H++)I[H]=arguments[H];(E=this._availableMarkerTypes).push.apply(E,I)},V.prototype.addRenderEventListener=function(E){this.addEventListener("render",function(I){E(I.dataUrl,I.state)})},V.prototype.removeRenderEventListener=function(E){},V.prototype.addCloseEventListener=function(E){this.addEventListener("close",function(){E()})},V.prototype.removeCloseEventListener=function(E){},V.prototype.setupResizeObserver=function(){var E=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){E.resize(E.target.clientWidth,E.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return E.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},V.prototype.onPopupTargetResize=function(){var E=1*this.target.clientWidth/this.target.clientHeight,I=this.editorCanvas.clientWidth/E>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*E:this.editorCanvas.clientWidth,H=I<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/E;this.resize(I,H)},V.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},V.prototype.resize=function(E,I){this._isResizing=!0;var H=E/this.imageWidth,q=I/this.imageHeight;this.imageWidth=Math.round(E),this.imageHeight=Math.round(I),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(H,q),this._isResizing=!1},V.prototype.scaleMarkers=function(E,I){var H,q=this;this._currentMarker&&this._currentMarker instanceof Ne?this._currentMarker.scale(E,I):(H=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(z){z!==q._currentMarker&&z.scale(E,I)}),H!==void 0&&this.setCurrentMarker(H)},V.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"},V.prototype.setTopLeft=function(){var E=this.editingTarget.getBoundingClientRect(),I=this.editorCanvas.getBoundingClientRect();this.left=E.left-I.left,this.top=E.top-I.top},V.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)},V.prototype.addDefs=function(){for(var E,I=[],H=0;H<arguments.length;H++)I[H]=arguments[H];this.defs=ue.createDefs(),this.addDefsToImage(),(E=this.defs).append.apply(E,I)},V.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},V.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)},V.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},V.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},V.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)},V.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},V.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)},V.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 E=document.createElement("a");E.href="https://markerjs.com/",E.target="_blank",E.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>',E.title="Powered by marker.js",E.style.display="grid",E.style.alignItems="center",E.style.justifyItems="center",E.style.padding="3px",E.style.width="20px",E.style.height="20px",this.logoUI.appendChild(E),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},V.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")},V.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"},V.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},V.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 E=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=E+"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 Me(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 Ge(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},V.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},V.prototype.removeMarker=function(E){this.markerImage.removeChild(E.container),this.markers.indexOf(E)>-1&&this.markers.splice(this.markers.indexOf(E),1),E.dispose()},V.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())},V.prototype.toolbarButtonClicked=function(E,I){if(E==="marker"&&I!==void 0)this.createNewMarker(I);else if(E==="action")switch(I){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()}},V.prototype.deleteSelectedMarker=function(){var E=this;if(this._currentMarker!==void 0){var I=!1;if(this.eventListeners.markerbeforedelete.forEach(function(q){var z=new tt(E,E._currentMarker,!0);q(z),z.defaultPrevented&&(I=!0)}),!I){var H=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(q){return q(new tt(E,H))})}}},V.prototype.clear=function(){var E=this,I=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(me){var je=new tt(E,void 0,!0);me(je),je.defaultPrevented&&(I=!0)}),!I)){this.setCurrentMarker();for(var H=function(me){var je=q.markers[me];q.setCurrentMarker(q.markers[me]),q._currentMarker.dispose(),q.markerImage.removeChild(q._currentMarker.container),q.markers.splice(q.markers.indexOf(q._currentMarker),1),q.eventListeners.markerdelete.forEach(function(it){return it(new tt(E,je))})},q=this,z=this.markers.length-1;z>=0;z--)H(z);this.addUndoStep()}},Object.defineProperty(V.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),V.prototype.showNotesEditor=function(){var E;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=(E=this._currentMarker.notes)!==null&&E!==void 0?E:"",this.overlayContainer.appendChild(this.notesArea))},V.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)},V.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},V.prototype.addUndoStep=function(){var E=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var I=this.getState(),H=this.undoRedoManager.getLastUndoStep();if(!H||H.width===I.width&&H.height===I.height){var q=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(I),q<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(z){return z(new mt(E))})}else this.undoRedoManager.replaceLastUndoStep(I),this.eventListeners.statechange.forEach(function(z){return z(new mt(E))})}},V.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},V.prototype.undoStep=function(){var E=this,I=this.undoRedoManager.undo();I!==void 0&&(this.restoreState(I),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(H){return H(new mt(E))}))},V.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},V.prototype.redoStep=function(){var E=this,I=this.undoRedoManager.redo();I!==void 0&&(this.restoreState(I),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(H){return H(new mt(E))}))},V.prototype.stepZoom=function(){var E=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=E<this.zoomSteps.length-1?this.zoomSteps[E+1]:this.zoomSteps[0]},V.prototype.panTo=function(E){this.contentDiv.scrollBy({left:this.prevPanPoint.x-E.x,top:this.prevPanPoint.y-E.y}),this.prevPanPoint=E},V.prototype.startRenderAndClose=function(){return Ae(this,void 0,void 0,function(){var E,I,H=this;return Oe(this,function(q){switch(q.label){case 0:return[4,this.render()];case 1:return E=q.sent(),I=this.getState(),this.eventListeners.render.forEach(function(z){return z(new yt(H,E,I))}),this.close(!0),[2]}})})},V.prototype.getState=function(E){E===!0&&this.setCurrentMarker();var I={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(H){return I.markers.push(H.getState())}),I},V.prototype.restoreState=function(E){var I=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);E.markers.forEach(function(H){var q=I._availableMarkerTypes.find(function(me){return me.typeName===H.typeName});if(q!==void 0){var z=I.addNewMarker(q);z.restoreState(H),I.markers.push(z)}}),E.width&&E.height&&(E.width!==this.imageWidth||E.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/E.width,this.imageHeight/E.height),this.eventListeners.restorestate.forEach(function(H){return H(new mt(I))})},V.prototype.addNewMarker=function(E){var I=ue.createGroup();return this.markerImage.appendChild(I),new E(I,this.overlayContainer,this.settings)},V.prototype.createNewMarker=function(E){var I,H=this;(I=typeof E=="string"?this._availableMarkerTypes.find(function(q){return q.typeName===E}):E)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(I),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(I.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(q){return q(new tt(H,H._currentMarker))}))},V.prototype.markerCreated=function(E){var I=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(E),this.setCurrentMarker(E),E instanceof _e&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(_e):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(H){return H(new tt(I,I._currentMarker))})},V.prototype.colorChanged=function(E){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=E,this.settings.defaultStrokeColor=E)},V.prototype.fillColorChanged=function(E){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=E)},V.prototype.markerStateChanged=function(E){var I=this;this.eventListeners.markerchange.forEach(function(H){return H(new tt(I,E))})},V.prototype.setCurrentMarker=function(E){var I=this;this._currentMarker!==E&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(H){return H(new tt(I,I._currentMarker))})),this._currentMarker=E,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(H){return H(new tt(I,I._currentMarker))}))},V.prototype.onPointerDown=function(E){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||E.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var I=this.markers.find(function(H){return H.ownsTarget(E.target)});I!==void 0?(this.setCurrentMarker(I),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(E.clientX,E.clientY),E.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:E.clientX,y:E.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(E.clientX,E.clientY))},V.prototype.onDblClick=function(E){if(this._isFocused||this.focus(),this.mode==="select"){var I=this.markers.find(function(H){return H.ownsTarget(E.target)});I!==void 0&&I!==this._currentMarker&&this.setCurrentMarker(I),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(E.clientX,E.clientY),E.target):this.setCurrentMarker()}},V.prototype.onPointerMove=function(E){this.touchPoints!==1&&E.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||E.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(E.clientX,E.clientY)):this.zoomLevel>1&&this.panTo({x:E.clientX,y:E.clientY}))},V.prototype.onPointerUp=function(E){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(E.clientX,E.clientY)),this.isDragging=!1,this.addUndoStep()},V.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},V.prototype.onKeyUp=function(E){this._currentMarker===void 0||this.notesArea!==void 0||E.key!=="Delete"&&E.key!=="Backspace"||this.deleteSelectedMarker()},V.prototype.clientToLocalCoordinates=function(E,I){var H=this.markerImage.getBoundingClientRect();return{x:(E-H.left)/this.zoomLevel,y:(I-H.top)/this.zoomLevel}},V.prototype.onWindowResize=function(){this.positionUI()},V.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var E=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=E+"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()},V.prototype.addLicenseKey=function(E){Pe.addKey(E)},V.prototype.addEventListener=function(E,I){this.eventListeners.addEventListener(E,I)},V.prototype.removeEventListener=function(E,I){this.eventListeners.removeEventListener(E,I)},V.prototype.renderState=function(E){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(E),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(V.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),V.prototype.focus=function(){var E=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(I){return I(new mt(E))}))},V.prototype.blur=function(){var E=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(I){return I(new mt(E))}))},V.instanceCounter=0,V}();/* **********************************
|
|
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 Jt=function(V,E){return(Jt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,H){I.__proto__=H}||function(I,H){for(var q in H)Object.prototype.hasOwnProperty.call(H,q)&&(I[q]=H[q])})(V,E)};function ei(V,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");function I(){this.constructor=V}Jt(V,E),V.prototype=E===null?Object.create(E):(I.prototype=E.prototype,new I)}function Dt(V,E,I,H){return new(I||(I=Promise))(function(q,z){function me(gt){try{it(H.next(gt))}catch(We){z(We)}}function je(gt){try{it(H.throw(gt))}catch(We){z(We)}}function it(gt){var We;gt.done?q(gt.value):(We=gt.value,We instanceof I?We:new I(function(Tt){Tt(We)})).then(me,je)}it((H=H.apply(V,E||[])).next())})}function ci(V,E){var I,H,q,z,me={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return z={next:je(0),throw:je(1),return:je(2)},typeof Symbol=="function"&&(z[Symbol.iterator]=function(){return this}),z;function je(it){return function(gt){return function(We){if(I)throw new TypeError("Generator is already executing.");for(;me;)try{if(I=1,H&&(q=2&We[0]?H.return:We[0]?H.throw||((q=H.return)&&q.call(H),0):H.next)&&!(q=q.call(H,We[1])).done)return q;switch(H=0,q&&(We=[2&We[0],q.value]),We[0]){case 0:case 1:q=We;break;case 4:return me.label++,{value:We[1],done:!1};case 5:me.label++,H=We[1],We=[0];continue;case 7:We=me.ops.pop(),me.trys.pop();continue;default:if(!(q=me.trys,(q=q.length>0&&q[q.length-1])||We[0]!==6&&We[0]!==2)){me=0;continue}if(We[0]===3&&(!q||We[1]>q[0]&&We[1]<q[3])){me.label=We[1];break}if(We[0]===6&&me.label<q[1]){me.label=q[1],q=We;break}if(q&&me.label<q[2]){me.label=q[2],me.ops.push(We);break}q[2]&&me.ops.pop(),me.trys.pop();continue}We=E.call(V,me)}catch(Tt){We=[6,Tt],H=0}finally{I=q=0}if(5&We[0])throw We[1];return{value:We[0]?We[1]:void 0,done:!0}}([it,gt])}}}var Di=function(){function V(){}return V.addKey=function(E){V.key=E},Object.defineProperty(V,"isLicensed",{get:function(){return!!V.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(V.key)},enumerable:!1,configurable:!0}),V}(),bt=function(){function V(){}return V.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},V.setAttributes=function(E,I){for(var H=0,q=I;H<q.length;H++){var z=q[H],me=z[0],je=z[1];E.setAttribute(me,je)}},V.createRect=function(E,I,H){var q=document.createElementNS("http://www.w3.org/2000/svg","rect");return q.setAttribute("width",E.toString()),q.setAttribute("height",I.toString()),H&&V.setAttributes(q,H),q},V.createLine=function(E,I,H,q,z){var me=document.createElementNS("http://www.w3.org/2000/svg","line");return me.setAttribute("x1",E.toString()),me.setAttribute("y1",I.toString()),me.setAttribute("x2",H.toString()),me.setAttribute("y2",q.toString()),z&&V.setAttributes(me,z),me},V.createPolygon=function(E,I){var H=document.createElementNS("http://www.w3.org/2000/svg","polygon");return H.setAttribute("points",E),I&&V.setAttributes(H,I),H},V.createCircle=function(E,I){var H=document.createElementNS("http://www.w3.org/2000/svg","circle");return H.setAttribute("cx",(E/2).toString()),H.setAttribute("cy",(E/2).toString()),H.setAttribute("r",E.toString()),I&&V.setAttributes(H,I),H},V.createEllipse=function(E,I,H){var q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return q.setAttribute("cx",(E/2).toString()),q.setAttribute("cy",(I/2).toString()),q.setAttribute("rx",(E/2).toString()),q.setAttribute("ry",(I/2).toString()),H&&V.setAttributes(q,H),q},V.createGroup=function(E){var I=document.createElementNS("http://www.w3.org/2000/svg","g");return E&&V.setAttributes(I,E),I},V.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},V.createMarker=function(E,I,H,q,z,me,je){var it=document.createElementNS("http://www.w3.org/2000/svg","marker");return V.setAttributes(it,[["id",E],["orient",I],["markerWidth",H.toString()],["markerHeight",q.toString()],["refX",z.toString()],["refY",me.toString()]]),it.appendChild(je),it},V.createText=function(E){var I=document.createElementNS("http://www.w3.org/2000/svg","text");return I.setAttribute("x","0"),I.setAttribute("y","0"),E&&V.setAttributes(I,E),I},V.createTSpan=function(E,I){var H=document.createElementNS("http://www.w3.org/2000/svg","tspan");return H.textContent=E,I&&V.setAttributes(H,I),H},V.createImage=function(E){var I=document.createElementNS("http://www.w3.org/2000/svg","image");return E&&V.setAttributes(I,E),I},V.createPoint=function(E,I){var H=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return H.x=E,H.y=I,H},V.createPath=function(E,I){var H=document.createElementNS("http://www.w3.org/2000/svg","path");return H.setAttribute("d",E),I&&V.setAttributes(H,I),H},V.createElement=function(E,I){var H=document.createElementNS("http://www.w3.org/2000/svg",E);return I&&V.setAttributes(H,I),H},V.getHollowRectanglePath=function(E,I,H,q,z,me,je,it){return"M"+E+","+I+"V"+(I+q)+"H"+(E+H)+"V"+I+"H"+z+"V"+me+"H"+(z+je)+"V"+(me+it)+"H"+z+"V"+I+"Z"},V}(),fi=function(){function V(E){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+E+"_"}return Object.defineProperty(V.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(V.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(V.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),V.prototype.addClass=function(E){return this.styleSheet===void 0&&this.addStyleSheet(),E.name=""+this.classNamePrefix+E.localName,this.classes.push(E),this.styleSheet.sheet.insertRule("."+E.name+" {"+E.style+"}",this.styleSheet.sheet.cssRules.length),E},V.prototype.addRule=function(E){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(E),this.styleSheet.sheet.insertRule(E.selector+" {"+E.style+"}",this.styleSheet.sheet.cssRules.length)},V.prototype.addStyleSheet=function(){var E;this.styleSheet=document.createElement("style"),((E=this.styleSheetRoot)!==null&&E!==void 0?E:document.head).appendChild(this.styleSheet),this.addRule(new _t("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new _t("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new _t("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new wt("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new wt("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},V.prototype.removeStyleSheet=function(){var E;this.styleSheet&&(((E=this.styleSheetRoot)!==null&&E!==void 0?E:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},V}(),_t=function(V,E){this.selector=V,this.style=E},wt=function(V,E){this.localName=V,this.style=E},Bt=function(){function V(){this.blocks=[],this.display=""}return V.prototype.addButtonBlock=function(E){E.className=this.blockClassName,E.buttonClassName=this.buttonClassName,E.buttonColorsClassName=this.buttonColorsClassName,E.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(E)},V.prototype.addElementBlock=function(E){E.className===void 0&&(E.className=this.blockClassName),this.blocks.push(E)},V.prototype.getUI=function(){var E=document.createElement("div");return E.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,E.style.display=this.display,this.blocks.forEach(function(I){return E.appendChild(I.getUI())}),E},V}(),Lt=function(){function V(){}return V.prototype.getUI=function(){var E=document.createElement("div");if(E.className=this.className,this.minWidth!==void 0&&(E.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":E.style.justifyContent="flex-start";break;case"center":E.style.justifyContent="center";break;case"end":E.style.justifyContent="flex-end"}return E.style.whiteSpace="nowrap",E},V}(),Mt=function(V){function E(){var I=V!==null&&V.apply(this,arguments)||this;return I.buttons=[],I}return ei(E,V),E.prototype.addButton=function(I){I.className=this.buttonClassName,I.colorsClassName=this.buttonColorsClassName,I.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(I)},E.prototype.getUI=function(){var I=V.prototype.getUI.call(this);return this.buttons.forEach(function(H){return I.appendChild(H.getUI())}),I},E}(Lt),Et=function(){function V(E,I){this._isActive=!1,this._isHidden=!1,this._icon=E,this.title=I,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(V.prototype,"icon",{get:function(){return this._icon},set:function(E){this._icon=E,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isActive",{get:function(){return this._isActive},set:function(E){this._isActive=E,this.adjustClassName()},enumerable:!1,configurable:!0}),V.prototype.getUI=function(){var E=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 E.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},V.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,"")))},V.prototype.hide=function(){this._isHidden=!0},V}(),ht=function(V){function E(){var I=V!==null&&V.apply(this,arguments)||this;return I.elements=[],I}return ei(E,V),E.prototype.addElement=function(I){this.elements.push(I)},E.prototype.getUI=function(){var I=V.prototype.getUI.call(this);return this.elements.forEach(function(H){return I.appendChild(H)}),I},E}(Lt),_i=function(){function V(E,I){this.horizontal=E,this.vertical=I}return Object.defineProperty(V.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),V.prototype.getVerticalLength=function(E){return E/this.ratio},V.prototype.getHorizontalLength=function(E){return E*this.ratio},V}(),Ht=function(){function V(){}return V.getIcon=function(E,I){if(E>0&&I>0){var H=new _i(E,I),q=H.ratio>=1?20:H.getHorizontalLength(20),z=H.ratio<1?20:H.getVerticalLength(20),me=document.createElementNS("http://www.w3.org/2000/svg","svg");me.setAttribute("xmlns","http://www.w3.org/2000/svg"),me.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(me);var je=bt.createDefs();me.appendChild(je);var it=bt.createElement("clipPath",[["id","text-bg-clip"]]);je.appendChild(it);var gt=bt.createPath(bt.getHollowRectanglePath((24-q)/2,(24-z)/2,q,z,(24-q)/2+2,(24-z)/2+2,q-4,z-4));me.appendChild(gt);var We=bt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);We.appendChild(bt.createTSpan(E+":"+I)),me.appendChild(We);var Tt=We.getBBox();bt.setAttributes(We,[["x",((24-Tt.width)/2).toString()],["y",((24-Tt.height)/2-Tt.y).toString()]]);var Gt=bt.createPath(bt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Tt.width))/2,(24-Math.ceil(Tt.height))/2,Math.ceil(Tt.width),Math.ceil(Tt.height)));return it.appendChild(Gt),bt.setAttributes(gt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(me),me.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>'},V}(),zt=function(V){function E(I,H,q){var z=V.call(this,I,H)||this;return z.isDropdownOpen=!1,z.onClick=z.dropdownButtonClicked,z.dropdownButtons=q,z}return ei(E,V),E.prototype.setupDropdown=function(){var I=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(H){H.className=I.className,H.colorsClassName=I.colorsClassName,I.dropdownBlock.appendChild(H.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},E.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},E.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},E.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},E.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},E.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},E}(Et),It=function(){function V(E,I){this.GRIP_SIZE=10,this.color=E,this.fillColor=I,this.visual=bt.createGroup(),this.visual.appendChild(bt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(bt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return V.prototype.ownsTarget=function(E){return E===this.visual||E===this.visual.childNodes[0]||E===this.visual.childNodes[1]},V.prototype.setCenter=function(E,I){this.visual.childNodes.forEach(function(H){return bt.setAttributes(H,[["cx",E.toString()],["cy",I.toString()]])})},V}(),ui=function(){function V(E,I,H,q){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=E,this.canvasHeight=I,this.margin=H,this.container=q,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(V.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(E){this._aspectRatio=E,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(E){this._isGridVisible=E,this.gridContainer&&bt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(E){this._zoomFactor=E,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),V.prototype.open=function(){var E=this;this.cropShadeElement=bt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=bt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var I=0;I<this.numberOfGridLines;I++)this.horizontalGridLines.push(bt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(bt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(H){return E.gridContainer.appendChild(H)}),this.verticalGridLines.forEach(function(H){return E.gridContainer.appendChild(H)}),this.cropRectElement=bt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},V.prototype.setCropRectangle=function(E){this.cropRect=E;var I=Object.assign({},this.cropRect);this.zoomFactor!==1&&(I.width=this.cropRect.width*this.zoomFactor,I.height=this.cropRect.height*this.zoomFactor,I.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-I.width/2,I.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-I.height/2),bt.setAttributes(this.cropRectElement,[["x",I.x.toString()],["y",I.y.toString()],["width",I.width.toString()],["height",I.height.toString()]]);var H=I.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(z,me){var je=I.y+H*(me+1);bt.setAttributes(z,[["x1",""+I.x],["y1",""+je],["x2",""+(I.x+I.width)],["y2",""+je]])});var q=I.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(z,me){var je=I.x+q*(me+1);bt.setAttributes(z,[["x1",""+je],["y1",""+I.y],["x2",""+je],["y2",""+(I.y+I.height)]])}),bt.setAttributes(this.cropShadeElement,[["d",bt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,I.x,I.y,I.width,I.height)]]),this.topLeftGrip.setCenter(I.x,I.y),this.topRightGrip.setCenter(I.x+I.width,I.y),this.bottomLeftGrip.setCenter(I.x,I.y+I.height),this.bottomRightGrip.setCenter(I.x+I.width,I.y+I.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},V.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)},V.prototype.clientToLocalCoordinates=function(E,I){var H=this.container.getBoundingClientRect();return{x:E-H.left+this.margin,y:I-H.top+this.margin}},V.prototype.onPointerDown=function(E){this.container.setPointerCapture(E.pointerId),this.previousPoint=this.clientToLocalCoordinates(E.clientX,E.clientY),this.cropRectElement===E.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(E.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(E.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(E.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(E.target)&&(this.activeGrip=this.bottomRightGrip)},V.prototype.onPointerMove=function(E){if(this.isMoving)this.move(this.clientToLocalCoordinates(E.clientX,E.clientY));else if(this.activeGrip){var I=this.clientToLocalCoordinates(E.clientX,E.clientY);this.resize(I)}E.preventDefault()},V.prototype.onPointerUp=function(E){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(E.pointerId)},V.prototype.move=function(E){var I=E.x-this.previousPoint.x,H=E.y-this.previousPoint.y;this.zoomFactor!==1&&(I=-I/this.zoomFactor,H=-H/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+I),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+H),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=E},V.prototype.resize=function(E){var I=Object.assign({},this.cropRect),H=E.x-this.previousPoint.x,q=E.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:I.x+H<this.margin&&(H=this.margin-I.x),I.x+=H,I.width=this.cropRect.x+this.cropRect.width-I.x;break;case this.bottomRightGrip:case this.topRightGrip:I.width+H>this.canvasWidth*this.zoomFactor&&(H=this.canvasWidth*this.zoomFactor-I.width),I.width+=H}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(I.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(H),I.height=this.aspectRatio.getVerticalLength(I.width)):(I.y+=q,I.height=this.cropRect.y+this.cropRect.height-I.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?I.height=this.aspectRatio.getVerticalLength(I.width):I.height+=q}I.width<10&&(I.x=this.cropRect.x,I.width=10),I.height<10&&(I.y=this.cropRect.y,I.height=10),this.previousPoint=E,I.x>=this.margin&&I.y>=this.margin&&I.x-this.margin+I.width<=this.canvasWidth&&I.y-this.margin+I.height<=this.canvasHeight&&(this.cropRect=I,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},V.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var E=this.cropRect.x+this.cropRect.width/2,I=this.cropRect.y+this.cropRect.height/2,H=this.aspectRatio.getHorizontalLength(this.cropRect.height),q=this.aspectRatio.getVerticalLength(this.cropRect.width);H/this.canvasWidth<q/this.canvasHeight?this.cropRect.width=H:this.cropRect.height=q,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=E-this.cropRect.width/2,this.cropRect.y=I-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)}},V.prototype.getRescaledRect=function(E,I,H,q,z,me){var je=H/E,it=q/I;return{x:(z.x-me)*je+me,y:(z.y-me)*it+me,width:z.width*je,height:z.height*it}},V.prototype.scaleCanvas=function(E,I){var H=this.getRescaledRect(this.canvasWidth,this.canvasHeight,E,I,this.cropRect,this.margin);this.canvasWidth=E,this.canvasHeight=I,this.onCropChange&&this.onCropChange(H),this.setCropRectangle(H)},V}(),ki=function(){function V(E){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=E,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(V.prototype,"angle",{get:function(){return this._angle},set:function(E){this._angle=E,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),V.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},V.prototype.onPointerDown=function(E){this.controlContainer.setPointerCapture(E.pointerId),this.isDragging=!0,this.previousPoint={x:E.clientX,y:E.clientY}},V.prototype.onPointerMove=function(E){this.isDragging&&(this.onAngleChange&&this.onAngleChange((E.clientX-this.previousPoint.x)/5),this.previousPoint.x=E.clientX)},V.prototype.onPointerUp=function(E){this.isDragging&&this.onAngleChange&&this.onAngleChange((E.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(E.pointerId)},V.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var E=this.angleLabelText.getBBox();bt.setAttributes(this.angleLabelElement,[["x",((this.width-E.width)/2).toString()],["y",(this.height/2).toString()]])}},V.prototype.positionScaleShape=function(){if(this.scaleShape){var E=this.scaleShape.transform.baseVal.getItem(0);E.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(E,0)}},V.prototype.getVisual=function(){var E=document.createElementNS("http://www.w3.org/2000/svg","svg");E.setAttribute("xmlns","http://www.w3.org/2000/svg"),E.setAttribute("width",this.width+"px"),E.setAttribute("height",this.height+"px"),E.setAttribute("viewBox","0 0 "+this.width+" "+this.height),E.style.flexShrink="0",document.body.appendChild(E);for(var I="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,H=1;H<=this.width/5+10;H++){var q=H%5==0?this.height/3:this.height/6;I+="h4v"+-q+"h1v"+q}I+="v1H0Z",this.scaleShape=bt.createPath(I);var z=bt.createTransform();this.scaleShape.transform.baseVal.appendItem(z),E.appendChild(this.scaleShape),this.angleLabelElement=bt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=bt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var me=bt.createTSpan("");return me.innerHTML="°",this.angleLabelElement.appendChild(me),E.appendChild(this.angleLabelElement),document.body.removeChild(E),E},V}(),Xi=function(){function V(){this.naturalSize=!1,this.imageType="image/png"}return V.prototype.rasterize=function(E,I,H,q,z,me,je){var it=this;return new Promise(function(gt){var We=document.createElement("canvas");We.width=E.width.baseVal.value-2*q,We.height=E.height.baseVal.value-2*q;var Tt=1,Gt=1;it.naturalSize===!0?(Tt=I.naturalWidth/(E.width.baseVal.value-2*q)/me,Gt=I.naturalHeight/(E.height.baseVal.value-2*q)/je,We.width=I.naturalWidth/me,We.height=I.naturalHeight/je):it.width!==void 0&&it.height!==void 0&&(Tt=it.width/H.width,Gt=it.height/H.height,We.width*=Tt,We.height*=Gt);var qt=We.getContext("2d");qt.translate(We.width/2,We.height/2),qt.rotate(z*Math.PI/180),qt.scale(me,je),qt.translate(-We.width/2,-We.height/2),qt.drawImage(I,0,0,We.width,We.height);var Hi=document.createElement("canvas");Hi.width=H.width*Tt,Hi.height=H.height*Gt,Hi.getContext("2d").putImageData(qt.getImageData((H.x-q)*Tt,(H.y-q)*Gt,H.width*Tt,H.height*Gt),0,0),gt(Hi.toDataURL(it.imageType,it.imageQuality))})},V}(),Ye=function(){function V(E){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=V.instanceCounter++,this.styles=new fi(this.instanceNo),this.target=E,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(V.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(E){this._zoomToCropEnabled=E,E?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(E){this._isGridVisible=E,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"gridLines",{get:function(){return this._gridLines},set:function(E){this._gridLines=E,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(E){this._rotationAngle=E,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"aspectRatio",{get:function(){var E;return(E=this._aspectRatio)!==null&&E!==void 0?E:this.aspectRatios[0]},set:function(E){this._aspectRatio=E},enumerable:!1,configurable:!0}),V.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},V.prototype.show=function(){this.showUI(),this.open()},V.prototype.close=function(E){E===void 0&&(E=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),E||this.closeEventListeners.forEach(function(I){return I()}),this._isOpen=!1)},V.prototype.addRenderEventListener=function(E){this.renderEventListeners.push(E)},V.prototype.removeRenderEventListener=function(E){this.renderEventListeners.indexOf(E)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(E),1)},V.prototype.addCloseEventListener=function(E){this.closeEventListeners.push(E)},V.prototype.removeCloseEventListener=function(E){this.closeEventListeners.indexOf(E)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(E),1)},V.prototype.setupResizeObserver=function(){var E=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){E.resize(E.target.clientWidth,E.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))},V.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var E=1*this.target.clientWidth/this.target.clientHeight,I=this.contentDiv.clientWidth/E>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*E:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,H=I+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/E;this.resize(I,H)}},V.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},V.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",bt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},V.prototype.resize=function(E,I){this.imageWidth=Math.round(E),this.imageHeight=Math.round(I),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()},V.prototype.setEditingTarget=function(){var E=document.createElement("canvas");E.width=this.target.naturalWidth,E.height=this.target.naturalHeight,E.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var I=E.toDataURL();bt.setAttributes(this.editingTarget,[["href",I]]),this.setEditingTargetSize()},V.prototype.setTopLeft=function(){var E=this.target.getBoundingClientRect(),I=this.editorCanvas.getBoundingClientRect();this.left=E.left-I.left-this.CANVAS_MARGIN,this.top=E.top-I.top-this.CANVAS_MARGIN},V.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=bt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=bt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=bt.createGroup(),this.editingTargetRotationScaleContainer=bt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var E=bt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(E);var I=bt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(I),this.editingTargetContainer=bt.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)},V.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},V.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=bt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new ui(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()},V.prototype.zoomToCrop=function(){if(this.cropRect){var E=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,I=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=E+"px "+I+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-E+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-I+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},V.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)},V.prototype.cropRectChanged=function(E){this.cropRect=E,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},V.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},V.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"},V.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},V.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 E=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,I=this.target.offsetTop>E+this.CANVAS_MARGIN?this.target.offsetTop-(E+this.CANVAS_MARGIN):0;this.coverDiv.style.top=I+"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},V.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},V.prototype.addTopToolbar=function(){var E=this;this.topToolbar=new Bt,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 I=new Mt;I.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(I);var H=[];this.aspectRatios.forEach(function(Gt){var qt=new Et(Ht.getIcon(Gt.horizontal,Gt.vertical),Gt.horizontal===0&&Gt.vertical===0?"FREE":Gt.horizontal+":"+Gt.vertical);qt.onClick=function(){return E.ratioButtonClicked(Gt)},H.push(qt)}),this.aspectRatioButton=new zt(Ht.getIcon(0,0),"Aspect ratio",H),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,I.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var q=new Et('<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");q.isActive=this.isGridVisible,q.onClick=function(){E.isGridVisible=!E.isGridVisible,q.isActive=E.isGridVisible},I.addButton(q);var z=new Et('<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(z.isActive=this.zoomToCropEnabled,z.onClick=function(){E.zoomToCropEnabled=!E.zoomToCropEnabled,z.isActive=E.zoomToCropEnabled},I.addButton(z),!Di.isLicensed){var me=new ht;this.topToolbar.addElementBlock(me);var je=document.createElement("div");je.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var it=document.createElement("a");it.style.color="currentColor",it.href="https://markerjs.com/products/cropro",it.target="_blank",it.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>',je.appendChild(it),me.addElement(je)}var gt=new Mt;gt.minWidth=3*this.toolbarHeight+"px",gt.contentAlign="end",this.topToolbar.addButtonBlock(gt);var We=new Et('<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");We.onClick=this.startRenderAndClose,gt.addButton(We),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(We.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Tt=new Et('<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");Tt.onClick=this.close,gt.addButton(Tt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Tt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},V.prototype.addBottomToolbar=function(){var E=this;this.bottomToolbar=new Bt,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 I=new Mt;I.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(I);var H=new Et('<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");H.onClick=this.rotateLeftButtonClicked,I.addButton(H);var q=new Et('<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");q.onClick=this.rotateRightButtonClicked,I.addButton(q);var z=new ht;z.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(z),this.straightener=new ki("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(gt){E.rotateBy(gt),E.straightener.angle=E.rotationAngle},z.addElement(this.straightener.getUI());var me=new Mt;me.minWidth=2*this.toolbarHeight+"px",me.contentAlign="end",this.bottomToolbar.addButtonBlock(me);var je=new Et('<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");je.onClick=this.flipHorizontallyButtonClicked,me.addButton(je);var it=new Et('<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");it.onClick=this.flipVerticallyButtonClicked,me.addButton(it)},V.prototype.ratioButtonClicked=function(E){this.aspectRatio=E,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},V.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Ht.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},V.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new _i(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},V.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},V.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},V.prototype.restoreState=function(E){if(E){var I=this.cropLayer.getRescaledRect(E.width,E.height,this.imageWidth,this.imageHeight,E.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(I),this.cropRectChanged(I),this.flippedHorizontally=E.flippedHorizontally,this.flippedVertically=E.flippedVertically,this.applyFlip(),this.rotationAngle=E.rotationAngle,this.applyRotation()}},V.prototype.clientToLocalCoordinates=function(E,I){var H=this.cropImage.getBoundingClientRect();return{x:E-H.left,y:I-H.top}},V.prototype.onWindowResize=function(){this.positionUI()},V.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var E=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=E+"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()},V.prototype.rotateLeftButtonClicked=function(){var E=this.rotationAngle-90;this.rotationAngle%90!=0&&(E+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(E)},V.prototype.rotateRightButtonClicked=function(){var E=this.rotationAngle+90;this.rotationAngle%90!=0&&(E-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(E)},V.prototype.rotateTo=function(E){E=(E=E>180?E-360:E)<=-180?E+360:E,this.rotationAngle=E,this.applyRotation()},V.prototype.rotateBy=function(E){this.rotateTo((this.rotationAngle+E)%360)},V.prototype.applyRotation=function(){var E=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var I=this.editingTargetRotationContainer.transform.baseVal.getItem(0);I.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(I,0);var H=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/H.width,this.imageHeight/H.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=E},V.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},V.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},V.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},V.prototype.startRenderAndClose=function(){return Dt(this,void 0,void 0,function(){var E,I;return ci(this,function(H){switch(H.label){case 0:return[4,this.render()];case 1:return E=H.sent(),I=this.getState(),this.renderEventListeners.forEach(function(q){return q(E,I)}),this.close(!0),[2]}})})},V.prototype.render=function(){return Dt(this,void 0,void 0,function(){var E;return ci(this,function(I){switch(I.label){case 0:return(E=new Xi).naturalSize=this.renderAtNaturalSize,E.imageType=this.renderImageType,E.imageQuality=this.renderImageQuality,E.width=this.renderWidth,E.height=this.renderHeight,this.unzoomFromCrop(),bt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,E.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 I.sent(),[4,E.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,I.sent()]}})})},V.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new wt("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 wt("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new wt("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var E=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new wt("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*E)+`px;
|
|
height: `+(this.toolbarHeight-2*E)+`px;
|
|
padding: `+E+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new wt("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new wt("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new _t("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new _t("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new wt("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 wt("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new wt("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 wt("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*E)+`px;
|
|
padding: `+E+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new wt("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},V.instanceCounter=0,V}(),Rt=J("8hTe"),mn=J.n(Rt),gn=/<pre[^>]*>/g;function vn(V){var E=document.createElement("div");return E.innerHTML=V,E.childNodes.length===0?"":E.childNodes[0].nodeValue}var yn=ge.a=function(V){var E=V.value,I=E===void 0?"":E,H=V.edit,q=H===void 0?!1:H,z=V.className,me=V.showTextOnly,je=V.showLines,it=V.replaces,gt=V.zoomImg,We=V.hasMask,Tt=V.style,Gt=Tt===void 0?{}:Tt,qt=V.stylesPrev,Hi=qt===void 0?{}:qt,wi=String(I),Si=Object(D.useRef)(),Qi=Object(D.useRef)(),Dn=Object(D.useState)(""),pi=Object(G.a)(Dn,2),zi=pi[0],un=pi[1],hn=Object(D.useState)("office"),Wi=Object(G.a)(hn,2),kn=Wi[0],bn=Wi[1],zn=function(){var Kt=new Ye(Qi.current);Kt.displayMode="popup",Kt.addRenderEventListener(function(){var Ei=Object(U.a)(i.a.mark(function Nt(si){var Xt;return i.a.wrap(function(mi){for(;;)switch(mi.prev=mi.next){case 0:return Si.current.style.display="none",mi.next=3,Object(Re.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:si}});case 3:Xt=mi.sent,Xt!=null&&Xt.id&&it(Qi.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(Xt==null?void 0:Xt.id,"?type=").concat(Xt.content_type));case 5:case"end":return mi.stop()}},Nt)}));return function(Nt){return Ei.apply(this,arguments)}}()),Kt.show()},Vn=function(){var Kt=new Ct(Qi.current);Kt.settings.displayMode="popup",Kt.addEventListener("render",function(){var Ei=Object(U.a)(i.a.mark(function Nt(si){var Xt;return i.a.wrap(function(mi){for(;;)switch(mi.prev=mi.next){case 0:if(Si.current.style.display="none",!Qi.current){mi.next=6;break}return mi.next=4,Object(Re.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:si.dataUrl}});case 4:Xt=mi.sent,Xt!=null&&Xt.id&&it(Qi.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(Xt==null?void 0:Xt.id,"?type=").concat(Xt.content_type));case 6:case"end":return mi.stop()}},Nt)}));return function(Nt){return Ei.apply(this,arguments)}}()),Kt.show(),window.markerArea=Kt},Zi=Object(D.useMemo)(function(){Si.current&&(Si.current.style.zIndex=-1);try{var ri=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Kt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Ei=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;wi=wi.replace(ri,"("+ee.a.API_SERVER+"/api/attachments/").replace(Kt,'"'+ee.a.API_SERVER+"/api/attachments/").replace(Ei,'"'+ee.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(rn){}var Nt=j(wi),si=T();if(wi.match(/\[TOC\]/)&&(Nt=Nt.replace("<p>[TOC]</p>",L()),A()),Nt=Nt.replace(/(__special_katext_id_\d+__)/g,function(rn,mi){var Oi=si[mi],Yn=Oi.type,xn=Oi.expression;return Object(ae.renderToString)(vn(xn)||"",{displayMode:Yn==="block",throwOnError:!1,output:"html"})}),Nt=Nt.replace(/▁/g,"\u2581\u2581\u2581"),v(),me){var Xt=document.createElement("div");return Xt.innerHTML=Nt,Xt.innerText}return setTimeout(function(){return dr()},500),Nt},[wi]),$i=Object(D.useRef)();_.WebkitLineClamp=je,je&&(Gt=Object(F.a)(Object(F.a)({},Gt),_));function _n(ri){var Kt=ri.target;if(Kt.tagName.toUpperCase()==="IMG"){if(gt){var Ei=Kt.getAttribute("src");un(Ei),bn("image")}}else if(Kt.tagName.toUpperCase()==="A"){var Nt=Kt.getAttribute("href");if(Nt.indexOf("office")>-1)ri.preventDefault(),un(Nt),bn("office");else if(Nt.indexOf("application/pdf")>-1)ri.preventDefault(),un(Nt),bn("pdf");else if(Nt.indexOf("text/html")>-1)ri.preventDefault(),un(Nt),bn("html");else if(Nt.startsWith("#")){ri.preventDefault();var si=document.getElementById(Nt.replace("#",""));si&&si.scrollIntoView(!0)}}}var dr=function(){var Kt,Ei=(Kt=$i.current)===null||Kt===void 0?void 0:Kt.querySelectorAll("video");Ei==null||Ei.forEach(function(Nt){if(Nt.oncontextmenu=function(){return!1},Nt.src.indexOf(".m3u8")>-1&&!Nt.canPlayType("application/vnd.apple.mpegurl")){if(X.a.isSupported()){var si=new X.a;si.loadSource(Nt.src),si.attachMedia(Nt)}}})};Object(D.useEffect)(function(){if($i.current&&Zi&&(Zi.match(gn)&&window.PR.prettyPrint()),$i.current)return $i.current.addEventListener("click",_n),function(){$i.current.removeEventListener("click",_n),v(),A()}},[Zi,$i.current,_n]);var En=function(Kt){if(!q)return;Kt.target.nodeName==="IMG"?(Si.current.style.zIndex=1,Si.current.style.display="flex",Si.current.style.width=Kt.target.clientWidth+"px",Si.current.style.height=Kt.target.clientHeight+"px",Si.current.style.top=Kt.target.offsetTop+"px",Si.current.style.left=Kt.target.offsetLeft+"px",Qi.current.src=Kt.target.getAttribute("src")):Si.current.style.display="none"};return g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("div",{ref:$i,style:Object(F.a)({},Gt),className:"".concat(z||""," markdown-body ").concat(mn.a.mdBody),onMouseOver:En,dangerouslySetInnerHTML:{__html:Zi}}),g.a.createElement("div",{ref:Si,className:mn.a.button},g.a.createElement($.a,null,g.a.createElement(Y.a,{onClick:function(){return zn()}},"\u88C1\u526A"),g.a.createElement(Y.a,{onClick:function(){return Vn()}},"\u7F16\u8F91"))),g.a.createElement("img",{ref:Qi,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),g.a.createElement(le.a,{close:!0,data:zi,type:zi!=null&&zi.length?kn:"",style:Object(F.a)({},Hi),onClose:function(){return un("")}}))}},"9VGf":function(at,ge,J){"use strict";J.d(ge,"a",function(){return M});var ie=J("q1tI"),$=J.n(ie);function M(Y,F){var U=Object(ie.useRef)();Object(ie.useEffect)(function(){U.current=Y}),Object(ie.useEffect)(function(){function G(){U.current()}if(F!==null){var W=setInterval(G,F);return function(){return clearInterval(W)}}},[F])}},BU3w:function(at,ge,J){"use strict";J.d(ge,"a",function(){return U});var ie=J("MNnm"),$="rc-util-key";function M(G){if(G.attachTo)return G.attachTo;var W=document.querySelector("head");return W||document.body}function Y(G){var W,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ie.a)())return null;var D=document.createElement("style");if((W=i.csp)===null||W===void 0?void 0:W.nonce){var g;D.nonce=(g=i.csp)===null||g===void 0?void 0:g.nonce}D.innerHTML=G;var d=M(i),m=d.firstChild;return i.prepend&&d.prepend?d.prepend(D):i.prepend&&m?d.insertBefore(D,m):d.appendChild(D),D}var F=new Map;function U(G,W){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=M(i);if(!F.has(D)){var g=Y("",i),d=g.parentNode;F.set(D,d),d.removeChild(g)}var m=Array.from(F.get(D).children).find(function(h){return h.tagName==="STYLE"&&h[$]===W});if(m){var u,a;if(((u=i.csp)===null||u===void 0?void 0:u.nonce)&&m.nonce!==((a=i.csp)===null||a===void 0?void 0:a.nonce)){var f;m.nonce=(f=i.csp)===null||f===void 0?void 0:f.nonce}return m.innerHTML!==G&&(m.innerHTML=G),m}var l=Y(G,i);return l[$]=W,l}},Bd2K:function(at,ge,J){(function(ie){ie(J("VrN/"),J("osHv"))})(function(ie){ie.defineOption("autoCloseTags",!1,function(i,D,g){if(g!=ie.Init&&g&&i.removeKeyMap("autoCloseTags"),!D)return;var d={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(d["'/'"]=function(m){return U(m)}),(typeof D!="object"||D.whenOpening!==!1)&&(d["'>'"]=function(m){return Y(m)}),i.addKeyMap(d)});var $=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],M=["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 Y(i){if(i.getOption("disableInput"))return ie.Pass;for(var D=i.listSelections(),g=[],d=i.getOption("autoCloseTags"),m=0;m<D.length;m++){if(!D[m].empty())return ie.Pass;var u=D[m].head,a=i.getTokenAt(u),f=ie.innerMode(i.getMode(),a.state),l=f.state,h=f.mode.xmlCurrentTag&&f.mode.xmlCurrentTag(l),o=h&&h.name;if(!o)return ie.Pass;var s=f.mode.configuration=="html",A=typeof d=="object"&&d.dontCloseTags||s&&$,_=typeof d=="object"&&d.indentTags||s&&M;a.end>u.ch&&(o=o.slice(0,o.length-a.end+u.ch));var S=o.toLowerCase();if(!o||a.type=="string"&&(a.end!=u.ch||!/[\"\']/.test(a.string.charAt(a.string.length-1))||a.string.length==1)||a.type=="tag"&&h.close||a.string.indexOf("/")==u.ch-a.start-1||A&&G(A,S)>-1||W(i,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(l)||[],o,u,!0))return ie.Pass;var L=typeof d=="object"&&d.emptyTags;if(L&&G(L,o)>-1){g[m]={text:"/>",newPos:ie.Pos(u.line,u.ch+2)};continue}var O=_&&G(_,S)>-1;g[m]={indent:O,text:">"+(O?`
|
|
|
|
`:"")+"</"+o+">",newPos:O?ie.Pos(u.line+1,0):ie.Pos(u.line,u.ch+1)}}for(var C=typeof d=="object"&&d.dontIndentOnAutoClose,m=D.length-1;m>=0;m--){var w=g[m];i.replaceRange(w.text,D[m].head,D[m].anchor,"+insert");var x=i.listSelections().slice(0);x[m]={head:w.newPos,anchor:w.newPos},i.setSelections(x),!C&&w.indent&&(i.indentLine(w.newPos.line,null,!0),i.indentLine(w.newPos.line+1,null,!0))}}function F(i,D){for(var g=i.listSelections(),d=[],m=D?"/":"</",u=i.getOption("autoCloseTags"),a=typeof u=="object"&&u.dontIndentOnSlash,f=0;f<g.length;f++){if(!g[f].empty())return ie.Pass;var l=g[f].head,h=i.getTokenAt(l),o=ie.innerMode(i.getMode(),h.state),s=o.state;if(D&&(h.type=="string"||h.string.charAt(0)!="<"||h.start!=l.ch-1))return ie.Pass;var A,_=o.mode.name!="xml"&&i.getMode().name=="htmlmixed";if(_&&o.mode.name=="javascript")A=m+"script";else if(_&&o.mode.name=="css")A=m+"style";else{var S=o.mode.xmlCurrentContext&&o.mode.xmlCurrentContext(s);if(!S||S.length&&W(i,S,S[S.length-1],l))return ie.Pass;A=m+S[S.length-1]}i.getLine(l.line).charAt(h.end)!=">"&&(A+=">"),d[f]=A}if(i.replaceSelections(d),g=i.listSelections(),!a)for(var f=0;f<g.length;f++)(f==g.length-1||g[f].head.line<g[f+1].head.line)&&i.indentLine(g[f].head.line)}function U(i){return i.getOption("disableInput")?ie.Pass:F(i,!0)}ie.commands.closeTag=function(i){return F(i)};function G(i,D){if(i.indexOf)return i.indexOf(D);for(var g=0,d=i.length;g<d;++g)if(i[g]==D)return g;return-1}function W(i,D,g,d,m){if(!ie.scanForClosingTag)return!1;var u=Math.min(i.lastLine()+1,d.line+500),a=ie.scanForClosingTag(i,d,null,u);if(!a||a.tag!=g)return!1;for(var f=m?1:0,l=D.length-1;l>=0&&D[l]==g;l--)++f;d=a.to;for(var l=1;l<f;l++){var h=ie.scanForClosingTag(i,d,null,u);if(!h||h.tag!=g)return!1;d=h.to}return!0}})},BjJ7:function(at,ge,J){"use strict";J.d(ge,"d",function(){return $}),J.d(ge,"c",function(){return M}),J.d(ge,"e",function(){return Y}),J.d(ge,"b",function(){return F}),J.d(ge,"a",function(){return G});var ie=J("m3rI");function $(W){var i=!0;if(W.length>0){for(var D=0;D<W.length;D++)if(W[D].compile_success==0||!W[D].compile_success){i=!1;break}}else i=!1;return i}function M(W){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",D=[],g=0;g<W.length;g++){var d=W[g],m=i?"".concat(i,"/").concat(d.name):"".concat(d.name);D.push({title:d.name,isLeaf:!(d.type==="tree"),key:m})}return D}function Y(W,i,D){for(var g=0;g<W.length;g++){var d=W[g];if(d.key===i){d.children=D;break}d.children&&Y(d.children,i,D)}return W}function F(W,i,D){var g;return function(){var d=this,m=arguments,u=function(){g=null,D||W.apply(d,m)},a=D&&!g;clearTimeout(g),g=setTimeout(u,i),a&&W.apply(d,m)}}var U=!0,G=ie.a.API_SERVER},"C+DQ":function(at,ge,J){},"C/vA":function(at,ge,J){"use strict";J.d(ge,"a",function(){return ie});function ie($){const M=this;let Y=!1,F;return function(){return Y||(Y=!0,F=$.apply(M,arguments)),F}}},"Cg/j":function(at,ge,J){"use strict";J.d(ge,"b",function(){return ie}),J.d(ge,"a",function(){return $}),J.d(ge,"c",function(){return Y}),J.d(ge,"d",function(){return F});var ie;(function(U){U.serviceIds=new Map,U.DI_TARGET="$di$target",U.DI_DEPENDENCIES="$di$dependencies";function G(W){return W[U.DI_DEPENDENCIES]||[]}U.getServiceDependencies=G})(ie||(ie={}));const $=Y("instantiationService");function M(U,G,W,i){G[ie.DI_TARGET]===G?G[ie.DI_DEPENDENCIES].push({id:U,index:W,optional:i}):(G[ie.DI_DEPENDENCIES]=[{id:U,index:W,optional:i}],G[ie.DI_TARGET]=G)}function Y(U){if(ie.serviceIds.has(U))return ie.serviceIds.get(U);const G=function(W,i,D){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");M(G,W,D,!1)};return G.toString=()=>U,ie.serviceIds.set(U,G),G}function F(U){return function(G,W,i){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");M(U,G,i,!0)}}},DlQD:function(at,ge,J){(function(ie,$){at.exports=$()})(this,function(){"use strict";function ie(_e,fe){for(var ve=0;ve<fe.length;ve++){var ne=fe[ve];ne.enumerable=ne.enumerable||!1,ne.configurable=!0,"value"in ne&&(ne.writable=!0),Object.defineProperty(_e,ne.key,ne)}}function $(_e,fe,ve){return fe&&ie(_e.prototype,fe),ve&&ie(_e,ve),_e}function M(_e,fe){if(!_e)return;if(typeof _e=="string")return Y(_e,fe);var ve=Object.prototype.toString.call(_e).slice(8,-1);if(ve==="Object"&&_e.constructor&&(ve=_e.constructor.name),ve==="Map"||ve==="Set")return Array.from(_e);if(ve==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ve))return Y(_e,fe)}function Y(_e,fe){(fe==null||fe>_e.length)&&(fe=_e.length);for(var ve=0,ne=new Array(fe);ve<fe;ve++)ne[ve]=_e[ve];return ne}function F(_e,fe){var ve;if(typeof Symbol=="undefined"||_e[Symbol.iterator]==null){if(Array.isArray(_e)||(ve=M(_e))||fe&&_e&&typeof _e.length=="number"){ve&&(_e=ve);var ne=0;return function(){return ne>=_e.length?{done:!0}:{done:!1,value:_e[ne++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return ve=_e[Symbol.iterator](),ve.next.bind(ve)}function U(_e,fe){return fe={exports:{}},_e(fe,fe.exports),fe.exports}var G=U(function(_e){function fe(){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 ve(ne){_e.exports.defaults=ne}_e.exports={defaults:fe(),getDefaults:fe,changeDefaults:ve}}),W=G.defaults,i=G.getDefaults,D=G.changeDefaults,g=/[&<>"']/,d=/[&<>"']/g,m=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,a={"&":"&","<":"<",">":">",'"':""","'":"'"},f=function(fe){return a[fe]};function l(_e,fe){if(fe){if(g.test(_e))return _e.replace(d,f)}else if(m.test(_e))return _e.replace(u,f);return _e}var h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function o(_e){return _e.replace(h,function(fe,ve){return ve=ve.toLowerCase(),ve==="colon"?":":ve.charAt(0)==="#"?ve.charAt(1)==="x"?String.fromCharCode(parseInt(ve.substring(2),16)):String.fromCharCode(+ve.substring(1)):""})}var s=/(^|[^\[])\^/g;function A(_e,fe){_e=_e.source||_e,fe=fe||"";var ve={replace:function(re,oe){return oe=oe.source||oe,oe=oe.replace(s,"$1"),_e=_e.replace(re,oe),ve},getRegex:function(){return new RegExp(_e,fe)}};return ve}var _=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(_e,fe,ve){if(_e){var ne;try{ne=decodeURIComponent(o(ve)).replace(_,"").toLowerCase()}catch(re){return null}if(ne.indexOf("javascript:")===0||ne.indexOf("vbscript:")===0||ne.indexOf("data:")===0)return null}fe&&!S.test(ve)&&(ve=p(fe,ve));try{ve=encodeURI(ve).replace(/%25/g,"%")}catch(re){return null}return ve}var O={},C=/^[^:]+:\/*[^/]*$/,w=/^([^:]+:)[\s\S]*$/,x=/^([^:]+:\/*[^/]*)[\s\S]*$/;function p(_e,fe){O[" "+_e]||(C.test(_e)?O[" "+_e]=_e+"/":O[" "+_e]=N(_e,"/",!0)),_e=O[" "+_e];var ve=_e.indexOf(":")===-1;return fe.substring(0,2)==="//"?ve?fe:_e.replace(w,"$1")+fe:fe.charAt(0)==="/"?ve?fe:_e.replace(x,"$1")+fe:_e+fe}var T={exec:function(){}};function v(_e){for(var fe=1,ve,ne;fe<arguments.length;fe++){ve=arguments[fe];for(ne in ve)Object.prototype.hasOwnProperty.call(ve,ne)&&(_e[ne]=ve[ne])}return _e}function y(_e,fe){var ve=_e.replace(/\|/g,function(oe,de,ye){for(var Le=!1,Ue=de;--Ue>=0&&ye[Ue]==="\\";)Le=!Le;return Le?"|":" |"}),ne=ve.split(/ \|/),re=0;if(ne.length>fe)ne.splice(fe);else for(;ne.length<fe;)ne.push("");for(;re<ne.length;re++)ne[re]=ne[re].trim().replace(/\\\|/g,"|");return ne}function N(_e,fe,ve){var ne=_e.length;if(ne===0)return"";for(var re=0;re<ne;){var oe=_e.charAt(ne-re-1);if(oe===fe&&!ve)re++;else if(oe!==fe&&ve)re++;else break}return _e.substr(0,ne-re)}function B(_e,fe){if(_e.indexOf(fe[1])===-1)return-1;for(var ve=_e.length,ne=0,re=0;re<ve;re++)if(_e[re]==="\\")re++;else if(_e[re]===fe[0])ne++;else if(_e[re]===fe[1]&&(ne--,ne<0))return re;return-1}function R(_e){_e&&_e.sanitize&&!_e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var j={escape:l,unescape:o,edit:A,cleanUrl:L,resolveUrl:p,noopTest:T,merge:v,splitCells:y,rtrim:N,findClosingBracket:B,checkSanitizeDeprecation:R},P=G.defaults,b=j.rtrim,X=j.splitCells,ee=j.escape,ae=j.findClosingBracket;function le(_e,fe,ve){var ne=fe.href,re=fe.title?ee(fe.title):null,oe=_e[1].replace(/\\([\[\]])/g,"$1");return _e[0].charAt(0)!=="!"?{type:"link",raw:ve,href:ne,title:re,text:oe}:{type:"image",raw:ve,href:ne,title:re,text:ee(oe)}}function Re(_e,fe){var ve=_e.match(/^(\s+)(?:```)/);if(ve===null)return fe;var ne=ve[1];return fe.split(`
|
|
`).map(function(re){var oe=re.match(/^\s+/);if(oe===null)return re;var de=oe[0];return de.length>=ne.length?re.slice(ne.length):re}).join(`
|
|
`)}var Ee=function(){function _e(ve){this.options=ve||P}var fe=_e.prototype;return fe.space=function(ne){var re=this.rules.block.newline.exec(ne);if(re)return re[0].length>1?{type:"space",raw:re[0]}:{raw:`
|
|
`}},fe.code=function(ne,re){var oe=this.rules.block.code.exec(ne);if(oe){var de=re[re.length-1];if(de&&de.type==="paragraph")return{raw:oe[0],text:oe[0].trimRight()};var ye=oe[0].replace(/^ {4}/gm,"");return{type:"code",raw:oe[0],codeBlockStyle:"indented",text:this.options.pedantic?ye:b(ye,`
|
|
`)}}},fe.fences=function(ne){var re=this.rules.block.fences.exec(ne);if(re){var oe=re[0],de=Re(oe,re[3]||"");return{type:"code",raw:oe,lang:re[2]?re[2].trim():re[2],text:de}}},fe.heading=function(ne){var re=this.rules.block.heading.exec(ne);if(re)return{type:"heading",raw:re[0],depth:re[1].length,text:re[2]}},fe.nptable=function(ne){var re=this.rules.block.nptable.exec(ne);if(re){var oe={type:"table",header:X(re[1].replace(/^ *| *\| *$/g,"")),align:re[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:re[3]?re[3].replace(/\n$/,"").split(`
|
|
`):[],raw:re[0]};if(oe.header.length===oe.align.length){var de=oe.align.length,ye;for(ye=0;ye<de;ye++)/^ *-+: *$/.test(oe.align[ye])?oe.align[ye]="right":/^ *:-+: *$/.test(oe.align[ye])?oe.align[ye]="center":/^ *:-+ *$/.test(oe.align[ye])?oe.align[ye]="left":oe.align[ye]=null;for(de=oe.cells.length,ye=0;ye<de;ye++)oe.cells[ye]=X(oe.cells[ye],oe.header.length);return oe}}},fe.hr=function(ne){var re=this.rules.block.hr.exec(ne);if(re)return{type:"hr",raw:re[0]}},fe.blockquote=function(ne){var re=this.rules.block.blockquote.exec(ne);if(re){var oe=re[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:re[0],text:oe}}},fe.list=function(ne){var re=this.rules.block.list.exec(ne);if(re){for(var oe=re[0],de=re[2],ye=de.length>1,Le=de[de.length-1]===")",Ue={type:"list",raw:oe,ordered:ye,start:ye?+de.slice(0,-1):"",loose:!1,items:[]},Je=re[0].match(this.rules.block.item),dt=!1,rt,mt,yt,tt,Ut,Ct,Jt,ei=Je.length,Dt=0;Dt<ei;Dt++)rt=Je[Dt],oe=rt,mt=rt.length,rt=rt.replace(/^ *([*+-]|\d+[.)]) */,""),~rt.indexOf(`
|
|
`)&&(mt-=rt.length,rt=this.options.pedantic?rt.replace(/^ {1,4}/gm,""):rt.replace(new RegExp("^ {1,"+mt+"}","gm"),"")),Dt!==ei-1&&(yt=this.rules.block.bullet.exec(Je[Dt+1])[0],(ye?yt.length===1||!Le&&yt[yt.length-1]===")":yt.length>1||this.options.smartLists&&yt!==de)&&(tt=Je.slice(Dt+1).join(`
|
|
`),Ue.raw=Ue.raw.substring(0,Ue.raw.length-tt.length),Dt=ei-1)),Ut=dt||/\n\n(?!\s*$)/.test(rt),Dt!==ei-1&&(dt=rt.charAt(rt.length-1)===`
|
|
`,Ut||(Ut=dt)),Ut&&(Ue.loose=!0),Ct=/^\[[ xX]\] /.test(rt),Jt=void 0,Ct&&(Jt=rt[1]!==" ",rt=rt.replace(/^\[[ xX]\] +/,"")),Ue.items.push({type:"list_item",raw:oe,task:Ct,checked:Jt,loose:Ut,text:rt});return Ue}},fe.html=function(ne){var re=this.rules.block.html.exec(ne);if(re)return{type:this.options.sanitize?"paragraph":"html",raw:re[0],pre:!this.options.sanitizer&&(re[1]==="pre"||re[1]==="script"||re[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(re[0]):ee(re[0]):re[0]}},fe.def=function(ne){var re=this.rules.block.def.exec(ne);if(re){re[3]&&(re[3]=re[3].substring(1,re[3].length-1));var oe=re[1].toLowerCase().replace(/\s+/g," ");return{tag:oe,raw:re[0],href:re[2],title:re[3]}}},fe.table=function(ne){var re=this.rules.block.table.exec(ne);if(re){var oe={type:"table",header:X(re[1].replace(/^ *| *\| *$/g,"")),align:re[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:re[3]?re[3].replace(/\n$/,"").split(`
|
|
`):[]};if(oe.header.length===oe.align.length){oe.raw=re[0];var de=oe.align.length,ye;for(ye=0;ye<de;ye++)/^ *-+: *$/.test(oe.align[ye])?oe.align[ye]="right":/^ *:-+: *$/.test(oe.align[ye])?oe.align[ye]="center":/^ *:-+ *$/.test(oe.align[ye])?oe.align[ye]="left":oe.align[ye]=null;for(de=oe.cells.length,ye=0;ye<de;ye++)oe.cells[ye]=X(oe.cells[ye].replace(/^ *\| *| *\| *$/g,""),oe.header.length);return oe}}},fe.lheading=function(ne){var re=this.rules.block.lheading.exec(ne);if(re)return{type:"heading",raw:re[0],depth:re[2].charAt(0)==="="?1:2,text:re[1]}},fe.paragraph=function(ne){var re=this.rules.block.paragraph.exec(ne);if(re)return{type:"paragraph",raw:re[0],text:re[1].charAt(re[1].length-1)===`
|
|
`?re[1].slice(0,-1):re[1]}},fe.text=function(ne,re){var oe=this.rules.block.text.exec(ne);if(oe){var de=re[re.length-1];return de&&de.type==="text"?{raw:oe[0],text:oe[0]}:{type:"text",raw:oe[0],text:oe[0]}}},fe.escape=function(ne){var re=this.rules.inline.escape.exec(ne);if(re)return{type:"escape",raw:re[0],text:ee(re[1])}},fe.tag=function(ne,re,oe){var de=this.rules.inline.tag.exec(ne);if(de)return!re&&/^<a /i.test(de[0])?re=!0:re&&/^<\/a>/i.test(de[0])&&(re=!1),!oe&&/^<(pre|code|kbd|script)(\s|>)/i.test(de[0])?oe=!0:oe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(de[0])&&(oe=!1),{type:this.options.sanitize?"text":"html",raw:de[0],inLink:re,inRawBlock:oe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(de[0]):ee(de[0]):de[0]}},fe.link=function(ne){var re=this.rules.inline.link.exec(ne);if(re){var oe=ae(re[2],"()");if(oe>-1){var de=re[0].indexOf("!")===0?5:4,ye=de+re[1].length+oe;re[2]=re[2].substring(0,oe),re[0]=re[0].substring(0,ye).trim(),re[3]=""}var Le=re[2],Ue="";if(this.options.pedantic){var Je=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Le);Je?(Le=Je[1],Ue=Je[3]):Ue=""}else Ue=re[3]?re[3].slice(1,-1):"";Le=Le.trim().replace(/^<([\s\S]*)>$/,"$1");var dt=le(re,{href:Le&&Le.replace(this.rules.inline._escapes,"$1"),title:Ue&&Ue.replace(this.rules.inline._escapes,"$1")},re[0]);return dt}},fe.reflink=function(ne,re){var oe;if((oe=this.rules.inline.reflink.exec(ne))||(oe=this.rules.inline.nolink.exec(ne))){var de=(oe[2]||oe[1]).replace(/\s+/g," ");if(de=re[de.toLowerCase()],!de||!de.href){var ye=oe[0].charAt(0);return{type:"text",raw:ye,text:ye}}var Le=le(oe,de,oe[0]);return Le}},fe.strong=function(ne,re,oe){oe===void 0&&(oe="");var de=this.rules.inline.strong.start.exec(ne);if(de&&(!de[1]||de[1]&&(oe===""||this.rules.inline.punctuation.exec(oe)))){re=re.slice(-1*ne.length);var ye=de[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ye.lastIndex=0;for(var Le;(de=ye.exec(re))!=null;)if(Le=this.rules.inline.strong.middle.exec(re.slice(0,de.index+3)),Le)return{type:"strong",raw:ne.slice(0,Le[0].length),text:ne.slice(2,Le[0].length-2)}}},fe.em=function(ne,re,oe){oe===void 0&&(oe="");var de=this.rules.inline.em.start.exec(ne);if(de&&(!de[1]||de[1]&&(oe===""||this.rules.inline.punctuation.exec(oe)))){re=re.slice(-1*ne.length);var ye=de[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ye.lastIndex=0;for(var Le;(de=ye.exec(re))!=null;)if(Le=this.rules.inline.em.middle.exec(re.slice(0,de.index+2)),Le)return{type:"em",raw:ne.slice(0,Le[0].length),text:ne.slice(1,Le[0].length-1)}}},fe.codespan=function(ne){var re=this.rules.inline.code.exec(ne);if(re){var oe=re[2].replace(/\n/g," "),de=/[^ ]/.test(oe),ye=oe.startsWith(" ")&&oe.endsWith(" ");return de&&ye&&(oe=oe.substring(1,oe.length-1)),oe=ee(oe,!0),{type:"codespan",raw:re[0],text:oe}}},fe.br=function(ne){var re=this.rules.inline.br.exec(ne);if(re)return{type:"br",raw:re[0]}},fe.del=function(ne){var re=this.rules.inline.del.exec(ne);if(re)return{type:"del",raw:re[0],text:re[1]}},fe.autolink=function(ne,re){var oe=this.rules.inline.autolink.exec(ne);if(oe){var de,ye;return oe[2]==="@"?(de=ee(this.options.mangle?re(oe[1]):oe[1]),ye="mailto:"+de):(de=ee(oe[1]),ye=de),{type:"link",raw:oe[0],text:de,href:ye,tokens:[{type:"text",raw:de,text:de}]}}},fe.url=function(ne,re){var oe;if(oe=this.rules.inline.url.exec(ne)){var de,ye;if(oe[2]==="@")de=ee(this.options.mangle?re(oe[0]):oe[0]),ye="mailto:"+de;else{var Le;do Le=oe[0],oe[0]=this.rules.inline._backpedal.exec(oe[0])[0];while(Le!==oe[0]);de=ee(oe[0]),oe[1]==="www."?ye="http://"+de:ye=de}return{type:"link",raw:oe[0],text:de,href:ye,tokens:[{type:"text",raw:de,text:de}]}}},fe.inlineText=function(ne,re,oe){var de=this.rules.inline.text.exec(ne);if(de){var ye;return re?ye=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(de[0]):ee(de[0]):de[0]:ye=ee(this.options.smartypants?oe(de[0]):de[0]),{type:"text",raw:de[0],text:ye}}},_e}(),Te=j.noopTest,Ae=j.edit,Oe=j.merge,ce={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:Te,table:Te,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ce._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ce._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ce.def=Ae(ce.def).replace("label",ce._label).replace("title",ce._title).getRegex(),ce.bullet=/(?:[*+-]|\d{1,9}[.)])/,ce.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ce.item=Ae(ce.item,"gm").replace(/bull/g,ce.bullet).getRegex(),ce.list=Ae(ce.list).replace(/bull/g,ce.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ce.def.source+")").getRegex(),ce._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",ce._comment=/<!--(?!-?>)[\s\S]*?-->/,ce.html=Ae(ce.html,"i").replace("comment",ce._comment).replace("tag",ce._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ce.paragraph=Ae(ce._paragraph).replace("hr",ce.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",ce._tag).getRegex(),ce.blockquote=Ae(ce.blockquote).replace("paragraph",ce.paragraph).getRegex(),ce.normal=Oe({},ce),ce.gfm=Oe({},ce.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*|$)"}),ce.gfm.nptable=Ae(ce.gfm.nptable).replace("hr",ce.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",ce._tag).getRegex(),ce.gfm.table=Ae(ce.gfm.table).replace("hr",ce.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",ce._tag).getRegex(),ce.pedantic=Oe({},ce.normal,{html:Ae(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ce._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:Te,paragraph:Ae(ce.normal._paragraph).replace("hr",ce.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ce.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ue={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Te,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:Te,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ue._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ue.punctuation=Ae(ue.punctuation).replace(/punctuation/g,ue._punctuation).getRegex(),ue._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ue._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ue.em.start=Ae(ue.em.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.middle=Ae(ue.em.middle).replace(/punctuation/g,ue._punctuation).replace(/overlapSkip/g,ue._overlapSkip).getRegex(),ue.em.endAst=Ae(ue.em.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.endUnd=Ae(ue.em.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.start=Ae(ue.strong.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.middle=Ae(ue.strong.middle).replace(/punctuation/g,ue._punctuation).replace(/blockSkip/g,ue._blockSkip).getRegex(),ue.strong.endAst=Ae(ue.strong.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.endUnd=Ae(ue.strong.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.blockSkip=Ae(ue._blockSkip,"g").getRegex(),ue.overlapSkip=Ae(ue._overlapSkip,"g").getRegex(),ue._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ue._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ue._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])?)+(?![-_])/,ue.autolink=Ae(ue.autolink).replace("scheme",ue._scheme).replace("email",ue._email).getRegex(),ue._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ue.tag=Ae(ue.tag).replace("comment",ce._comment).replace("attribute",ue._attribute).getRegex(),ue._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ue._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ue._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ue.link=Ae(ue.link).replace("label",ue._label).replace("href",ue._href).replace("title",ue._title).getRegex(),ue.reflink=Ae(ue.reflink).replace("label",ue._label).getRegex(),ue.reflinkSearch=Ae(ue.reflinkSearch,"g").replace("reflink",ue.reflink).replace("nolink",ue.nolink).getRegex(),ue.normal=Oe({},ue),ue.pedantic=Oe({},ue.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",ue._label).getRegex(),reflink:Ae(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ue._label).getRegex()}),ue.gfm=Oe({},ue.normal,{escape:Ae(ue.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ue.gfm.url=Ae(ue.gfm.url,"i").replace("email",ue.gfm._extended_email).getRegex(),ue.breaks=Oe({},ue.gfm,{br:Ae(ue.br).replace("{2,}","*").getRegex(),text:Ae(ue.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Pe={block:ce,inline:ue},qe=G.defaults,ze=Pe.block,et=Pe.inline;function nt(_e){return _e.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 Ie(_e){var fe="",ve,ne,re=_e.length;for(ve=0;ve<re;ve++)ne=_e.charCodeAt(ve),Math.random()>.5&&(ne="x"+ne.toString(16)),fe+="&#"+ne+";";return fe}var Me=function(){function _e(ve){this.tokens=[],this.tokens.links=Object.create(null),this.options=ve||qe,this.options.tokenizer=this.options.tokenizer||new Ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ne={block:ze.normal,inline:et.normal};this.options.pedantic?(ne.block=ze.pedantic,ne.inline=et.pedantic):this.options.gfm&&(ne.block=ze.gfm,this.options.breaks?ne.inline=et.breaks:ne.inline=et.gfm),this.tokenizer.rules=ne}_e.lex=function(ne,re){var oe=new _e(re);return oe.lex(ne)};var fe=_e.prototype;return fe.lex=function(ne){return ne=ne.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(ne,this.tokens,!0),this.inline(this.tokens),this.tokens},fe.blockTokens=function(ne,re,oe){re===void 0&&(re=[]),oe===void 0&&(oe=!0),ne=ne.replace(/^ +$/gm,"");for(var de,ye,Le,Ue;ne;){if(de=this.tokenizer.space(ne)){ne=ne.substring(de.raw.length),de.type&&re.push(de);continue}if(de=this.tokenizer.code(ne,re)){ne=ne.substring(de.raw.length),de.type?re.push(de):(Ue=re[re.length-1],Ue.raw+=`
|
|
`+de.raw,Ue.text+=`
|
|
`+de.text);continue}if(de=this.tokenizer.fences(ne)){ne=ne.substring(de.raw.length),re.push(de);continue}if(de=this.tokenizer.heading(ne)){ne=ne.substring(de.raw.length),re.push(de);continue}if(de=this.tokenizer.nptable(ne)){ne=ne.substring(de.raw.length),re.push(de);continue}if(de=this.tokenizer.hr(ne)){ne=ne.substring(de.raw.length),re.push(de);continue}if(de=this.tokenizer.blockquote(ne)){ne=ne.substring(de.raw.length),de.tokens=this.blockTokens(de.text,[],oe),re.push(de);continue}if(de=this.tokenizer.list(ne)){for(ne=ne.substring(de.raw.length),Le=de.items.length,ye=0;ye<Le;ye++)de.items[ye].tokens=this.blockTokens(de.items[ye].text,[],!1);re.push(de);continue}if(de=this.tokenizer.html(ne)){ne=ne.substring(de.raw.length),re.push(de);continue}if(oe&&(de=this.tokenizer.def(ne))){ne=ne.substring(de.raw.length),this.tokens.links[de.tag]||(this.tokens.links[de.tag]={href:de.href,title:de.title});continue}if(de=this.tokenizer.table(ne)){ne=ne.substring(de.raw.length),re.push(de);continue}if(de=this.tokenizer.lheading(ne)){ne=ne.substring(de.raw.length),re.push(de);continue}if(oe&&(de=this.tokenizer.paragraph(ne))){ne=ne.substring(de.raw.length),re.push(de);continue}if(de=this.tokenizer.text(ne,re)){ne=ne.substring(de.raw.length),de.type?re.push(de):(Ue=re[re.length-1],Ue.raw+=`
|
|
`+de.raw,Ue.text+=`
|
|
`+de.text);continue}if(ne){var Je="Infinite loop on byte: "+ne.charCodeAt(0);if(this.options.silent){console.error(Je);break}else throw new Error(Je)}}return re},fe.inline=function(ne){var re,oe,de,ye,Le,Ue,Je=ne.length;for(re=0;re<Je;re++){Ue=ne[re];switch(Ue.type){case"paragraph":case"text":case"heading":{Ue.tokens=[],this.inlineTokens(Ue.text,Ue.tokens);break}case"table":{for(Ue.tokens={header:[],cells:[]},ye=Ue.header.length,oe=0;oe<ye;oe++)Ue.tokens.header[oe]=[],this.inlineTokens(Ue.header[oe],Ue.tokens.header[oe]);for(ye=Ue.cells.length,oe=0;oe<ye;oe++)for(Le=Ue.cells[oe],Ue.tokens.cells[oe]=[],de=0;de<Le.length;de++)Ue.tokens.cells[oe][de]=[],this.inlineTokens(Le[de],Ue.tokens.cells[oe][de]);break}case"blockquote":{this.inline(Ue.tokens);break}case"list":{for(ye=Ue.items.length,oe=0;oe<ye;oe++)this.inline(Ue.items[oe].tokens);break}}}return ne},fe.inlineTokens=function(ne,re,oe,de,ye){re===void 0&&(re=[]),oe===void 0&&(oe=!1),de===void 0&&(de=!1),ye===void 0&&(ye="");var Le,Ue=ne,Je;if(this.tokens.links){var dt=Object.keys(this.tokens.links);if(dt.length>0)for(;(Je=this.tokenizer.rules.inline.reflinkSearch.exec(Ue))!=null;)dt.includes(Je[0].slice(Je[0].lastIndexOf("[")+1,-1))&&(Ue=Ue.slice(0,Je.index)+"["+"a".repeat(Je[0].length-2)+"]"+Ue.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Je=this.tokenizer.rules.inline.blockSkip.exec(Ue))!=null;)Ue=Ue.slice(0,Je.index)+"["+"a".repeat(Je[0].length-2)+"]"+Ue.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ne;){if(Le=this.tokenizer.escape(ne)){ne=ne.substring(Le.raw.length),re.push(Le);continue}if(Le=this.tokenizer.tag(ne,oe,de)){ne=ne.substring(Le.raw.length),oe=Le.inLink,de=Le.inRawBlock,re.push(Le);continue}if(Le=this.tokenizer.link(ne)){ne=ne.substring(Le.raw.length),Le.type==="link"&&(Le.tokens=this.inlineTokens(Le.text,[],!0,de)),re.push(Le);continue}if(Le=this.tokenizer.reflink(ne,this.tokens.links)){ne=ne.substring(Le.raw.length),Le.type==="link"&&(Le.tokens=this.inlineTokens(Le.text,[],!0,de)),re.push(Le);continue}if(Le=this.tokenizer.strong(ne,Ue,ye)){ne=ne.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],oe,de),re.push(Le);continue}if(Le=this.tokenizer.em(ne,Ue,ye)){ne=ne.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],oe,de),re.push(Le);continue}if(Le=this.tokenizer.codespan(ne)){ne=ne.substring(Le.raw.length),re.push(Le);continue}if(Le=this.tokenizer.br(ne)){ne=ne.substring(Le.raw.length),re.push(Le);continue}if(Le=this.tokenizer.del(ne)){ne=ne.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],oe,de),re.push(Le);continue}if(Le=this.tokenizer.autolink(ne,Ie)){ne=ne.substring(Le.raw.length),re.push(Le);continue}if(!oe&&(Le=this.tokenizer.url(ne,Ie))){ne=ne.substring(Le.raw.length),re.push(Le);continue}if(Le=this.tokenizer.inlineText(ne,de,nt)){ne=ne.substring(Le.raw.length),ye=Le.raw.slice(-1),re.push(Le);continue}if(ne){var rt="Infinite loop on byte: "+ne.charCodeAt(0);if(this.options.silent){console.error(rt);break}else throw new Error(rt)}}return re},$(_e,null,[{key:"rules",get:function(){return{block:ze,inline:et}}}]),_e}(),Ge=G.defaults,se=j.cleanUrl,be=j.escape,xe=function(){function _e(ve){this.options=ve||Ge}var fe=_e.prototype;return fe.code=function(ne,re,oe){var de=(re||"").match(/\S*/)[0];if(this.options.highlight){var ye=this.options.highlight(ne,de);ye!=null&&ye!==ne&&(oe=!0,ne=ye)}return de?'<pre><code class="'+this.options.langPrefix+be(de,!0)+'">'+(oe?ne:be(ne,!0))+`</code></pre>
|
|
`:"<pre><code>"+(oe?ne:be(ne,!0))+`</code></pre>
|
|
`},fe.blockquote=function(ne){return`<blockquote>
|
|
`+ne+`</blockquote>
|
|
`},fe.html=function(ne){return ne},fe.heading=function(ne,re,oe,de){return this.options.headerIds?"<h"+re+' id="'+this.options.headerPrefix+de.slug(oe)+'">'+ne+"</h"+re+`>
|
|
`:"<h"+re+">"+ne+"</h"+re+`>
|
|
`},fe.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},fe.list=function(ne,re,oe){var de=re?"ol":"ul",ye=re&&oe!==1?' start="'+oe+'"':"";return"<"+de+ye+`>
|
|
`+ne+"</"+de+`>
|
|
`},fe.listitem=function(ne){return"<li>"+ne+`</li>
|
|
`},fe.checkbox=function(ne){return"<input "+(ne?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},fe.paragraph=function(ne){return"<p>"+ne+`</p>
|
|
`},fe.table=function(ne,re){return re&&(re="<tbody>"+re+"</tbody>"),`<table>
|
|
<thead>
|
|
`+ne+`</thead>
|
|
`+re+`</table>
|
|
`},fe.tablerow=function(ne){return`<tr>
|
|
`+ne+`</tr>
|
|
`},fe.tablecell=function(ne,re){var oe=re.header?"th":"td",de=re.align?"<"+oe+' align="'+re.align+'">':"<"+oe+">";return de+ne+"</"+oe+`>
|
|
`},fe.strong=function(ne){return"<strong>"+ne+"</strong>"},fe.em=function(ne){return"<em>"+ne+"</em>"},fe.codespan=function(ne){return"<code>"+ne+"</code>"},fe.br=function(){return this.options.xhtml?"<br/>":"<br>"},fe.del=function(ne){return"<del>"+ne+"</del>"},fe.link=function(ne,re,oe){if(ne=se(this.options.sanitize,this.options.baseUrl,ne),ne===null)return oe;var de='<a href="'+be(ne)+'"';return re&&(de+=' title="'+re+'"'),de+=">"+oe+"</a>",de},fe.image=function(ne,re,oe){if(ne=se(this.options.sanitize,this.options.baseUrl,ne),ne===null)return oe;var de='<img src="'+ne+'" alt="'+oe+'"';return re&&(de+=' title="'+re+'"'),de+=this.options.xhtml?"/>":">",de},fe.text=function(ne){return ne},_e}(),Se=function(){function _e(){}var fe=_e.prototype;return fe.strong=function(ne){return ne},fe.em=function(ne){return ne},fe.codespan=function(ne){return ne},fe.del=function(ne){return ne},fe.html=function(ne){return ne},fe.text=function(ne){return ne},fe.link=function(ne,re,oe){return""+oe},fe.image=function(ne,re,oe){return""+oe},fe.br=function(){return""},_e}(),Be=function(){function _e(){this.seen={}}var fe=_e.prototype;return fe.slug=function(ne){var re=ne.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(re)){var oe=re;do this.seen[oe]++,re=oe+"-"+this.seen[oe];while(this.seen.hasOwnProperty(re))}return this.seen[re]=0,re},_e}(),He=G.defaults,Xe=j.unescape,Ve=function(){function _e(ve){this.options=ve||He,this.options.renderer=this.options.renderer||new xe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Se,this.slugger=new Be}_e.parse=function(ne,re){var oe=new _e(re);return oe.parse(ne)};var fe=_e.prototype;return fe.parse=function(ne,re){re===void 0&&(re=!0);var oe="",de,ye,Le,Ue,Je,dt,rt,mt,yt,tt,Ut,Ct,Jt,ei,Dt,ci,Di,bt,fi=ne.length;for(de=0;de<fi;de++){tt=ne[de];switch(tt.type){case"space":continue;case"hr":{oe+=this.renderer.hr();continue}case"heading":{oe+=this.renderer.heading(this.parseInline(tt.tokens),tt.depth,Xe(this.parseInline(tt.tokens,this.textRenderer)),this.slugger);continue}case"code":{oe+=this.renderer.code(tt.text,tt.lang,tt.escaped);continue}case"table":{for(mt="",rt="",Ue=tt.header.length,ye=0;ye<Ue;ye++)rt+=this.renderer.tablecell(this.parseInline(tt.tokens.header[ye]),{header:!0,align:tt.align[ye]});for(mt+=this.renderer.tablerow(rt),yt="",Ue=tt.cells.length,ye=0;ye<Ue;ye++){for(dt=tt.tokens.cells[ye],rt="",Je=dt.length,Le=0;Le<Je;Le++)rt+=this.renderer.tablecell(this.parseInline(dt[Le]),{header:!1,align:tt.align[Le]});yt+=this.renderer.tablerow(rt)}oe+=this.renderer.table(mt,yt);continue}case"blockquote":{yt=this.parse(tt.tokens),oe+=this.renderer.blockquote(yt);continue}case"list":{for(Ut=tt.ordered,Ct=tt.start,Jt=tt.loose,Ue=tt.items.length,yt="",ye=0;ye<Ue;ye++)Dt=tt.items[ye],ci=Dt.checked,Di=Dt.task,ei="",Dt.task&&(bt=this.renderer.checkbox(ci),Jt?Dt.tokens.length>0&&Dt.tokens[0].type==="text"?(Dt.tokens[0].text=bt+" "+Dt.tokens[0].text,Dt.tokens[0].tokens&&Dt.tokens[0].tokens.length>0&&Dt.tokens[0].tokens[0].type==="text"&&(Dt.tokens[0].tokens[0].text=bt+" "+Dt.tokens[0].tokens[0].text)):Dt.tokens.unshift({type:"text",text:bt}):ei+=bt),ei+=this.parse(Dt.tokens,Jt),yt+=this.renderer.listitem(ei,Di,ci);oe+=this.renderer.list(yt,Ut,Ct);continue}case"html":{oe+=this.renderer.html(tt.text);continue}case"paragraph":{oe+=this.renderer.paragraph(this.parseInline(tt.tokens));continue}case"text":{for(yt=tt.tokens?this.parseInline(tt.tokens):tt.text;de+1<fi&&ne[de+1].type==="text";)tt=ne[++de],yt+=`
|
|
`+(tt.tokens?this.parseInline(tt.tokens):tt.text);oe+=re?this.renderer.paragraph(yt):yt;continue}default:{var _t='Token with "'+tt.type+'" type was not found.';if(this.options.silent){console.error(_t);return}else throw new Error(_t)}}}return oe},fe.parseInline=function(ne,re){re=re||this.renderer;var oe="",de,ye,Le=ne.length;for(de=0;de<Le;de++){ye=ne[de];switch(ye.type){case"escape":{oe+=re.text(ye.text);break}case"html":{oe+=re.html(ye.text);break}case"link":{oe+=re.link(ye.href,ye.title,this.parseInline(ye.tokens,re));break}case"image":{oe+=re.image(ye.href,ye.title,ye.text);break}case"strong":{oe+=re.strong(this.parseInline(ye.tokens,re));break}case"em":{oe+=re.em(this.parseInline(ye.tokens,re));break}case"codespan":{oe+=re.codespan(ye.text);break}case"br":{oe+=re.br();break}case"del":{oe+=re.del(this.parseInline(ye.tokens,re));break}case"text":{oe+=re.text(ye.text);break}default:{var Ue='Token with "'+ye.type+'" type was not found.';if(this.options.silent){console.error(Ue);return}else throw new Error(Ue)}}}return oe},_e}(),lt=j.merge,$e=j.checkSanitizeDeprecation,Qe=j.escape,De=G.getDefaults,ct=G.changeDefaults,ut=G.defaults;function ke(_e,fe,ve){if(typeof _e=="undefined"||_e===null)throw new Error("marked(): input parameter is undefined or null");if(typeof _e!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(_e)+", string expected");if(typeof fe=="function"&&(ve=fe,fe=null),fe=lt({},ke.defaults,fe||{}),$e(fe),ve){var ne=fe.highlight,re;try{re=Me.lex(_e,fe)}catch(Le){return ve(Le)}var oe=function(Ue){var Je;if(!Ue)try{Je=Ve.parse(re,fe)}catch(dt){Ue=dt}return fe.highlight=ne,Ue?ve(Ue):ve(null,Je)};if(!ne||ne.length<3)return oe();if(delete fe.highlight,!re.length)return oe();var de=0;ke.walkTokens(re,function(Le){Le.type==="code"&&(de++,setTimeout(function(){ne(Le.text,Le.lang,function(Ue,Je){if(Ue)return oe(Ue);Je!=null&&Je!==Le.text&&(Le.text=Je,Le.escaped=!0),de--,de===0&&oe()})},0))}),de===0&&oe();return}try{var ye=Me.lex(_e,fe);return fe.walkTokens&&ke.walkTokens(ye,fe.walkTokens),Ve.parse(ye,fe)}catch(Le){if(Le.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,fe.silent)return"<p>An error occurred:</p><pre>"+Qe(Le.message+"",!0)+"</pre>";throw Le}}ke.options=ke.setOptions=function(_e){return lt(ke.defaults,_e),ct(ke.defaults),ke},ke.getDefaults=De,ke.defaults=ut,ke.use=function(_e){var fe=lt({},_e);if(_e.renderer&&function(){var ne=ke.defaults.renderer||new xe,re=function(ye){var Le=ne[ye];ne[ye]=function(){for(var Ue=arguments.length,Je=new Array(Ue),dt=0;dt<Ue;dt++)Je[dt]=arguments[dt];var rt=_e.renderer[ye].apply(ne,Je);return rt===!1&&(rt=Le.apply(ne,Je)),rt}};for(var oe in _e.renderer)re(oe);fe.renderer=ne}(),_e.tokenizer&&function(){var ne=ke.defaults.tokenizer||new Ee,re=function(ye){var Le=ne[ye];ne[ye]=function(){for(var Ue=arguments.length,Je=new Array(Ue),dt=0;dt<Ue;dt++)Je[dt]=arguments[dt];var rt=_e.tokenizer[ye].apply(ne,Je);return rt===!1&&(rt=Le.apply(ne,Je)),rt}};for(var oe in _e.tokenizer)re(oe);fe.tokenizer=ne}(),_e.walkTokens){var ve=ke.defaults.walkTokens;fe.walkTokens=function(ne){_e.walkTokens(ne),ve&&ve(ne)}}ke.setOptions(fe)},ke.walkTokens=function(_e,fe){for(var ve=F(_e),ne;!(ne=ve()).done;){var re=ne.value;fe(re);switch(re.type){case"table":{for(var oe=F(re.tokens.header),de;!(de=oe()).done;){var ye=de.value;ke.walkTokens(ye,fe)}for(var Le=F(re.tokens.cells),Ue;!(Ue=Le()).done;)for(var Je=Ue.value,dt=F(Je),rt;!(rt=dt()).done;){var mt=rt.value;ke.walkTokens(mt,fe)}break}case"list":{ke.walkTokens(re.items,fe);break}default:re.tokens&&ke.walkTokens(re.tokens,fe)}}},ke.Parser=Ve,ke.parser=Ve.parse,ke.Renderer=xe,ke.TextRenderer=Se,ke.Lexer=Me,ke.lexer=Me.lex,ke.Tokenizer=Ee,ke.Slugger=Be,ke.parse=ke;var Ne=ke;return Ne})},ELLl:function(at,ge,J){(function(ie){ie(J("VrN/"))})(function(ie){var $={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},M=ie.Pos;ie.defineOption("autoCloseBrackets",!1,function(a,f,l){l&&l!=ie.Init&&(a.removeKeyMap(F),a.state.closeBrackets=null),f&&(U(Y(f,"pairs")),a.state.closeBrackets=f,a.addKeyMap(F))});function Y(a,f){return f=="pairs"&&typeof a=="string"?a:typeof a=="object"&&a[f]!=null?a[f]:$[f]}var F={Backspace:i,Enter:D};function U(a){for(var f=0;f<a.length;f++){var l=a.charAt(f),h="'"+l+"'";F[h]||(F[h]=G(l))}}U($.pairs+"`");function G(a){return function(f){return d(f,a)}}function W(a){var f=a.state.closeBrackets;if(!f||f.override)return f;var l=a.getModeAt(a.getCursor());return l.closeBrackets||f}function i(a){var f=W(a);if(!f||a.getOption("disableInput"))return ie.Pass;for(var l=Y(f,"pairs"),h=a.listSelections(),o=0;o<h.length;o++){if(!h[o].empty())return ie.Pass;var s=m(a,h[o].head);if(!s||l.indexOf(s)%2!=0)return ie.Pass}for(var o=h.length-1;o>=0;o--){var A=h[o].head;a.replaceRange("",M(A.line,A.ch-1),M(A.line,A.ch+1),"+delete")}}function D(a){var f=W(a),l=f&&Y(f,"explode");if(!l||a.getOption("disableInput"))return ie.Pass;for(var h=a.listSelections(),o=0;o<h.length;o++){if(!h[o].empty())return ie.Pass;var s=m(a,h[o].head);if(!s||l.indexOf(s)%2!=0)return ie.Pass}a.operation(function(){var A=a.lineSeparator()||`
|
|
`;a.replaceSelection(A+A,null),a.execCommand("goCharLeft"),h=a.listSelections();for(var _=0;_<h.length;_++){var S=h[_].head.line;a.indentLine(S,null,!0),a.indentLine(S+1,null,!0)}})}function g(a){var f=ie.cmpPos(a.anchor,a.head)>0;return{anchor:new M(a.anchor.line,a.anchor.ch+(f?-1:1)),head:new M(a.head.line,a.head.ch+(f?1:-1))}}function d(a,f){var l=W(a);if(!l||a.getOption("disableInput"))return ie.Pass;var h=Y(l,"pairs"),o=h.indexOf(f);if(o==-1)return ie.Pass;for(var s=Y(l,"closeBefore"),A=Y(l,"triples"),_=h.charAt(o+1)==f,S=a.listSelections(),L=o%2==0,O,C=0;C<S.length;C++){var w=S[C],x=w.head,p,T=a.getRange(x,M(x.line,x.ch+1));if(L&&!w.empty())p="surround";else if((_||!L)&&T==f)_&&u(a,x)?p="both":A.indexOf(f)>=0&&a.getRange(x,M(x.line,x.ch+3))==f+f+f?p="skipThree":p="skip";else if(_&&x.ch>1&&A.indexOf(f)>=0&&a.getRange(M(x.line,x.ch-2),x)==f+f){if(x.ch>2&&/\bstring/.test(a.getTokenTypeAt(M(x.line,x.ch-2))))return ie.Pass;p="addFour"}else if(_){var v=x.ch==0?" ":a.getRange(M(x.line,x.ch-1),x);if(!ie.isWordChar(T)&&v!=f&&!ie.isWordChar(v))p="both";else return ie.Pass}else if(L&&(T.length===0||/\s/.test(T)||s.indexOf(T)>-1))p="both";else return ie.Pass;if(!O)O=p;else if(O!=p)return ie.Pass}var y=o%2?h.charAt(o-1):f,N=o%2?f:h.charAt(o+1);a.operation(function(){if(O=="skip")a.execCommand("goCharRight");else if(O=="skipThree")for(var B=0;B<3;B++)a.execCommand("goCharRight");else if(O=="surround"){for(var R=a.getSelections(),B=0;B<R.length;B++)R[B]=y+R[B]+N;a.replaceSelections(R,"around"),R=a.listSelections().slice();for(var B=0;B<R.length;B++)R[B]=g(R[B]);a.setSelections(R)}else O=="both"?(a.replaceSelection(y+N,null),a.triggerElectric(y+N),a.execCommand("goCharLeft")):O=="addFour"&&(a.replaceSelection(y+y+y+y,"before"),a.execCommand("goCharRight"))})}function m(a,f){var l=a.getRange(M(f.line,f.ch-1),M(f.line,f.ch+1));return l.length==2?l:null}function u(a,f){var l=a.getTokenAt(M(f.line,f.ch+1));return/\bstring/.test(l.type)&&l.start==f.ch&&(f.ch==0||!/\bstring/.test(a.getTokenTypeAt(f)))}})},FWmy:function(at,ge,J){"use strict";J.d(ge,"a",function(){return ie});function ie($,M){if(!$)throw new Error(M?`Assertion failed (${M})`:"Assertion Failed")}},HmJG:function(at,ge,J){},JYp7:function(at,ge,J){"use strict";J.d(ge,"a",function(){return ie});var ie;(function($){function M(s){return s&&typeof s=="object"&&typeof s[Symbol.iterator]=="function"}$.is=M;const Y=Object.freeze([]);function F(){return Y}$.empty=F;function*U(s){yield s}$.single=U;function G(s){return s||Y}$.from=G;function W(s){return!s||s[Symbol.iterator]().next().done===!0}$.isEmpty=W;function i(s){return s[Symbol.iterator]().next().value}$.first=i;function D(s,A){for(const _ of s)if(A(_))return!0;return!1}$.some=D;function g(s,A){for(const _ of s)if(A(_))return _;return}$.find=g;function*d(s,A){for(const _ of s)A(_)&&(yield _)}$.filter=d;function*m(s,A){let _=0;for(const S of s)yield A(S,_++)}$.map=m;function*u(...s){for(const A of s)for(const _ of A)yield _}$.concat=u;function*a(s){for(const A of s)for(const _ of A)yield _}$.concatNested=a;function f(s,A,_){let S=_;for(const L of s)S=A(S,L);return S}$.reduce=f;function*l(s,A,_=s.length){for(A<0&&(A+=s.length),_<0?_+=s.length:_>s.length&&(_=s.length);A<_;A++)yield s[A]}$.slice=l;function h(s,A=Number.POSITIVE_INFINITY){const _=[];if(A===0)return[_,s];const S=s[Symbol.iterator]();for(let L=0;L<A;L++){const O=S.next();if(O.done)return[_,$.empty()];_.push(O.value)}return[_,{[Symbol.iterator](){return S}}]}$.consume=h;function o(s,A,_=(S,L)=>S===L){const S=s[Symbol.iterator](),L=A[Symbol.iterator]();for(;;){const O=S.next(),C=L.next();if(O.done!==C.done)return!1;if(O.done)return!0;if(!_(O.value,C.value))return!1}}$.equals=o})(ie||(ie={}))},LSTS:function(at,ge,J){"use strict";Object.defineProperty(ge,"__esModule",{value:!0});var ie=function(){function d(m,u){for(var a=0;a<u.length;a++){var f=u[a];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(m,f.key,f)}}return function(m,u,a){return u&&d(m.prototype,u),a&&d(m,a),m}}(),$=J("q1tI"),M=U($),Y=J("17x9"),F=U(Y);function U(d){return d&&d.__esModule?d:{default:d}}function G(d,m){var u={};for(var a in d){if(m.indexOf(a)>=0)continue;if(!Object.prototype.hasOwnProperty.call(d,a))continue;u[a]=d[a]}return u}function W(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")}function i(d,m){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:d}function D(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(d,m):d.__proto__=m)}var g=function(d){D(m,d);function m(u){W(this,m);var a=i(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,u));return a.scrollListener=a.scrollListener.bind(a),a.eventListenerOptions=a.eventListenerOptions.bind(a),a.mousewheelListener=a.mousewheelListener.bind(a),a}return ie(m,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var a=this.getParentElement(this.scrollComponent);a.scrollTop=a.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var a=!1,f={get passive(){a=!0}};try{document.addEventListener("test",null,f),document.removeEventListener("test",null,f)}catch(l){}return a}},{key:"eventListenerOptions",value:function(){var a=this.props.useCapture;return this.isPassiveSupported()&&(a={useCapture:this.props.useCapture,passive:!0}),a}},{key:"setDefaultLoader",value:function(a){this.defaultLoader=a}},{key:"detachMousewheelListener",value:function(){var a=window;this.props.useWindow===!1&&(a=this.scrollComponent.parentNode),a.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var a=window;this.props.useWindow===!1&&(a=this.getParentElement(this.scrollComponent)),a.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),a.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(a){var f=this.props.getScrollParent&&this.props.getScrollParent();return f!=null?f:a&&a.parentNode}},{key:"filterProps",value:function(a){return a}},{key:"attachScrollListener",value:function(){var a=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!a)return;var f=window;this.props.useWindow===!1&&(f=a),f.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),f.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),f.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}},{key:"mousewheelListener",value:function(a){a.deltaY===1&&!this.isPassiveSupported()&&a.preventDefault()}},{key:"scrollListener",value:function(){var a=this.scrollComponent,f=window,l=this.getParentElement(a),h=void 0;if(this.props.useWindow){var o=document.documentElement||document.body.parentNode||document.body,s=f.pageYOffset!==void 0?f.pageYOffset:o.scrollTop;this.props.isReverse?h=s:h=this.calculateOffset(a,s)}else this.props.isReverse?h=l.scrollTop:h=a.scrollHeight-l.scrollTop-l.clientHeight;h<Number(this.props.threshold)&&a&&a.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=l.scrollHeight,this.beforeScrollTop=l.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(a,f){return a?this.calculateTopPosition(a)+(a.offsetHeight-f-window.innerHeight):0}},{key:"calculateTopPosition",value:function(a){return a?a.offsetTop+this.calculateTopPosition(a.offsetParent):0}},{key:"render",value:function(){var a=this,f=this.filterProps(this.props),l=f.children,h=f.element,o=f.hasMore,s=f.initialLoad,A=f.isReverse,_=f.loader,S=f.loadMore,L=f.pageStart,O=f.ref,C=f.threshold,w=f.useCapture,x=f.useWindow,p=f.getScrollParent,T=G(f,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]);T.ref=function(y){a.scrollComponent=y,O&&O(y)};var v=[l];return o&&(_?A?v.unshift(_):v.push(_):this.defaultLoader&&(A?v.unshift(this.defaultLoader):v.push(this.defaultLoader))),M.default.createElement(h,T,v)}}]),m}($.Component);g.propTypes={children:F.default.node.isRequired,element:F.default.node,hasMore:F.default.bool,initialLoad:F.default.bool,isReverse:F.default.bool,loader:F.default.node,loadMore:F.default.func.isRequired,pageStart:F.default.number,ref:F.default.func,getScrollParent:F.default.func,threshold:F.default.number,useCapture:F.default.bool,useWindow:F.default.bool},g.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},ge.default=g,at.exports=ge.default},LdHM:function(at,ge,J){"use strict";J.d(ge,"b",function(){return s}),J.d(ge,"a",function(){return _});var ie=J("1OyB"),$=J("vuIU"),M=J("Ji7U"),Y=J("LK+K"),F=J("q1tI"),U=J("rePB"),G=J("Ff2n"),W=J("ODXe"),i=J("4IlW"),D=J("bX4T"),g=J("YrtM"),d=J("TSYQ"),m=J.n(d),u=J("+nKL"),a=J("8OUc"),f=function(X,ee){var ae=X.prefixCls,le=X.id,Re=X.flattenOptions,Ee=X.childrenAsData,Te=X.values,Ae=X.searchValue,Oe=X.multiple,ce=X.defaultActiveFirstOption,ue=X.height,Pe=X.itemHeight,qe=X.notFoundContent,ze=X.open,et=X.menuItemSelectedIcon,nt=X.virtual,Ie=X.onSelect,Me=X.onToggleOpen,Ge=X.onActiveValue,se=X.onScroll,be=X.onMouseEnter,xe="".concat(ae,"-item"),Se=Object(g.a)(function(){return Re},[ze,Re],function(Ne,_e){return _e[0]&&Ne[1]!==_e[1]}),Be=F.useRef(null),He=function(_e){_e.preventDefault()},Xe=function(_e){Be.current&&Be.current.scrollTo({index:_e})},Ve=function(_e){for(var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ve=Se.length,ne=0;ne<ve;ne+=1){var re=(_e+ne*fe+ve)%ve,oe=Se[re],de=oe.group,ye=oe.data;if(!de&&!ye.disabled)return re}return-1},lt=F.useState(function(){return Ve(0)}),$e=Object(W.a)(lt,2),Qe=$e[0],De=$e[1],ct=function(_e){De(_e);var fe=Se[_e];if(!fe){Ge(null,-1);return}Ge(fe.data.value,_e)};F.useEffect(function(){ct(ce!==!1?Ve(0):-1)},[Se.length,Ae]),F.useEffect(function(){var Ne=setTimeout(function(){if(!Oe&&ze&&Te.size===1){var _e=Array.from(Te)[0],fe=Se.findIndex(function(ve){var ne=ve.data;return ne.value===_e});ct(fe),Xe(fe)}});return function(){return clearTimeout(Ne)}},[ze]);var ut=function(_e){_e!==void 0&&Ie(_e,{selected:!Te.has(_e)}),Oe||Me(!1)};if(F.useImperativeHandle(ee,function(){return{onKeyDown:function(_e){var fe=_e.which;switch(fe){case i.a.UP:case i.a.DOWN:{var ve=0;if(fe===i.a.UP?ve=-1:fe===i.a.DOWN&&(ve=1),ve!==0){var ne=Ve(Qe+ve,ve);Xe(ne),ct(ne)}break}case i.a.ENTER:{var re=Se[Qe];re&&!re.data.disabled?ut(re.data.value):ut(void 0),ze&&_e.preventDefault();break}case i.a.ESC:Me(!1)}},onKeyUp:function(){},scrollTo:function(_e){Xe(_e)}}}),Se.length===0)return F.createElement("div",{role:"listbox",id:"".concat(le,"_list"),className:"".concat(xe,"-empty"),onMouseDown:He},qe);function ke(Ne){var _e=Se[Ne];if(!_e)return null;var fe=_e.data||{},ve=fe.value,ne=fe.label,re=fe.children,oe=Object(D.a)(fe,!0),de=Ee?re:ne;return _e?F.createElement("div",Object.assign({"aria-label":typeof de=="string"?de:null},oe,{key:Ne,role:"option",id:"".concat(le,"_list_").concat(Ne),"aria-selected":Te.has(ve)}),ve):null}return F.createElement(F.Fragment,null,F.createElement("div",{role:"listbox",id:"".concat(le,"_list"),style:{height:0,width:0,overflow:"hidden"}},ke(Qe-1),ke(Qe),ke(Qe+1)),F.createElement(u.a,{itemKey:"key",ref:Be,data:Se,height:ue,itemHeight:Pe,fullHeight:!1,onMouseDown:He,onScroll:se,virtual:nt,onMouseEnter:be},function(Ne,_e){var fe,ve=Ne.group,ne=Ne.groupOption,re=Ne.data,oe=re.label,de=re.key;if(ve)return F.createElement("div",{className:m()(xe,"".concat(xe,"-group"))},oe!==void 0?oe:de);var ye=re.disabled,Le=re.value,Ue=re.title,Je=re.children,dt=re.style,rt=re.className,mt=Object(G.a)(re,["disabled","value","title","children","style","className"]),yt=Te.has(Le),tt="".concat(xe,"-option"),Ut=m()(xe,tt,rt,(fe={},Object(U.a)(fe,"".concat(tt,"-grouped"),ne),Object(U.a)(fe,"".concat(tt,"-active"),Qe===_e&&!ye),Object(U.a)(fe,"".concat(tt,"-disabled"),ye),Object(U.a)(fe,"".concat(tt,"-selected"),yt),fe)),Ct=Ee?Je:oe,Jt=!et||typeof et=="function"||yt;return F.createElement("div",Object.assign({},mt,{"aria-selected":yt,className:Ut,title:Ue,onMouseMove:function(){if(Qe===_e||ye)return;ct(_e)},onClick:function(){ye||ut(Le)},style:dt}),F.createElement("div",{className:"".concat(tt,"-content")},Ct||Le),F.isValidElement(et)||yt,Jt&&F.createElement(a.a,{className:"".concat(xe,"-option-state"),customizeIcon:et,customizeIconProps:{isSelected:yt}},yt?"\u2713":null))}))},l=F.forwardRef(f);l.displayName="OptionList";var h=l,o=function(){return null};o.isSelectOption=!0;var s=o,A=function(){return null};A.isSelectOptGroup=!0;var _=A,S=J("VTBJ"),L=J("Zm9Q");function O(b){var X=b.key,ee=b.props,ae=ee.children,le=ee.value,Re=Object(G.a)(ee,["children","value"]);return Object(S.a)({key:X,value:le!==void 0?le:X,children:ae},Re)}function C(b){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(L.a)(b).map(function(ee,ae){if(!F.isValidElement(ee)||!ee.type)return null;var le=ee.type.isSelectOptGroup,Re=ee.key,Ee=ee.props,Te=Ee.children,Ae=Object(G.a)(Ee,["children"]);return X||!le?O(ee):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(Re===null?ae:Re,"__"),label:Re},Ae),{},{options:C(Te)})}).filter(function(ee){return ee})}var w=J("2Qr1"),x=J("qNPg"),p=J("U8pU"),T=J("Kwbf"),v=J("WKfj");function y(b){var X=b.mode,ee=b.options,ae=b.children,le=b.backfill,Re=b.allowClear,Ee=b.placeholder,Te=b.getInputElement,Ae=b.showSearch,Oe=b.onSearch,ce=b.defaultOpen,ue=b.autoFocus,Pe=b.labelInValue,qe=b.value,ze=b.inputValue,et=b.optionLabelProp,nt=X==="multiple"||X==="tags",Ie=Ae!==void 0?Ae:nt||X==="combobox",Me=ee||C(ae);if(Object(T.a)(X!=="tags"||Me.every(function(xe){return!xe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),X==="tags"||X==="combobox"){var Ge=Me.some(function(xe){return xe.options?xe.options.some(function(Se){return typeof("value"in Se?Se.value:Se.key)=="number"}):typeof("value"in xe?xe.value:xe.key)=="number"});Object(T.a)(!Ge,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(T.a)(X!=="combobox"||!et,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(T.a)(X==="combobox"||!le,"`backfill` only works with `combobox` mode."),Object(T.a)(X==="combobox"||!Te,"`getInputElement` only work with `combobox` mode."),Object(T.b)(X!=="combobox"||!Te||!Re||!Ee,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Oe&&!Ie&&X!=="combobox"&&X!=="tags"&&Object(T.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(T.b)(!ce||ue,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),qe!=null){var se=Object(v.d)(qe);Object(T.a)(!Pe||se.every(function(xe){return Object(p.a)(xe)==="object"&&("key"in xe||"value"in xe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(T.a)(!nt||Array.isArray(qe),"`value` should be array when `mode` is `multiple` or `tags`")}if(ae){var be=null;Object(L.a)(ae).some(function(xe){if(!F.isValidElement(xe)||!xe.type)return!1;var Se=xe.type;if(Se.isSelectOption)return!1;if(Se.isSelectOptGroup){var Be=Object(L.a)(xe.props.children).every(function(He){return!F.isValidElement(He)||!xe.type||He.type.isSelectOption?!0:(be=He.type,!1)});return!Be}return be=Se,!0}),be&&Object(T.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(be.displayName||be.name||be,"`.")),Object(T.a)(ze===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var N=y,B=Object(x.a)({prefixCls:"rc-select",components:{optionList:h},convertChildrenToData:C,flattenOptions:w.d,getLabeledValue:w.e,filterOptions:w.b,isValueDisabled:w.g,findValueOption:w.c,warningProps:N,fillOptionsWithMissingValue:w.a}),R=function(b){Object(M.a)(ee,b);var X=Object(Y.a)(ee);function ee(){var ae;return Object(ie.a)(this,ee),ae=X.apply(this,arguments),ae.selectRef=F.createRef(),ae.focus=function(){ae.selectRef.current.focus()},ae.blur=function(){ae.selectRef.current.blur()},ae}return Object($.a)(ee,[{key:"render",value:function(){return F.createElement(B,Object.assign({ref:this.selectRef},this.props))}}]),ee}(F.Component);R.Option=s,R.OptGroup=_;var j=R,P=ge.c=j},M8RZ:function(at,ge,J){"use strict";J.d(ge,"a",function(){return i});var ie=J("fWQN"),$=J("mtLc"),M=J("yKVA"),Y=J("879j"),F=J("q1tI"),U=J.n(F),G=J("i8i4"),W=J.n(G),i=function(D){Object(M.a)(d,D);var g=Object(Y.a)(d);function d(m){var u;Object(ie.a)(this,d),u=g.call(this,m);var a=window.document;return u.node=a.createElement("div"),a.body.appendChild(u.node),u}return Object($.a)(d,[{key:"render",value:function(){var u=this.props.children;return Object(G.createPortal)(u,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),d}(U.a.Component)},MI8n:function(at,ge,J){"use strict";J.d(ge,"c",function(){return F}),J.d(ge,"b",function(){return i}),J.d(ge,"e",function(){return D}),J.d(ge,"a",function(){return g}),J.d(ge,"d",function(){return d}),J.d(ge,"f",function(){return m});var ie=J("/cxE"),$=J("pmY6"),M=J("24hK"),Y=J("5Y4S"),F;(function(u){u.None=()=>$.a.None;function a(y){return(N,B=null,R)=>{let j=!1,P;return P=y(b=>j?void 0:(P?P.dispose():j=!0,N.call(B,b)),null,R),j&&P.dispose(),P}}u.once=a;function f(y,N){return _((B,R=null,j)=>y(P=>B.call(R,N(P)),null,j))}u.map=f;function l(y,N){return _((B,R=null,j)=>y(P=>{N(P),B.call(R,P)},null,j))}u.forEach=l;function h(y,N){return _((B,R=null,j)=>y(P=>N(P)&&B.call(R,P),null,j))}u.filter=h;function o(y){return y}u.signal=o;function s(...y){return(N,B=null,R)=>Object($.e)(...y.map(j=>j(P=>N.call(B,P),null,R)))}u.any=s;function A(y,N,B){let R=B;return f(y,j=>(R=N(R,j),R))}u.reduce=A;function _(y){let N;const B=new i({onFirstListenerAdd(){N=y(B.fire,B)},onLastListenerRemove(){N.dispose()}});return B.event}function S(y,N,B=100,R=!1,j){let P,b,X,ee=0;const ae=new i({leakWarningThreshold:j,onFirstListenerAdd(){P=y(le=>{ee++,b=N(b,le),R&&!X&&(ae.fire(b),b=void 0),clearTimeout(X),X=setTimeout(()=>{const Re=b;b=void 0,X=void 0,(!R||ee>1)&&ae.fire(Re),ee=0},B)})},onLastListenerRemove(){P.dispose()}});return ae.event}u.debounce=S;function L(y,N=(B,R)=>B===R){let B=!0,R;return h(y,j=>{const P=B||!N(j,R);return B=!1,R=j,P})}u.latch=L;function O(y,N){return[u.filter(y,N),u.filter(y,B=>!N(B))]}u.split=O;function C(y,N=!1,B=[]){let R=B.slice(),j=y(X=>{R?R.push(X):b.fire(X)});const P=()=>{R&&R.forEach(X=>b.fire(X)),R=null},b=new i({onFirstListenerAdd(){j||(j=y(X=>b.fire(X)))},onFirstListenerDidAdd(){R&&(N?setTimeout(P):P())},onLastListenerRemove(){j&&j.dispose(),j=null}});return b.event}u.buffer=C;class w{constructor(y){this.event=y}map(y){return new w(f(this.event,y))}forEach(y){return new w(l(this.event,y))}filter(y){return new w(h(this.event,y))}reduce(y,N){return new w(A(this.event,y,N))}latch(){return new w(L(this.event))}debounce(y,N=100,B=!1,R){return new w(S(this.event,y,N,B,R))}on(y,N,B){return this.event(y,N,B)}once(y,N,B){return a(this.event)(y,N,B)}}function x(y){return new w(y)}u.chain=x;function p(y,N,B=R=>R){const R=(...X)=>b.fire(B(...X)),j=()=>y.on(N,R),P=()=>y.removeListener(N,R),b=new i({onFirstListenerAdd:j,onLastListenerRemove:P});return b.event}u.fromNodeEventEmitter=p;function T(y,N,B=R=>R){const R=(...X)=>b.fire(B(...X)),j=()=>y.addEventListener(N,R),P=()=>y.removeEventListener(N,R),b=new i({onFirstListenerAdd:j,onLastListenerRemove:P});return b.event}u.fromDOMEventEmitter=T;function v(y){return new Promise(N=>a(y)(N))}u.toPromise=v})(F||(F={}));class U{constructor(u){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${u}_${U._idPool++}`}start(u){this._stopWatch=new Y.a(!0),this._listenerCount=u}stop(){if(this._stopWatch){const u=this._stopWatch.elapsed();this._elapsedOverall+=u,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${u.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}U._idPool=0;let G=-1;class W{constructor(u,a=Math.random().toString(18).slice(2,5)){this.customThreshold=u,this.name=a,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(u){let a=G;if(typeof this.customThreshold=="number"&&(a=this.customThreshold),a<=0||u<a)return;this._stacks||(this._stacks=new Map);const f=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),l=this._stacks.get(f)||0;if(this._stacks.set(f,l+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;let h,o=0;for(const[s,A]of this._stacks)(!h||o<A)&&(h=s,o=A);console.warn(`[${this.name}] potential listener LEAK detected, having ${u} listeners already. MOST frequent listener (${o}):`),console.warn(h)}return()=>{const h=this._stacks.get(f)||0;this._stacks.set(f,h-1)}}}class i{constructor(u){var a;this._disposed=!1,this._options=u,this._leakageMon=G>0?new W(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((a=this._options)===null||a===void 0?void 0:a._profName)?new U(this._options._profName):void 0}get event(){return this._event||(this._event=(u,a,f)=>{var l;this._listeners||(this._listeners=new M.a);const h=this._listeners.isEmpty();h&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const o=this._listeners.push(a?[u,a]:u);h&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,u,a);const s=(l=this._leakageMon)===null||l===void 0?void 0:l.check(this._listeners.size),A=Object($.i)(()=>{if(s&&s(),!this._disposed&&(o(),this._options&&this._options.onLastListenerRemove)){const _=this._listeners&&!this._listeners.isEmpty();_||this._options.onLastListenerRemove(this)}});return f instanceof $.b?f.add(A):Array.isArray(f)&&f.push(A),A}),this._event}fire(u){var a,f;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new M.a);for(let l of this._listeners)this._deliveryQueue.push([l,u]);for((a=this._perfMon)===null||a===void 0||a.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[l,h]=this._deliveryQueue.shift();try{typeof l=="function"?l.call(void 0,h):l[0].call(l[1],h)}catch(o){Object(ie.f)(o)}}(f=this._perfMon)===null||f===void 0||f.stop()}}dispose(){var u,a,f,l,h;this._disposed||(this._disposed=!0,(u=this._listeners)===null||u===void 0||u.clear(),(a=this._deliveryQueue)===null||a===void 0||a.clear(),(l=(f=this._options)===null||f===void 0?void 0:f.onLastListenerRemove)===null||l===void 0||l.call(f),(h=this._leakageMon)===null||h===void 0||h.dispose())}}class D extends i{constructor(u){super(u);this._isPaused=0,this._eventQueue=new M.a,this._mergeFn=u==null?void 0:u.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const u=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(u))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(u){this._listeners&&(this._isPaused!==0?this._eventQueue.push(u):super.fire(u))}}class g extends D{constructor(u){var a;super(u);this._delay=(a=u.delay)!==null&&a!==void 0?a:100}fire(u){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(u)}}class d{constructor(){this.buffers=[]}wrapEvent(u){return(a,f,l)=>u(h=>{const o=this.buffers[this.buffers.length-1];o?o.push(()=>a.call(f,h)):a.call(f,h)},void 0,l)}bufferEvents(u){const a=[];this.buffers.push(a);const f=u();return this.buffers.pop(),a.forEach(l=>l()),f}}class m{constructor(){this.listening=!1,this.inputEvent=F.None,this.inputEventListener=$.a.None,this.emitter=new i({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(u){this.inputEvent=u,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=u(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(at,ge,J){"use strict";(function(ie,$){J.d(ge,"b",function(){return f}),J.d(ge,"i",function(){return s}),J.d(ge,"f",function(){return A}),J.d(ge,"d",function(){return _}),J.d(ge,"g",function(){return S}),J.d(ge,"h",function(){return L}),J.d(ge,"c",function(){return O}),J.d(ge,"k",function(){return C}),J.d(ge,"j",function(){return w}),J.d(ge,"a",function(){return x}),J.d(ge,"e",function(){return v});var M;const Y="en";let F=!1,U=!1,G=!1,W=!1,i=!1,D=!1,g=!1,d,m=Y,u,a;const f=typeof self=="object"?self:typeof ie=="object"?ie:{};let l;typeof f.vscode!="undefined"&&typeof f.vscode.process!="undefined"?l=f.vscode.process:typeof $!="undefined"&&(l=$);const h=typeof((M=l==null?void 0:l.versions)===null||M===void 0?void 0:M.electron)=="string"&&l.type==="renderer";if(typeof navigator=="object"&&!h)a=navigator.userAgent,F=a.indexOf("Windows")>=0,U=a.indexOf("Macintosh")>=0,g=(a.indexOf("Macintosh")>=0||a.indexOf("iPad")>=0||a.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,G=a.indexOf("Linux")>=0,D=!0,d=navigator.language,m=d;else if(typeof l=="object"){F=l.platform==="win32",U=l.platform==="darwin",G=l.platform==="linux",W=G&&!!l.env.SNAP&&!!l.env.SNAP_REVISION,d=Y,m=Y;const y=l.env.VSCODE_NLS_CONFIG;if(y)try{const N=JSON.parse(y),B=N.availableLanguages["*"];d=N.locale,m=B||Y,u=N._translationsConfigFile}catch(N){}i=!0}else console.error("Unable to resolve platform.");let o=0;U?o=1:F?o=3:G&&(o=2);const s=F,A=U,_=G,S=i,L=D,O=g,C=a,w=function(){if(f.setImmediate)return f.setImmediate.bind(f);if(typeof f.postMessage=="function"&&!f.importScripts){let B=[];f.addEventListener("message",j=>{if(j.data&&j.data.vscodeSetImmediateId)for(let P=0,b=B.length;P<b;P++){const X=B[P];if(X.id===j.data.vscodeSetImmediateId){B.splice(P,1),X.callback();return}}});let R=0;return j=>{const P=++R;B.push({id:P,callback:j}),f.postMessage({vscodeSetImmediateId:P},"*")}}if(typeof(l==null?void 0:l.nextTick)=="function")return l.nextTick.bind(l);const N=Promise.resolve();return B=>N.then(B)}(),x=U||g?2:F?1:3;let p=!0,T=!1;function v(){if(!T){T=!0;const y=new Uint8Array(2);y[0]=1,y[1]=2;const N=new Uint16Array(y.buffer);p=N[0]===(2<<8)+1}return p}}).call(this,J("IyRk"),J("Q2Ig"))},N0LK:function(at,ge,J){"use strict";J.d(ge,"C",function(){return ie}),J.d(ge,"v",function(){return M}),J.d(ge,"s",function(){return Y}),J.d(ge,"t",function(){return F}),J.d(ge,"U",function(){return U}),J.d(ge,"J",function(){return G}),J.d(ge,"O",function(){return W}),J.d(ge,"p",function(){return i}),J.d(ge,"T",function(){return D}),J.d(ge,"q",function(){return g}),J.d(ge,"N",function(){return d}),J.d(ge,"M",function(){return m}),J.d(ge,"Q",function(){return u}),J.d(ge,"u",function(){return a}),J.d(ge,"x",function(){return f}),J.d(ge,"I",function(){return l}),J.d(ge,"f",function(){return h}),J.d(ge,"h",function(){return o}),J.d(ge,"g",function(){return s}),J.d(ge,"i",function(){return A}),J.d(ge,"G",function(){return _}),J.d(ge,"H",function(){return S}),J.d(ge,"r",function(){return L}),J.d(ge,"R",function(){return O}),J.d(ge,"d",function(){return C}),J.d(ge,"e",function(){return w}),J.d(ge,"E",function(){return x}),J.d(ge,"F",function(){return p}),J.d(ge,"j",function(){return T}),J.d(ge,"z",function(){return v}),J.d(ge,"K",function(){return N}),J.d(ge,"L",function(){return B}),J.d(ge,"m",function(){return j}),J.d(ge,"k",function(){return b}),J.d(ge,"A",function(){return ee}),J.d(ge,"a",function(){return ae}),J.d(ge,"n",function(){return le}),J.d(ge,"l",function(){return Re}),J.d(ge,"D",function(){return Ee}),J.d(ge,"B",function(){return Te}),J.d(ge,"b",function(){return Ae}),J.d(ge,"S",function(){return Oe}),J.d(ge,"o",function(){return ce}),J.d(ge,"P",function(){return ue}),J.d(ge,"w",function(){return Pe}),J.d(ge,"c",function(){return qe}),J.d(ge,"y",function(){return nt});function ie(se){return!se||typeof se!="string"?!0:se.trim().length===0}const $=/{(\d+)}/g;function M(se,...be){return be.length===0?se:se.replace($,function(xe,Se){const Be=parseInt(Se,10);return isNaN(Be)||Be<0||Be>=be.length?xe:be[Be]})}function Y(se){return se.replace(/[<>&]/g,function(be){switch(be){case"<":return"<";case">":return">";case"&":return"&";default:return be}})}function F(se){return se.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function U(se,be=" "){const xe=G(se,be);return W(xe,be)}function G(se,be){if(!se||!be)return se;const xe=be.length;if(xe===0||se.length===0)return se;let Se=0;for(;se.indexOf(be,Se)===Se;)Se=Se+xe;return se.substring(Se)}function W(se,be){if(!se||!be)return se;const xe=be.length,Se=se.length;if(xe===0||Se===0)return se;let Be=Se,He=-1;for(;!(He=se.lastIndexOf(be,Be-1),He===-1||He+xe!==Be);){if(He===0)return"";Be=He}return se.substring(0,Be)}function i(se){return se.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function D(se){return se.replace(/\*/g,"")}function g(se,be,xe={}){if(!se)throw new Error("Cannot create regex from empty string");be||(se=F(se)),xe.wholeWord&&(/\B/.test(se.charAt(0))||(se="\\b"+se),/\B/.test(se.charAt(se.length-1))||(se=se+"\\b"));let Se="";return xe.global&&(Se+="g"),xe.matchCase||(Se+="i"),xe.multiline&&(Se+="m"),xe.unicode&&(Se+="u"),new RegExp(se,Se)}function d(se){if(se.source==="^"||se.source==="^$"||se.source==="$"||se.source==="^\\s*$")return!1;const be=se.exec("");return!!(be&&se.lastIndex===0)}function m(se){return(se.global?"g":"")+(se.ignoreCase?"i":"")+(se.multiline?"m":"")+(se.unicode?"u":"")}function u(se){return se.split(/\r\n|\r|\n/)}function a(se){for(let be=0,xe=se.length;be<xe;be++){const Se=se.charCodeAt(be);if(Se!==32&&Se!==9)return be}return-1}function f(se,be=0,xe=se.length){for(let Se=be;Se<xe;Se++){const Be=se.charCodeAt(Se);if(Be!==32&&Be!==9)return se.substring(be,Se)}return se.substring(be,xe)}function l(se,be=se.length-1){for(let xe=be;xe>=0;xe--){const Se=se.charCodeAt(xe);if(Se!==32&&Se!==9)return xe}return-1}function h(se,be){return se<be?-1:se>be?1:0}function o(se,be,xe=0,Se=se.length,Be=0,He=be.length){for(;xe<Se&&Be<He;xe++,Be++){let lt=se.charCodeAt(xe),$e=be.charCodeAt(Be);if(lt<$e)return-1;if(lt>$e)return 1}const Xe=Se-xe,Ve=He-Be;return Xe<Ve?-1:Xe>Ve?1:0}function s(se,be){return A(se,be,0,se.length,0,be.length)}function A(se,be,xe=0,Se=se.length,Be=0,He=be.length){for(;xe<Se&&Be<He;xe++,Be++){let lt=se.charCodeAt(xe),$e=be.charCodeAt(Be);if(lt===$e)continue;if(lt>=128||$e>=128)return o(se.toLowerCase(),be.toLowerCase(),xe,Se,Be,He);_(lt)&&(lt-=32),_($e)&&($e-=32);const Qe=lt-$e;if(Qe===0)continue;return Qe}const Xe=Se-xe,Ve=He-Be;return Xe<Ve?-1:Xe>Ve?1:0}function _(se){return se>=97&&se<=122}function S(se){return se>=65&&se<=90}function L(se,be){return se.length===be.length&&A(se,be)===0}function O(se,be){const xe=be.length;return be.length>se.length?!1:A(se,be,0,xe)===0}function C(se,be){let xe,Se=Math.min(se.length,be.length);for(xe=0;xe<Se;xe++)if(se.charCodeAt(xe)!==be.charCodeAt(xe))return xe;return Se}function w(se,be){let xe,Se=Math.min(se.length,be.length);const Be=se.length-1,He=be.length-1;for(xe=0;xe<Se;xe++)if(se.charCodeAt(Be-xe)!==be.charCodeAt(He-xe))return xe;return Se}function x(se){return 55296<=se&&se<=56319}function p(se){return 56320<=se&&se<=57343}function T(se,be){return(se-55296<<10)+(be-56320)+65536}function v(se,be,xe){const Se=se.charCodeAt(xe);if(x(Se)&&xe+1<be){const Be=se.charCodeAt(xe+1);if(p(Be))return T(Se,Be)}return Se}function y(se,be){const xe=se.charCodeAt(be-1);if(p(xe)&&be>1){const Se=se.charCodeAt(be-2);if(x(Se))return T(Se,xe)}return xe}function N(se,be){const xe=ze.getInstance(),Se=be,Be=se.length,He=v(se,Be,be);be+=He>=65536?2:1;let Xe=xe.getGraphemeBreakType(He);for(;be<Be;){const Ve=v(se,Be,be),lt=xe.getGraphemeBreakType(Ve);if(qe(Xe,lt))break;be+=Ve>=65536?2:1,Xe=lt}return be-Se}function B(se,be){const xe=ze.getInstance(),Se=be,Be=y(se,be);be-=Be>=65536?2:1;let He=xe.getGraphemeBreakType(Be);for(;be>0;){const Xe=y(se,be),Ve=xe.getGraphemeBreakType(Xe);if(qe(Ve,He))break;be-=Xe>=65536?2:1,He=Ve}return Se-be}const R=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function j(se){return R.test(se)}const P=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function b(se){return P.test(se)}const X=/^[\t\n\r\x20-\x7E]*$/;function ee(se){return X.test(se)}const ae=/[\u2028\u2029]/;function le(se){return ae.test(se)}function Re(se){for(let be=0,xe=se.length;be<xe;be++)if(Ee(se.charCodeAt(be)))return!0;return!1}function Ee(se){return se=+se,se>=11904&&se<=55215||se>=63744&&se<=64255||se>=65281&&se<=65374}function Te(se){return se>=127462&&se<=127487||se===8986||se===8987||se===9200||se===9203||se>=9728&&se<=10175||se===11088||se===11093||se>=127744&&se<=128591||se>=128640&&se<=128764||se>=128992&&se<=129003||se>=129280&&se<=129535||se>=129648&&se<=129750}const Ae=String.fromCharCode(65279);function Oe(se){return!!(se&&se.length>0&&se.charCodeAt(0)===65279)}function ce(se,be=!1){return se?(be&&(se=se.replace(/\\./g,"")),se.toLowerCase()!==se):!1}function ue(se){const be=90-65+1;return se=se%(2*be),se<be?String.fromCharCode(97+se):String.fromCharCode(65+se-be)}function Pe(se){const be=ze.getInstance();return be.getGraphemeBreakType(se)}function qe(se,be){return se===0?be!==5&&be!==7:se===2&&be===3?!1:se===4||se===2||se===3||(be===4||be===2||be===3)?!0:se===8&&(be===8||be===9||be===11||be===12)||((se===11||se===9)&&(be===9||be===10)||((se===12||se===10)&&be===10||(be===5||be===13||(be===7||(se===1||se===13&&be===14)))))?!1:!(se===6&&be===6)}class ze{constructor(){this._data=et()}static getInstance(){return ze._INSTANCE||(ze._INSTANCE=new ze),ze._INSTANCE}getGraphemeBreakType(se){if(se<32)return se===10?3:se===13?2:4;if(se<127)return 0;const be=this._data,xe=be.length/3;let Se=1;for(;Se<=xe;)if(se<be[3*Se])Se=2*Se;else if(se>be[3*Se+1])Se=2*Se+1;else return be[3*Se+2];return 0}}ze._INSTANCE=null;function et(){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 nt(se,be){if(se===0)return 0;const xe=Ie(se,be);if(xe!==void 0)return xe;const Se=y(be,se);return se-=Me(Se),se}function Ie(se,be){let xe=y(be,se);for(se-=Me(xe);Ge(xe)||xe===65039||xe===8419;){if(se===0)return;xe=y(be,se),se-=Me(xe)}if(!Te(xe))return;if(se>=0){const Se=y(be,se);Se===8205&&(se-=Me(Se))}return se}function Me(se){return se>=65536?2:1}function Ge(se){return 127995<=se&&se<=127999}},Ot1p:function(at,ge,J){"use strict";var ie=J("2qtc"),$=J("kLXV"),M=J("rAM+"),Y=J("miYZ"),F=J("tsqr"),U=J("9og8"),G=J("tJVT"),W=J("jrin"),i=J("WmNS"),D=J.n(i),g=J("q1tI"),d=J.n(g),m=J("VrN/"),u=J.n(m),a=J("bdgK"),f=J("p77/"),l=J("Bd2K"),h=J("ELLl"),o=J("19Vz"),s=J("lZu9"),A=J("+NIl"),_=J("kSUc"),S=J("9Bee"),L=function(ye){var Le=ye.value,Ue=Le===void 0?"":Le,Je=ye.className,dt=ye.showTextOnly,rt=ye.showLines,mt=ye.style,yt=mt===void 0?{}:mt,tt=Object(g.useMemo)(function(){return""},[Ue]);return d.a.createElement(d.a.Fragment,null,d.a.createElement("div",{dangerouslySetInnerHTML:{__html:tt}}))},O=J("0Owb"),C=J("dejd"),w=J("C+DQ"),x=J("1vsH"),p=J("m3rI"),T=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function v(ye){var Le=ye.onActionCallback,Ue=ye.title,Je=ye.icon,dt=ye.actionName,rt=ye.className,mt=rt===void 0?"":rt,yt=ye.children;function tt(){Le(dt)}return d.a.createElement("a",{title:Ue,className:mt,onClick:tt},d.a.createElement("i",{className:"md-iconfont ".concat(Je)}),yt)}var y=function(ye){var Le=ye.watch,Ue=ye.showNullButton,Je=ye.onActionCallback,dt=ye.fullScreen,rt=ye.insertTemp,mt=ye.hidetoolBar,yt=ye.uuid,tt=ye.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(x.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(x.G)("_educoder_session"),"&key=").concat(yt,"&api=").concat(encodeURIComponent(p.a.PROXY_SERVER)));var Ut=[].concat(T,[{title:"".concat(Le?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Le?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return d.a.createElement("ul",{className:"markdown-toolbar-container"},!mt&&Ut.map(function(Ct,Jt){return d.a.createElement("li",{key:Jt},Ct.actionName?d.a.createElement(v,Object(O.a)({},Ct,{onActionCallback:Je})):d.a.createElement("span",{className:"v-line"}))}),Ue?d.a.createElement("li",null,d.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Je},d.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,rt&&d.a.createElement("li",null,d.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(rt),onActionCallback:Je},d.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),d.a.createElement("li",{className:"btn-full-screen"},d.a.createElement(v,{icon:"".concat(dt?"icon-shrink":"icon-enlarge"),title:dt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Je})))},N=J("M8RZ"),B=J("+L6B"),R=J("2/Rp"),j=J("y8nQ"),P=J("Vl3Y"),b=J("5NDa"),X=J("5rEg"),ee={labelCol:{span:4},wrapperCol:{span:20}},ae=function(ye){var Le=ye.callback,Ue=ye.onCancel;function Je(dt){Le(dt)}return d.a.createElement(P.a,Object(O.a)({},ee,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Je}),d.a.createElement(P.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},d.a.createElement(X.a,null)),d.a.createElement(P.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},d.a.createElement(X.a,null)),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(R.a,{type:"ghost",onClick:Ue},"\u53D6\u6D88")))},le=J("7ahc"),Re=J("HmJG"),Ee=J("BjJ7"),Te=P.a.useForm,Ae={width:280,marginRight:10},Oe={labelCol:{span:5},wrapperCol:{span:19}},ce=function(ye){var Le=ye.callback,Ue=ye.onCancel,Je=Te(),dt=Object(G.a)(Je,1),rt=dt[0];function mt(Ut){Le(Ut)}function yt(Ut,Ct){if(Ut.status===-1){F.b.error(Ut.message);return}rt.setFieldsValue({src:"/api/attachments/".concat(Ut.id),type:Ct.type})}function tt(Ut){var Ct=Ut.target.files[0];Pe(Ct,yt)}return d.a.createElement(P.a,Object(O.a)({form:rt},Oe,{className:"upload-image-panel",onFinish:mt}),d.a.createElement(P.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},d.a.createElement("div",{className:"flex-container"},d.a.createElement(P.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},d.a.createElement(X.a,{style:Ae})),d.a.createElement(ue,{onFileChange:tt}))),d.a.createElement(P.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},d.a.createElement(X.a,{style:{width:264}})),d.a.createElement(P.a.Item,{style:{textAlign:"right"}},d.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(R.a,{type:"ghost",onClick:Ue},"\u53D6\u6D88")))};function ue(ye){var Le=ye.onFileChange;return d.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",d.a.createElement("input",{type:"file",onChange:Le}))}function Pe(ye,Le){if(!ye)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ue=new FormData;Ue.append("editormd-image-file",ye),Ue.append("file_param_name","editormd-image-file"),Ue.append("byxhr","true");var Je=new window.XMLHttpRequest;Je.withCredentials=!0,Je.addEventListener("load",function(dt){Le(JSON.parse(dt.target.responseText),ye)},!1),Je.addEventListener("error",function(dt){console.error(dt)},!1),Je.open("POST","".concat(Ee.a,"/api/attachments.json")),Je.send(Ue)}var qe=J("giR+"),ze=J("fyUT"),et=J("7Kak"),nt=J("9yH6"),Ie=nt.a.Group,Me={margin:"0 8px"},Ge=function(ye){var Le=ye.callback,Ue=ye.onCancel;function Je(dt){Le(dt)}return d.a.createElement(P.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Je},d.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},d.a.createElement("span",{style:Me},"\u5355\u5143\u683C\u6570\uFF1A"),d.a.createElement("span",{style:Me},"\u884C\u6570"),d.a.createElement(P.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},d.a.createElement(ze.a,null)),d.a.createElement("span",{style:Me},"\u5217\u6570"),d.a.createElement(P.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},d.a.createElement(ze.a,null))),d.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},d.a.createElement("span",{style:Me},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),d.a.createElement(P.a.Item,{name:"align"},d.a.createElement(Ie,null,d.a.createElement(nt.a,{value:"default"},d.a.createElement("i",{className:"fa fa-align-justify"})),d.a.createElement(nt.a,{value:"left"},d.a.createElement("i",{className:"fa fa-align-left"})),d.a.createElement(nt.a,{value:"center"},d.a.createElement("i",{className:"fa fa-align-center"})),d.a.createElement(nt.a,{value:"right"},d.a.createElement("i",{className:"fa fa-align-right"}))))),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(R.a,{type:"ghost",onClick:Ue},"\u53D6\u6D88")))},se=J("ErOA"),be=J("7Cbv"),xe="link",Se="upload-image",Be="code-block",He="add-table",Xe="------------",Ve={default:Xe,left:":".concat(Xe),center:":".concat(Xe,":"),right:"".concat(Xe,":")},lt=J("9VGf"),$e,Qe;function De(){}var ct=0,ut=1e4,ke="\u2581",Ne=`
|
|
**\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 _e(ye){return/^\d+$/.test(ye)?"".concat(ye,"px"):ye}var fe=navigator.platform.toUpperCase().indexOf("MAC")>=0,ve=fe?"Cmd":"Ctrl",ne=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],re=($e={},Object(W.a)($e,ve+"-B","bold"),Object(W.a)($e,ve+"-I","italic"),$e),oe=(Qe={},Object(W.a)(Qe,xe,"\u6DFB\u52A0\u94FE\u63A5"),Object(W.a)(Qe,Be,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(W.a)(Qe,Se,"\u6DFB\u52A0\u6587\u4EF6"),Object(W.a)(Qe,He,"\u6DFB\u52A0\u8868\u683C"),Qe),de=ge.a=function(ye){var Le=ye.defaultValue,Ue=Le===void 0?"":Le,Je=ye.onChange,dt=ye.width,rt=dt===void 0?"100%":dt,mt=ye.height,yt=mt===void 0?400:mt,tt=ye.miniToolbar,Ut=tt===void 0?!1:tt,Ct=ye.isFocus,Jt=Ct===void 0?!1:Ct,ei=ye.watch,Dt=ye.insertTemp,ci=ye.mode,Di=ci===void 0?"markdown":ci,bt=ye.id,fi=bt===void 0?"markdown-editor-id":bt,_t=ye.showResizeBar,wt=_t===void 0?!1:_t,Bt=ye.noStorage,Lt=Bt===void 0?!1:Bt,Mt=ye.showNullButton,Et=Mt===void 0?!1:Mt,ht=ye.hidetoolBar,_i=ht===void 0?!1:ht,Ht=ye.fullScreen,zt=Ht===void 0?!1:Ht,It=ye.onBlur,ui=ye.onCMBeforeChange,ki=ye.onFullScreen,Xi=ye.className,Ye=Xi===void 0?"":Xi,Rt=ye.disablePaste,mn=Rt===void 0?!1:Rt,gn=ye.placeholder,vn=gn===void 0?"":gn,yn=ye.values,V=yn===void 0?"":yn,E=Object(g.useState)(null),I=Object(G.a)(E,2),H=I[0],q=I[1],z=Object(g.useState)(Ue),me=Object(G.a)(z,2),je=me[0],it=me[1],gt=Object(g.useState)(ei),We=Object(G.a)(gt,2),Tt=We[0],Gt=We[1],qt=Object(g.useState)(zt),Hi=Object(G.a)(qt,2),wi=Hi[0],Si=Hi[1],Qi=Object(g.useState)(""),Dn=Object(G.a)(Qi,2),pi=Dn[0],zi=Dn[1],un=Object(g.useState)(0),hn=Object(G.a)(un,2),Wi=hn[0],kn=hn[1],bn=Object(g.useState)(yt),zn=Object(G.a)(bn,2),Vn=zn[0],Zi=zn[1],$i=Object(g.useState)(!1),_n=Object(G.a)($i,2),dr=_n[0],En=_n[1],ri=Object(g.useRef)(Object(be.a)()),Kt=Object(g.useRef)(!1),Ei=Object(g.useRef)(),Nt=Object(g.useRef)(),si=Object(g.useRef)(),Xt=Object(g.useRef)(),rn=Object(g.useRef)(),mi=function(){var vt=Object(U.a)(D.a.mark(function Ot(){var St,Pt;return D.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:return Qt.next=2,Object(se.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:ri.current}});case 2:Pt=Qt.sent,Pt!=null&&(St=Pt.attachments)!==null&&St!==void 0&&St.length&&(console.log("cm:",H,Nt),Pt.attachments.map(function(jt){jt.content_type.indexOf("image")>-1?H.replaceSelection(".concat(jt.content_type,")")):jt.content_type.indexOf("video")>-1?H.replaceSelection('<video width="100%" controls src="'.concat(p.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):jt.content_type.indexOf("pdf")>-1?H.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(jt.id,"?type=").concat(jt.content_type,'&disposition=inline" target="_blank">').concat(jt.name,"</a>")):H.replaceSelection("[".concat(jt.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(jt.id,"?type=").concat(jt.content_type,")"))}));case 4:case"end":return Qt.stop()}},Ot)}));return function(){return vt.apply(this,arguments)}}();Object(g.useEffect)(function(){it(V),H==null||H.setValue(V)},[V]),Object(g.useEffect)(function(){ki==null||ki(wi)},[wi]),Object(g.useEffect)(function(){if(Nt.current){var vt=u.a.fromTextArea(Nt.current,{mode:Di,lineNumbers:!Ut,lineWrapping:!0,value:Ue,autoCloseTags:!0,autoCloseBrackets:!0});Jt&&vt.focus();function Ot(St,Pt){if(mn){Pt.preventDefault();return}var Wt=Pt.clipboardData;if(Wt){var Qt=Wt.types.toString(),jt=Wt.items;if(Qt==="Files"||Wt.types.indexOf("Files")>-1){if(Pt.preventDefault(),Di=="stex")return;try{var hi,Mi=jt[1];((hi=jt[0])===null||hi===void 0?void 0:hi.kind)==="file"&&(Mi=jt[0]);var Ft=Mi.getAsFile(),dn=Ft.name.split(".").pop();Pe(Ft,function(Vt){if(Vt.id){var Pi,Ci,Ji;(Ft==null||((Pi=Ft.type)===null||Pi===void 0)?void 0:Pi.indexOf("image"))>-1?vt.replaceSelection(".concat(Vt.content_type,")")):(Ft==null||((Ci=Ft.type)===null||Ci===void 0)?void 0:Ci.indexOf("video"))>-1?vt.replaceSelection('<video width="100%" controls src="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Vt.id,'"></video>')):(Ft==null||((Ji=Ft.type)===null||Ji===void 0)?void 0:Ji.indexOf("pdf"))>-1?vt.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Ft.type,'&disposition=inline" target="_blank">').concat(Ft.name,"</a>")):ne.includes(dn)?vt.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Vt.id,'?type=office&disposition=inline" target="_blank">').concat(Ft.name,"</a>")):vt.replaceSelection("[".concat(Ft.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Vt.content_type,")"))}else(Vt==null?void 0:Vt.status)===401&&(document.location.href="/user/login")})}catch(Vt){F.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return vt.on("paste",Ot),vt.on("dragleave",function(St,Pt){si.current.classList.remove("mouse-hover-md")}),vt.on("dragover",function(St,Pt){si.current.classList.add("mouse-hover-md")}),vt.on("drop",function(St,Pt){si.current.classList.add("mouse-hover-md");var Wt;if(Wt=Pt.dataTransfer.files,Wt.length>0){Pt.preventDefault(),Pt.stopPropagation();for(var Qt=function(Mi){var Ft=Wt[Mi],dn=Ft.name.split(".").pop();Pe(Ft,function(Vt){if(Vt.id){var Pi,Ci,Ji;(Ft==null||((Pi=Ft.type)===null||Pi===void 0)?void 0:Pi.indexOf("image"))>-1?vt.replaceSelection(".concat(Vt.content_type,")")):(Ft==null||((Ci=Ft.type)===null||Ci===void 0)?void 0:Ci.indexOf("video"))>-1?vt.replaceSelection('<video width="100%" controls src="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Vt.id,'"></video>')):(Ft==null||((Ji=Ft.type)===null||Ji===void 0)?void 0:Ji.indexOf("pdf"))>-1?vt.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Ft.type,'&disposition=inline" target="_blank">').concat(Ft.name,"</a>")):ne.includes(dn)?vt.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Vt.id,'?type=office&disposition=inline" target="_blank">').concat(Ft.name,"</a>")):vt.replaceSelection("[".concat(Ft.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Vt.content_type,")"))}else(Vt==null?void 0:Vt.status)===401&&(document.location.href="/user/login")})},jt=0;jt<Wt.length;jt++)Qt(jt)}}),q(vt),function(){vt.off("paste",Ot)}}},[]);var Oi=Object(g.useCallback)(function(){if(si.current)try{}catch(vt){console.log(vt,"---- to set md editor body height")}},[Vn,si,wi]);Object(g.useEffect)(function(){function vt(){var St=new a.default(function(Pt){var Wt=Object(M.a)(Pt),Qt;try{for(Wt.s();!(Qt=Wt.n()).done;){var jt=Qt.value;(jt.target.offsetHeight>0||jt.target.offsetWidth>0)&&(Oi(),H.setSize("100%","100%"),H.refresh())}}catch(hi){Wt.e(hi)}finally{Wt.f()}});return St.observe(Nt.current.parentElement),St}if(H){var Ot=vt();return function(){Ot.unobserve(Nt.current.parentElement)}}},[H,Oi]),Object(g.useEffect)(function(){if(H){for(var vt=[],Ot=function(){var jt=Pt[St];Wt=Object(G.a)(jt,2);var hi=Wt[0],Mi=Wt[1],Ft=Object(W.a)({},hi,function(){Yn(Mi)});vt.push(Ft),H.addKeyMap(Ft)},St=0,Pt=Object.entries(re);St<Pt.length;St++){var Wt;Ot()}return Ei.current=setInterval(function(){Kt.current&&mi()},4e3),function(){clearInterval(Ei.current);var Qt=Object(M.a)(vt),jt;try{for(Qt.s();!(jt=Qt.n()).done;){var hi=jt.value;H.removeKeyMap(hi)}}catch(Mi){Qt.e(Mi)}finally{Qt.f()}}}},[H]),Object(g.useEffect)(function(){zt!==wi&&Si(zt)},[zt]),Object(lt.a)(function(){if(!Lt&&Wi>0){var vt=new Date().getTime(),Ot=window.sessionStorage.getItem(fi);vt>=Wi+ut&&(!Ot||Ot!==je)&&(window.sessionStorage.setItem(fi,je),En(!0))}},ut),Object(g.useEffect)(function(){Gt(ei)},[H,ei]),Object(g.useEffect)(function(){H&&(Jt&&H.focus())},[H,Jt]),Object(g.useEffect)(function(){if(Tt&&H){var vt=H.getScrollerElement();function Ot(St){var Pt=St.target;if(rn.current){var Wt=Pt.scrollTop/Pt.scrollHeight;rn.current.scrollTop=rn.current.scrollHeight*Wt}}return vt.addEventListener("scroll",Ot),function(){vt.removeEventListener("scroll",Ot)}}},[H,Tt]),Object(g.useEffect)(function(){if(H&&ui){function vt(Ot,St){ui(Ot,St)}return H.on("beforeChange",vt),function(){H.off("beforeChange",vt)}}},[H,ui]),Object(g.useEffect)(function(){if(H&&It){function vt(){It(H.getValue())}return H.on("blur",vt),function(){H.off("blur",vt)}}},[H,It]),Object(g.useEffect)(function(){if(H){function vt(Ot){var St=Ot.getValue();it(St),kn(new Date().getTime()),Ot.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Je&&Je(St)}return H.on("change",vt),function(){H.off("change",vt)}}},[H,Je]),Object(g.useEffect)(function(){H&&(Ue==null?(H.setValue(""),it("")):Ue!==H.getValue()&&(H.setValue(Ue),it(Ue),H.setCursor(H.lineCount(),0)))},[H,Ue]);var Yn=Object(g.useCallback)(function(vt){var Ot=H.getCursor(),St=H.getSelection(),Pt=St.split(`
|
|
`);switch(vt){case"bold":return H.replaceSelection("**"+St+"**"),St===""&&H.setCursor(Ot.line,Ot.ch+2),H.focus();case"italic":return H.replaceSelection("*"+St+"*"),St===""&&H.setCursor(Ot.line,Ot.ch+1),H.focus();case"code":return H.replaceSelection("`"+St+"`"),St===""&&H.setCursor(Ot.line,Ot.ch+1),H.focus();case"inline-latex":return H.replaceSelection("`$$"+St+"$$`"),St===""&&H.setCursor(Ot.line,Ot.ch+3),H.focus();case"latex":return H.replaceSelection("```latex\n"+St+"\n```"),H.setCursor(Ot.line+1,St.length+1),H.focus();case"line-break":return H.replaceSelection(`<br/>
|
|
`),H.focus();case"list-ul":return St===""?H.replaceSelection("- "+St):H.replaceSelection(Pt.map(function(Wt){return Wt===""?"":"- ".concat(Wt)}).join(`
|
|
`)),H.focus();case"list-ol":return St===""?H.replaceSelection("1. "+St):H.replaceSelection(Pt.map(function(Wt,Qt){return Wt===""?"":"".concat(Qt+1,". ").concat(Wt)}).join(`
|
|
`)),H.focus();case"add-null-ch":return St===""&&H.setCursor(Ot.line,Ot.ch+1),H.replaceSelection(ke),H.focus();case"inster-template-1":return St===""&&H.setCursor(Ot.line,Ot.ch),H.replaceSelection(Ne),H.focus();case"eraser":return H.setValue(""),H.focus();case"trigger-watch":return Gt(!Tt),H.focus();case"trigger-full-screen":return Si(!wi),H.focus();case xe:zi(xe);return;case Be:zi(Be);return;case Se:zi(Se);return;case He:zi(He);return;default:throw new Error}},[H,Tt,wi]),xn=Object(g.useCallback)(function(vt){zi("");switch(pi){case xe:var Ot=vt.title,St=vt.link;return H.replaceSelection("[".concat(Ot,"](").concat(St,")")),H.focus();case Be:var Pt=vt.language,Wt=vt.content;return H.replaceSelection(["```"+Pt,Wt,"```"].join(`
|
|
`)),H.focus();case Se:var Qt=vt.src,jt=vt.alt;return jt?H.replaceSelection(".concat(Qt,' "').concat(jt,'" )')):H.replaceSelection("")),H.focus();case He:for(var hi=vt.row,Mi=vt.col,Ft=vt.align,dn=`
|
|
`,Vt=0;Vt<hi;Vt++){for(var Pi=[],Ci=[],Ji=0;Ji<Mi;Ji++)Vt===1&&Ci.push(Ve[Ft]),Pi.push(" ");Vt===1&&(dn+="| ".concat(Ci.join(" | "),` |
|
|
`)),dn+="| ".concat(Pi.join(Mi===1?"":" | "),` |
|
|
`)}return H.replaceSelection(dn+`
|
|
`),H.focus();default:throw new Error}},[H,pi]),cr=Object(g.useMemo)(function(){switch(pi){case xe:return d.a.createElement(ae,{callback:xn,onCancel:Tn});case Be:return d.a.createElement(le.b,{callback:xn,onCancel:Tn});case Se:return d.a.createElement(ce,{callback:xn,onCancel:Tn});case He:return d.a.createElement(Ge,{callback:xn,onCancel:Tn});default:return null}},[pi]);function Tn(){zi("")}Object(g.useEffect)(function(){if(Xt.current){var vt=Xt.current,Ot=!1,St=0;function Pt(jt){Ot=!0,St=jt.pageY}function Wt(){Ot=!1}function Qt(jt){if(Ot){var hi=jt.pageY-St;hi<0&&(hi=0),hi>300&&(hi=300);var Mi=yt+hi+"px";Zi(Mi)}}return vt.addEventListener("mousedown",Pt),document.addEventListener("mousemove",Qt),document.addEventListener("mouseup",Wt),function(){vt.removeEventListener("mousedown",Pt),document.removeEventListener("mousemove",Qt),document.removeEventListener("mouseup",Wt)}}},[H,Xt]),Object(g.useEffect)(function(){Zi(yt)},[yt]);var an=_e(rt),fr=_e(Vn),qi={width:an,height:fr},pr=Object(g.useMemo)(function(){if(Wi){var vt=new Date(Wi),Ot=vt.getHours(),St=vt.getMinutes(),Pt=vt.getSeconds();return Ot=Ot<10?"0"+Ot:Ot,St=St<10?"0"+St:St,Pt=Pt<10?"0"+Pt:Pt,"".concat(Ot,":").concat(St,":").concat(Pt)}return 0},[Wi]);function jr(){window.sessionStorage.removeItem(fi),En(!1),kn(0)}function Mn(){En(!1),kn(0),H.setValue(window.sessionStorage.getItem(fi))}function ua(vt,Ot){var St=H.getValue();St=St.replace(vt,Ot),it(St),H==null||H.setValue(St)}return d.a.createElement(g.Fragment,null,d.a.createElement("div",{className:"markdown-editor-wrapper",ref:si},d.a.createElement("div",{className:"markdown-editor-container ".concat(Ye," ").concat(Tt?"on-preview":""," ").concat(Ut?"mini":""," ").concat(wi?"full-screen":""),style:qi},d.a.createElement(y,{insertTemp:Dt,watch:Tt,fullScreen:wi,showNullButton:Et,onActionCallback:Yn,hidetoolBar:_i,uuid:ri.current,setOpenPhones:function(){Kt.current=!0}}),d.a.createElement("div",{className:"markdown-editor-body"},d.a.createElement("div",{className:"codemirror-container"},d.a.createElement("textarea",{ref:Nt,placeholder:vn})),Tt?d.a.createElement("div",{ref:rn,className:"preview-container"},Di==="stex"&&d.a.createElement(L,{value:je}),Di!=="stex"&&d.a.createElement(S.a,{edit:!0,value:je,replaces:ua})):null))),wt?d.a.createElement("a",{ref:Xt,className:"editor-resize"}):null,d.a.createElement(N.a,null,oe[pi]?d.a.createElement($.a,{centered:!0,title:oe[pi],visible:!0,onCancel:Tn,footer:null,className:"markdown-popup-form"},cr):null))}},RotF:function(at,ge,J){at.exports=J("LSTS")},SJMd:function(at,ge){/**
|
|
* @license
|
|
* Copyright (C) 2006 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var J,ie,$,M=!1,Y,F;window.PR_SHOULD_USE_CONTINUATION=!0;var U,G;(function(){var W=window,i=["break,continue,do,else,for,if,return,while"],D=[i,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],g=[D,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],d=[g,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],m=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],u=[g,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],a="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=[g,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],l="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",h=[i,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],o=[i,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],s=[i,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],A=[d,u,m,f,l,h,o,s],_=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,S="str",L="kwd",O="com",C="typ",w="lit",x="pun",p="pln",T="tag",v="dec",y="src",N="atn",B="atv",R="nocode",j="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function P(Ie){for(var Me=0,Ge=!1,se=!1,be=0,xe=Ie.length;be<xe;++be){var Se=Ie[be];if(Se.ignoreCase)se=!0;else if(/[a-z]/i.test(Se.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ge=!0,se=!1;break}}var Be={b:8,t:9,n:10,v:11,f:12,r:13};function He(Qe){var De=Qe.charCodeAt(0);if(De!==92)return De;var ct=Qe.charAt(1);return De=Be[ct],De||("0"<=ct&&ct<="7"?parseInt(Qe.substring(1),8):ct==="u"||ct==="x"?parseInt(Qe.substring(2),16):Qe.charCodeAt(1))}function Xe(Qe){if(Qe<32)return(Qe<16?"\\x0":"\\x")+Qe.toString(16);var De=String.fromCharCode(Qe);return De==="\\"||De==="-"||De==="]"||De==="^"?"\\"+De:De}function Ve(Qe){var De=Qe.substring(1,Qe.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")),ct=[],ut=De[0]==="^",ke=["["];ut&&ke.push("^");for(var Ne=ut?1:0,_e=De.length;Ne<_e;++Ne){var fe=De[Ne];if(/\\[bdsw]/i.test(fe))ke.push(fe);else{var ve=He(fe),ne;Ne+2<_e&&De[Ne+1]==="-"?(ne=He(De[Ne+2]),Ne+=2):ne=ve,ct.push([ve,ne]),ne<65||ve>122||(ne<65||ve>90||ct.push([Math.max(65,ve)|32,Math.min(ne,90)|32]),ne<97||ve>122||ct.push([Math.max(97,ve)&~32,Math.min(ne,122)&~32]))}}ct.sort(function(ye,Le){return ye[0]-Le[0]||Le[1]-ye[1]});for(var re=[],oe=[],Ne=0;Ne<ct.length;++Ne){var de=ct[Ne];de[0]<=oe[1]+1?oe[1]=Math.max(oe[1],de[1]):re.push(oe=de)}for(var Ne=0;Ne<re.length;++Ne){var de=re[Ne];ke.push(Xe(de[0])),de[1]>de[0]&&(de[1]+1>de[0]&&ke.push("-"),ke.push(Xe(de[1])))}return ke.push("]"),ke.join("")}function lt(Qe){for(var De=Qe.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")),ct=De.length,ut=[],ke=0,Ne=0;ke<ct;++ke){var _e=De[ke];if(_e==="(")++Ne;else if(_e.charAt(0)==="\\"){var fe=+_e.substring(1);fe&&(fe<=Ne?ut[fe]=-1:De[ke]=Xe(fe))}}for(var ke=1;ke<ut.length;++ke)ut[ke]===-1&&(ut[ke]=++Me);for(var ke=0,Ne=0;ke<ct;++ke){var _e=De[ke];if(_e==="(")++Ne,ut[Ne]||(De[ke]="(?:");else if(_e.charAt(0)==="\\"){var fe=+_e.substring(1);fe&&fe<=Ne&&(De[ke]="\\"+ut[fe])}}for(var ke=0;ke<ct;++ke)De[ke]==="^"&&De[ke+1]!=="^"&&(De[ke]="");if(Qe.ignoreCase&&Ge)for(var ke=0;ke<ct;++ke){var _e=De[ke],ve=_e.charAt(0);_e.length>=2&&ve==="["?De[ke]=Ve(_e):ve!=="\\"&&(De[ke]=_e.replace(/[a-zA-Z]/g,function(oe){var de=oe.charCodeAt(0);return"["+String.fromCharCode(de&~32,de|32)+"]"}))}return De.join("")}for(var $e=[],be=0,xe=Ie.length;be<xe;++be){var Se=Ie[be];if(Se.global||Se.multiline)throw new Error(""+Se);$e.push("(?:"+lt(Se)+")")}return new RegExp($e.join("|"),se?"gi":"g")}function b(Ie,Me){var Ge=/(?:^|\s)nocode(?:\s|$)/,se=[],be=0,xe=[],Se=0;function Be(He){var Xe=He.nodeType;if(Xe==1){if(Ge.test(He.className))return;for(var Ve=He.firstChild;Ve;Ve=Ve.nextSibling)Be(Ve);var lt=He.nodeName.toLowerCase();(lt==="br"||lt==="li")&&(se[Se]=`
|
|
`,xe[Se<<1]=be++,xe[Se++<<1|1]=He)}else if(Xe==3||Xe==4){var $e=He.nodeValue;$e.length&&(Me?$e=$e.replace(/\r\n?/g,`
|
|
`):$e=$e.replace(/[ \t\r\n]+/g," "),se[Se]=$e,xe[Se<<1]=be,be+=$e.length,xe[Se++<<1|1]=He)}}return Be(Ie),{sourceCode:se.join("").replace(/\n$/,""),spans:xe}}function X(Ie,Me,Ge,se,be){if(!Ge)return;var xe={sourceNode:Ie,pre:1,langExtension:null,numberLines:null,sourceCode:Ge,spans:null,basePos:Me,decorations:null};se(xe),be.push.apply(be,xe.decorations)}var ee=/\S/;function ae(Ie){for(var Me=void 0,Ge=Ie.firstChild;Ge;Ge=Ge.nextSibling){var se=Ge.nodeType;Me=se===1?Me?Ie:Ge:se===3&&ee.test(Ge.nodeValue)?Ie:Me}return Me===Ie?void 0:Me}function le(Ie,Me){var Ge={},se;(function(){for(var Se=Ie.concat(Me),Be=[],He={},Xe=0,Ve=Se.length;Xe<Ve;++Xe){var lt=Se[Xe],$e=lt[3];if($e)for(var Qe=$e.length;--Qe>=0;)Ge[$e.charAt(Qe)]=lt;var De=lt[1],ct=""+De;He.hasOwnProperty(ct)||(Be.push(De),He[ct]=null)}Be.push(/[\0-\uffff]/),se=P(Be)})();var be=Me.length,xe=function(Se){for(var Be=Se.sourceCode,He=Se.basePos,Xe=Se.sourceNode,Ve=[He,p],lt=0,$e=Be.match(se)||[],Qe={},De=0,ct=$e.length;De<ct;++De){var ut=$e[De],ke=Qe[ut],Ne=void 0,_e;if(typeof ke=="string")_e=!1;else{var fe=Ge[ut.charAt(0)];if(fe)Ne=ut.match(fe[1]),ke=fe[0];else{for(var ve=0;ve<be;++ve)if(fe=Me[ve],Ne=ut.match(fe[1]),Ne){ke=fe[0];break}Ne||(ke=p)}_e=ke.length>=5&&ke.substring(0,5)==="lang-",_e&&!(Ne&&typeof Ne[1]=="string")&&(_e=!1,ke=y),_e||(Qe[ut]=ke)}var ne=lt;if(lt+=ut.length,!_e)Ve.push(He+ne,ke);else{var re=Ne[1],oe=ut.indexOf(re),de=oe+re.length;Ne[2]&&(de=ut.length-Ne[2].length,oe=de-re.length);var ye=ke.substring(5);X(Xe,He+ne,ut.substring(0,oe),xe,Ve),X(Xe,He+ne+oe,re,ue(ye,re),Ve),X(Xe,He+ne+de,ut.substring(de),xe,Ve)}}Se.decorations=Ve};return xe}function Re(Ie){var Me=[],Ge=[];Ie.tripleQuotedStrings?Me.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ie.multiLineStrings?Me.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Me.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ie.verbatimStrings&&Ge.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var se=Ie.hashComments;se&&(Ie.cStyleComments?(se>1?Me.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Me.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ge.push([S,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Me.push([O,/^#[^\r\n]*/,null,"#"])),Ie.cStyleComments&&(Ge.push([O,/^\/\/[^\r\n]*/,null]),Ge.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var be=Ie.regexLiterals;if(be){var xe=be>1?"":`
|
|
\r`,Se=xe?".":"[\\S\\s]",Be="/(?=[^/*"+xe+"])(?:[^/\\x5B\\x5C"+xe+"]|\\x5C"+Se+"|\\x5B(?:[^\\x5C\\x5D"+xe+"]|\\x5C"+Se+")*(?:\\x5D|$))+/";Ge.push(["lang-regex",RegExp("^"+j+"("+Be+")")])}var He=Ie.types;He&&Ge.push([C,He]);var Xe=(""+Ie.keywords).replace(/^ | $/g,"");Xe.length&&Ge.push([L,new RegExp("^(?:"+Xe.replace(/[\s,]+/g,"|")+")\\b"),null]),Me.push([p,/^\s+/,null,` \r
|
|
\xA0`]);var Ve="^.[^\\s\\w.$@'\"`/\\\\]*";return Ie.regexLiterals&&(Ve+="(?!s*/)"),Ge.push([w,/^@[a-z_$][a-z_$@0-9]*/i,null],[C,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[p,/^[a-z_$][a-z_$@0-9]*/i,null],[w,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[p,/^\\[\s\S]?/,null],[x,new RegExp(Ve),null]),le(Me,Ge)}var Ee=Re({keywords:A,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Te(Ie,Me,Ge){for(var se=/(?:^|\s)nocode(?:\s|$)/,be=/\r\n?|\n/,xe=Ie.ownerDocument,Se=xe.createElement("li");Ie.firstChild;)Se.appendChild(Ie.firstChild);var Be=[Se];function He(De){var ct=De.nodeType;if(ct==1&&!se.test(De.className))if(De.nodeName==="br")Xe(De),De.parentNode&&De.parentNode.removeChild(De);else for(var ut=De.firstChild;ut;ut=ut.nextSibling)He(ut);else if((ct==3||ct==4)&&Ge){var ke=De.nodeValue,Ne=ke.match(be);if(Ne){var _e=ke.substring(0,Ne.index);De.nodeValue=_e;var fe=ke.substring(Ne.index+Ne[0].length);if(fe){var ve=De.parentNode;ve.insertBefore(xe.createTextNode(fe),De.nextSibling)}Xe(De),_e||De.parentNode.removeChild(De)}}}function Xe(De){for(;!De.nextSibling;)if(De=De.parentNode,!De)return;function ct(Ne,_e){var fe=_e?Ne.cloneNode(!1):Ne,ve=Ne.parentNode;if(ve){var ne=ct(ve,1),re=Ne.nextSibling;ne.appendChild(fe);for(var oe=re;oe;oe=re)re=oe.nextSibling,ne.appendChild(oe)}return fe}for(var ut=ct(De.nextSibling,0),ke;(ke=ut.parentNode)&&ke.nodeType===1;)ut=ke;Be.push(ut)}for(var Ve=0;Ve<Be.length;++Ve)He(Be[Ve]);Me===(Me|0)&&Be[0].setAttribute("value",Me);var lt=xe.createElement("ol");lt.className="linenums";for(var $e=Math.max(0,Me-1|0)||0,Ve=0,Qe=Be.length;Ve<Qe;++Ve)Se=Be[Ve],Se.className="L"+(Ve+$e)%10,Se.firstChild||Se.appendChild(xe.createTextNode("\xA0")),lt.appendChild(Se);Ie.appendChild(lt)}function Ae(Ie){var Me=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Me=Me&&+Me[1]<=8;var Ge=/\n/g,se=Ie.sourceCode,be=se.length,xe=0,Se=Ie.spans,Be=Se.length,He=0,Xe=Ie.decorations,Ve=Xe.length,lt=0;Xe[Ve]=be;var $e,Qe;for(Qe=$e=0;Qe<Ve;)Xe[Qe]!==Xe[Qe+2]?(Xe[$e++]=Xe[Qe++],Xe[$e++]=Xe[Qe++]):Qe+=2;for(Ve=$e,Qe=$e=0;Qe<Ve;){for(var De=Xe[Qe],ct=Xe[Qe+1],ut=Qe+2;ut+2<=Ve&&Xe[ut+1]===ct;)ut+=2;Xe[$e++]=De,Xe[$e++]=ct,Qe=ut}Ve=Xe.length=$e;var ke=Ie.sourceNode,Ne="";ke&&(Ne=ke.style.display,ke.style.display="none");try{for(var _e=null;He<Be;){var fe=Se[He],ve=Se[He+2]||be,ne=Xe[lt+2]||be,ut=Math.min(ve,ne),re=Se[He+1],oe;if(re.nodeType!==1&&(oe=se.substring(xe,ut))){Me&&(oe=oe.replace(Ge,"\r")),re.nodeValue=oe;var de=re.ownerDocument,ye=de.createElement("span");ye.className=Xe[lt+1];var Le=re.parentNode;Le.replaceChild(ye,re),ye.appendChild(re),xe<ve&&(Se[He+1]=re=de.createTextNode(se.substring(ut,ve)),Le.insertBefore(re,ye.nextSibling))}xe=ut,xe>=ve&&(He+=2),xe>=ne&&(lt+=2)}}finally{ke&&(ke.style.display=Ne)}}var Oe={};function ce(Ie,Me){for(var Ge=Me.length;--Ge>=0;){var se=Me[Ge];Oe.hasOwnProperty(se)?W.console&&console.warn("cannot override language handler %s",se):Oe[se]=Ie}}function ue(Ie,Me){return Ie&&Oe.hasOwnProperty(Ie)||(Ie=/^\s*</.test(Me)?"default-markup":"default-code"),Oe[Ie]}ce(Ee,["default-code"]),ce(le([],[[p,/^[^<?]+/],[v,/^<!\w[^>]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[x,/^(?:<[%?]|[%?]>)/],["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"]),ce(le([[p,/^[\s]+/,null,` \r
|
|
`],[B,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[T,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[N,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[x,/^[=<>\/]+/],["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"]),ce(le([],[[B,/^[\s\S]+/]]),["uq.val"]),ce(Re({keywords:d,hashComments:!0,cStyleComments:!0,types:_}),["c","cc","cpp","cxx","cyc","m"]),ce(Re({keywords:"null,true,false"}),["json"]),ce(Re({keywords:u,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:_}),["cs"]),ce(Re({keywords:m,cStyleComments:!0}),["java"]),ce(Re({keywords:s,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ce(Re({keywords:h,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ce(Re({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ce(Re({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ce(Re({keywords:f,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ce(Re({keywords:a,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ce(le([],[[S,/^[\s\S]+/]]),["regex"]);function Pe(Ie){var Me=Ie.langExtension;try{var Ge=b(Ie.sourceNode,Ie.pre),se=Ge.sourceCode;Ie.sourceCode=se,Ie.spans=Ge.spans,Ie.basePos=0,ue(Me,se)(Ie),Ae(Ie)}catch(be){W.console&&console.log(be&&be.stack||be)}}function qe(Ie,Me,Ge){var se=Ge||!1,be=Me||null,xe=document.createElement("div");xe.innerHTML="<pre>"+Ie+"</pre>",xe=xe.firstChild,se&&Te(xe,se,!0);var Se={langExtension:be,numberLines:se,sourceNode:xe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Pe(Se),xe.innerHTML}function ze(Ie,Me){var Ge=Me||document.body,se=Ge.ownerDocument||document;function be(fe){return Ge.getElementsByTagName(fe)}for(var xe=[be("pre"),be("code"),be("xmp")],Se=[],Be=0;Be<xe.length;++Be)for(var He=0,Xe=xe[Be].length;He<Xe;++He)Se.push(xe[Be][He]);xe=null;var Ve=Date;Ve.now||(Ve={now:function(){return+new Date}});var lt=0,$e=/\blang(?:uage)?-([\w.]+)(?!\S)/,Qe=/\bprettyprint\b/,De=/\bprettyprinted\b/,ct=/pre|xmp/i,ut=/^code$/i,ke=/^(?:pre|code|xmp)$/i,Ne={};function _e(){for(var fe=W.PR_SHOULD_USE_CONTINUATION?Ve.now()+250:Infinity;lt<Se.length&&Ve.now()<fe;lt++){for(var ve=Se[lt],ne=Ne,re=ve;re=re.previousSibling;){var oe=re.nodeType,de=(oe===7||oe===8)&&re.nodeValue;if(de?!/^\??prettify\b/.test(de):oe!==3||/\S/.test(re.nodeValue))break;if(de){ne={},de.replace(/\b(\w+)=([\w:.%+-]+)/g,function(ei,Dt,ci){ne[Dt]=ci});break}}var ye=ve.className;if((ne!==Ne||Qe.test(ye))&&!De.test(ye)){for(var Le=!1,Ue=ve.parentNode;Ue;Ue=Ue.parentNode){var Je=Ue.tagName;if(ke.test(Je)&&Ue.className&&Qe.test(Ue.className)){Le=!0;break}}if(!Le){ve.className+=" prettyprinted";var dt=ne.lang;if(!dt){dt=ye.match($e);var rt;!dt&&(rt=ae(ve))&&ut.test(rt.tagName)&&(dt=rt.className.match($e)),dt&&(dt=dt[1])}var mt;if(ct.test(ve.tagName))mt=1;else{var yt=ve.currentStyle,tt=se.defaultView,Ut=yt?yt.whiteSpace:tt&&tt.getComputedStyle?tt.getComputedStyle(ve,null).getPropertyValue("white-space"):0;mt=Ut&&Ut.substring(0,3)==="pre"}var Ct=ne.linenums;(Ct=Ct==="true"||+Ct)||(Ct=ye.match(/\blinenums\b(?::(\d+))?/),Ct=Ct?Ct[1]&&Ct[1].length?+Ct[1]:!0:!1),Ct&&Te(ve,Ct,mt);var Jt={langExtension:dt,sourceNode:ve,numberLines:Ct,pre:mt,sourceCode:null,basePos:null,spans:null,decorations:null};Pe(Jt)}}}lt<Se.length?W.setTimeout(_e,250):typeof Ie=="function"&&Ie()}_e()}var et=W.PR={createSimpleLexer:le,registerLangHandler:ce,sourceDecorator:Re,PR_ATTRIB_NAME:N,PR_ATTRIB_VALUE:B,PR_COMMENT:O,PR_DECLARATION:v,PR_KEYWORD:L,PR_LITERAL:w,PR_NOCODE:R,PR_PLAIN:p,PR_PUNCTUATION:x,PR_SOURCE:y,PR_STRING:S,PR_TAG:T,PR_TYPE:C,prettyPrintOne:M?W.prettyPrintOne=qe:U=qe,prettyPrint:G=M?W.prettyPrint=ze:G=ze},nt=W.define;typeof nt=="function"&&nt.amd&&nt("google-code-prettify",[],function(){return et})})()},SbmS:function(at,ge,J){at.exports={flex_box_center:"flex_box_center___HG_ui",flex_space_between:"flex_space_between___i7dgQ",flex_box_vertical_center:"flex_box_vertical_center___25J9O",flex_box_center_end:"flex_box_center_end___Q7-xc",flex_box_column:"flex_box_column___2Q6GJ",userInfo:"userInfo___2ECUY",navInfo:"navInfo___3H3dt",actived:"actived___ilDpa",topBar:"topBar___2O4NK",tabs:"tabs___yp4Rb",active:"active___3Xgtk",list:"list___U4GMG",tags:"tags___2IWIk",searchWrp:"searchWrp___1-W5t",listMessage:"listMessage___1M4jE",deleteMsg:"deleteMsg___1HDtB",listRightMessage:"listRightMessage___1rCRK",content:"content___KsZrb",msg:"msg___35IM3",msgDate:"msgDate___ovoCe"}},T8No:function(at,ge,J){"use strict";J.d(ge,"a",function(){return G}),J.d(ge,"e",function(){return W}),J.d(ge,"c",function(){return x}),J.d(ge,"b",function(){return p}),J.d(ge,"d",function(){return T}),J.d(ge,"f",function(){return N});var ie=J("MNsG"),$=J("N0LK"),M=J("Cg/j");let Y=ie.k||"";const F=new Map;F.set("false",!1),F.set("true",!0),F.set("isMac",ie.f),F.set("isLinux",ie.d),F.set("isWindows",ie.i),F.set("isWeb",ie.h),F.set("isMacNative",ie.f&&!ie.h),F.set("isEdge",Y.indexOf("Edg/")>=0),F.set("isFirefox",Y.indexOf("Firefox")>=0),F.set("isChrome",Y.indexOf("Chrome")>=0),F.set("isSafari",Y.indexOf("Safari")>=0);const U=Object.prototype.hasOwnProperty;class G{static has(R){return d.create(R)}static equals(R,j){return m.create(R,j)}static regex(R,j){return S.create(R,j)}static not(R){return l.create(R)}static and(...R){return C.create(R,null)}static or(...R){return w.create(R,null,!0)}static deserialize(R,j=!1){return R?this._deserializeOrExpression(R,j):void 0}static _deserializeOrExpression(R,j){let P=R.split("||");return w.create(P.map(b=>this._deserializeAndExpression(b,j)),null,!0)}static _deserializeAndExpression(R,j){let P=R.split("&&");return C.create(P.map(b=>this._deserializeOne(b,j)),null)}static _deserializeOne(R,j){if(R=R.trim(),R.indexOf("!=")>=0){let P=R.split("!=");return f.create(P[0].trim(),this._deserializeValue(P[1],j))}if(R.indexOf("==")>=0){let P=R.split("==");return m.create(P[0].trim(),this._deserializeValue(P[1],j))}if(R.indexOf("=~")>=0){let P=R.split("=~");return S.create(P[0].trim(),this._deserializeRegexValue(P[1],j))}if(R.indexOf(" in ")>=0){let P=R.split(" in ");return u.create(P[0].trim(),P[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(R)){const P=R.split(">=");return s.create(P[0].trim(),P[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(R)){const P=R.split(">");return o.create(P[0].trim(),P[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(R)){const P=R.split("<=");return _.create(P[0].trim(),P[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(R)){const P=R.split("<");return A.create(P[0].trim(),P[1].trim())}return/^\!\s*/.test(R)?l.create(R.substr(1).trim()):d.create(R)}static _deserializeValue(R,j){if(R=R.trim(),R==="true")return!0;if(R==="false")return!1;let P=/^'([^']*)'$/.exec(R);return P?P[1].trim():R}static _deserializeRegexValue(R,j){if(Object($.C)(R)){if(j)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let P=R.indexOf("/"),b=R.lastIndexOf("/");if(P===b||P<0){if(j)throw new Error(`bad regexp-value '${R}', missing /-enclosure`);return console.warn(`bad regexp-value '${R}', missing /-enclosure`),null}let X=R.slice(P+1,b),ee=R[b+1]==="i"?"i":"";try{return new RegExp(X,ee)}catch(ae){if(j)throw new Error(`bad regexp-value '${R}', parse error: ${ae}`);return console.warn(`bad regexp-value '${R}', parse error: ${ae}`),null}}}function W(R,j){const P=R?R.substituteConstants():void 0,b=j?j.substituteConstants():void 0;return!P&&!b?!0:!P||!b?!1:P.equals(b)}function i(R,j){return R.cmp(j)}class D{constructor(){this.type=0}cmp(R){return this.type-R.type}equals(R){return R.type===this.type}substituteConstants(){return this}evaluate(R){return!1}serialize(){return"false"}keys(){return[]}negate(){return g.INSTANCE}}D.INSTANCE=new D;class g{constructor(){this.type=1}cmp(R){return this.type-R.type}equals(R){return R.type===this.type}substituteConstants(){return this}evaluate(R){return!0}serialize(){return"true"}keys(){return[]}negate(){return D.INSTANCE}}g.INSTANCE=new g;class d{constructor(R,j){this.key=R,this.negated=j,this.type=2}static create(R,j=null){const P=F.get(R);return typeof P=="boolean"?P?g.INSTANCE:D.INSTANCE:new d(R,j)}cmp(R){return R.type!==this.type?this.type-R.type:v(this.key,R.key)}equals(R){return R.type===this.type?this.key===R.key:!1}substituteConstants(){const R=F.get(this.key);return typeof R=="boolean"?R?g.INSTANCE:D.INSTANCE:this}evaluate(R){return!!R.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=l.create(this.key,this)),this.negated}}class m{constructor(R,j,P){this.key=R,this.value=j,this.negated=P,this.type=4}static create(R,j,P=null){if(typeof j=="boolean")return j?d.create(R,P):l.create(R,P);const b=F.get(R);if(typeof b=="boolean"){const X=b?"true":"false";return j===X?g.INSTANCE:D.INSTANCE}return new m(R,j,P)}cmp(R){return R.type!==this.type?this.type-R.type:y(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){const R=F.get(this.key);if(typeof R=="boolean"){const j=R?"true":"false";return this.value===j?g.INSTANCE:D.INSTANCE}return this}evaluate(R){return R.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 u{constructor(R,j){this.key=R,this.valueKey=j,this.type=10,this.negated=null}static create(R,j){return new u(R,j)}cmp(R){return R.type!==this.type?this.type-R.type:y(this.key,this.valueKey,R.key,R.valueKey)}equals(R){return R.type===this.type?this.key===R.key&&this.valueKey===R.valueKey:!1}substituteConstants(){return this}evaluate(R){const j=R.getValue(this.valueKey),P=R.getValue(this.key);return Array.isArray(j)?j.indexOf(P)>=0:typeof P=="string"&&typeof j=="object"&&j!==null?U.call(j,P):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=a.create(this)),this.negated}}class a{constructor(R){this._actual=R,this.type=11}static create(R){return new a(R)}cmp(R){return R.type!==this.type?this.type-R.type:this._actual.cmp(R._actual)}equals(R){return R.type===this.type?this._actual.equals(R._actual):!1}substituteConstants(){return this}evaluate(R){return!this._actual.evaluate(R)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class f{constructor(R,j,P){this.key=R,this.value=j,this.negated=P,this.type=5}static create(R,j,P=null){if(typeof j=="boolean")return j?l.create(R,P):d.create(R,P);const b=F.get(R);if(typeof b=="boolean"){const X=b?"true":"false";return j===X?D.INSTANCE:g.INSTANCE}return new f(R,j,P)}cmp(R){return R.type!==this.type?this.type-R.type:y(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){const R=F.get(this.key);if(typeof R=="boolean"){const j=R?"true":"false";return this.value===j?D.INSTANCE:g.INSTANCE}return this}evaluate(R){return R.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this.value,this)),this.negated}}class l{constructor(R,j){this.key=R,this.negated=j,this.type=3}static create(R,j=null){const P=F.get(R);return typeof P=="boolean"?P?D.INSTANCE:g.INSTANCE:new l(R,j)}cmp(R){return R.type!==this.type?this.type-R.type:v(this.key,R.key)}equals(R){return R.type===this.type?this.key===R.key:!1}substituteConstants(){const R=F.get(this.key);return typeof R=="boolean"?R?D.INSTANCE:g.INSTANCE:this}evaluate(R){return!R.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=d.create(this.key,this)),this.negated}}function h(R,j){if(typeof R=="string"){const P=parseFloat(R);isNaN(P)||(R=P)}return typeof R=="string"||typeof R=="number"?j(R):D.INSTANCE}class o{constructor(R,j,P){this.key=R,this.value=j,this.negated=P,this.type=12}static create(R,j,P=null){return h(j,b=>new o(R,b,P))}cmp(R){return R.type!==this.type?this.type-R.type:y(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.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(R,j,P){this.key=R,this.value=j,this.negated=P,this.type=13}static create(R,j,P=null){return h(j,b=>new s(R,b,P))}cmp(R){return R.type!==this.type?this.type-R.type:y(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.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 A{constructor(R,j,P){this.key=R,this.value=j,this.negated=P,this.type=14}static create(R,j,P=null){return h(j,b=>new A(R,b,P))}cmp(R){return R.type!==this.type?this.type-R.type:y(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.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(R,j,P){this.key=R,this.value=j,this.negated=P,this.type=15}static create(R,j,P=null){return h(j,b=>new _(R,b,P))}cmp(R){return R.type!==this.type?this.type-R.type:y(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this.value,this)),this.negated}}class S{constructor(R,j){this.key=R,this.regexp=j,this.type=7,this.negated=null}static create(R,j){return new S(R,j)}cmp(R){if(R.type!==this.type)return this.type-R.type;if(this.key<R.key)return-1;if(this.key>R.key)return 1;const j=this.regexp?this.regexp.source:"",P=R.regexp?R.regexp.source:"";return j<P?-1:j>P?1:0}equals(R){if(R.type===this.type){const j=this.regexp?this.regexp.source:"",P=R.regexp?R.regexp.source:"";return this.key===R.key&&j===P}return!1}substituteConstants(){return this}evaluate(R){let j=R.getValue(this.key);return this.regexp?this.regexp.test(j):!1}serialize(){const R=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${R}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=L.create(this)),this.negated}}class L{constructor(R){this._actual=R,this.type=8}static create(R){return new L(R)}cmp(R){return R.type!==this.type?this.type-R.type:this._actual.cmp(R._actual)}equals(R){return R.type===this.type?this._actual.equals(R._actual):!1}substituteConstants(){return this}evaluate(R){return!this._actual.evaluate(R)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function O(R){let j=null;for(let P=0,b=R.length;P<b;P++){const X=R[P].substituteConstants();if(R[P]!==X&&j===null){j=[];for(let ee=0;ee<P;ee++)j[ee]=R[ee]}j!==null&&(j[P]=X)}return j===null?R:j}class C{constructor(R,j){this.expr=R,this.negated=j,this.type=6}static create(R,j){return C._normalizeArr(R,j)}cmp(R){if(R.type!==this.type)return this.type-R.type;if(this.expr.length<R.expr.length)return-1;if(this.expr.length>R.expr.length)return 1;for(let j=0,P=this.expr.length;j<P;j++){const b=i(this.expr[j],R.expr[j]);if(b!==0)return b}return 0}equals(R){if(R.type===this.type){if(this.expr.length!==R.expr.length)return!1;for(let j=0,P=this.expr.length;j<P;j++)if(!this.expr[j].equals(R.expr[j]))return!1;return!0}return!1}substituteConstants(){const R=O(this.expr);return R===this.expr?this:C.create(R,this.negated)}evaluate(R){for(let j=0,P=this.expr.length;j<P;j++)if(!this.expr[j].evaluate(R))return!1;return!0}static _normalizeArr(R,j){const P=[];let b=!1;for(const X of R){if(!X)continue;if(X.type===1){b=!0;continue}if(X.type===0)return D.INSTANCE;if(X.type===6){P.push(...X.expr);continue}P.push(X)}if(P.length===0&&b)return g.INSTANCE;if(P.length===0)return;if(P.length===1)return P[0];P.sort(i);for(let X=1;X<P.length;X++)P[X-1].equals(P[X])&&(P.splice(X,1),X--);if(P.length===1)return P[0];for(;P.length>1;){const X=P[P.length-1];if(X.type!==9)break;P.pop();const ee=P.pop(),ae=P.length===0,le=w.create(X.expr.map(Re=>C.create([Re,ee],null)),null,ae);le&&(P.push(le),P.sort(i))}return P.length===1?P[0]:new C(P,j)}serialize(){return this.expr.map(R=>R.serialize()).join(" && ")}keys(){const R=[];for(let j of this.expr)R.push(...j.keys());return R}negate(){if(!this.negated){const R=[];for(let j of this.expr)R.push(j.negate());this.negated=w.create(R,this,!0)}return this.negated}}class w{constructor(R,j){this.expr=R,this.negated=j,this.type=9}static create(R,j,P){return w._normalizeArr(R,j,P)}cmp(R){if(R.type!==this.type)return this.type-R.type;if(this.expr.length<R.expr.length)return-1;if(this.expr.length>R.expr.length)return 1;for(let j=0,P=this.expr.length;j<P;j++){const b=i(this.expr[j],R.expr[j]);if(b!==0)return b}return 0}equals(R){if(R.type===this.type){if(this.expr.length!==R.expr.length)return!1;for(let j=0,P=this.expr.length;j<P;j++)if(!this.expr[j].equals(R.expr[j]))return!1;return!0}return!1}substituteConstants(){const R=O(this.expr);return R===this.expr?this:w.create(R,this.negated,!1)}evaluate(R){for(let j=0,P=this.expr.length;j<P;j++)if(this.expr[j].evaluate(R))return!0;return!1}static _normalizeArr(R,j,P){let b=[],X=!1;if(R){for(let ee=0,ae=R.length;ee<ae;ee++){const le=R[ee];if(!le)continue;if(le.type===0){X=!0;continue}if(le.type===1)return g.INSTANCE;if(le.type===9){b=b.concat(le.expr);continue}b.push(le)}if(b.length===0&&X)return D.INSTANCE;b.sort(i)}if(b.length===0)return;if(b.length===1)return b[0];for(let ee=1;ee<b.length;ee++)b[ee-1].equals(b[ee])&&(b.splice(ee,1),ee--);if(b.length===1)return b[0];if(P){for(let ee=0;ee<b.length;ee++)for(let ae=ee+1;ae<b.length;ae++)N(b[ee],b[ae])&&(b.splice(ae,1),ae--);if(b.length===1)return b[0]}return new w(b,j)}serialize(){return this.expr.map(R=>R.serialize()).join(" || ")}keys(){const R=[];for(let j of this.expr)R.push(...j.keys());return R}negate(){if(!this.negated){let R=[];for(let j of this.expr)R.push(j.negate());for(;R.length>1;){const j=R.shift(),P=R.shift(),b=[];for(const ee of B(j))for(const ae of B(P))b.push(C.create([ee,ae],null));const X=R.length===0;R.unshift(w.create(b,null,X))}this.negated=R[0]}return this.negated}}class x extends d{constructor(R,j,P){super(R,null);this._defaultValue=j,typeof P=="object"?x._info.push(Object.assign(Object.assign({},P),{key:R})):P!==!0&&x._info.push({key:R,description:P,type:j!=null?typeof j:void 0})}static all(){return x._info.values()}bindTo(R){return R.createKey(this.key,this._defaultValue)}getValue(R){return R.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(R){return m.create(this.key,R)}}x._info=[];const p=Object(M.c)("contextKeyService"),T="setContext";function v(R,j){return R<j?-1:R>j?1:0}function y(R,j,P,b){return R<P?-1:R>P?1:j<b?-1:j>b?1:0}function N(R,j){if(j.type===6&&R.type!==9&&R.type!==6){for(const X of j.expr)if(R.equals(X))return!0}const P=R.negate(),b=B(P).concat(B(j));b.sort(i);for(let X=0;X<b.length;X++){const ee=b[X],ae=ee.negate();for(let le=X+1;le<b.length;le++){const Re=b[le];if(ae.equals(Re))return!0}}return!1}function B(R){return R.type===9?R.expr:[R]}},TXwP:function(at,ge,J){var ie,$;(function(){var M;(function(){"use strict";var F=[,,function(i){function D(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}D.prototype.clone_empty=function(){var m=new D(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},D.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},D.prototype.has_match=function(m){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(m))return!0;return!1},D.prototype.set_indent=function(m,u){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.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)},D.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},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(m){this.__items.push(m);var u=m.lastIndexOf(`
|
|
`);u!==-1?this.__character_count=m.length-u:this.__character_count+=m.length},D.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function g(m,u){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),u=u||"",m.indent_level>0&&(u=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}g.prototype.get_indent_size=function(m,u){var a=this.__base_string_length;return u=u||0,m<0&&(a=0),a+=m*this.__indent_size,a+=u,a},g.prototype.get_indent_string=function(m,u){var a=this.__base_string;return u=u||0,m<0&&(m=0,a=""),u+=m*this.__indent_size,this.__ensure_cache(u),a+=this.__cache[u],a},g.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var m=this.__cache.length,u=0,a="";this.__indent_size&&m>=this.__indent_size&&(u=Math.floor(m/this.__indent_size),m-=u*this.__indent_size,a=new Array(u+1).join(this.__indent_string)),m&&(a+=new Array(m+1).join(" ")),this.__cache.push(a)};function d(m,u){this.__indent_cache=new g(m,u),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}d.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},d.prototype.get_line_number=function(){return this.__lines.length},d.prototype.get_indent_string=function(m,u){return this.__indent_cache.get_indent_string(m,u)},d.prototype.get_indent_size=function(m,u){return this.__indent_cache.get_indent_size(m,u)},d.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},d.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},d.prototype.get_code=function(m){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
|
|
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
|
|
`);return m!==`
|
|
`&&(a=a.replace(/[\n]/g,m)),a},d.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},d.prototype.set_indent=function(m,u){return m=m||0,u=u||0,this.next_line.set_indent(m,u),this.__lines.length>1?(this.current_line.set_indent(m,u),!0):(this.current_line.set_indent(),!1)},d.prototype.add_raw_token=function(m){for(var u=0;u<m.newlines;u++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},d.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},d.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(" "))},d.prototype.remove_indent=function(m){for(var u=this.__lines.length;m<u;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},d.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},d.prototype.just_added_newline=function(){return this.current_line.is_empty()},d.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},d.prototype.ensure_empty_line_above=function(m,u){for(var a=this.__lines.length-2;a>=0;){var f=this.__lines[a];if(f.is_empty())break;if(f.item(0).indexOf(m)!==0&&f.item(-1)!==u){this.__lines.splice(a+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},i.exports.Output=d},,,,function(i){function D(m,u){this.raw_options=g(m,u),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}D.prototype._get_array=function(m,u){var a=this.raw_options[m],f=u||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(f=a.concat()):typeof a=="string"&&(f=a.split(/[^a-zA-Z0-9_\/\-]+/)),f},D.prototype._get_boolean=function(m,u){var a=this.raw_options[m],f=a===void 0?!!u:!!a;return f},D.prototype._get_characters=function(m,u){var a=this.raw_options[m],f=u||"";return typeof a=="string"&&(f=a.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),f},D.prototype._get_number=function(m,u){var a=this.raw_options[m];u=parseInt(u,10),isNaN(u)&&(u=0);var f=parseInt(a,10);return isNaN(f)&&(f=u),f},D.prototype._get_selection=function(m,u,a){var f=this._get_selection_list(m,u,a);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[m]+"'");return f[0]},D.prototype._get_selection_list=function(m,u,a){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[u[0]],!this._is_valid_selection(a,u))throw new Error("Invalid Default Value!");var f=this._get_array(m,a);if(!this._is_valid_selection(f,u))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[m]+"'");return f},D.prototype._is_valid_selection=function(m,u){return m.length&&u.length&&!m.some(function(a){return u.indexOf(a)===-1})};function g(m,u){var a={};m=d(m);var f;for(f in m)f!==u&&(a[f]=m[f]);if(u&&m[u])for(f in m[u])a[f]=m[u][f];return a}function d(m){var u={},a;for(a in m){var f=a.replace(/-/g,"_");u[f]=m[a]}return u}i.exports.Options=D,i.exports.normalizeOpts=d,i.exports.mergeOpts=g},,function(i){var D=RegExp.prototype.hasOwnProperty("sticky");function g(d){this.__input=d||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var d=null;return this.hasNext()&&(d=this.__input.charAt(this.__position),this.__position+=1),d},g.prototype.peek=function(d){var m=null;return d=d||0,d+=this.__position,d>=0&&d<this.__input_length&&(m=this.__input.charAt(d)),m},g.prototype.__match=function(d,m){d.lastIndex=m;var u=d.exec(this.__input);return u&&!(D&&d.sticky)&&(u.index!==m&&(u=null)),u},g.prototype.test=function(d,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(d,m):!1},g.prototype.testChar=function(d,m){var u=this.peek(m);return d.lastIndex=0,u!==null&&d.test(u)},g.prototype.match=function(d){var m=this.__match(d,this.__position);return m?this.__position+=m[0].length:m=null,m},g.prototype.read=function(d,m,u){var a="",f;return d&&(f=this.match(d),f&&(a+=f[0])),m&&(f||!d)&&(a+=this.readUntil(m,u)),a},g.prototype.readUntil=function(d,m){var u="",a=this.__position;d.lastIndex=this.__position;var f=d.exec(this.__input);return f?(a=f.index,m&&(a+=f[0].length)):a=this.__input_length,u=this.__input.substring(this.__position,a),this.__position=a,u},g.prototype.readUntilAfter=function(d){return this.readUntil(d,!0)},g.prototype.get_regexp=function(d,m){var u=null,a="g";return m&&D&&(a="y"),typeof d=="string"&&d!==""?u=new RegExp(d,a):d&&(u=new RegExp(d.source,a)),u},g.prototype.get_literal_regexp=function(d){return RegExp(d.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(d){var m=this.__position,u=this.readUntilAfter(d);return this.__position=m,u},g.prototype.lookBack=function(d){var m=this.__position-1;return m>=d.length&&this.__input.substring(m-d.length,m).toLowerCase()===d},i.exports.InputScanner=g},,,,,function(i){function D(g,d){g=typeof g=="string"?g:g.source,d=typeof d=="string"?d:d.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+d,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+d,"g")}D.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var d={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(g);m;)d[m[1]]=m[2],m=this.__directive_pattern.exec(g);return d},D.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},i.exports.Directives=D},,function(i,D,g){var d=g(16).Beautifier,m=g(17).Options;function u(a,f){var l=new d(a,f);return l.beautify()}i.exports=u,i.exports.defaultOptions=function(){return new m}},function(i,D,g){var d=g(17).Options,m=g(2).Output,u=g(8).InputScanner,a=g(13).Directives,f=new a(/\/\*/,/\*\//),l=/\r\n|[\r\n]/,h=/\r\n|[\r\n]/g,o=/\s/,s=/(?:\s|\n)+/g,A=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,_=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function S(L,O){this._source_text=L||"",this._options=new d(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"]}S.prototype.eatString=function(L){var O="";for(this._ch=this._input.next();this._ch;){if(O+=this._ch,this._ch==="\\")O+=this._input.next();else if(L.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return O},S.prototype.eatWhitespace=function(L){for(var O=o.test(this._input.peek()),C=0;o.test(this._input.peek());)this._ch=this._input.next(),L&&this._ch===`
|
|
`&&((C===0||C<this._options.max_preserve_newlines)&&(C++,this._output.add_new_line(!0)));return O},S.prototype.foundNestedPseudoClass=function(){for(var L=0,O=1,C=this._input.peek(O);C;){if(C==="{")return!0;if(C==="(")L+=1;else if(C===")"){if(L===0)return!1;L-=1}else if(C===";"||C==="}")return!1;O++,C=this._input.peek(O)}return!1},S.prototype.print_string=function(L){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(L)},S.prototype.preserveSingleSpace=function(L){L&&(this._output.space_before_token=!0)},S.prototype.indent=function(){this._indentLevel++},S.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},S.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var L=this._source_text,O=this._options.eol;O==="auto"&&(O=`
|
|
`,L&&l.test(L||"")&&(O=L.match(l)[0])),L=L.replace(h,`
|
|
`);var C=L.match(/^[\t ]*/)[0];this._output=new m(this._options,C),this._input=new u(L),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var w=0,x=!1,p=!1,T=!1,v=!1,y=!1,N=!1,B=this._ch,R=!1,j,P,b;j=this._input.read(s),P=j!=="",b=B,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),B=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var X=this._input.read(A),ee=f.get_directives(X);ee&&ee.ignore==="start"&&(X+=f.readIgnored(this._input)),this.print_string(X),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(_)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(P),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ae=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ae.match(/[ :]$/)&&(ae=this.eatString(": ").replace(/\s$/,""),this.print_string(ae),this._output.space_before_token=!0),ae=ae.replace(/\s$/,""),ae==="extend"?v=!0:ae==="import"&&(y=!0),ae in this.NESTED_AT_RULE?(this._nestedLevel+=1,ae in this.CONDITIONAL_GROUP_RULE&&(T=!0)):!x&&w===0&&ae.indexOf(":")!==-1&&(p=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(P),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")p&&(p=!1,this.outdent()),T?(T=!1,x=this._indentLevel>=this._nestedLevel):x=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&x&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(b==="("?this._output.space_before_token=!1:b!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),b==="{"&&this._output.trim(!0),y=!1,v=!1,p&&(this.outdent(),p=!1),this.print_string(this._ch),x=!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 le=0;le<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;le++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[le])){R=!0;break}(x||T)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!v&&w===0?(this.print_string(":"),p||(p=!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 Re=b==='"'||b==="'";this.preserveSingleSpace(Re||P),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")R=!1,w===0?(p&&(this.outdent(),p=!1),v=!1,y=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),w++,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(")")),w&&(w--,this.outdent()));else{var Ee=!1;this._input.lookBack("with")&&(Ee=!0),this.preserveSingleSpace(P||Ee),this.print_string(this._ch),p&&b==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),N=!0):(this.eatWhitespace(),w++,this.indent())}else if(this._ch===")")w&&(w--,this.outdent()),N&&this._input.peek()===";"&&this._options.selector_separator_newline&&(N=!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&&(!p||N)&&w===0&&!y&&!v?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!p&&w===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&&o.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(P),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),o.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 Te=b==='"'||b==="'";this.preserveSingleSpace(Te||P),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&R&&this._output.add_new_line()}var Ae=this._output.get_code(O);return Ae},i.exports.Beautifier=S},function(i,D,g){var d=g(6).Options;function m(u){d.call(this,u,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var a=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||a;var f=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var l=0;l<f.length;l++)f[l]!=="expand"?this.brace_style="collapse":this.brace_style=f[l]}m.prototype=new d,i.exports.Options=m}],U={};function G(i){var D=U[i];if(D!==void 0)return D.exports;var g=U[i]={exports:{}};return F[i](g,g.exports,G),g.exports}var W=G(15);M=W})();var Y=M;!(ie=[],$=function(){return{css_beautify:Y}}.apply(ge,ie),$!==void 0&&(at.exports=$))})()},UZu5:function(at,ge,J){},Vhoy:function(at,ge,J){"use strict";J.d(ge,"d",function(){return Y}),J.d(ge,"e",function(){return F}),J.d(ge,"c",function(){return U}),J.d(ge,"b",function(){return G}),J.d(ge,"a",function(){return W});var ie=J("MI8n");class ${constructor(){this._icons=new Map,this._onDidRegister=new ie.b}add(i){const D=this._icons.get(i.id);D?i.description?D.description=i.description:console.error(`Duplicate registration of codicon ${i.id}`):(this._icons.set(i.id,i),this._onDidRegister.fire(i))}get(i){return this._icons.get(i)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const M=new $,Y=M;function F(i,D){return new G(i,D)}function U(i){return i?i.replace(/\$\((.*?)\)/g,(D,g)=>` ${g} `).trim():""}class G{constructor(i,D,g){this.id=i,this.definition=D,this.description=g,M.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var W;(function(i){i.iconNameSegment="[A-Za-z0-9]+",i.iconNameExpression="[A-Za-z0-9\\-]+",i.iconModifierExpression="~[A-Za-z]+";const D=new RegExp(`^(${i.iconNameExpression})(${i.iconModifierExpression})?$`);function g(u){if(u instanceof G)return["codicon","codicon-"+u.id];const a=D.exec(u.id);if(!a)return g(G.error);let[,f,l]=a;const h=["codicon","codicon-"+f];return l&&h.push("codicon-modifier-"+l.substr(1)),h}i.asClassNameArray=g;function d(u){return g(u).join(" ")}i.asClassName=d;function m(u){return"."+g(u).join(".")}i.asCSSSelector=m})(W||(W={})),function(i){i.add=new i("add",{fontCharacter:"\\ea60"}),i.plus=new i("plus",i.add.definition),i.gistNew=new i("gist-new",i.add.definition),i.repoCreate=new i("repo-create",i.add.definition),i.lightbulb=new i("lightbulb",{fontCharacter:"\\ea61"}),i.lightBulb=new i("light-bulb",{fontCharacter:"\\ea61"}),i.repo=new i("repo",{fontCharacter:"\\ea62"}),i.repoDelete=new i("repo-delete",{fontCharacter:"\\ea62"}),i.gistFork=new i("gist-fork",{fontCharacter:"\\ea63"}),i.repoForked=new i("repo-forked",{fontCharacter:"\\ea63"}),i.gitPullRequest=new i("git-pull-request",{fontCharacter:"\\ea64"}),i.gitPullRequestAbandoned=new i("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),i.recordKeys=new i("record-keys",{fontCharacter:"\\ea65"}),i.keyboard=new i("keyboard",{fontCharacter:"\\ea65"}),i.tag=new i("tag",{fontCharacter:"\\ea66"}),i.tagAdd=new i("tag-add",{fontCharacter:"\\ea66"}),i.tagRemove=new i("tag-remove",{fontCharacter:"\\ea66"}),i.person=new i("person",{fontCharacter:"\\ea67"}),i.personFollow=new i("person-follow",{fontCharacter:"\\ea67"}),i.personOutline=new i("person-outline",{fontCharacter:"\\ea67"}),i.personFilled=new i("person-filled",{fontCharacter:"\\ea67"}),i.gitBranch=new i("git-branch",{fontCharacter:"\\ea68"}),i.gitBranchCreate=new i("git-branch-create",{fontCharacter:"\\ea68"}),i.gitBranchDelete=new i("git-branch-delete",{fontCharacter:"\\ea68"}),i.sourceControl=new i("source-control",{fontCharacter:"\\ea68"}),i.mirror=new i("mirror",{fontCharacter:"\\ea69"}),i.mirrorPublic=new i("mirror-public",{fontCharacter:"\\ea69"}),i.star=new i("star",{fontCharacter:"\\ea6a"}),i.starAdd=new i("star-add",{fontCharacter:"\\ea6a"}),i.starDelete=new i("star-delete",{fontCharacter:"\\ea6a"}),i.starEmpty=new i("star-empty",{fontCharacter:"\\ea6a"}),i.comment=new i("comment",{fontCharacter:"\\ea6b"}),i.commentAdd=new i("comment-add",{fontCharacter:"\\ea6b"}),i.alert=new i("alert",{fontCharacter:"\\ea6c"}),i.warning=new i("warning",{fontCharacter:"\\ea6c"}),i.search=new i("search",{fontCharacter:"\\ea6d"}),i.searchSave=new i("search-save",{fontCharacter:"\\ea6d"}),i.logOut=new i("log-out",{fontCharacter:"\\ea6e"}),i.signOut=new i("sign-out",{fontCharacter:"\\ea6e"}),i.logIn=new i("log-in",{fontCharacter:"\\ea6f"}),i.signIn=new i("sign-in",{fontCharacter:"\\ea6f"}),i.eye=new i("eye",{fontCharacter:"\\ea70"}),i.eyeUnwatch=new i("eye-unwatch",{fontCharacter:"\\ea70"}),i.eyeWatch=new i("eye-watch",{fontCharacter:"\\ea70"}),i.circleFilled=new i("circle-filled",{fontCharacter:"\\ea71"}),i.primitiveDot=new i("primitive-dot",{fontCharacter:"\\ea71"}),i.closeDirty=new i("close-dirty",{fontCharacter:"\\ea71"}),i.debugBreakpoint=new i("debug-breakpoint",{fontCharacter:"\\ea71"}),i.debugBreakpointDisabled=new i("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),i.debugHint=new i("debug-hint",{fontCharacter:"\\ea71"}),i.primitiveSquare=new i("primitive-square",{fontCharacter:"\\ea72"}),i.edit=new i("edit",{fontCharacter:"\\ea73"}),i.pencil=new i("pencil",{fontCharacter:"\\ea73"}),i.info=new i("info",{fontCharacter:"\\ea74"}),i.issueOpened=new i("issue-opened",{fontCharacter:"\\ea74"}),i.gistPrivate=new i("gist-private",{fontCharacter:"\\ea75"}),i.gitForkPrivate=new i("git-fork-private",{fontCharacter:"\\ea75"}),i.lock=new i("lock",{fontCharacter:"\\ea75"}),i.mirrorPrivate=new i("mirror-private",{fontCharacter:"\\ea75"}),i.close=new i("close",{fontCharacter:"\\ea76"}),i.removeClose=new i("remove-close",{fontCharacter:"\\ea76"}),i.x=new i("x",{fontCharacter:"\\ea76"}),i.repoSync=new i("repo-sync",{fontCharacter:"\\ea77"}),i.sync=new i("sync",{fontCharacter:"\\ea77"}),i.clone=new i("clone",{fontCharacter:"\\ea78"}),i.desktopDownload=new i("desktop-download",{fontCharacter:"\\ea78"}),i.beaker=new i("beaker",{fontCharacter:"\\ea79"}),i.microscope=new i("microscope",{fontCharacter:"\\ea79"}),i.vm=new i("vm",{fontCharacter:"\\ea7a"}),i.deviceDesktop=new i("device-desktop",{fontCharacter:"\\ea7a"}),i.file=new i("file",{fontCharacter:"\\ea7b"}),i.fileText=new i("file-text",{fontCharacter:"\\ea7b"}),i.more=new i("more",{fontCharacter:"\\ea7c"}),i.ellipsis=new i("ellipsis",{fontCharacter:"\\ea7c"}),i.kebabHorizontal=new i("kebab-horizontal",{fontCharacter:"\\ea7c"}),i.mailReply=new i("mail-reply",{fontCharacter:"\\ea7d"}),i.reply=new i("reply",{fontCharacter:"\\ea7d"}),i.organization=new i("organization",{fontCharacter:"\\ea7e"}),i.organizationFilled=new i("organization-filled",{fontCharacter:"\\ea7e"}),i.organizationOutline=new i("organization-outline",{fontCharacter:"\\ea7e"}),i.newFile=new i("new-file",{fontCharacter:"\\ea7f"}),i.fileAdd=new i("file-add",{fontCharacter:"\\ea7f"}),i.newFolder=new i("new-folder",{fontCharacter:"\\ea80"}),i.fileDirectoryCreate=new i("file-directory-create",{fontCharacter:"\\ea80"}),i.trash=new i("trash",{fontCharacter:"\\ea81"}),i.trashcan=new i("trashcan",{fontCharacter:"\\ea81"}),i.history=new i("history",{fontCharacter:"\\ea82"}),i.clock=new i("clock",{fontCharacter:"\\ea82"}),i.folder=new i("folder",{fontCharacter:"\\ea83"}),i.fileDirectory=new i("file-directory",{fontCharacter:"\\ea83"}),i.symbolFolder=new i("symbol-folder",{fontCharacter:"\\ea83"}),i.logoGithub=new i("logo-github",{fontCharacter:"\\ea84"}),i.markGithub=new i("mark-github",{fontCharacter:"\\ea84"}),i.github=new i("github",{fontCharacter:"\\ea84"}),i.terminal=new i("terminal",{fontCharacter:"\\ea85"}),i.console=new i("console",{fontCharacter:"\\ea85"}),i.repl=new i("repl",{fontCharacter:"\\ea85"}),i.zap=new i("zap",{fontCharacter:"\\ea86"}),i.symbolEvent=new i("symbol-event",{fontCharacter:"\\ea86"}),i.error=new i("error",{fontCharacter:"\\ea87"}),i.stop=new i("stop",{fontCharacter:"\\ea87"}),i.variable=new i("variable",{fontCharacter:"\\ea88"}),i.symbolVariable=new i("symbol-variable",{fontCharacter:"\\ea88"}),i.array=new i("array",{fontCharacter:"\\ea8a"}),i.symbolArray=new i("symbol-array",{fontCharacter:"\\ea8a"}),i.symbolModule=new i("symbol-module",{fontCharacter:"\\ea8b"}),i.symbolPackage=new i("symbol-package",{fontCharacter:"\\ea8b"}),i.symbolNamespace=new i("symbol-namespace",{fontCharacter:"\\ea8b"}),i.symbolObject=new i("symbol-object",{fontCharacter:"\\ea8b"}),i.symbolMethod=new i("symbol-method",{fontCharacter:"\\ea8c"}),i.symbolFunction=new i("symbol-function",{fontCharacter:"\\ea8c"}),i.symbolConstructor=new i("symbol-constructor",{fontCharacter:"\\ea8c"}),i.symbolBoolean=new i("symbol-boolean",{fontCharacter:"\\ea8f"}),i.symbolNull=new i("symbol-null",{fontCharacter:"\\ea8f"}),i.symbolNumeric=new i("symbol-numeric",{fontCharacter:"\\ea90"}),i.symbolNumber=new i("symbol-number",{fontCharacter:"\\ea90"}),i.symbolStructure=new i("symbol-structure",{fontCharacter:"\\ea91"}),i.symbolStruct=new i("symbol-struct",{fontCharacter:"\\ea91"}),i.symbolParameter=new i("symbol-parameter",{fontCharacter:"\\ea92"}),i.symbolTypeParameter=new i("symbol-type-parameter",{fontCharacter:"\\ea92"}),i.symbolKey=new i("symbol-key",{fontCharacter:"\\ea93"}),i.symbolText=new i("symbol-text",{fontCharacter:"\\ea93"}),i.symbolReference=new i("symbol-reference",{fontCharacter:"\\ea94"}),i.goToFile=new i("go-to-file",{fontCharacter:"\\ea94"}),i.symbolEnum=new i("symbol-enum",{fontCharacter:"\\ea95"}),i.symbolValue=new i("symbol-value",{fontCharacter:"\\ea95"}),i.symbolRuler=new i("symbol-ruler",{fontCharacter:"\\ea96"}),i.symbolUnit=new i("symbol-unit",{fontCharacter:"\\ea96"}),i.activateBreakpoints=new i("activate-breakpoints",{fontCharacter:"\\ea97"}),i.archive=new i("archive",{fontCharacter:"\\ea98"}),i.arrowBoth=new i("arrow-both",{fontCharacter:"\\ea99"}),i.arrowDown=new i("arrow-down",{fontCharacter:"\\ea9a"}),i.arrowLeft=new i("arrow-left",{fontCharacter:"\\ea9b"}),i.arrowRight=new i("arrow-right",{fontCharacter:"\\ea9c"}),i.arrowSmallDown=new i("arrow-small-down",{fontCharacter:"\\ea9d"}),i.arrowSmallLeft=new i("arrow-small-left",{fontCharacter:"\\ea9e"}),i.arrowSmallRight=new i("arrow-small-right",{fontCharacter:"\\ea9f"}),i.arrowSmallUp=new i("arrow-small-up",{fontCharacter:"\\eaa0"}),i.arrowUp=new i("arrow-up",{fontCharacter:"\\eaa1"}),i.bell=new i("bell",{fontCharacter:"\\eaa2"}),i.bold=new i("bold",{fontCharacter:"\\eaa3"}),i.book=new i("book",{fontCharacter:"\\eaa4"}),i.bookmark=new i("bookmark",{fontCharacter:"\\eaa5"}),i.debugBreakpointConditionalUnverified=new i("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),i.debugBreakpointConditional=new i("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),i.debugBreakpointConditionalDisabled=new i("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),i.debugBreakpointDataUnverified=new i("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),i.debugBreakpointData=new i("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),i.debugBreakpointDataDisabled=new i("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),i.debugBreakpointLogUnverified=new i("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),i.debugBreakpointLog=new i("debug-breakpoint-log",{fontCharacter:"\\eaab"}),i.debugBreakpointLogDisabled=new i("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),i.briefcase=new i("briefcase",{fontCharacter:"\\eaac"}),i.broadcast=new i("broadcast",{fontCharacter:"\\eaad"}),i.browser=new i("browser",{fontCharacter:"\\eaae"}),i.bug=new i("bug",{fontCharacter:"\\eaaf"}),i.calendar=new i("calendar",{fontCharacter:"\\eab0"}),i.caseSensitive=new i("case-sensitive",{fontCharacter:"\\eab1"}),i.check=new i("check",{fontCharacter:"\\eab2"}),i.checklist=new i("checklist",{fontCharacter:"\\eab3"}),i.chevronDown=new i("chevron-down",{fontCharacter:"\\eab4"}),i.dropDownButton=new i("drop-down-button",i.chevronDown.definition),i.chevronLeft=new i("chevron-left",{fontCharacter:"\\eab5"}),i.chevronRight=new i("chevron-right",{fontCharacter:"\\eab6"}),i.chevronUp=new i("chevron-up",{fontCharacter:"\\eab7"}),i.chromeClose=new i("chrome-close",{fontCharacter:"\\eab8"}),i.chromeMaximize=new i("chrome-maximize",{fontCharacter:"\\eab9"}),i.chromeMinimize=new i("chrome-minimize",{fontCharacter:"\\eaba"}),i.chromeRestore=new i("chrome-restore",{fontCharacter:"\\eabb"}),i.circleOutline=new i("circle-outline",{fontCharacter:"\\eabc"}),i.debugBreakpointUnverified=new i("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),i.circleSlash=new i("circle-slash",{fontCharacter:"\\eabd"}),i.circuitBoard=new i("circuit-board",{fontCharacter:"\\eabe"}),i.clearAll=new i("clear-all",{fontCharacter:"\\eabf"}),i.clippy=new i("clippy",{fontCharacter:"\\eac0"}),i.closeAll=new i("close-all",{fontCharacter:"\\eac1"}),i.cloudDownload=new i("cloud-download",{fontCharacter:"\\eac2"}),i.cloudUpload=new i("cloud-upload",{fontCharacter:"\\eac3"}),i.code=new i("code",{fontCharacter:"\\eac4"}),i.collapseAll=new i("collapse-all",{fontCharacter:"\\eac5"}),i.colorMode=new i("color-mode",{fontCharacter:"\\eac6"}),i.commentDiscussion=new i("comment-discussion",{fontCharacter:"\\eac7"}),i.compareChanges=new i("compare-changes",{fontCharacter:"\\eafd"}),i.creditCard=new i("credit-card",{fontCharacter:"\\eac9"}),i.dash=new i("dash",{fontCharacter:"\\eacc"}),i.dashboard=new i("dashboard",{fontCharacter:"\\eacd"}),i.database=new i("database",{fontCharacter:"\\eace"}),i.debugContinue=new i("debug-continue",{fontCharacter:"\\eacf"}),i.debugDisconnect=new i("debug-disconnect",{fontCharacter:"\\ead0"}),i.debugPause=new i("debug-pause",{fontCharacter:"\\ead1"}),i.debugRestart=new i("debug-restart",{fontCharacter:"\\ead2"}),i.debugStart=new i("debug-start",{fontCharacter:"\\ead3"}),i.debugStepInto=new i("debug-step-into",{fontCharacter:"\\ead4"}),i.debugStepOut=new i("debug-step-out",{fontCharacter:"\\ead5"}),i.debugStepOver=new i("debug-step-over",{fontCharacter:"\\ead6"}),i.debugStop=new i("debug-stop",{fontCharacter:"\\ead7"}),i.debug=new i("debug",{fontCharacter:"\\ead8"}),i.deviceCameraVideo=new i("device-camera-video",{fontCharacter:"\\ead9"}),i.deviceCamera=new i("device-camera",{fontCharacter:"\\eada"}),i.deviceMobile=new i("device-mobile",{fontCharacter:"\\eadb"}),i.diffAdded=new i("diff-added",{fontCharacter:"\\eadc"}),i.diffIgnored=new i("diff-ignored",{fontCharacter:"\\eadd"}),i.diffModified=new i("diff-modified",{fontCharacter:"\\eade"}),i.diffRemoved=new i("diff-removed",{fontCharacter:"\\eadf"}),i.diffRenamed=new i("diff-renamed",{fontCharacter:"\\eae0"}),i.diff=new i("diff",{fontCharacter:"\\eae1"}),i.discard=new i("discard",{fontCharacter:"\\eae2"}),i.editorLayout=new i("editor-layout",{fontCharacter:"\\eae3"}),i.emptyWindow=new i("empty-window",{fontCharacter:"\\eae4"}),i.exclude=new i("exclude",{fontCharacter:"\\eae5"}),i.extensions=new i("extensions",{fontCharacter:"\\eae6"}),i.eyeClosed=new i("eye-closed",{fontCharacter:"\\eae7"}),i.fileBinary=new i("file-binary",{fontCharacter:"\\eae8"}),i.fileCode=new i("file-code",{fontCharacter:"\\eae9"}),i.fileMedia=new i("file-media",{fontCharacter:"\\eaea"}),i.filePdf=new i("file-pdf",{fontCharacter:"\\eaeb"}),i.fileSubmodule=new i("file-submodule",{fontCharacter:"\\eaec"}),i.fileSymlinkDirectory=new i("file-symlink-directory",{fontCharacter:"\\eaed"}),i.fileSymlinkFile=new i("file-symlink-file",{fontCharacter:"\\eaee"}),i.fileZip=new i("file-zip",{fontCharacter:"\\eaef"}),i.files=new i("files",{fontCharacter:"\\eaf0"}),i.filter=new i("filter",{fontCharacter:"\\eaf1"}),i.flame=new i("flame",{fontCharacter:"\\eaf2"}),i.foldDown=new i("fold-down",{fontCharacter:"\\eaf3"}),i.foldUp=new i("fold-up",{fontCharacter:"\\eaf4"}),i.fold=new i("fold",{fontCharacter:"\\eaf5"}),i.folderActive=new i("folder-active",{fontCharacter:"\\eaf6"}),i.folderOpened=new i("folder-opened",{fontCharacter:"\\eaf7"}),i.gear=new i("gear",{fontCharacter:"\\eaf8"}),i.gift=new i("gift",{fontCharacter:"\\eaf9"}),i.gistSecret=new i("gist-secret",{fontCharacter:"\\eafa"}),i.gist=new i("gist",{fontCharacter:"\\eafb"}),i.gitCommit=new i("git-commit",{fontCharacter:"\\eafc"}),i.gitCompare=new i("git-compare",{fontCharacter:"\\eafd"}),i.gitMerge=new i("git-merge",{fontCharacter:"\\eafe"}),i.githubAction=new i("github-action",{fontCharacter:"\\eaff"}),i.githubAlt=new i("github-alt",{fontCharacter:"\\eb00"}),i.globe=new i("globe",{fontCharacter:"\\eb01"}),i.grabber=new i("grabber",{fontCharacter:"\\eb02"}),i.graph=new i("graph",{fontCharacter:"\\eb03"}),i.gripper=new i("gripper",{fontCharacter:"\\eb04"}),i.heart=new i("heart",{fontCharacter:"\\eb05"}),i.home=new i("home",{fontCharacter:"\\eb06"}),i.horizontalRule=new i("horizontal-rule",{fontCharacter:"\\eb07"}),i.hubot=new i("hubot",{fontCharacter:"\\eb08"}),i.inbox=new i("inbox",{fontCharacter:"\\eb09"}),i.issueClosed=new i("issue-closed",{fontCharacter:"\\eba4"}),i.issueReopened=new i("issue-reopened",{fontCharacter:"\\eb0b"}),i.issues=new i("issues",{fontCharacter:"\\eb0c"}),i.italic=new i("italic",{fontCharacter:"\\eb0d"}),i.jersey=new i("jersey",{fontCharacter:"\\eb0e"}),i.json=new i("json",{fontCharacter:"\\eb0f"}),i.kebabVertical=new i("kebab-vertical",{fontCharacter:"\\eb10"}),i.key=new i("key",{fontCharacter:"\\eb11"}),i.law=new i("law",{fontCharacter:"\\eb12"}),i.lightbulbAutofix=new i("lightbulb-autofix",{fontCharacter:"\\eb13"}),i.linkExternal=new i("link-external",{fontCharacter:"\\eb14"}),i.link=new i("link",{fontCharacter:"\\eb15"}),i.listOrdered=new i("list-ordered",{fontCharacter:"\\eb16"}),i.listUnordered=new i("list-unordered",{fontCharacter:"\\eb17"}),i.liveShare=new i("live-share",{fontCharacter:"\\eb18"}),i.loading=new i("loading",{fontCharacter:"\\eb19"}),i.location=new i("location",{fontCharacter:"\\eb1a"}),i.mailRead=new i("mail-read",{fontCharacter:"\\eb1b"}),i.mail=new i("mail",{fontCharacter:"\\eb1c"}),i.markdown=new i("markdown",{fontCharacter:"\\eb1d"}),i.megaphone=new i("megaphone",{fontCharacter:"\\eb1e"}),i.mention=new i("mention",{fontCharacter:"\\eb1f"}),i.milestone=new i("milestone",{fontCharacter:"\\eb20"}),i.mortarBoard=new i("mortar-board",{fontCharacter:"\\eb21"}),i.move=new i("move",{fontCharacter:"\\eb22"}),i.multipleWindows=new i("multiple-windows",{fontCharacter:"\\eb23"}),i.mute=new i("mute",{fontCharacter:"\\eb24"}),i.noNewline=new i("no-newline",{fontCharacter:"\\eb25"}),i.note=new i("note",{fontCharacter:"\\eb26"}),i.octoface=new i("octoface",{fontCharacter:"\\eb27"}),i.openPreview=new i("open-preview",{fontCharacter:"\\eb28"}),i.package_=new i("package",{fontCharacter:"\\eb29"}),i.paintcan=new i("paintcan",{fontCharacter:"\\eb2a"}),i.pin=new i("pin",{fontCharacter:"\\eb2b"}),i.play=new i("play",{fontCharacter:"\\eb2c"}),i.run=new i("run",{fontCharacter:"\\eb2c"}),i.plug=new i("plug",{fontCharacter:"\\eb2d"}),i.preserveCase=new i("preserve-case",{fontCharacter:"\\eb2e"}),i.preview=new i("preview",{fontCharacter:"\\eb2f"}),i.project=new i("project",{fontCharacter:"\\eb30"}),i.pulse=new i("pulse",{fontCharacter:"\\eb31"}),i.question=new i("question",{fontCharacter:"\\eb32"}),i.quote=new i("quote",{fontCharacter:"\\eb33"}),i.radioTower=new i("radio-tower",{fontCharacter:"\\eb34"}),i.reactions=new i("reactions",{fontCharacter:"\\eb35"}),i.references=new i("references",{fontCharacter:"\\eb36"}),i.refresh=new i("refresh",{fontCharacter:"\\eb37"}),i.regex=new i("regex",{fontCharacter:"\\eb38"}),i.remoteExplorer=new i("remote-explorer",{fontCharacter:"\\eb39"}),i.remote=new i("remote",{fontCharacter:"\\eb3a"}),i.remove=new i("remove",{fontCharacter:"\\eb3b"}),i.replaceAll=new i("replace-all",{fontCharacter:"\\eb3c"}),i.replace=new i("replace",{fontCharacter:"\\eb3d"}),i.repoClone=new i("repo-clone",{fontCharacter:"\\eb3e"}),i.repoForcePush=new i("repo-force-push",{fontCharacter:"\\eb3f"}),i.repoPull=new i("repo-pull",{fontCharacter:"\\eb40"}),i.repoPush=new i("repo-push",{fontCharacter:"\\eb41"}),i.report=new i("report",{fontCharacter:"\\eb42"}),i.requestChanges=new i("request-changes",{fontCharacter:"\\eb43"}),i.rocket=new i("rocket",{fontCharacter:"\\eb44"}),i.rootFolderOpened=new i("root-folder-opened",{fontCharacter:"\\eb45"}),i.rootFolder=new i("root-folder",{fontCharacter:"\\eb46"}),i.rss=new i("rss",{fontCharacter:"\\eb47"}),i.ruby=new i("ruby",{fontCharacter:"\\eb48"}),i.saveAll=new i("save-all",{fontCharacter:"\\eb49"}),i.saveAs=new i("save-as",{fontCharacter:"\\eb4a"}),i.save=new i("save",{fontCharacter:"\\eb4b"}),i.screenFull=new i("screen-full",{fontCharacter:"\\eb4c"}),i.screenNormal=new i("screen-normal",{fontCharacter:"\\eb4d"}),i.searchStop=new i("search-stop",{fontCharacter:"\\eb4e"}),i.server=new i("server",{fontCharacter:"\\eb50"}),i.settingsGear=new i("settings-gear",{fontCharacter:"\\eb51"}),i.settings=new i("settings",{fontCharacter:"\\eb52"}),i.shield=new i("shield",{fontCharacter:"\\eb53"}),i.smiley=new i("smiley",{fontCharacter:"\\eb54"}),i.sortPrecedence=new i("sort-precedence",{fontCharacter:"\\eb55"}),i.splitHorizontal=new i("split-horizontal",{fontCharacter:"\\eb56"}),i.splitVertical=new i("split-vertical",{fontCharacter:"\\eb57"}),i.squirrel=new i("squirrel",{fontCharacter:"\\eb58"}),i.starFull=new i("star-full",{fontCharacter:"\\eb59"}),i.starHalf=new i("star-half",{fontCharacter:"\\eb5a"}),i.symbolClass=new i("symbol-class",{fontCharacter:"\\eb5b"}),i.symbolColor=new i("symbol-color",{fontCharacter:"\\eb5c"}),i.symbolConstant=new i("symbol-constant",{fontCharacter:"\\eb5d"}),i.symbolEnumMember=new i("symbol-enum-member",{fontCharacter:"\\eb5e"}),i.symbolField=new i("symbol-field",{fontCharacter:"\\eb5f"}),i.symbolFile=new i("symbol-file",{fontCharacter:"\\eb60"}),i.symbolInterface=new i("symbol-interface",{fontCharacter:"\\eb61"}),i.symbolKeyword=new i("symbol-keyword",{fontCharacter:"\\eb62"}),i.symbolMisc=new i("symbol-misc",{fontCharacter:"\\eb63"}),i.symbolOperator=new i("symbol-operator",{fontCharacter:"\\eb64"}),i.symbolProperty=new i("symbol-property",{fontCharacter:"\\eb65"}),i.wrench=new i("wrench",{fontCharacter:"\\eb65"}),i.wrenchSubaction=new i("wrench-subaction",{fontCharacter:"\\eb65"}),i.symbolSnippet=new i("symbol-snippet",{fontCharacter:"\\eb66"}),i.tasklist=new i("tasklist",{fontCharacter:"\\eb67"}),i.telescope=new i("telescope",{fontCharacter:"\\eb68"}),i.textSize=new i("text-size",{fontCharacter:"\\eb69"}),i.threeBars=new i("three-bars",{fontCharacter:"\\eb6a"}),i.thumbsdown=new i("thumbsdown",{fontCharacter:"\\eb6b"}),i.thumbsup=new i("thumbsup",{fontCharacter:"\\eb6c"}),i.tools=new i("tools",{fontCharacter:"\\eb6d"}),i.triangleDown=new i("triangle-down",{fontCharacter:"\\eb6e"}),i.triangleLeft=new i("triangle-left",{fontCharacter:"\\eb6f"}),i.triangleRight=new i("triangle-right",{fontCharacter:"\\eb70"}),i.triangleUp=new i("triangle-up",{fontCharacter:"\\eb71"}),i.twitter=new i("twitter",{fontCharacter:"\\eb72"}),i.unfold=new i("unfold",{fontCharacter:"\\eb73"}),i.unlock=new i("unlock",{fontCharacter:"\\eb74"}),i.unmute=new i("unmute",{fontCharacter:"\\eb75"}),i.unverified=new i("unverified",{fontCharacter:"\\eb76"}),i.verified=new i("verified",{fontCharacter:"\\eb77"}),i.versions=new i("versions",{fontCharacter:"\\eb78"}),i.vmActive=new i("vm-active",{fontCharacter:"\\eb79"}),i.vmOutline=new i("vm-outline",{fontCharacter:"\\eb7a"}),i.vmRunning=new i("vm-running",{fontCharacter:"\\eb7b"}),i.watch=new i("watch",{fontCharacter:"\\eb7c"}),i.whitespace=new i("whitespace",{fontCharacter:"\\eb7d"}),i.wholeWord=new i("whole-word",{fontCharacter:"\\eb7e"}),i.window=new i("window",{fontCharacter:"\\eb7f"}),i.wordWrap=new i("word-wrap",{fontCharacter:"\\eb80"}),i.zoomIn=new i("zoom-in",{fontCharacter:"\\eb81"}),i.zoomOut=new i("zoom-out",{fontCharacter:"\\eb82"}),i.listFilter=new i("list-filter",{fontCharacter:"\\eb83"}),i.listFlat=new i("list-flat",{fontCharacter:"\\eb84"}),i.listSelection=new i("list-selection",{fontCharacter:"\\eb85"}),i.selection=new i("selection",{fontCharacter:"\\eb85"}),i.listTree=new i("list-tree",{fontCharacter:"\\eb86"}),i.debugBreakpointFunctionUnverified=new i("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),i.debugBreakpointFunction=new i("debug-breakpoint-function",{fontCharacter:"\\eb88"}),i.debugBreakpointFunctionDisabled=new i("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),i.debugStackframeActive=new i("debug-stackframe-active",{fontCharacter:"\\eb89"}),i.debugStackframeDot=new i("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),i.debugStackframe=new i("debug-stackframe",{fontCharacter:"\\eb8b"}),i.debugStackframeFocused=new i("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),i.debugBreakpointUnsupported=new i("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),i.symbolString=new i("symbol-string",{fontCharacter:"\\eb8d"}),i.debugReverseContinue=new i("debug-reverse-continue",{fontCharacter:"\\eb8e"}),i.debugStepBack=new i("debug-step-back",{fontCharacter:"\\eb8f"}),i.debugRestartFrame=new i("debug-restart-frame",{fontCharacter:"\\eb90"}),i.callIncoming=new i("call-incoming",{fontCharacter:"\\eb92"}),i.callOutgoing=new i("call-outgoing",{fontCharacter:"\\eb93"}),i.menu=new i("menu",{fontCharacter:"\\eb94"}),i.expandAll=new i("expand-all",{fontCharacter:"\\eb95"}),i.feedback=new i("feedback",{fontCharacter:"\\eb96"}),i.groupByRefType=new i("group-by-ref-type",{fontCharacter:"\\eb97"}),i.ungroupByRefType=new i("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),i.account=new i("account",{fontCharacter:"\\eb99"}),i.bellDot=new i("bell-dot",{fontCharacter:"\\eb9a"}),i.debugConsole=new i("debug-console",{fontCharacter:"\\eb9b"}),i.library=new i("library",{fontCharacter:"\\eb9c"}),i.output=new i("output",{fontCharacter:"\\eb9d"}),i.runAll=new i("run-all",{fontCharacter:"\\eb9e"}),i.syncIgnored=new i("sync-ignored",{fontCharacter:"\\eb9f"}),i.pinned=new i("pinned",{fontCharacter:"\\eba0"}),i.githubInverted=new i("github-inverted",{fontCharacter:"\\eba1"}),i.debugAlt=new i("debug-alt",{fontCharacter:"\\eb91"}),i.serverProcess=new i("server-process",{fontCharacter:"\\eba2"}),i.serverEnvironment=new i("server-environment",{fontCharacter:"\\eba3"}),i.pass=new i("pass",{fontCharacter:"\\eba4"}),i.stopCircle=new i("stop-circle",{fontCharacter:"\\eba5"}),i.playCircle=new i("play-circle",{fontCharacter:"\\eba6"}),i.record=new i("record",{fontCharacter:"\\eba7"}),i.debugAltSmall=new i("debug-alt-small",{fontCharacter:"\\eba8"}),i.vmConnect=new i("vm-connect",{fontCharacter:"\\eba9"}),i.cloud=new i("cloud",{fontCharacter:"\\ebaa"}),i.merge=new i("merge",{fontCharacter:"\\ebab"}),i.exportIcon=new i("export",{fontCharacter:"\\ebac"}),i.graphLeft=new i("graph-left",{fontCharacter:"\\ebad"}),i.magnet=new i("magnet",{fontCharacter:"\\ebae"}),i.notebook=new i("notebook",{fontCharacter:"\\ebaf"}),i.redo=new i("redo",{fontCharacter:"\\ebb0"}),i.checkAll=new i("check-all",{fontCharacter:"\\ebb1"}),i.pinnedDirty=new i("pinned-dirty",{fontCharacter:"\\ebb2"}),i.passFilled=new i("pass-filled",{fontCharacter:"\\ebb3"}),i.circleLargeFilled=new i("circle-large-filled",{fontCharacter:"\\ebb4"}),i.circleLargeOutline=new i("circle-large-outline",{fontCharacter:"\\ebb5"}),i.combine=new i("combine",{fontCharacter:"\\ebb6"}),i.gather=new i("gather",{fontCharacter:"\\ebb6"}),i.table=new i("table",{fontCharacter:"\\ebb7"}),i.variableGroup=new i("variable-group",{fontCharacter:"\\ebb8"}),i.typeHierarchy=new i("type-hierarchy",{fontCharacter:"\\ebb9"}),i.typeHierarchySub=new i("type-hierarchy-sub",{fontCharacter:"\\ebba"}),i.typeHierarchySuper=new i("type-hierarchy-super",{fontCharacter:"\\ebbb"}),i.gitPullRequestCreate=new i("git-pull-request-create",{fontCharacter:"\\ebbc"}),i.runAbove=new i("run-above",{fontCharacter:"\\ebbd"}),i.runBelow=new i("run-below",{fontCharacter:"\\ebbe"}),i.notebookTemplate=new i("notebook-template",{fontCharacter:"\\ebbf"}),i.debugRerun=new i("debug-rerun",{fontCharacter:"\\ebc0"}),i.workspaceTrusted=new i("workspace-trusted",{fontCharacter:"\\ebc1"}),i.workspaceUntrusted=new i("workspace-untrusted",{fontCharacter:"\\ebc2"}),i.workspaceUnspecified=new i("workspace-unspecified",{fontCharacter:"\\ebc3"}),i.terminalCmd=new i("terminal-cmd",{fontCharacter:"\\ebc4"}),i.terminalDebian=new i("terminal-debian",{fontCharacter:"\\ebc5"}),i.terminalLinux=new i("terminal-linux",{fontCharacter:"\\ebc6"}),i.terminalPowershell=new i("terminal-powershell",{fontCharacter:"\\ebc7"}),i.terminalTmux=new i("terminal-tmux",{fontCharacter:"\\ebc8"}),i.terminalUbuntu=new i("terminal-ubuntu",{fontCharacter:"\\ebc9"}),i.terminalBash=new i("terminal-bash",{fontCharacter:"\\ebca"}),i.arrowSwap=new i("arrow-swap",{fontCharacter:"\\ebcb"}),i.copy=new i("copy",{fontCharacter:"\\ebcc"}),i.personAdd=new i("person-add",{fontCharacter:"\\ebcd"}),i.filterFilled=new i("filter-filled",{fontCharacter:"\\ebce"}),i.wand=new i("wand",{fontCharacter:"\\ebcf"}),i.debugLineByLine=new i("debug-line-by-line",{fontCharacter:"\\ebd0"}),i.inspect=new i("inspect",{fontCharacter:"\\ebd1"}),i.layers=new i("layers",{fontCharacter:"\\ebd2"}),i.layersDot=new i("layers-dot",{fontCharacter:"\\ebd3"}),i.layersActive=new i("layers-active",{fontCharacter:"\\ebd4"}),i.compass=new i("compass",{fontCharacter:"\\ebd5"}),i.compassDot=new i("compass-dot",{fontCharacter:"\\ebd6"}),i.compassActive=new i("compass-active",{fontCharacter:"\\ebd7"}),i.azure=new i("azure",{fontCharacter:"\\ebd8"}),i.issueDraft=new i("issue-draft",{fontCharacter:"\\ebd9"}),i.gitPullRequestClosed=new i("git-pull-request-closed",{fontCharacter:"\\ebda"}),i.gitPullRequestDraft=new i("git-pull-request-draft",{fontCharacter:"\\ebdb"}),i.debugAll=new i("debug-all",{fontCharacter:"\\ebdc"}),i.debugCoverage=new i("debug-coverage",{fontCharacter:"\\ebdd"}),i.runErrors=new i("run-errors",{fontCharacter:"\\ebde"}),i.folderLibrary=new i("folder-library",{fontCharacter:"\\ebdf"}),i.debugContinueSmall=new i("debug-continue-small",{fontCharacter:"\\ebe0"}),i.beakerStop=new i("beaker-stop",{fontCharacter:"\\ebe1"}),i.graphLine=new i("graph-line",{fontCharacter:"\\ebe2"}),i.graphScatter=new i("graph-scatter",{fontCharacter:"\\ebe3"}),i.pieChart=new i("pie-chart",{fontCharacter:"\\ebe4"}),i.bracket=new i("bracket",i.json.definition),i.bracketDot=new i("bracket-dot",{fontCharacter:"\\ebe5"}),i.bracketError=new i("bracket-error",{fontCharacter:"\\ebe6"}),i.lockSmall=new i("lock-small",{fontCharacter:"\\ebe7"}),i.azureDevops=new i("azure-devops",{fontCharacter:"\\ebe8"}),i.verifiedFilled=new i("verified-filled",{fontCharacter:"\\ebe9"})}(G||(G={}))},"VrN/":function(at,ge,J){(function(ie,$){at.exports=$()})(this,function(){"use strict";var ie=navigator.userAgent,$=navigator.platform,M=/gecko\/\d/i.test(ie),Y=/MSIE \d/.test(ie),F=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ie),U=/Edge\/(\d+)/.exec(ie),G=Y||F||U,W=G&&(Y?document.documentMode||6:+(U||F)[1]),i=!U&&/WebKit\//.test(ie),D=i&&/Qt\/\d+\.\d+/.test(ie),g=!U&&/Chrome\//.test(ie),d=/Opera\//.test(ie),m=/Apple Computer/.test(navigator.vendor),u=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ie),a=/PhantomJS/.test(ie),f=!U&&/AppleWebKit/.test(ie)&&/Mobile\/\w+/.test(ie),l=/Android/.test(ie),h=f||l||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ie),o=f||/Mac/.test($),s=/\bCrOS\b/.test(ie),A=/win/i.test($),_=d&&ie.match(/Version\/(\d*\.\d*)/);_&&(_=Number(_[1])),_&&_>=15&&(d=!1,i=!0);var S=o&&(D||d&&(_==null||_<12.11)),L=M||G&&W>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var C=function(e,t){var r=e.className,n=O(t).exec(r);if(n){var c=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(c?n[1]+c:"")}};function w(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function x(e,t){return w(e).appendChild(t)}function p(e,t,r,n){var c=document.createElement(e);if(r&&(c.className=r),n&&(c.style.cssText=n),typeof t=="string")c.appendChild(document.createTextNode(t));else if(t)for(var k=0;k<t.length;++k)c.appendChild(t[k]);return c}function T(e,t,r,n){var c=p(e,t,r,n);return c.setAttribute("role","presentation"),c}var v;document.createRange?v=function(e,t,r,n){var c=document.createRange();return c.setEnd(n||e,r),c.setStart(e,t),c}:v=function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(c){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};function y(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function N(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function B(e,t){var r=e.className;O(t).test(r)||(e.className+=(r?" ":"")+t)}function R(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!O(r[n]).test(t)&&(t+=" "+r[n]);return t}var j=function(e){e.select()};f?j=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:G&&(j=function(e){try{e.select()}catch(t){}});function P(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function b(e,t,r){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(r!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function X(e,t,r,n,c){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var k=n||0,K=c||0;;){var Q=e.indexOf(" ",k);if(Q<0||Q>=t)return K+(t-k);K+=Q-k,K+=r-K%r,k=Q+1}}var ee=function(){this.id=null,this.f=null,this.time=0,this.handler=P(this.onTimeout,this)};ee.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ee.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};function ae(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}var le=50,Re={toString:function(){return"CodeMirror.Pass"}},Ee={scroll:!1},Te={origin:"*mouse"},Ae={origin:"+move"};function Oe(e,t,r){for(var n=0,c=0;;){var k=e.indexOf(" ",n);k==-1&&(k=e.length);var K=k-n;if(k==e.length||c+K>=t)return n+Math.min(K,t-c);if(c+=k-n,c+=r-c%r,n=k+1,c>=t)return n}}var ce=[""];function ue(e){for(;ce.length<=e;)ce.push(Pe(ce)+" ");return ce[e]}function Pe(e){return e[e.length-1]}function qe(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function ze(e,t,r){for(var n=0,c=r(t);n<e.length&&r(e[n])<=c;)n++;e.splice(n,0,t)}function et(){}function nt(e,t){var r;return Object.create?r=Object.create(e):(et.prototype=e,r=new et),t&&b(t,r),r}var Ie=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Me(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ie.test(e))}function Ge(e,t){return t?t.source.indexOf("\\w")>-1&&Me(e)?!0:t.test(e):Me(e)}function se(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var be=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function xe(e){return e.charCodeAt(0)>=768&&be.test(e)}function Se(e,t,r){for(;(r<0?t>0:t<e.length)&&xe(e.charAt(t));)t+=r;return t}function Be(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var c=(t+r)/2,k=n<0?Math.ceil(c):Math.floor(c);if(k==t)return e(k)?t:r;e(k)?r=k:t=k+n}}function He(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var c=!1,k=0;k<e.length;++k){var K=e[k];(K.from<r&&K.to>t||t==r&&K.to==t)&&(n(Math.max(K.from,t),Math.min(K.to,r),K.level==1?"rtl":"ltr",k),c=!0)}c||n(t,r,"ltr")}var Xe=null;function Ve(e,t,r){var n;Xe=null;for(var c=0;c<e.length;++c){var k=e[c];if(k.from<t&&k.to>t)return c;k.to==t&&(k.from!=k.to&&r=="before"?n=c:Xe=c),k.from==t&&(k.from!=k.to&&r!="before"?n=c:Xe=c)}return n!=null?n:Xe}var lt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(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 n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,c=/[stwN]/,k=/[LRr]/,K=/[Lb1n]/,Q=/[1n]/;function Z(te,he,pe){this.level=te,this.from=he,this.to=pe}return function(te,he){var pe=he=="ltr"?"L":"R";if(te.length==0||he=="ltr"&&!n.test(te))return!1;for(var Ce=te.length,we=[],Fe=0;Fe<Ce;++Fe)we.push(r(te.charCodeAt(Fe)));for(var Ke=0,Ze=pe;Ke<Ce;++Ke){var st=we[Ke];st=="m"?we[Ke]=Ze:Ze=st}for(var ft=0,ot=pe;ft<Ce;++ft){var pt=we[ft];pt=="1"&&ot=="r"?we[ft]="n":k.test(pt)&&(ot=pt,pt=="r"&&(we[ft]="R"))}for(var At=1,xt=we[0];At<Ce-1;++At){var kt=we[At];kt=="+"&&xt=="1"&&we[At+1]=="1"?we[At]="1":kt==","&&xt==we[At+1]&&(xt=="1"||xt=="n")&&(we[At]=xt),xt=kt}for(var Zt=0;Zt<Ce;++Zt){var yi=we[Zt];if(yi==",")we[Zt]="N";else if(yi=="%"){var ii=void 0;for(ii=Zt+1;ii<Ce&&we[ii]=="%";++ii);for(var Ki=Zt&&we[Zt-1]=="!"||ii<Ce&&we[ii]=="1"?"1":"N",Ui=Zt;Ui<ii;++Ui)we[Ui]=Ki;Zt=ii-1}}for(var oi=0,Bi=pe;oi<Ce;++oi){var Ti=we[oi];Bi=="L"&&Ti=="1"?we[oi]="L":k.test(Ti)&&(Bi=Ti)}for(var di=0;di<Ce;++di)if(c.test(we[di])){var li=void 0;for(li=di+1;li<Ce&&c.test(we[li]);++li);for(var ni=(di?we[di-1]:pe)=="L",ji=(li<Ce?we[li]:pe)=="L",ur=ni==ji?ni?"L":"R":pe,In=di;In<li;++In)we[In]=ur;di=li-1}for(var Ri=[],ln,bi=0;bi<Ce;)if(K.test(we[bi])){var Va=bi;for(++bi;bi<Ce&&K.test(we[bi]);++bi);Ri.push(new Z(0,Va,bi))}else{var pn=bi,Gn=Ri.length,Kn=he=="rtl"?1:0;for(++bi;bi<Ce&&we[bi]!="L";++bi);for(var Ii=pn;Ii<bi;)if(Q.test(we[Ii])){pn<Ii&&(Ri.splice(Gn,0,new Z(1,pn,Ii)),Gn+=Kn);var hr=Ii;for(++Ii;Ii<bi&&Q.test(we[Ii]);++Ii);Ri.splice(Gn,0,new Z(2,hr,Ii)),Gn+=Kn,pn=Ii}else++Ii;pn<bi&&Ri.splice(Gn,0,new Z(1,pn,bi))}return he=="ltr"&&(Ri[0].level==1&&(ln=te.match(/^\s+/))&&(Ri[0].from=ln[0].length,Ri.unshift(new Z(0,0,ln[0].length))),Pe(Ri).level==1&&(ln=te.match(/\s+$/))&&(Pe(Ri).to-=ln[0].length,Ri.push(new Z(0,Ce-ln[0].length,Ce)))),he=="rtl"?Ri.reverse():Ri}}();function $e(e,t){var r=e.order;return r==null&&(r=e.order=lt(e.text,t)),r}var Qe=[],De=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||Qe).concat(r)}};function ct(e,t){return e._handlers&&e._handlers[t]||Qe}function ut(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,c=n&&n[t];if(c){var k=ae(c,r);k>-1&&(n[t]=c.slice(0,k).concat(c.slice(k+1)))}}}function ke(e,t){var r=ct(e,t);if(!r.length)return;for(var n=Array.prototype.slice.call(arguments,2),c=0;c<r.length;++c)r[c].apply(null,n)}function Ne(e,t,r){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ke(e,r||t.type,e,t),oe(t)||t.codemirrorIgnore}function _e(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)ae(r,t[n])==-1&&r.push(t[n])}function fe(e,t){return ct(e,t).length>0}function ve(e){e.prototype.on=function(t,r){De(this,t,r)},e.prototype.off=function(t,r){ut(this,t,r)}}function ne(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function re(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function oe(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function de(e){ne(e),re(e)}function ye(e){return e.target||e.srcElement}function Le(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),o&&e.ctrlKey&&t==1&&(t=3),t}var Ue=function(){if(G&&W<9)return!1;var e=p("div");return"draggable"in e||"dragDrop"in e}(),Je;function dt(e){if(Je==null){var t=p("span","\u200B");x(e,p("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Je=t.offsetWidth<=1&&t.offsetHeight>2&&!(G&&W<8))}var r=Je?p("span","\u200B"):p("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var rt;function mt(e){if(rt!=null)return rt;var t=x(e,document.createTextNode("A\u062EA")),r=v(t,0,1).getBoundingClientRect(),n=v(t,1,2).getBoundingClientRect();return w(e),!r||r.left==r.right?!1:rt=n.right-r.right<3}var yt=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,r=[],n=e.length;t<=n;){var c=e.indexOf(`
|
|
`,t);c==-1&&(c=e.length);var k=e.slice(t,e.charAt(c-1)=="\r"?c-1:c),K=k.indexOf("\r");K!=-1?(r.push(k.slice(0,K)),t+=K+1):(r.push(k),t=c+1)}return r}:function(e){return e.split(/\r\n?|\n/)},tt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(r){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ut=function(){var e=p("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Ct=null;function Jt(e){if(Ct!=null)return Ct;var t=x(e,p("span","x")),r=t.getBoundingClientRect(),n=v(t,0,1).getBoundingClientRect();return Ct=Math.abs(r.left-n.left)>1}var ei={},Dt={};function ci(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ei[e]=t}function Di(e,t){Dt[e]=t}function bt(e){if(typeof e=="string"&&Dt.hasOwnProperty(e))e=Dt[e];else if(e&&typeof e.name=="string"&&Dt.hasOwnProperty(e.name)){var t=Dt[e.name];typeof t=="string"&&(t={name:t}),e=nt(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return bt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return bt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function fi(e,t){t=bt(t);var r=ei[t.name];if(!r)return fi(e,"text/plain");var n=r(e,t);if(_t.hasOwnProperty(t.name)){var c=_t[t.name];for(var k in c){if(!c.hasOwnProperty(k))continue;n.hasOwnProperty(k)&&(n["_"+k]=n[k]),n[k]=c[k]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var K in t.modeProps)n[K]=t.modeProps[K];return n}var _t={};function wt(e,t){var r=_t.hasOwnProperty(e)?_t[e]:_t[e]={};b(t,r)}function Bt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var c=t[n];c instanceof Array&&(c=c.concat([])),r[n]=c}return r}function Lt(e,t){for(var r;e.innerMode&&!(r=e.innerMode(t),!r||r.mode==e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Mt(e,t,r){return e.startState?e.startState(t,r):!0}var Et=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};Et.prototype.eol=function(){return this.pos>=this.string.length},Et.prototype.sol=function(){return this.pos==this.lineStart},Et.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Et.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Et.prototype.eat=function(e){var t=this.string.charAt(this.pos),r;if(typeof e=="string"?r=t==e:r=t&&(e.test?e.test(t):e(t)),r)return++this.pos,t},Et.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Et.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Et.prototype.skipToEnd=function(){this.pos=this.string.length},Et.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Et.prototype.backUp=function(e){this.pos-=e},Et.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=X(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?X(this.string,this.lineStart,this.tabSize):0)},Et.prototype.indentation=function(){return X(this.string,null,this.tabSize)-(this.lineStart?X(this.string,this.lineStart,this.tabSize):0)},Et.prototype.match=function(e,t,r){if(typeof e=="string"){var n=function(K){return r?K.toLowerCase():K},c=this.string.substr(this.pos,e.length);if(n(c)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var k=this.string.slice(this.pos).match(e);return k&&k.index>0?null:(k&&t!==!1&&(this.pos+=k[0].length),k)}},Et.prototype.current=function(){return this.string.slice(this.start,this.pos)},Et.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Et.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Et.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ht(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var c=r.children[n],k=c.chunkSize();if(t<k){r=c;break}t-=k}return r.lines[t]}function _i(e,t,r){var n=[],c=t.line;return e.iter(t.line,r.line+1,function(k){var K=k.text;c==r.line&&(K=K.slice(0,r.ch)),c==t.line&&(K=K.slice(t.ch)),n.push(K),++c}),n}function Ht(e,t,r){var n=[];return e.iter(t,r,function(c){n.push(c.text)}),n}function zt(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function It(e){if(e.parent==null)return null;for(var t=e.parent,r=ae(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var c=0;!(n.children[c]==t);++c)r+=n.children[c].chunkSize();return r+t.first}function ui(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var c=e.children[n],k=c.height;if(t<k){e=c;continue e}t-=k,r+=c.chunkSize()}return r}while(!e.lines);for(var K=0;K<e.lines.length;++K){var Q=e.lines[K],Z=Q.height;if(t<Z)break;t-=Z}return r+K}function ki(e,t){return t>=e.first&&t<e.first+e.size}function Xi(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Ye(e,t,r){if(r===void 0&&(r=null),!(this instanceof Ye))return new Ye(e,t,r);this.line=e,this.ch=t,this.sticky=r}function Rt(e,t){return e.line-t.line||e.ch-t.ch}function mn(e,t){return e.sticky==t.sticky&&Rt(e,t)==0}function gn(e){return Ye(e.line,e.ch)}function vn(e,t){return Rt(e,t)<0?t:e}function yn(e,t){return Rt(e,t)<0?e:t}function V(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function E(e,t){if(t.line<e.first)return Ye(e.first,0);var r=e.first+e.size-1;return t.line>r?Ye(r,ht(e,r).text.length):I(t,ht(e,t.line).text.length)}function I(e,t){var r=e.ch;return r==null||r>t?Ye(e.line,t):r<0?Ye(e.line,0):e}function H(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=E(e,t[n]);return r}var q=function(e,t){this.state=e,this.lookAhead=t},z=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};z.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},z.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}},z.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},z.fromSaved=function(e,t,r){return t instanceof q?new z(e,Bt(e.mode,t.state),r,t.lookAhead):new z(e,Bt(e.mode,t),r)},z.prototype.save=function(e){var t=e!==!1?Bt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new q(t,this.maxLookAhead):t};function me(e,t,r,n){var c=[e.state.modeGen],k={};wi(e,t.text,e.doc.mode,r,function(te,he){return c.push(te,he)},k,n);for(var K=r.state,Q=function(te){r.baseTokens=c;var he=e.state.overlays[te],pe=1,Ce=0;r.state=!0,wi(e,t.text,he.mode,r,function(we,Fe){for(var Ke=pe;Ce<we;){var Ze=c[pe];Ze>we&&c.splice(pe,1,we,c[pe+1],Ze),pe+=2,Ce=Math.min(we,Ze)}if(!Fe)return;if(he.opaque)c.splice(Ke,pe-Ke,we,"overlay "+Fe),pe=Ke+2;else for(;Ke<pe;Ke+=2){var st=c[Ke+1];c[Ke+1]=(st?st+" ":"")+"overlay "+Fe}},k),r.state=K,r.baseTokens=null,r.baseTokenPos=1},Z=0;Z<e.state.overlays.length;++Z)Q(Z);return{styles:c,classes:k.bgClass||k.textClass?k:null}}function je(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=it(e,It(t)),c=t.text.length>e.options.maxHighlightLength&&Bt(e.doc.mode,n.state),k=me(e,t,n);c&&(n.state=c),t.stateAfter=n.save(!c),t.styles=k.styles,k.classes?t.styleClasses=k.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function it(e,t,r){var n=e.doc,c=e.display;if(!n.mode.startState)return new z(n,!0,t);var k=Si(e,t,r),K=k>n.first&&ht(n,k-1).stateAfter,Q=K?z.fromSaved(n,K,k):new z(n,Mt(n.mode),k);return n.iter(k,t,function(Z){gt(e,Z.text,Q);var te=Q.line;Z.stateAfter=te==t-1||te%5==0||te>=c.viewFrom&&te<c.viewTo?Q.save():null,Q.nextLine()}),r&&(n.modeFrontier=Q.line),Q}function gt(e,t,r,n){var c=e.doc.mode,k=new Et(t,e.options.tabSize,r);for(k.start=k.pos=n||0,t==""&&We(c,r.state);!k.eol();)Tt(c,k,r.state),k.start=k.pos}function We(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var r=Lt(e,t);if(r.mode.blankLine)return r.mode.blankLine(r.state)}function Tt(e,t,r,n){for(var c=0;c<10;c++){n&&(n[0]=Lt(e,r).mode);var k=e.token(t,r);if(t.pos>t.start)return k}throw new Error("Mode "+e.name+" failed to advance stream.")}var Gt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function qt(e,t,r,n){var c=e.doc,k=c.mode,K;t=E(c,t);var Q=ht(c,t.line),Z=it(e,t.line,r),te=new Et(Q.text,e.options.tabSize,Z),he;for(n&&(he=[]);(n||te.pos<t.ch)&&!te.eol();)te.start=te.pos,K=Tt(k,te,Z.state),n&&he.push(new Gt(te,K,Bt(c.mode,Z.state)));return n?he:new Gt(te,K,Z.state)}function Hi(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";t[n]==null?t[n]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+r[2])}return e}function wi(e,t,r,n,c,k,K){var Q=r.flattenSpans;Q==null&&(Q=e.options.flattenSpans);var Z=0,te=null,he=new Et(t,e.options.tabSize,n),pe,Ce=e.options.addModeClass&&[null];for(t==""&&Hi(We(r,n.state),k);!he.eol();){if(he.pos>e.options.maxHighlightLength?(Q=!1,K&>(e,t,n,he.pos),he.pos=t.length,pe=null):pe=Hi(Tt(r,he,n.state,Ce),k),Ce){var we=Ce[0].name;we&&(pe="m-"+(pe?we+" "+pe:we))}if(!Q||te!=pe){for(;Z<he.start;)Z=Math.min(he.start,Z+5e3),c(Z,te);te=pe}he.start=he.pos}for(;Z<he.pos;){var Fe=Math.min(he.pos,Z+5e3);c(Fe,te),Z=Fe}}function Si(e,t,r){for(var n,c,k=e.doc,K=r?-1:t-(e.doc.mode.innerMode?1e3:100),Q=t;Q>K;--Q){if(Q<=k.first)return k.first;var Z=ht(k,Q-1),te=Z.stateAfter;if(te&&(!r||Q+(te instanceof q?te.lookAhead:0)<=k.modeFrontier))return Q;var he=X(Z.text,null,e.options.tabSize);(c==null||n>he)&&(c=Q-1,n=he)}return c}function Qi(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var r=e.first,n=t-1;n>r;n--){var c=ht(e,n).stateAfter;if(c&&(!(c instanceof q)||n+c.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}var Dn=!1,pi=!1;function zi(){Dn=!0}function un(){pi=!0}function hn(e,t,r){this.marker=e,this.from=t,this.to=r}function Wi(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function kn(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function bn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function zn(e,t,r){var n;if(e)for(var c=0;c<e.length;++c){var k=e[c],K=k.marker,Q=k.from==null||(K.inclusiveLeft?k.from<=t:k.from<t);if(Q||k.from==t&&K.type=="bookmark"&&(!r||!k.marker.insertLeft)){var Z=k.to==null||(K.inclusiveRight?k.to>=t:k.to>t);(n||(n=[])).push(new hn(K,k.from,Z?null:k.to))}}return n}function Vn(e,t,r){var n;if(e)for(var c=0;c<e.length;++c){var k=e[c],K=k.marker,Q=k.to==null||(K.inclusiveRight?k.to>=t:k.to>t);if(Q||k.from==t&&K.type=="bookmark"&&(!r||k.marker.insertLeft)){var Z=k.from==null||(K.inclusiveLeft?k.from<=t:k.from<t);(n||(n=[])).push(new hn(K,Z?null:k.from-t,k.to==null?null:k.to-t))}}return n}function Zi(e,t){if(t.full)return null;var r=ki(e,t.from.line)&&ht(e,t.from.line).markedSpans,n=ki(e,t.to.line)&&ht(e,t.to.line).markedSpans;if(!r&&!n)return null;var c=t.from.ch,k=t.to.ch,K=Rt(t.from,t.to)==0,Q=zn(r,c,K),Z=Vn(n,k,K),te=t.text.length==1,he=Pe(t.text).length+(te?c:0);if(Q)for(var pe=0;pe<Q.length;++pe){var Ce=Q[pe];if(Ce.to==null){var we=Wi(Z,Ce.marker);we?te&&(Ce.to=we.to==null?null:we.to+he):Ce.to=c}}if(Z)for(var Fe=0;Fe<Z.length;++Fe){var Ke=Z[Fe];if(Ke.to!=null&&(Ke.to+=he),Ke.from==null){var Ze=Wi(Q,Ke.marker);Ze||(Ke.from=he,te&&(Q||(Q=[])).push(Ke))}else Ke.from+=he,te&&(Q||(Q=[])).push(Ke)}Q&&(Q=$i(Q)),Z&&Z!=Q&&(Z=$i(Z));var st=[Q];if(!te){var ft=t.text.length-2,ot;if(ft>0&&Q)for(var pt=0;pt<Q.length;++pt)Q[pt].to==null&&(ot||(ot=[])).push(new hn(Q[pt].marker,null,null));for(var At=0;At<ft;++At)st.push(ot);st.push(Z)}return st}function $i(e){for(var t=0;t<e.length;++t){var r=e[t];r.from!=null&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function _n(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(we){if(we.markedSpans)for(var Fe=0;Fe<we.markedSpans.length;++Fe){var Ke=we.markedSpans[Fe].marker;Ke.readOnly&&(!n||ae(n,Ke)==-1)&&(n||(n=[])).push(Ke)}}),!n)return null;for(var c=[{from:t,to:r}],k=0;k<n.length;++k)for(var K=n[k],Q=K.find(0),Z=0;Z<c.length;++Z){var te=c[Z];if(Rt(te.to,Q.from)<0||Rt(te.from,Q.to)>0)continue;var he=[Z,1],pe=Rt(te.from,Q.from),Ce=Rt(te.to,Q.to);(pe<0||!K.inclusiveLeft&&!pe)&&he.push({from:te.from,to:Q.from}),(Ce>0||!K.inclusiveRight&&!Ce)&&he.push({from:Q.to,to:te.to}),c.splice.apply(c,he),Z+=he.length-3}return c}function dr(e){var t=e.markedSpans;if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}function En(e,t){if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}function ri(e){return e.inclusiveLeft?-1:0}function Kt(e){return e.inclusiveRight?1:0}function Ei(e,t){var r=e.lines.length-t.lines.length;if(r!=0)return r;var n=e.find(),c=t.find(),k=Rt(n.from,c.from)||ri(e)-ri(t);if(k)return-k;var K=Rt(n.to,c.to)||Kt(e)-Kt(t);return K||t.id-e.id}function Nt(e,t){var r=pi&&e.markedSpans,n;if(r)for(var c=void 0,k=0;k<r.length;++k)c=r[k],c.marker.collapsed&&(t?c.from:c.to)==null&&(!n||Ei(n,c.marker)<0)&&(n=c.marker);return n}function si(e){return Nt(e,!0)}function Xt(e){return Nt(e,!1)}function rn(e,t){var r=pi&&e.markedSpans,n;if(r)for(var c=0;c<r.length;++c){var k=r[c];k.marker.collapsed&&(k.from==null||k.from<t)&&(k.to==null||k.to>t)&&(!n||Ei(n,k.marker)<0)&&(n=k.marker)}return n}function mi(e,t,r,n,c){var k=ht(e,t),K=pi&&k.markedSpans;if(K)for(var Q=0;Q<K.length;++Q){var Z=K[Q];if(!Z.marker.collapsed)continue;var te=Z.marker.find(0),he=Rt(te.from,r)||ri(Z.marker)-ri(c),pe=Rt(te.to,n)||Kt(Z.marker)-Kt(c);if(he>=0&&pe<=0||he<=0&&pe>=0)continue;if(he<=0&&(Z.marker.inclusiveRight&&c.inclusiveLeft?Rt(te.to,r)>=0:Rt(te.to,r)>0)||he>=0&&(Z.marker.inclusiveRight&&c.inclusiveLeft?Rt(te.from,n)<=0:Rt(te.from,n)<0))return!0}}function Oi(e){for(var t;t=si(e);)e=t.find(-1,!0).line;return e}function Yn(e){for(var t;t=Xt(e);)e=t.find(1,!0).line;return e}function xn(e){for(var t,r;t=Xt(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function cr(e,t){var r=ht(e,t),n=Oi(r);return r==n?t:It(n)}function Tn(e,t){if(t>e.lastLine())return t;var r=ht(e,t),n;if(!an(e,r))return t;for(;n=Xt(r);)r=n.find(1,!0).line;return It(r)+1}function an(e,t){var r=pi&&t.markedSpans;if(r)for(var n=void 0,c=0;c<r.length;++c){if(n=r[c],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&fr(e,t,n))return!0}}function fr(e,t,r){if(r.to==null){var n=r.marker.find(1,!0);return fr(e,n.line,Wi(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var c=void 0,k=0;k<t.markedSpans.length;++k)if(c=t.markedSpans[k],c.marker.collapsed&&!c.marker.widgetNode&&c.from==r.to&&(c.to==null||c.to!=r.from)&&(c.marker.inclusiveLeft||r.marker.inclusiveRight)&&fr(e,t,c))return!0}function qi(e){e=Oi(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var c=r.lines[n];if(c==e)break;t+=c.height}for(var k=r.parent;k;r=k,k=r.parent)for(var K=0;K<k.children.length;++K){var Q=k.children[K];if(Q==r)break;t+=Q.height}return t}function pr(e){if(e.height==0)return 0;for(var t=e.text.length,r,n=e;r=si(n);){var c=r.find(0,!0);n=c.from.line,t+=c.from.ch-c.to.ch}for(n=e;r=Xt(n);){var k=r.find(0,!0);t-=n.text.length-k.from.ch,n=k.to.line,t+=n.text.length-k.to.ch}return t}function jr(e){var t=e.display,r=e.doc;t.maxLine=ht(r,r.first),t.maxLineLength=pr(t.maxLine),t.maxLineChanged=!0,r.iter(function(n){var c=pr(n);c>t.maxLineLength&&(t.maxLineLength=c,t.maxLine=n)})}var Mn=function(e,t,r){this.text=e,En(this,t),this.height=r?r(this):1};Mn.prototype.lineNo=function(){return It(this)},ve(Mn);function ua(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),dr(e),En(e,r);var c=n?n(e):1;c!=e.height&&zt(e,c)}function vt(e){e.parent=null,dr(e)}var Ot={},St={};function Pt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?St:Ot;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Wt(e,t){var r=T("span",null,null,i?"padding-right: .1px":null),n={pre:T("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var c=0;c<=(t.rest?t.rest.length:0);c++){var k=c?t.rest[c-1]:t.line,K=void 0;n.pos=0,n.addToken=jt,mt(e.display.measure)&&(K=$e(k,e.doc.direction))&&(n.addToken=Mi(n.addToken,K)),n.map=[];var Q=t!=e.display.externalMeasured&&It(k);dn(k,n,je(e,k,Q)),k.styleClasses&&(k.styleClasses.bgClass&&(n.bgClass=R(k.styleClasses.bgClass,n.bgClass||"")),k.styleClasses.textClass&&(n.textClass=R(k.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(dt(e.display.measure))),c==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(i){var Z=n.content.lastChild;(/\bcm-tab\b/.test(Z.className)||Z.querySelector&&Z.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return ke(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=R(n.pre.className,n.textClass||"")),n}function Qt(e){var t=p("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function jt(e,t,r,n,c,k,K){if(!t)return;var Q=e.splitSpaces?hi(t,e.trailingSpace):t,Z=e.cm.state.specialChars,te=!1,he;if(!Z.test(t))e.col+=t.length,he=document.createTextNode(Q),e.map.push(e.pos,e.pos+t.length,he),G&&W<9&&(te=!0),e.pos+=t.length;else{he=document.createDocumentFragment();for(var pe=0;;){Z.lastIndex=pe;var Ce=Z.exec(t),we=Ce?Ce.index-pe:t.length-pe;if(we){var Fe=document.createTextNode(Q.slice(pe,pe+we));G&&W<9?he.appendChild(p("span",[Fe])):he.appendChild(Fe),e.map.push(e.pos,e.pos+we,Fe),e.col+=we,e.pos+=we}if(!Ce)break;pe+=we+1;var Ke=void 0;if(Ce[0]==" "){var Ze=e.cm.options.tabSize,st=Ze-e.col%Ze;Ke=he.appendChild(p("span",ue(st),"cm-tab")),Ke.setAttribute("role","presentation"),Ke.setAttribute("cm-text"," "),e.col+=st}else Ce[0]=="\r"||Ce[0]==`
|
|
`?(Ke=he.appendChild(p("span",Ce[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ke.setAttribute("cm-text",Ce[0]),e.col+=1):(Ke=e.cm.options.specialCharPlaceholder(Ce[0]),Ke.setAttribute("cm-text",Ce[0]),G&&W<9?he.appendChild(p("span",[Ke])):he.appendChild(Ke),e.col+=1);e.map.push(e.pos,e.pos+1,Ke),e.pos++}}if(e.trailingSpace=Q.charCodeAt(t.length-1)==32,r||n||c||te||k||K){var ft=r||"";n&&(ft+=n),c&&(ft+=c);var ot=p("span",[he],ft,k);if(K)for(var pt in K)K.hasOwnProperty(pt)&&pt!="style"&&pt!="class"&&ot.setAttribute(pt,K[pt]);return e.content.appendChild(ot)}e.content.appendChild(he)}function hi(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",c=0;c<e.length;c++){var k=e.charAt(c);k==" "&&r&&(c==e.length-1||e.charCodeAt(c+1)==32)&&(k="\xA0"),n+=k,r=k==" "}return n}function Mi(e,t){return function(r,n,c,k,K,Q,Z){c=c?c+" cm-force-border":"cm-force-border";for(var te=r.pos,he=te+n.length;;){for(var pe=void 0,Ce=0;Ce<t.length&&!(pe=t[Ce],pe.to>te&&pe.from<=te);Ce++);if(pe.to>=he)return e(r,n,c,k,K,Q,Z);e(r,n.slice(0,pe.to-te),c,k,null,Q,Z),k=null,n=n.slice(pe.to-te),te=pe.to}}}function Ft(e,t,r,n){var c=!n&&r.widgetNode;c&&e.map.push(e.pos,e.pos+t,c),!n&&e.cm.display.input.needsContentAttribute&&(c||(c=e.content.appendChild(document.createElement("span"))),c.setAttribute("cm-marker",r.id)),c&&(e.cm.display.input.setUneditable(c),e.content.appendChild(c)),e.pos+=t,e.trailingSpace=!1}function dn(e,t,r){var n=e.markedSpans,c=e.text,k=0;if(!n){for(var K=1;K<r.length;K+=2)t.addToken(t,c.slice(k,k=r[K]),Pt(r[K+1],t.cm.options));return}for(var Q=c.length,Z=0,te=1,he="",pe,Ce,we=0,Fe,Ke,Ze,st,ft;;){if(we==Z){Fe=Ke=Ze=Ce="",ft=null,st=null,we=Infinity;for(var ot=[],pt=void 0,At=0;At<n.length;++At){var xt=n[At],kt=xt.marker;if(kt.type=="bookmark"&&xt.from==Z&&kt.widgetNode)ot.push(kt);else if(xt.from<=Z&&(xt.to==null||xt.to>Z||kt.collapsed&&xt.to==Z&&xt.from==Z)){if(xt.to!=null&&xt.to!=Z&&we>xt.to&&(we=xt.to,Ke=""),kt.className&&(Fe+=" "+kt.className),kt.css&&(Ce=(Ce?Ce+";":"")+kt.css),kt.startStyle&&xt.from==Z&&(Ze+=" "+kt.startStyle),kt.endStyle&&xt.to==we&&(pt||(pt=[])).push(kt.endStyle,xt.to),kt.title&&((ft||(ft={})).title=kt.title),kt.attributes)for(var Zt in kt.attributes)(ft||(ft={}))[Zt]=kt.attributes[Zt];kt.collapsed&&(!st||Ei(st.marker,kt)<0)&&(st=xt)}else xt.from>Z&&we>xt.from&&(we=xt.from)}if(pt)for(var yi=0;yi<pt.length;yi+=2)pt[yi+1]==we&&(Ke+=" "+pt[yi]);if(!st||st.from==Z)for(var ii=0;ii<ot.length;++ii)Ft(t,0,ot[ii]);if(st&&(st.from||0)==Z){if(Ft(t,(st.to==null?Q+1:st.to)-Z,st.marker,st.from==null),st.to==null)return;st.to==Z&&(st=!1)}}if(Z>=Q)break;for(var Ki=Math.min(Q,we);;){if(he){var Ui=Z+he.length;if(!st){var oi=Ui>Ki?he.slice(0,Ki-Z):he;t.addToken(t,oi,pe?pe+Fe:Fe,Ze,Z+oi.length==we?Ke:"",Ce,ft)}if(Ui>=Ki){he=he.slice(Ki-Z),Z=Ki;break}Z=Ui,Ze=""}he=c.slice(k,k=r[te++]),pe=Pt(r[te++],t.cm.options)}}}function Vt(e,t,r){this.line=t,this.rest=xn(t),this.size=this.rest?It(Pe(this.rest))-r+1:1,this.node=this.text=null,this.hidden=an(e,t)}function Pi(e,t,r){for(var n=[],c,k=t;k<r;k=c){var K=new Vt(e.doc,ht(e.doc,k),k);c=k+K.size,n.push(K)}return n}var Ci=null;function Ji(e){Ci?Ci.ops.push(e):e.ownsGroup=Ci={ops:[e],delayedCallbacks:[]}}function Lo(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var c=e.ops[n];if(c.cursorActivityHandlers)for(;c.cursorActivityCalled<c.cursorActivityHandlers.length;)c.cursorActivityHandlers[c.cursorActivityCalled++].call(null,c.cm)}}while(r<t.length)}function Io(e,t){var r=e.ownsGroup;if(!r)return;try{Lo(r)}finally{Ci=null,t(r)}}var mr=null;function xi(e,t){var r=ct(e,t);if(!r.length)return;var n=Array.prototype.slice.call(arguments,2),c;Ci?c=Ci.delayedCallbacks:mr?c=mr:(c=mr=[],setTimeout(Do,0));for(var k=function(Q){c.push(function(){return r[Q].apply(null,n)})},K=0;K<r.length;++K)k(K)}function Do(){var e=mr;mr=null;for(var t=0;t<e.length;++t)e[t]()}function Xa(e,t,r,n){for(var c=0;c<t.changes.length;c++){var k=t.changes[c];k=="text"?Mo(e,t):k=="gutter"?Ja(e,t,r,n):k=="class"?ha(e,t):k=="widget"&&Po(e,t,n)}t.changes=null}function gr(e){return e.node==e.text&&(e.node=p("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),G&&W<8&&(e.node.style.zIndex=2)),e.node}function ko(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=gr(t);t.background=n.insertBefore(p("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}function $a(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Wt(e,t)}function Mo(e,t){var r=t.text.className,n=$a(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,ha(e,t)):r&&(t.text.className=r)}function ha(e,t){ko(e,t),t.line.wrapClass?gr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function Ja(e,t,r,n){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 c=gr(t);t.gutterBackground=p("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),c.insertBefore(t.gutterBackground,t.text)}var k=t.line.gutterMarkers;if(e.options.lineNumbers||k){var K=gr(t),Q=t.gutter=p("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(Q),K.insertBefore(Q,t.text),t.line.gutterClass&&(Q.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!k||!k["CodeMirror-linenumbers"])&&(t.lineNumber=Q.appendChild(p("div",Xi(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),k)for(var Z=0;Z<e.display.gutterSpecs.length;++Z){var te=e.display.gutterSpecs[Z].className,he=k.hasOwnProperty(te)&&k[te];he&&Q.appendChild(p("div",[he],"CodeMirror-gutter-elt","left: "+n.gutterLeft[te]+"px; width: "+n.gutterWidth[te]+"px"))}}}function Po(e,t,r){t.alignable&&(t.alignable=null);for(var n=O("CodeMirror-linewidget"),c=t.node.firstChild,k=void 0;c;c=k)k=c.nextSibling,n.test(c.className)&&t.node.removeChild(c);Qa(e,t,r)}function No(e,t,r,n){var c=$a(e,t);return t.text=t.node=c.pre,c.bgClass&&(t.bgClass=c.bgClass),c.textClass&&(t.textClass=c.textClass),ha(e,t),Ja(e,t,r,n),Qa(e,t,n),t.node}function Qa(e,t,r){if(Za(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)Za(e,t.rest[n],t,r,!1)}function Za(e,t,r,n,c){if(!t.widgets)return;for(var k=gr(r),K=0,Q=t.widgets;K<Q.length;++K){var Z=Q[K],te=p("div",[Z.node],"CodeMirror-linewidget"+(Z.className?" "+Z.className:""));Z.handleMouseEvents||te.setAttribute("cm-ignore-events","true"),Fo(Z,te,r,n),e.display.input.setUneditable(te),c&&Z.above?k.insertBefore(te,r.gutter||r.text):k.appendChild(te),xi(Z,"redraw")}}function Fo(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var c=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(c-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=c+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function vr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!y(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),x(t.display.measure,p("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function cn(e,t){for(var r=ye(t);r!=e.wrapper;r=r.parentNode)if(!r||r.nodeType==1&&r.getAttribute("cm-ignore-events")=="true"||r.parentNode==e.sizer&&r!=e.mover)return!0}function Hr(e){return e.lineSpace.offsetTop}function da(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function qa(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=x(e.measure,p("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function sn(e){return le-e.display.nativeBarWidth}function Pn(e){return e.display.scroller.clientWidth-sn(e)-e.display.barWidth}function ca(e){return e.display.scroller.clientHeight-sn(e)-e.display.barHeight}function Uo(e,t,r){var n=e.options.lineWrapping,c=n&&Pn(e);if(!t.measure.heights||n&&t.measure.width!=c){var k=t.measure.heights=[];if(n){t.measure.width=c;for(var K=t.text.firstChild.getClientRects(),Q=0;Q<K.length-1;Q++){var Z=K[Q],te=K[Q+1];Math.abs(Z.bottom-te.bottom)>2&&k.push((Z.bottom+te.top)/2-r.top)}}k.push(r.bottom-r.top)}}function es(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var c=0;c<e.rest.length;c++)if(It(e.rest[c])>r)return{map:e.measure.maps[c],cache:e.measure.caches[c],before:!0}}function Bo(e,t){t=Oi(t);var r=It(t),n=e.display.externalMeasured=new Vt(e.doc,t,r);n.lineN=r;var c=n.built=Wt(e,n);return n.text=c.pre,x(e.display.lineMeasure,c.pre),n}function ts(e,t,r,n){return on(e,Xn(e,t),r,n)}function fa(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Un(e,t)];var r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size)return r}function Xn(e,t){var r=It(t),n=fa(e,r);n&&!n.text?n=null:n&&n.changes&&(Xa(e,n,r,ba(e)),e.curOp.forceUpdate=!0),n||(n=Bo(e,t));var c=es(n,t,r);return{line:t,view:n,rect:null,map:c.map,cache:c.cache,before:c.before,hasHeights:!1}}function on(e,t,r,n,c){t.before&&(r=-1);var k=r+(n||""),K;return t.cache.hasOwnProperty(k)?K=t.cache[k]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Uo(e,t.view,t.rect),t.hasHeights=!0),K=Ho(e,t,r,n),K.bogus||(t.cache[k]=K)),{left:K.left,right:K.right,top:c?K.rtop:K.top,bottom:c?K.rbottom:K.bottom}}var is={left:0,right:0,top:0,bottom:0};function ns(e,t,r){for(var n,c,k,K,Q,Z,te=0;te<e.length;te+=3)if(Q=e[te],Z=e[te+1],t<Q?(c=0,k=1,K="left"):t<Z?(c=t-Q,k=c+1):(te==e.length-3||t==Z&&e[te+3]>t)&&(k=Z-Q,c=k-1,t>=Z&&(K="right")),c!=null){if(n=e[te+2],Q==Z&&r==(n.insertLeft?"left":"right")&&(K=r),r=="left"&&c==0)for(;te&&e[te-2]==e[te-3]&&e[te-1].insertLeft;)n=e[(te-=3)+2],K="left";if(r=="right"&&c==Z-Q)for(;te<e.length-3&&e[te+3]==e[te+4]&&!e[te+5].insertLeft;)n=e[(te+=3)+2],K="right";break}return{node:n,start:c,end:k,collapse:K,coverStart:Q,coverEnd:Z}}function jo(e,t){var r=is;if(t=="left")for(var n=0;n<e.length&&!((r=e[n]).left!=r.right);n++);else for(var c=e.length-1;c>=0&&!((r=e[c]).left!=r.right);c--);return r}function Ho(e,t,r,n){var c=ns(t.map,r,n),k=c.node,K=c.start,Q=c.end,Z=c.collapse,te;if(k.nodeType==3){for(var he=0;he<4;he++){for(;K&&xe(t.line.text.charAt(c.coverStart+K));)--K;for(;c.coverStart+Q<c.coverEnd&&xe(t.line.text.charAt(c.coverStart+Q));)++Q;if(G&&W<9&&K==0&&Q==c.coverEnd-c.coverStart?te=k.parentNode.getBoundingClientRect():te=jo(v(k,K,Q).getClientRects(),n),te.left||te.right||K==0)break;Q=K,K=K-1,Z="right"}G&&W<11&&(te=Wo(e.display.measure,te))}else{K>0&&(Z=n="right");var pe;e.options.lineWrapping&&(pe=k.getClientRects()).length>1?te=pe[n=="right"?pe.length-1:0]:te=k.getBoundingClientRect()}if(G&&W<9&&!K&&(!te||!te.left&&!te.right)){var Ce=k.parentNode.getClientRects()[0];Ce?te={left:Ce.left,right:Ce.left+Jn(e.display),top:Ce.top,bottom:Ce.bottom}:te=is}for(var we=te.top-t.rect.top,Fe=te.bottom-t.rect.top,Ke=(we+Fe)/2,Ze=t.view.measure.heights,st=0;st<Ze.length-1&&!(Ke<Ze[st]);st++);var ft=st?Ze[st-1]:0,ot=Ze[st],pt={left:(Z=="right"?te.right:te.left)-t.rect.left,right:(Z=="left"?te.left:te.right)-t.rect.left,top:ft,bottom:ot};return!te.left&&!te.right&&(pt.bogus=!0),e.options.singleCursorHeightPerLine||(pt.rtop=we,pt.rbottom=Fe),pt}function Wo(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Jt(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function rs(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function as(e){e.display.externalMeasure=null,w(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)rs(e.display.view[t])}function yr(e){as(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ss(){return g&&l?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function os(){return g&&l?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function pa(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=vr(e.widgets[r]));return t}function Wr(e,t,r,n,c){if(!c){var k=pa(t);r.top+=k,r.bottom+=k}if(n=="line")return r;n||(n="local");var K=qi(t);if(n=="local"?K+=Hr(e.display):K-=e.display.viewOffset,n=="page"||n=="window"){var Q=e.display.lineSpace.getBoundingClientRect();K+=Q.top+(n=="window"?0:os());var Z=Q.left+(n=="window"?0:ss());r.left+=Z,r.right+=Z}return r.top+=K,r.bottom+=K,r}function ls(e,t,r){if(r=="div")return t;var n=t.left,c=t.top;if(r=="page")n-=ss(),c-=os();else if(r=="local"||!r){var k=e.display.sizer.getBoundingClientRect();n+=k.left,c+=k.top}var K=e.display.lineSpace.getBoundingClientRect();return{left:n-K.left,top:c-K.top}}function ma(e,t,r,n,c){return n||(n=ht(e.doc,t.line)),Wr(e,n,ts(e,n,t.ch,c),r)}function en(e,t,r,n,c,k){n=n||ht(e.doc,t.line),c||(c=Xn(e,n));function K(Fe,Ke){var Ze=on(e,c,Fe,Ke?"right":"left",k);return Ke?Ze.left=Ze.right:Ze.right=Ze.left,Wr(e,n,Ze,r)}var Q=$e(n,e.doc.direction),Z=t.ch,te=t.sticky;if(Z>=n.text.length?(Z=n.text.length,te="before"):Z<=0&&(Z=0,te="after"),!Q)return K(te=="before"?Z-1:Z,te=="before");function he(Fe,Ke,Ze){var st=Q[Ke],ft=st.level==1;return K(Ze?Fe-1:Fe,ft!=Ze)}var pe=Ve(Q,Z,te),Ce=Xe,we=he(Z,pe,te=="before");return Ce!=null&&(we.other=he(Z,Ce,te!="before")),we}function us(e,t){var r=0;t=E(e.doc,t),e.options.lineWrapping||(r=Jn(e.display)*t.ch);var n=ht(e.doc,t.line),c=qi(n)+Hr(e.display);return{left:r,right:r,top:c,bottom:c+n.height}}function ga(e,t,r,n,c){var k=Ye(e,t,r);return k.xRel=c,n&&(k.outside=n),k}function va(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return ga(n.first,0,null,-1,-1);var c=ui(n,r),k=n.first+n.size-1;if(c>k)return ga(n.first+n.size-1,ht(n,k).text.length,null,1,1);t<0&&(t=0);for(var K=ht(n,c);;){var Q=Go(e,K,c,t,r),Z=rn(K,Q.ch+(Q.xRel>0||Q.outside>0?1:0));if(!Z)return Q;var te=Z.find(1);if(te.line==c)return te;K=ht(n,c=te.line)}}function hs(e,t,r,n){n-=pa(t);var c=t.text.length,k=Be(function(K){return on(e,r,K-1).bottom<=n},c,0);return c=Be(function(K){return on(e,r,K).top>n},k,c),{begin:k,end:c}}function ds(e,t,r,n){r||(r=Xn(e,t));var c=Wr(e,t,on(e,r,n),"line").top;return hs(e,t,r,c)}function ya(e,t,r,n){return e.bottom<=r?!1:e.top>r?!0:(n?e.left:e.right)>t}function Go(e,t,r,n,c){c-=qi(t);var k=Xn(e,t),K=pa(t),Q=0,Z=t.text.length,te=!0,he=$e(t,e.doc.direction);if(he){var pe=(e.options.lineWrapping?zo:Ko)(e,t,r,k,he,n,c);te=pe.level!=1,Q=te?pe.from:pe.to-1,Z=te?pe.to:pe.from-1}var Ce=null,we=null,Fe=Be(function(At){var xt=on(e,k,At);return xt.top+=K,xt.bottom+=K,ya(xt,n,c,!1)?(xt.top<=c&&xt.left<=n&&(Ce=At,we=xt),!0):!1},Q,Z),Ke,Ze,st=!1;if(we){var ft=n-we.left<we.right-n,ot=ft==te;Fe=Ce+(ot?0:1),Ze=ot?"after":"before",Ke=ft?we.left:we.right}else{!te&&(Fe==Z||Fe==Q)&&Fe++,Ze=Fe==0?"after":Fe==t.text.length?"before":on(e,k,Fe-(te?1:0)).bottom+K<=c==te?"after":"before";var pt=en(e,Ye(r,Fe,Ze),"line",t,k);Ke=pt.left,st=c<pt.top?-1:c>=pt.bottom?1:0}return Fe=Se(t.text,Fe,1),ga(r,Fe,Ze,st,n-Ke)}function Ko(e,t,r,n,c,k,K){var Q=Be(function(pe){var Ce=c[pe],we=Ce.level!=1;return ya(en(e,Ye(r,we?Ce.to:Ce.from,we?"before":"after"),"line",t,n),k,K,!0)},0,c.length-1),Z=c[Q];if(Q>0){var te=Z.level!=1,he=en(e,Ye(r,te?Z.from:Z.to,te?"after":"before"),"line",t,n);ya(he,k,K,!0)&&he.top>K&&(Z=c[Q-1])}return Z}function zo(e,t,r,n,c,k,K){var Q=hs(e,t,n,K),Z=Q.begin,te=Q.end;/\s/.test(t.text.charAt(te-1))&&te--;for(var he=null,pe=null,Ce=0;Ce<c.length;Ce++){var we=c[Ce];if(we.from>=te||we.to<=Z)continue;var Fe=we.level!=1,Ke=on(e,n,Fe?Math.min(te,we.to)-1:Math.max(Z,we.from)).right,Ze=Ke<k?k-Ke+1e9:Ke-k;(!he||pe>Ze)&&(he=we,pe=Ze)}return he||(he=c[c.length-1]),he.from<Z&&(he={from:Z,to:he.to,level:he.level}),he.to>te&&(he={from:he.from,to:te,level:he.level}),he}var Nn;function $n(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Nn==null){Nn=p("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Nn.appendChild(document.createTextNode("x")),Nn.appendChild(p("br"));Nn.appendChild(document.createTextNode("x"))}x(e.measure,Nn);var r=Nn.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),w(e.measure),r||1}function Jn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=p("span","xxxxxxxxxx"),r=p("pre",[t],"CodeMirror-line-like");x(e.measure,r);var n=t.getBoundingClientRect(),c=(n.right-n.left)/10;return c>2&&(e.cachedCharWidth=c),c||10}function ba(e){for(var t=e.display,r={},n={},c=t.gutters.clientLeft,k=t.gutters.firstChild,K=0;k;k=k.nextSibling,++K){var Q=e.display.gutterSpecs[K].className;r[Q]=k.offsetLeft+k.clientLeft+c,n[Q]=k.clientWidth}return{fixedPos:_a(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function _a(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function cs(e){var t=$n(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/Jn(e.display)-3);return function(c){if(an(e.doc,c))return 0;var k=0;if(c.widgets)for(var K=0;K<c.widgets.length;K++)c.widgets[K].height&&(k+=c.widgets[K].height);return r?k+(Math.ceil(c.text.length/n)||1)*t:k+t}}function Ea(e){var t=e.doc,r=cs(e);t.iter(function(n){var c=r(n);c!=n.height&&zt(n,c)})}function Fn(e,t,r,n){var c=e.display;if(!r&&ye(t).getAttribute("cm-not-content")=="true")return null;var k,K,Q=c.lineSpace.getBoundingClientRect();try{k=t.clientX-Q.left,K=t.clientY-Q.top}catch(pe){return null}var Z=va(e,k,K),te;if(n&&Z.xRel>0&&(te=ht(e.doc,Z.line).text).length==Z.ch){var he=X(te,te.length,e.options.tabSize)-te.length;Z=Ye(Z.line,Math.max(0,Math.round((k-qa(e.display).left)/Jn(e.display))-he))}return Z}function Un(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if(t-=r[n].size,t<0)return n}function Ni(e,t,r,n){t==null&&(t=e.doc.first),r==null&&(r=e.doc.first+e.doc.size),n||(n=0);var c=e.display;if(n&&r<c.viewTo&&(c.updateLineNumbers==null||c.updateLineNumbers>t)&&(c.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=c.viewTo)pi&&cr(e.doc,t)<c.viewTo&&Sn(e);else if(r<=c.viewFrom)pi&&Tn(e.doc,r+n)>c.viewFrom?Sn(e):(c.viewFrom+=n,c.viewTo+=n);else if(t<=c.viewFrom&&r>=c.viewTo)Sn(e);else if(t<=c.viewFrom){var k=Gr(e,r,r+n,1);k?(c.view=c.view.slice(k.index),c.viewFrom=k.lineN,c.viewTo+=n):Sn(e)}else if(r>=c.viewTo){var K=Gr(e,t,t,-1);K?(c.view=c.view.slice(0,K.index),c.viewTo=K.lineN):Sn(e)}else{var Q=Gr(e,t,t,-1),Z=Gr(e,r,r+n,1);Q&&Z?(c.view=c.view.slice(0,Q.index).concat(Pi(e,Q.lineN,Z.lineN)).concat(c.view.slice(Z.index)),c.viewTo+=n):Sn(e)}var te=c.externalMeasured;te&&(r<te.lineN?te.lineN+=n:t<te.lineN+te.size&&(c.externalMeasured=null))}function wn(e,t,r){e.curOp.viewChanged=!0;var n=e.display,c=e.display.externalMeasured;if(c&&t>=c.lineN&&t<c.lineN+c.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var k=n.view[Un(e,t)];if(k.node==null)return;var K=k.changes||(k.changes=[]);ae(K,r)==-1&&K.push(r)}function Sn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gr(e,t,r,n){var c=Un(e,t),k,K=e.display.view;if(!pi||r==e.doc.first+e.doc.size)return{index:c,lineN:r};for(var Q=e.display.viewFrom,Z=0;Z<c;Z++)Q+=K[Z].size;if(Q!=t){if(n>0){if(c==K.length-1)return null;k=Q+K[c].size-t,c++}else k=Q-t;t+=k,r+=k}for(;cr(e.doc,r)!=r;){if(c==(n<0?0:K.length-1))return null;r+=n*K[c-(n<0?1:0)].size,c+=n}return{index:c,lineN:r}}function Vo(e,t,r){var n=e.display,c=n.view;c.length==0||t>=n.viewTo||r<=n.viewFrom?(n.view=Pi(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=Pi(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Un(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(Pi(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,Un(e,r)))),n.viewTo=r}function fs(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var c=t[n];!c.hidden&&(!c.node||c.changes)&&++r}return r}function br(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ps(e,t){t===void 0&&(t=!0);for(var r=e.doc,n={},c=n.cursors=document.createDocumentFragment(),k=n.selection=document.createDocumentFragment(),K=0;K<r.sel.ranges.length;K++){if(!t&&K==r.sel.primIndex)continue;var Q=r.sel.ranges[K];if(Q.from().line>=e.display.viewTo||Q.to().line<e.display.viewFrom)continue;var Z=Q.empty();(Z||e.options.showCursorWhenSelecting)&&ms(e,Q.head,c),Z||Yo(e,Q,k)}return n}function ms(e,t,r){var n=en(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),c=r.appendChild(p("div","\xA0","CodeMirror-cursor"));if(c.style.left=n.left+"px",c.style.top=n.top+"px",c.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var k=r.appendChild(p("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));k.style.display="",k.style.left=n.other.left+"px",k.style.top=n.other.top+"px",k.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function Kr(e,t){return e.top-t.top||e.left-t.left}function Yo(e,t,r){var n=e.display,c=e.doc,k=document.createDocumentFragment(),K=qa(e.display),Q=K.left,Z=Math.max(n.sizerWidth,Pn(e)-n.sizer.offsetLeft)-K.right,te=c.direction=="ltr";function he(ot,pt,At,xt){pt<0&&(pt=0),pt=Math.round(pt),xt=Math.round(xt),k.appendChild(p("div",null,"CodeMirror-selected","position: absolute; left: "+ot+`px;
|
|
top: `+pt+"px; width: "+(At==null?Z-ot:At)+`px;
|
|
height: `+(xt-pt)+"px"))}function pe(ot,pt,At){var xt=ht(c,ot),kt=xt.text.length,Zt,yi;function ii(oi,Bi){return ma(e,Ye(ot,oi),"div",xt,Bi)}function Ki(oi,Bi,Ti){var di=ds(e,xt,null,oi),li=Bi=="ltr"==(Ti=="after")?"left":"right",ni=Ti=="after"?di.begin:di.end-(/\s/.test(xt.text.charAt(di.end-1))?2:1);return ii(ni,li)[li]}var Ui=$e(xt,c.direction);return He(Ui,pt||0,At==null?kt:At,function(oi,Bi,Ti,di){var li=Ti=="ltr",ni=ii(oi,li?"left":"right"),ji=ii(Bi-1,li?"right":"left"),ur=pt==null&&oi==0,In=At==null&&Bi==kt,Ri=di==0,ln=!Ui||di==Ui.length-1;if(ji.top-ni.top<=3){var bi=(te?ur:In)&&Ri,Va=(te?In:ur)&&ln,pn=bi?Q:(li?ni:ji).left,Gn=Va?Z:(li?ji:ni).right;he(pn,ni.top,Gn-pn,ni.bottom)}else{var Kn,Ii,hr,Ya;li?(Kn=te&&ur&&Ri?Q:ni.left,Ii=te?Z:Ki(oi,Ti,"before"),hr=te?Q:Ki(Bi,Ti,"after"),Ya=te&&In&&ln?Z:ji.right):(Kn=te?Ki(oi,Ti,"before"):Q,Ii=!te&&ur&&Ri?Z:ni.right,hr=!te&&In&&ln?Q:ji.left,Ya=te?Ki(Bi,Ti,"after"):Z),he(Kn,ni.top,Ii-Kn,ni.bottom),ni.bottom<ji.top&&he(Q,ni.bottom,null,ji.top),he(hr,ji.top,Ya-hr,ji.bottom)}(!Zt||Kr(ni,Zt)<0)&&(Zt=ni),Kr(ji,Zt)<0&&(Zt=ji),(!yi||Kr(ni,yi)<0)&&(yi=ni),Kr(ji,yi)<0&&(yi=ji)}),{start:Zt,end:yi}}var Ce=t.from(),we=t.to();if(Ce.line==we.line)pe(Ce.line,Ce.ch,we.ch);else{var Fe=ht(c,Ce.line),Ke=ht(c,we.line),Ze=Oi(Fe)==Oi(Ke),st=pe(Ce.line,Ce.ch,Ze?Fe.text.length+1:null).end,ft=pe(we.line,Ze?0:null,we.ch).start;Ze&&(st.top<ft.top-2?(he(st.right,st.top,null,st.bottom),he(Q,ft.top,ft.left,ft.bottom)):he(st.right,st.top,ft.left-st.right,st.bottom)),st.bottom<ft.top&&he(Q,st.bottom,null,ft.top)}r.appendChild(k)}function xa(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Qn(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function gs(e){e.state.focused||(e.display.input.focus(),Ta(e))}function vs(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Qn(e))},100)}function Ta(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(ke(e,"focus",e,t),e.state.focused=!0,B(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),i&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),xa(e)}function Qn(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(ke(e,"blur",e,t),e.state.focused=!1,C(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function zr(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var c=t.view[n],k=e.options.lineWrapping,K=void 0,Q=0;if(c.hidden)continue;if(G&&W<8){var Z=c.node.offsetTop+c.node.offsetHeight;K=Z-r,r=Z}else{var te=c.node.getBoundingClientRect();K=te.bottom-te.top,!k&&c.text.firstChild&&(Q=c.text.firstChild.getBoundingClientRect().right-te.left-1)}var he=c.line.height-K;if((he>.005||he<-.005)&&(zt(c.line,K),ys(c.line),c.rest))for(var pe=0;pe<c.rest.length;pe++)ys(c.rest[pe]);if(Q>e.display.sizerWidth){var Ce=Math.ceil(Q/Jn(e.display));Ce>e.display.maxLineLength&&(e.display.maxLineLength=Ce,e.display.maxLine=c.line,e.display.maxLineChanged=!0)}}}function ys(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function Vr(e,t,r){var n=r&&r.top!=null?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Hr(e));var c=r&&r.bottom!=null?r.bottom:n+e.wrapper.clientHeight,k=ui(t,n),K=ui(t,c);if(r&&r.ensure){var Q=r.ensure.from.line,Z=r.ensure.to.line;Q<k?(k=Q,K=ui(t,qi(ht(t,Q))+e.wrapper.clientHeight)):Math.min(Z,t.lastLine())>=K&&(k=ui(t,qi(ht(t,Z))-e.wrapper.clientHeight),K=Z)}return{from:k,to:Math.max(K,k+1)}}function Xo(e,t){if(Ne(e,"scrollCursorIntoView"))return;var r=e.display,n=r.sizer.getBoundingClientRect(),c=null;if(t.top+n.top<0?c=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(c=!1),c!=null&&!a){var k=p("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-r.viewOffset-Hr(e.display))+`px;
|
|
height: `+(t.bottom-t.top+sn(e)+r.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(k),k.scrollIntoView(c),e.display.lineSpace.removeChild(k)}}function $o(e,t,r,n){n==null&&(n=0);var c;!e.options.lineWrapping&&t==r&&(t=t.ch?Ye(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,r=t.sticky=="before"?Ye(t.line,t.ch+1,"before"):t);for(var k=0;k<5;k++){var K=!1,Q=en(e,t),Z=!r||r==t?Q:en(e,r);c={left:Math.min(Q.left,Z.left),top:Math.min(Q.top,Z.top)-n,right:Math.max(Q.left,Z.left),bottom:Math.max(Q.bottom,Z.bottom)+n};var te=wa(e,c),he=e.doc.scrollTop,pe=e.doc.scrollLeft;if(te.scrollTop!=null&&(Er(e,te.scrollTop),Math.abs(e.doc.scrollTop-he)>1&&(K=!0)),te.scrollLeft!=null&&(Bn(e,te.scrollLeft),Math.abs(e.doc.scrollLeft-pe)>1&&(K=!0)),!K)break}return c}function Jo(e,t){var r=wa(e,t);r.scrollTop!=null&&Er(e,r.scrollTop),r.scrollLeft!=null&&Bn(e,r.scrollLeft)}function wa(e,t){var r=e.display,n=$n(e.display);t.top<0&&(t.top=0);var c=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,k=ca(e),K={};t.bottom-t.top>k&&(t.bottom=t.top+k);var Q=e.doc.height+da(r),Z=t.top<n,te=t.bottom>Q-n;if(t.top<c)K.scrollTop=Z?0:t.top;else if(t.bottom>c+k){var he=Math.min(t.top,(te?Q:t.bottom)-k);he!=c&&(K.scrollTop=he)}var pe=e.options.fixedGutter?0:r.gutters.offsetWidth,Ce=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-pe,we=Pn(e)-r.gutters.offsetWidth,Fe=t.right-t.left>we;return Fe&&(t.right=t.left+we),t.left<10?K.scrollLeft=0:t.left<Ce?K.scrollLeft=Math.max(0,t.left+pe-(Fe?0:10)):t.right>we+Ce-3&&(K.scrollLeft=t.right+(Fe?0:10)-we),K}function Sa(e,t){if(t==null)return;Yr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Zn(e){Yr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function _r(e,t,r){(t!=null||r!=null)&&Yr(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function Qo(e,t){Yr(e),e.curOp.scrollToPos=t}function Yr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=us(e,t.from),n=us(e,t.to);bs(e,r,n,t.margin)}}function bs(e,t,r,n){var c=wa(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});_r(e,c.scrollLeft,c.scrollTop)}function Er(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;M||Aa(e,{top:t}),_s(e,t,!0),M&&Aa(e),wr(e,100)}function _s(e,t,r){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!r)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Bn(e,t,r,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,Ss(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function xr(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+da(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+sn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var jn=function(e,t,r){this.cm=r;var n=this.vert=p("div",[p("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),c=this.horiz=p("div",[p("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=c.tabIndex=-1,e(n),e(c),De(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),De(c,"scroll",function(){c.clientWidth&&t(c.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,G&&W<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};jn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var c=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+c)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var k=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+k)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},jn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},jn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},jn.prototype.zeroWidthHack=function(){var e=o&&!u?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ee,this.disableVert=new ee},jn.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto";function n(){var c=e.getBoundingClientRect(),k=r=="vert"?document.elementFromPoint(c.right-1,(c.top+c.bottom)/2):document.elementFromPoint((c.right+c.left)/2,c.bottom-1);k!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},jn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Tr=function(){};Tr.prototype.update=function(){return{bottom:0,right:0}},Tr.prototype.setScrollLeft=function(){},Tr.prototype.setScrollTop=function(){},Tr.prototype.clear=function(){};function qn(e,t){t||(t=xr(e));var r=e.display.barWidth,n=e.display.barHeight;Es(e,t);for(var c=0;c<4&&r!=e.display.barWidth||n!=e.display.barHeight;c++)r!=e.display.barWidth&&e.options.lineWrapping&&zr(e),Es(e,xr(e)),r=e.display.barWidth,n=e.display.barHeight}function Es(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}var xs={native:jn,null:Tr};function Ts(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&C(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),De(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){r=="horizontal"?Bn(e,t):Er(e,t)},e),e.display.scrollbars.addClass&&B(e.display.wrapper,e.display.scrollbars.addClass)}var Zo=0;function Hn(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},Ji(e.curOp)}function Wn(e){var t=e.curOp;t&&Io(t,function(r){for(var n=0;n<r.ops.length;n++)r.ops[n].cm.curOp=null;qo(r)})}function qo(e){for(var t=e.ops,r=0;r<t.length;r++)el(t[r]);for(var n=0;n<t.length;n++)tl(t[n]);for(var c=0;c<t.length;c++)il(t[c]);for(var k=0;k<t.length;k++)nl(t[k]);for(var K=0;K<t.length;K++)rl(t[K])}function el(e){var t=e.cm,r=t.display;sl(t),e.updateMaxLine&&jr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Xr(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ca(e.cm,e.update)}function il(e){var t=e.cm,r=t.display;e.updatedDisplay&&zr(t),e.barMeasure=xr(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ts(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+sn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Pn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function nl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Bn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==N();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&qn(t,e.barMeasure),e.updatedDisplay&&Oa(t,e.barMeasure),e.selectionChanged&&xa(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&gs(e.cm)}function rl(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&ws(t,e.update),r.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(r.wheelStartX=r.wheelStartY=null),e.scrollTop!=null&&_s(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Bn(t,e.scrollLeft,!0,!0),e.scrollToPos){var c=$o(t,E(n,e.scrollToPos.from),E(n,e.scrollToPos.to),e.scrollToPos.margin);Xo(t,c)}var k=e.maybeHiddenMarkers,K=e.maybeUnhiddenMarkers;if(k)for(var Q=0;Q<k.length;++Q)k[Q].lines.length||ke(k[Q],"hide");if(K)for(var Z=0;Z<K.length;++Z)K[Z].lines.length&&ke(K[Z],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ke(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Gi(e,t){if(e.curOp)return t();Hn(e);try{return t()}finally{Wn(e)}}function gi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Hn(e);try{return t.apply(e,arguments)}finally{Wn(e)}}}function Li(e){return function(){if(this.curOp)return e.apply(this,arguments);Hn(this);try{return e.apply(this,arguments)}finally{Wn(this)}}}function vi(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Hn(t);try{return e.apply(this,arguments)}finally{Wn(t)}}}function wr(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,P(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var r=+new Date+e.options.workTime,n=it(e,t.highlightFrontier),c=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(k){if(n.line>=e.display.viewFrom){var K=k.styles,Q=k.text.length>e.options.maxHighlightLength?Bt(t.mode,n.state):null,Z=me(e,k,n,!0);Q&&(n.state=Q),k.styles=Z.styles;var te=k.styleClasses,he=Z.classes;he?k.styleClasses=he:te&&(k.styleClasses=null);for(var pe=!K||K.length!=k.styles.length||te!=he&&(!te||!he||te.bgClass!=he.bgClass||te.textClass!=he.textClass),Ce=0;!pe&&Ce<K.length;++Ce)pe=K[Ce]!=k.styles[Ce];pe&&c.push(n.line),k.stateAfter=n.save(),n.nextLine()}else k.text.length<=e.options.maxHighlightLength&>(e,k.text,n),k.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return wr(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),c.length&&Gi(e,function(){for(var k=0;k<c.length;k++)wn(e,c[k],"text")})}var Xr=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Vr(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Pn(e),this.force=r,this.dims=ba(e),this.events=[]};Xr.prototype.signal=function(e,t){fe(e,t)&&this.events.push(arguments)},Xr.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ke.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=sn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=sn(e)+"px",t.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var t=N();if(!t||!y(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&y(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}function ll(e){if(!e||!e.activeElt||e.activeElt==N())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&y(document.body,e.anchorNode)&&y(document.body,e.focusNode)){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}function Ca(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return Sn(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&fs(e)==0)return!1;Cs(e)&&(Sn(e),t.dims=ba(e));var c=n.first+n.size,k=Math.max(t.visible.from-e.options.viewportMargin,n.first),K=Math.min(c,t.visible.to+e.options.viewportMargin);r.viewFrom<k&&k-r.viewFrom<20&&(k=Math.max(n.first,r.viewFrom)),r.viewTo>K&&r.viewTo-K<20&&(K=Math.min(c,r.viewTo)),pi&&(k=cr(e.doc,k),K=Tn(e.doc,K));var Q=k!=r.viewFrom||K!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Vo(e,k,K),r.viewOffset=qi(ht(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var Z=fs(e);if(!Q&&Z==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;var te=ol(e);return Z>4&&(r.lineDiv.style.display="none"),ul(e,r.updateLineNumbers,t.dims),Z>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,ll(te),w(r.cursorDiv),w(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,Q&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,wr(e,400)),r.updateLineNumbers=null,!0}function ws(e,t){for(var r=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Pn(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+da(e.display)-ca(e),r.top)}),t.visible=Vr(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Vr(e.display,e.doc,r));if(!Ca(e,t))break;zr(e);var c=xr(e);br(e),qn(e,c),Oa(e,c),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Aa(e,t){var r=new Xr(e,t);if(Ca(e,r)){zr(e),ws(e,r);var n=xr(e);br(e),qn(e,n),Oa(e,n),r.finish()}}function ul(e,t,r){var n=e.display,c=e.options.lineNumbers,k=n.lineDiv,K=k.firstChild;function Q(Fe){var Ke=Fe.nextSibling;return i&&o&&e.display.currentWheelTarget==Fe?Fe.style.display="none":Fe.parentNode.removeChild(Fe),Ke}for(var Z=n.view,te=n.viewFrom,he=0;he<Z.length;he++){var pe=Z[he];if(!pe.hidden)if(!pe.node||pe.node.parentNode!=k){var Ce=No(e,pe,te,r);k.insertBefore(Ce,K)}else{for(;K!=pe.node;)K=Q(K);var we=c&&t!=null&&t<=te&&pe.lineNumber;pe.changes&&(ae(pe.changes,"gutter")>-1&&(we=!1),Xa(e,pe,te,r)),we&&(w(pe.lineNumber),pe.lineNumber.appendChild(document.createTextNode(Xi(e.options,te)))),K=pe.node.nextSibling}te+=pe.size}for(;K;)K=Q(K)}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+sn(e)+"px"}function Ss(e){var t=e.display,r=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=_a(t)-t.scroller.scrollLeft+e.doc.scrollLeft,c=t.gutters.offsetWidth,k=n+"px",K=0;K<r.length;K++)if(!r[K].hidden){e.options.fixedGutter&&(r[K].gutter&&(r[K].gutter.style.left=k),r[K].gutterBackground&&(r[K].gutterBackground.style.left=k));var Q=r[K].alignable;if(Q)for(var Z=0;Z<Q.length;Z++)Q[Z].style.left=k}e.options.fixedGutter&&(t.gutters.style.left=n+c+"px")}function Cs(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=Xi(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var c=n.measure.appendChild(p("div",[p("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),k=c.firstChild.offsetWidth,K=c.offsetWidth-k;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(k,n.lineGutter.offsetWidth-K)+1,n.lineNumWidth=n.lineNumInnerWidth+K,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Ra(e.display),!0}return!1}function La(e,t){for(var r=[],n=!1,c=0;c<e.length;c++){var k=e[c],K=null;if(typeof k!="string"&&(K=k.style,k=k.className),k=="CodeMirror-linenumbers")if(t)n=!0;else continue;r.push({className:k,style:K})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function As(e){var t=e.gutters,r=e.gutterSpecs;w(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var c=r[n],k=c.className,K=c.style,Q=t.appendChild(p("div",null,"CodeMirror-gutter "+k));K&&(Q.style.cssText=K),k=="CodeMirror-linenumbers"&&(e.lineGutter=Q,Q.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",Ra(e)}function Sr(e){As(e.display),Ni(e),Ss(e)}function hl(e,t,r,n){var c=this;this.input=r,c.scrollbarFiller=p("div",null,"CodeMirror-scrollbar-filler"),c.scrollbarFiller.setAttribute("cm-not-content","true"),c.gutterFiller=p("div",null,"CodeMirror-gutter-filler"),c.gutterFiller.setAttribute("cm-not-content","true"),c.lineDiv=T("div",null,"CodeMirror-code"),c.selectionDiv=p("div",null,null,"position: relative; z-index: 1"),c.cursorDiv=p("div",null,"CodeMirror-cursors"),c.measure=p("div",null,"CodeMirror-measure"),c.lineMeasure=p("div",null,"CodeMirror-measure"),c.lineSpace=T("div",[c.measure,c.lineMeasure,c.selectionDiv,c.cursorDiv,c.lineDiv],null,"position: relative; outline: none");var k=T("div",[c.lineSpace],"CodeMirror-lines");c.mover=p("div",[k],null,"position: relative"),c.sizer=p("div",[c.mover],"CodeMirror-sizer"),c.sizerWidth=null,c.heightForcer=p("div",null,null,"position: absolute; height: "+le+"px; width: 1px;"),c.gutters=p("div",null,"CodeMirror-gutters"),c.lineGutter=null,c.scroller=p("div",[c.sizer,c.heightForcer,c.gutters],"CodeMirror-scroll"),c.scroller.setAttribute("tabIndex","-1"),c.wrapper=p("div",[c.scrollbarFiller,c.gutterFiller,c.scroller],"CodeMirror"),G&&W<8&&(c.gutters.style.zIndex=-1,c.scroller.style.paddingRight=0),!i&&!(M&&h)&&(c.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(c.wrapper):e(c.wrapper)),c.viewFrom=c.viewTo=t.first,c.reportedViewFrom=c.reportedViewTo=t.first,c.view=[],c.renderedView=null,c.externalMeasured=null,c.viewOffset=0,c.lastWrapHeight=c.lastWrapWidth=0,c.updateLineNumbers=null,c.nativeBarWidth=c.barHeight=c.barWidth=0,c.scrollbarsClipped=!1,c.lineNumWidth=c.lineNumInnerWidth=c.lineNumChars=null,c.alignWidgets=!1,c.cachedCharWidth=c.cachedTextHeight=c.cachedPaddingH=null,c.maxLine=null,c.maxLineLength=0,c.maxLineChanged=!1,c.wheelDX=c.wheelDY=c.wheelStartX=c.wheelStartY=null,c.shift=!1,c.selForContextMenu=null,c.activeTouch=null,c.gutterSpecs=La(n.gutters,n.lineNumbers),As(c),r.init(c)}var $r=0,Vi=null;G?Vi=-.53:M?Vi=15:g?Vi=-.7:m&&(Vi=-1/3);function Rs(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),r==null&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:r==null&&(r=e.wheelDelta),{x:t,y:r}}function dl(e){var t=Rs(e);return t.x*=Vi,t.y*=Vi,t}function Os(e,t){var r=Rs(t),n=r.x,c=r.y,k=e.display,K=k.scroller,Q=K.scrollWidth>K.clientWidth,Z=K.scrollHeight>K.clientHeight;if(!(n&&Q||c&&Z))return;if(c&&o&&i){e:for(var te=t.target,he=k.view;te!=K;te=te.parentNode)for(var pe=0;pe<he.length;pe++)if(he[pe].node==te){e.display.currentWheelTarget=te;break e}}if(n&&!M&&!d&&Vi!=null){c&&Z&&Er(e,Math.max(0,K.scrollTop+c*Vi)),Bn(e,Math.max(0,K.scrollLeft+n*Vi)),(!c||c&&Z)&&ne(t),k.wheelStartX=null;return}if(c&&Vi!=null){var Ce=c*Vi,we=e.doc.scrollTop,Fe=we+k.wrapper.clientHeight;Ce<0?we=Math.max(0,we+Ce-50):Fe=Math.min(e.doc.height,Fe+Ce+50),Aa(e,{top:we,bottom:Fe})}$r<20&&(k.wheelStartX==null?(k.wheelStartX=K.scrollLeft,k.wheelStartY=K.scrollTop,k.wheelDX=n,k.wheelDY=c,setTimeout(function(){if(k.wheelStartX==null)return;var Ke=K.scrollLeft-k.wheelStartX,Ze=K.scrollTop-k.wheelStartY,st=Ze&&k.wheelDY&&Ze/k.wheelDY||Ke&&k.wheelDX&&Ke/k.wheelDX;if(k.wheelStartX=k.wheelStartY=null,!st)return;Vi=(Vi*$r+st)/($r+1),++$r},200)):(k.wheelDX+=n,k.wheelDY+=c))}var Yi=function(e,t){this.ranges=e,this.primIndex=t};Yi.prototype.primary=function(){return this.ranges[this.primIndex]},Yi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(!mn(r.anchor,n.anchor)||!mn(r.head,n.head))return!1}return!0},Yi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Yt(gn(this.ranges[t].anchor),gn(this.ranges[t].head));return new Yi(e,this.primIndex)},Yi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Yi.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(Rt(t,n.from())>=0&&Rt(e,n.to())<=0)return r}return-1};var Yt=function(e,t){this.anchor=e,this.head=t};Yt.prototype.from=function(){return yn(this.anchor,this.head)},Yt.prototype.to=function(){return vn(this.anchor,this.head)},Yt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function tn(e,t,r){var n=e&&e.options.selectionsMayTouch,c=t[r];t.sort(function(Ce,we){return Rt(Ce.from(),we.from())}),r=ae(t,c);for(var k=1;k<t.length;k++){var K=t[k],Q=t[k-1],Z=Rt(Q.to(),K.from());if(n&&!K.empty()?Z>0:Z>=0){var te=yn(Q.from(),K.from()),he=vn(Q.to(),K.to()),pe=Q.empty()?K.from()==K.head:Q.from()==Q.head;k<=r&&--r,t.splice(--k,2,new Yt(pe?he:te,pe?te:he))}}return new Yi(t,r)}function Cn(e,t){return new Yi([new Yt(e,t||e)],0)}function An(e){return e.text?Ye(e.from.line+e.text.length-1,Pe(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ls(e,t){if(Rt(e,t.from)<0)return e;if(Rt(e,t.to)<=0)return An(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=An(t).ch-t.to.ch),Ye(r,n)}function Ia(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var c=e.sel.ranges[n];r.push(new Yt(Ls(c.anchor,t),Ls(c.head,t)))}return tn(e.cm,r,e.sel.primIndex)}function Is(e,t,r){return e.line==t.line?Ye(r.line,e.ch-t.ch+r.ch):Ye(r.line+(e.line-t.line),e.ch)}function cl(e,t,r){for(var n=[],c=Ye(e.first,0),k=c,K=0;K<t.length;K++){var Q=t[K],Z=Is(Q.from,c,k),te=Is(An(Q),c,k);if(c=Q.to,k=te,r=="around"){var he=e.sel.ranges[K],pe=Rt(he.head,he.anchor)<0;n[K]=new Yt(pe?te:Z,pe?Z:te)}else n[K]=new Yt(Z,Z)}return new Yi(n,e.sel.primIndex)}function Da(e){e.doc.mode=fi(e.options,e.doc.modeOption),Cr(e)}function Cr(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,wr(e,100),e.state.modeGen++,e.curOp&&Ni(e)}function Ds(e,t){return t.from.ch==0&&t.to.ch==0&&Pe(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ka(e,t,r,n){function c(ft){return r?r[ft]:null}function k(ft,ot,pt){ua(ft,ot,pt,n),xi(ft,"change",ft,t)}function K(ft,ot){for(var pt=[],At=ft;At<ot;++At)pt.push(new Mn(te[At],c(At),n));return pt}var Q=t.from,Z=t.to,te=t.text,he=ht(e,Q.line),pe=ht(e,Z.line),Ce=Pe(te),we=c(te.length-1),Fe=Z.line-Q.line;if(t.full)e.insert(0,K(0,te.length)),e.remove(te.length,e.size-te.length);else if(Ds(e,t)){var Ke=K(0,te.length-1);k(pe,pe.text,we),Fe&&e.remove(Q.line,Fe),Ke.length&&e.insert(Q.line,Ke)}else if(he==pe)if(te.length==1)k(he,he.text.slice(0,Q.ch)+Ce+he.text.slice(Z.ch),we);else{var Ze=K(1,te.length-1);Ze.push(new Mn(Ce+he.text.slice(Z.ch),we,n)),k(he,he.text.slice(0,Q.ch)+te[0],c(0)),e.insert(Q.line+1,Ze)}else if(te.length==1)k(he,he.text.slice(0,Q.ch)+te[0]+pe.text.slice(Z.ch),c(0)),e.remove(Q.line+1,Fe);else{k(he,he.text.slice(0,Q.ch)+te[0],c(0)),k(pe,Ce+pe.text.slice(Z.ch),we);var st=K(1,te.length-1);Fe>1&&e.remove(Q.line+1,Fe-1),e.insert(Q.line+1,st)}xi(e,"change",e,t)}function Rn(e,t,r){function n(c,k,K){if(c.linked)for(var Q=0;Q<c.linked.length;++Q){var Z=c.linked[Q];if(Z.doc==k)continue;var te=K&&Z.sharedHist;if(r&&!te)continue;t(Z.doc,te),n(Z.doc,c,te)}}n(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||jr(e),e.options.mode=t.modeOption,Ni(e)}function Ms(e){(e.doc.direction=="rtl"?B:C)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Gi(e,function(){Ms(e),Ni(e)})}function Jr(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Ma(e,t){var r={from:gn(t.from),to:An(t),text:_i(e,t.from,t.to)};return Fs(e,r,t.from.line,t.to.line+1),Rn(e,function(n){return Fs(n,r,t.from.line,t.to.line+1)},!0),r}function Ps(e){for(;e.length;){var t=Pe(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ps(e.done),Pe(e.done);if(e.done.length&&!Pe(e.done).ranges)return Pe(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Pe(e.done)}function Ns(e,t,r,n){var c=e.history;c.undone.length=0;var k=+new Date,K,Q;if((c.lastOp==n||c.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&c.lastModTime>k-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(K=pl(c,c.lastOp==n)))Q=Pe(K.changes),Rt(t.from,t.to)==0&&Rt(t.from,Q.to)==0?Q.to=An(t):K.changes.push(Ma(e,t));else{var Z=Pe(c.done);for((!Z||!Z.ranges)&&Qr(e.sel,c.done),K={changes:[Ma(e,t)],generation:c.generation},c.done.push(K);c.done.length>c.undoDepth;)c.done.shift(),c.done[0].ranges||c.done.shift()}c.done.push(r),c.generation=++c.maxGeneration,c.lastModTime=c.lastSelTime=k,c.lastOp=c.lastSelOp=n,c.lastOrigin=c.lastSelOrigin=t.origin,Q||ke(e,"historyAdded")}function ml(e,t,r,n){var c=t.charAt(0);return c=="*"||c=="+"&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,r,n){var c=e.history,k=n&&n.origin;r==c.lastSelOp||k&&c.lastSelOrigin==k&&(c.lastModTime==c.lastSelTime&&c.lastOrigin==k||ml(e,k,Pe(c.done),t))?c.done[c.done.length-1]=t:Qr(t,c.done),c.lastSelTime=+new Date,c.lastSelOrigin=k,c.lastSelOp=r,n&&n.clearRedo!==!1&&Ps(c.undone)}function Qr(e,t){var r=Pe(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Fs(e,t,r,n){var c=t["spans_"+e.id],k=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(K){K.markedSpans&&((c||(c=t["spans_"+e.id]={}))[k]=K.markedSpans),++k})}function vl(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function yl(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],c=0;c<t.text.length;++c)n.push(vl(r[c]));return n}function Us(e,t){var r=yl(e,t),n=Zi(e,t);if(!r)return n;if(!n)return r;for(var c=0;c<r.length;++c){var k=r[c],K=n[c];if(k&&K){e:for(var Q=0;Q<K.length;++Q){for(var Z=K[Q],te=0;te<k.length;++te)if(k[te].marker==Z.marker)continue e;k.push(Z)}}else K&&(r[c]=K)}return r}function er(e,t,r){for(var n=[],c=0;c<e.length;++c){var k=e[c];if(k.ranges){n.push(r?Yi.prototype.deepCopy.call(k):k);continue}var K=k.changes,Q=[];n.push({changes:Q});for(var Z=0;Z<K.length;++Z){var te=K[Z],he=void 0;if(Q.push({from:te.from,to:te.to,text:te.text}),t)for(var pe in te)(he=pe.match(/^spans_(\d+)$/))&&(ae(t,Number(he[1]))>-1&&(Pe(Q)[pe]=te[pe],delete te[pe]))}}return n}function Pa(e,t,r,n){if(n){var c=e.anchor;if(r){var k=Rt(t,c)<0;k!=Rt(r,c)<0?(c=t,t=r):k!=Rt(t,r)<0&&(t=r)}return new Yt(c,t)}else return new Yt(r||t,t)}function Zr(e,t,r,n,c){c==null&&(c=e.cm&&(e.cm.display.shift||e.extend)),Ai(e,new Yi([Pa(e.sel.primary(),t,r,c)],0),n)}function Bs(e,t,r){for(var n=[],c=e.cm&&(e.cm.display.shift||e.extend),k=0;k<e.sel.ranges.length;k++)n[k]=Pa(e.sel.ranges[k],t[k],null,c);var K=tn(e.cm,n,e.sel.primIndex);Ai(e,K,r)}function Na(e,t,r,n){var c=e.sel.ranges.slice(0);c[t]=r,Ai(e,tn(e.cm,c,e.sel.primIndex),n)}function js(e,t,r,n){Ai(e,Cn(t,r),n)}function bl(e,t,r){var n={ranges:t.ranges,update:function(c){this.ranges=[];for(var k=0;k<c.length;k++)this.ranges[k]=new Yt(E(e,c[k].anchor),E(e,c[k].head))},origin:r&&r.origin};return ke(e,"beforeSelectionChange",e,n),e.cm&&ke(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?tn(e.cm,n.ranges,n.ranges.length-1):t}function Hs(e,t,r){var n=e.history.done,c=Pe(n);c&&c.ranges?(n[n.length-1]=t,qr(e,t,r)):Ai(e,t,r)}function Ai(e,t,r){qr(e,t,r),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function qr(e,t,r){(fe(e,"beforeSelectionChange")||e.cm&&fe(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,r));var n=r&&r.bias||(Rt(t.primary().head,e.sel.primary().head)<0?-1:1);Ws(e,Ks(e,t,n,!0)),!(r&&r.scroll===!1)&&e.cm&&Zn(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,_e(e.cm)),xi(e,"cursorActivity",e)}function Gs(e){Ws(e,Ks(e,e.sel,null,!1))}function Ks(e,t,r,n){for(var c,k=0;k<t.ranges.length;k++){var K=t.ranges[k],Q=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[k],Z=ea(e,K.anchor,Q&&Q.anchor,r,n),te=ea(e,K.head,Q&&Q.head,r,n);(c||Z!=K.anchor||te!=K.head)&&(c||(c=t.ranges.slice(0,k)),c[k]=new Yt(Z,te))}return c?tn(e.cm,c,t.primIndex):t}function tr(e,t,r,n,c){var k=ht(e,t.line);if(k.markedSpans)for(var K=0;K<k.markedSpans.length;++K){var Q=k.markedSpans[K],Z=Q.marker,te="selectLeft"in Z?!Z.selectLeft:Z.inclusiveLeft,he="selectRight"in Z?!Z.selectRight:Z.inclusiveRight;if((Q.from==null||(te?Q.from<=t.ch:Q.from<t.ch))&&(Q.to==null||(he?Q.to>=t.ch:Q.to>t.ch))){if(c&&(ke(Z,"beforeCursorEnter"),Z.explicitlyCleared))if(k.markedSpans){--K;continue}else break;if(!Z.atomic)continue;if(r){var pe=Z.find(n<0?1:-1),Ce=void 0;if((n<0?he:te)&&(pe=zs(e,pe,-n,pe&&pe.line==t.line?k:null)),pe&&pe.line==t.line&&(Ce=Rt(pe,r))&&(n<0?Ce<0:Ce>0))return tr(e,pe,t,n,c)}var we=Z.find(n<0?-1:1);return(n<0?te:he)&&(we=zs(e,we,n,we.line==t.line?k:null)),we?tr(e,we,t,n,c):null}}return t}function ea(e,t,r,n,c){var k=n||1,K=tr(e,t,r,k,c)||!c&&tr(e,t,r,k,!0)||tr(e,t,r,-k,c)||!c&&tr(e,t,r,-k,!0);return K||(e.cantEdit=!0,Ye(e.first,0))}function zs(e,t,r,n){return r<0&&t.ch==0?t.line>e.first?E(e,Ye(t.line-1)):null:r>0&&t.ch==(n||ht(e,t.line)).text.length?t.line<e.first+e.size-1?Ye(t.line+1,0):null:new Ye(t.line,t.ch+r)}function Vs(e){e.setSelection(Ye(e.firstLine(),0),Ye(e.lastLine()),Ee)}function Ys(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(c,k,K,Q){c&&(n.from=E(e,c)),k&&(n.to=E(e,k)),K&&(n.text=K),Q!==void 0&&(n.origin=Q)}),ke(e,"beforeChange",e,n),e.cm&&ke(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function ir(e,t,r){if(e.cm){if(!e.cm.curOp)return gi(e.cm,ir)(e,t,r);if(e.cm.state.suppressEdits)return}if((fe(e,"beforeChange")||e.cm&&fe(e.cm,"beforeChange"))&&(t=Ys(e,t,!0),!t))return;var n=Dn&&!r&&_n(e,t.from,t.to);if(n)for(var c=n.length-1;c>=0;--c)Xs(e,{from:n[c].from,to:n[c].to,text:c?[""]:t.text,origin:t.origin});else Xs(e,t)}function Xs(e,t){if(t.text.length==1&&t.text[0]==""&&Rt(t.from,t.to)==0)return;var r=Ia(e,t);Ns(e,t,r,e.cm?e.cm.curOp.id:NaN),Ar(e,t,r,Zi(e,t));var n=[];Rn(e,function(c,k){!k&&ae(n,c.history)==-1&&(Zs(c.history,t),n.push(c.history)),Ar(c,t,null,Zi(c,t))})}function ta(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!r)return;for(var c=e.history,k,K=e.sel,Q=t=="undo"?c.done:c.undone,Z=t=="undo"?c.undone:c.done,te=0;te<Q.length&&!(k=Q[te],r?k.ranges&&!k.equals(e.sel):!k.ranges);te++);if(te==Q.length)return;for(c.lastOrigin=c.lastSelOrigin=null;;)if(k=Q.pop(),k.ranges){if(Qr(k,Z),r&&!k.equals(e.sel)){Ai(e,k,{clearRedo:!1});return}K=k}else if(n){Q.push(k);return}else break;var he=[];Qr(K,Z),Z.push({changes:he,generation:c.generation}),c.generation=k.generation||++c.maxGeneration;for(var pe=fe(e,"beforeChange")||e.cm&&fe(e.cm,"beforeChange"),Ce=function(Ke){var Ze=k.changes[Ke];if(Ze.origin=t,pe&&!Ys(e,Ze,!1))return Q.length=0,{};he.push(Ma(e,Ze));var st=Ke?Ia(e,Ze):Pe(Q);Ar(e,Ze,st,Us(e,Ze)),!Ke&&e.cm&&e.cm.scrollIntoView({from:Ze.from,to:An(Ze)});var ft=[];Rn(e,function(ot,pt){!pt&&ae(ft,ot.history)==-1&&(Zs(ot.history,Ze),ft.push(ot.history)),Ar(ot,Ze,null,Us(ot,Ze))})},we=k.changes.length-1;we>=0;--we){var Fe=Ce(we);if(Fe)return Fe.v}}function $s(e,t){if(t==0)return;if(e.first+=t,e.sel=new Yi(qe(e.sel.ranges,function(c){return new Yt(Ye(c.anchor.line+t,c.anchor.ch),Ye(c.head.line+t,c.head.ch))}),e.sel.primIndex),e.cm){Ni(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)wn(e.cm,n,"gutter")}}function Ar(e,t,r,n){if(e.cm&&!e.cm.curOp)return gi(e.cm,Ar)(e,t,r,n);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 c=t.text.length-1-(e.first-t.from.line);$s(e,c),t={from:Ye(e.first,0),to:Ye(t.to.line+c,t.to.ch),text:[Pe(t.text)],origin:t.origin}}var k=e.lastLine();t.to.line>k&&(t={from:t.from,to:Ye(k,ht(e,k).text.length),text:[t.text[0]],origin:t.origin}),t.removed=_i(e,t.from,t.to),r||(r=Ia(e,t)),e.cm?_l(e.cm,t,n):ka(e,t,n),qr(e,r,Ee),e.cantEdit&&ea(e,Ye(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,r){var n=e.doc,c=e.display,k=t.from,K=t.to,Q=!1,Z=k.line;e.options.lineWrapping||(Z=It(Oi(ht(n,k.line))),n.iter(Z,K.line+1,function(we){if(we==c.maxLine)return Q=!0,!0})),n.sel.contains(t.from,t.to)>-1&&_e(e),ka(n,t,r,cs(e)),e.options.lineWrapping||(n.iter(Z,k.line+t.text.length,function(we){var Fe=pr(we);Fe>c.maxLineLength&&(c.maxLine=we,c.maxLineLength=Fe,c.maxLineChanged=!0,Q=!1)}),Q&&(e.curOp.updateMaxLine=!0)),Qi(n,k.line),wr(e,400);var te=t.text.length-(K.line-k.line)-1;t.full?Ni(e):k.line==K.line&&t.text.length==1&&!Ds(e.doc,t)?wn(e,k.line,"text"):Ni(e,k.line,K.line+1,te);var he=fe(e,"changes"),pe=fe(e,"change");if(pe||he){var Ce={from:k,to:K,text:t.text,removed:t.removed,origin:t.origin};pe&&xi(e,"change",e,Ce),he&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ce)}e.display.selForContextMenu=null}function nr(e,t,r,n,c){var k;n||(n=r),Rt(n,r)<0&&(k=[n,r],r=k[0],n=k[1]),typeof t=="string"&&(t=e.splitLines(t)),ir(e,{from:r,to:n,text:t,origin:c})}function Js(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Qs(e,t,r,n){for(var c=0;c<e.length;++c){var k=e[c],K=!0;if(k.ranges){k.copied||(k=e[c]=k.deepCopy(),k.copied=!0);for(var Q=0;Q<k.ranges.length;Q++)Js(k.ranges[Q].anchor,t,r,n),Js(k.ranges[Q].head,t,r,n);continue}for(var Z=0;Z<k.changes.length;++Z){var te=k.changes[Z];if(r<te.from.line)te.from=Ye(te.from.line+n,te.from.ch),te.to=Ye(te.to.line+n,te.to.ch);else if(t<=te.to.line){K=!1;break}}K||(e.splice(0,c+1),c=0)}}function Zs(e,t){var r=t.from.line,n=t.to.line,c=t.text.length-(n-r)-1;Qs(e.done,r,n,c),Qs(e.undone,r,n,c)}function Rr(e,t,r,n){var c=t,k=t;return typeof t=="number"?k=ht(e,V(e,t)):c=It(t),c==null?null:(n(k,c)&&e.cm&&wn(e.cm,c,r),k)}function Or(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}Or.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var c=this.lines[r];this.height-=c.height,vt(c),xi(c,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}};function Lr(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var c=e[n];t+=c.chunkSize(),r+=c.height,c.parent=this}this.size=t,this.height=r,this.parent=null}Lr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],c=n.chunkSize();if(e<c){var k=Math.min(t,c-e),K=n.height;if(n.removeInner(e,k),this.height-=K-n.height,c==k&&(this.children.splice(r--,1),n.parent=null),(t-=k)==0)break;e=0}else e-=c}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Or))){var Q=[];this.collapse(Q),this.children=[new Or(Q)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var c=this.children[n],k=c.chunkSize();if(e<=k){if(c.insertInner(e,t,r),c.lines&&c.lines.length>50){for(var K=c.lines.length%25+25,Q=K;Q<c.lines.length;){var Z=new Or(c.lines.slice(Q,Q+=25));c.height-=Z.height,this.children.splice(++n,0,Z),Z.parent=this}c.lines=c.lines.slice(0,K),this.maybeSpill()}break}e-=k}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new Lr(t);if(e.parent){e.size-=r.size,e.height-=r.height;var c=ae(e.parent.children,e);e.parent.children.splice(c+1,0,r)}else{var n=new Lr(e.children);n.parent=e,e.children=[n,r],e=n}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var c=this.children[n],k=c.chunkSize();if(e<k){var K=Math.min(t,k-e);if(c.iterN(e,K,r))return!0;if((t-=K)==0)break;e=0}else e-=k}}};var Ir=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};Ir.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=It(r);if(n==null||!t)return;for(var c=0;c<t.length;++c)t[c]==this&&t.splice(c--,1);t.length||(r.widgets=null);var k=vr(this);zt(r,Math.max(0,r.height-k)),e&&(Gi(e,function(){qs(e,r,-k),wn(e,n,"widget")}),xi(e,"lineWidgetCleared",e,this,n))},Ir.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var c=vr(this)-t;if(!c)return;an(this.doc,n)||zt(n,n.height+c),r&&Gi(r,function(){r.curOp.forceUpdate=!0,qs(r,n,c),xi(r,"lineWidgetChanged",r,e,It(n))})},ve(Ir);function qs(e,t,r){qi(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Sa(e,r)}function El(e,t,r,n){var c=new Ir(e,r,n),k=e.cm;return k&&c.noHScroll&&(k.display.alignWidgets=!0),Rr(e,t,"widget",function(K){var Q=K.widgets||(K.widgets=[]);if(c.insertAt==null?Q.push(c):Q.splice(Math.min(Q.length-1,Math.max(0,c.insertAt)),0,c),c.line=K,k&&!an(e,K)){var Z=qi(K)<e.scrollTop;zt(K,K.height+vr(c)),Z&&Sa(k,c.height),k.curOp.forceUpdate=!0}return!0}),k&&xi(k,"lineWidgetAdded",k,c,typeof t=="number"?t:It(t)),c}var eo=0,On=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++eo};On.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Hn(e),fe(this,"clear")){var r=this.find();r&&xi(this,"clear",r.from,r.to)}for(var n=null,c=null,k=0;k<this.lines.length;++k){var K=this.lines[k],Q=Wi(K.markedSpans,this);e&&!this.collapsed?wn(e,It(K),"text"):e&&(Q.to!=null&&(c=It(K)),Q.from!=null&&(n=It(K))),K.markedSpans=kn(K.markedSpans,Q),Q.from==null&&this.collapsed&&!an(this.doc,K)&&e&&zt(K,$n(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var Z=0;Z<this.lines.length;++Z){var te=Oi(this.lines[Z]),he=pr(te);he>e.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=he,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Ni(e,n,c+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Gs(e.doc)),e&&xi(e,"markerCleared",e,this,n,c),t&&Wn(e),this.parent&&this.parent.clear()},On.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var r,n,c=0;c<this.lines.length;++c){var k=this.lines[c],K=Wi(k.markedSpans,this);if(K.from!=null&&(r=Ye(t?k:It(k),K.from),e==-1))return r;if(K.to!=null&&(n=Ye(t?k:It(k),K.to),e==1))return n}return r&&{from:r,to:n}},On.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;if(!t||!n)return;Gi(n,function(){var c=t.line,k=It(t.line),K=fa(n,k);if(K&&(rs(K),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!an(r.doc,c)&&r.height!=null){var Q=r.height;r.height=null;var Z=vr(r)-Q;Z&&zt(c,c.height+Z)}xi(n,"markerChanged",n,e)})},On.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ae(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},On.prototype.detachLine=function(e){if(this.lines.splice(ae(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ve(On);function rr(e,t,r,n,c){if(n&&n.shared)return xl(e,t,r,n,c);if(e.cm&&!e.cm.curOp)return gi(e.cm,rr)(e,t,r,n,c);var k=new On(e,c),K=Rt(t,r);if(n&&b(n,k,!1),K>0||K==0&&k.clearWhenEmpty!==!1)return k;if(k.replacedWith&&(k.collapsed=!0,k.widgetNode=T("span",[k.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||k.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(k.widgetNode.insertLeft=!0)),k.collapsed){if(mi(e,t.line,t,r,k)||t.line!=r.line&&mi(e,r.line,t,r,k))throw new Error("Inserting collapsed marker partially overlapping an existing one");un()}k.addToHistory&&Ns(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var Q=t.line,Z=e.cm,te;if(e.iter(Q,r.line+1,function(pe){Z&&k.collapsed&&!Z.options.lineWrapping&&Oi(pe)==Z.display.maxLine&&(te=!0),k.collapsed&&Q!=t.line&&zt(pe,0),bn(pe,new hn(k,Q==t.line?t.ch:null,Q==r.line?r.ch:null)),++Q}),k.collapsed&&e.iter(t.line,r.line+1,function(pe){an(e,pe)&&zt(pe,0)}),k.clearOnEnter&&De(k,"beforeCursorEnter",function(){return k.clear()}),k.readOnly&&(zi(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),k.collapsed&&(k.id=++eo,k.atomic=!0),Z){if(te&&(Z.curOp.updateMaxLine=!0),k.collapsed)Ni(Z,t.line,r.line+1);else if(k.className||k.startStyle||k.endStyle||k.css||k.attributes||k.title)for(var he=t.line;he<=r.line;he++)wn(Z,he,"text");k.atomic&&Gs(Z.doc),xi(Z,"markerAdded",Z,k)}return k}var Dr=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};Dr.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();xi(this,"clear")},Dr.prototype.find=function(e,t){return this.primary.find(e,t)},ve(Dr);function xl(e,t,r,n,c){n=b(n),n.shared=!1;var k=[rr(e,t,r,n,c)],K=k[0],Q=n.widgetNode;return Rn(e,function(Z){Q&&(n.widgetNode=Q.cloneNode(!0)),k.push(rr(Z,E(Z,t),E(Z,r),n,c));for(var te=0;te<Z.linked.length;++te)if(Z.linked[te].isParent)return;K=Pe(k)}),new Dr(k,K)}function to(e){return e.findMarks(Ye(e.first,0),e.clipPos(Ye(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var r=0;r<t.length;r++){var n=t[r],c=n.find(),k=e.clipPos(c.from),K=e.clipPos(c.to);if(Rt(k,K)){var Q=rr(e,k,K,n.primary,n.primary.type);n.markers.push(Q),Q.parent=n}}}function wl(e){for(var t=function(n){var c=e[n],k=[c.primary.doc];Rn(c.primary.doc,function(Z){return k.push(Z)});for(var K=0;K<c.markers.length;K++){var Q=c.markers[K];ae(k,Q.doc)==-1&&(Q.parent=null,c.markers.splice(K--,1))}},r=0;r<e.length;r++)t(r)}var Sl=0,Fi=function(e,t,r,n,c){if(!(this instanceof Fi))return new Fi(e,t,r,n,c);r==null&&(r=0),Lr.call(this,[new Or([new Mn("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var k=Ye(r,0);this.sel=Cn(k),this.history=new Jr(null),this.id=++Sl,this.modeOption=t,this.lineSep=n,this.direction=c=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ka(this,{from:k,to:k,text:e}),Ai(this,Cn(k),Ee)};Fi.prototype=nt(Lr.prototype,{constructor:Fi,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ht(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:vi(function(e){var t=Ye(this.first,0),r=this.first+this.size-1;ir(this,{from:t,to:Ye(r,ht(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&_r(this.cm,0,0),Ai(this,Cn(t),Ee)}),replaceRange:function(e,t,r,n){t=E(this,t),r=r?E(this,r):t,nr(this,e,t,r,n)},getRange:function(e,t,r){var n=_i(this,E(this,e),E(this,t));return r===!1?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(ki(this,e))return ht(this,e)},getLineNumber:function(e){return It(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ht(this,e)),Oi(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return E(this,e)},getCursor:function(e){var t=this.sel.primary(),r;return e==null||e=="head"?r=t.head:e=="anchor"?r=t.anchor:e=="end"||e=="to"||e===!1?r=t.to():r=t.from(),r},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:vi(function(e,t,r){js(this,E(this,typeof e=="number"?Ye(e,t||0):e),null,r)}),setSelection:vi(function(e,t,r){js(this,E(this,e),E(this,t||e),r)}),extendSelection:vi(function(e,t,r){Zr(this,E(this,e),t&&E(this,t),r)}),extendSelections:vi(function(e,t){Bs(this,H(this,e),t)}),extendSelectionsBy:vi(function(e,t){var r=qe(this.sel.ranges,e);Bs(this,H(this,r),t)}),setSelections:vi(function(e,t,r){if(!e.length)return;for(var n=[],c=0;c<e.length;c++)n[c]=new Yt(E(this,e[c].anchor),E(this,e[c].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Ai(this,tn(this.cm,n,t),r)}),addSelection:vi(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new Yt(E(this,e),E(this,t||e))),Ai(this,tn(this.cm,n,n.length-1),r)}),getSelection:function(e){for(var t=this.sel.ranges,r,n=0;n<t.length;n++){var c=_i(this,t[n].from(),t[n].to());r=r?r.concat(c):c}return e===!1?r:r.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var c=_i(this,r[n].from(),r[n].to());e!==!1&&(c=c.join(e||this.lineSeparator())),t[n]=c}return t},replaceSelection:function(e,t,r){for(var n=[],c=0;c<this.sel.ranges.length;c++)n[c]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:vi(function(e,t,r){for(var n=[],c=this.sel,k=0;k<c.ranges.length;k++){var K=c.ranges[k];n[k]={from:K.from(),to:K.to(),text:this.splitLines(e[k]),origin:r}}for(var Q=t&&t!="end"&&cl(this,n,t),Z=n.length-1;Z>=0;Z--)ir(this,n[Z]);Q?Hs(this,Q):this.cm&&Zn(this.cm)}),undo:vi(function(){ta(this,"undo")}),redo:vi(function(){ta(this,"redo")}),undoSelection:vi(function(){ta(this,"undo",!0)}),redoSelection:vi(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,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var c=0;c<e.undone.length;c++)e.undone[c].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new Jr(this.history.maxGeneration),Rn(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:er(this.history.done),undone:er(this.history.undone)}},setHistory:function(e){var t=this.history=new Jr(this.history.maxGeneration);t.done=er(e.done.slice(0),null,!0),t.undone=er(e.undone.slice(0),null,!0)},setGutterMarker:vi(function(e,t,r){return Rr(this,e,"gutter",function(n){var c=n.gutterMarkers||(n.gutterMarkers={});return c[t]=r,!r&&se(c)&&(n.gutterMarkers=null),!0})}),clearGutter:vi(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&Rr(t,r,"gutter",function(){return r.gutterMarkers[e]=null,se(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!ki(this,e))return null;if(t=e,e=ht(this,e),!e)return null}else if(t=It(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:vi(function(e,t,r){return Rr(this,e,t=="gutter"?"gutter":"class",function(n){var c=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[c])n[c]=r;else{if(O(r).test(n[c]))return!1;n[c]+=" "+r}return!0})}),removeLineClass:vi(function(e,t,r){return Rr(this,e,t=="gutter"?"gutter":"class",function(n){var c=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",k=n[c];if(k)if(r==null)n[c]=null;else{var K=k.match(O(r));if(!K)return!1;var Q=K.index+K[0].length;n[c]=k.slice(0,K.index)+(!K.index||Q==k.length?"":" ")+k.slice(Q)||null}else return!1;return!0})}),addLineWidget:vi(function(e,t,r){return El(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return rr(this,E(this,e),E(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=E(this,e),rr(this,e,e,r,"bookmark")},findMarksAt:function(e){e=E(this,e);var t=[],r=ht(this,e.line).markedSpans;if(r)for(var n=0;n<r.length;++n){var c=r[n];(c.from==null||c.from<=e.ch)&&(c.to==null||c.to>=e.ch)&&t.push(c.marker.parent||c.marker)}return t},findMarks:function(e,t,r){e=E(this,e),t=E(this,t);var n=[],c=e.line;return this.iter(e.line,t.line+1,function(k){var K=k.markedSpans;if(K)for(var Q=0;Q<K.length;Q++){var Z=K[Q];!(Z.to!=null&&c==e.line&&e.ch>=Z.to||Z.from==null&&c!=e.line||Z.from!=null&&c==t.line&&Z.from>=t.ch)&&(!r||r(Z.marker))&&n.push(Z.marker.parent||Z.marker)}++c}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)r[n].from!=null&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter(function(c){var k=c.text.length+n;if(k>e)return t=e,!0;e-=k,++r}),E(this,Ye(r,t))},indexFromPos:function(e){e=E(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+r}),t},copy:function(e){var t=new Fi(Ht(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<r&&(r=e.to);var n=new Fi(Ht(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(n,to(this)),n},unlinkDoc:function(e){if(e instanceof ti&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var r=this.linked[t];if(r.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(to(this));break}if(e.history==this.history){var n=[e.id];Rn(e,function(c){return n.push(c.id)},!0),e.history=new Jr(null),e.history.done=er(this.history.done,n),e.history.undone=er(this.history.undone,n)}},iterLinkedDocs:function(e){Rn(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):yt(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:vi(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)})}),Fi.prototype.eachLine=Fi.prototype.iter;var io=0;function Cl(e){var t=this;if(no(t),Ne(t,e)||cn(t.display,e))return;ne(e),G&&(io=+new Date);var r=Fn(t,e,!0),n=e.dataTransfer.files;if(!r||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var c=n.length,k=Array(c),K=0,Q=function(){++K==c&&gi(t,function(){r=E(t.doc,r);var we={from:r,to:r,text:t.doc.splitLines(k.filter(function(Fe){return Fe!=null}).join(t.doc.lineSeparator())),origin:"paste"};ir(t.doc,we),Hs(t.doc,Cn(E(t.doc,r),E(t.doc,An(we))))})()},Z=function(we,Fe){if(t.options.allowDropFileTypes&&ae(t.options.allowDropFileTypes,we.type)==-1){Q();return}var Ke=new FileReader;Ke.onerror=function(){return Q()},Ke.onload=function(){var Ze=Ke.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ze)){Q();return}k[Fe]=Ze,Q()},Ke.readAsText(we)},te=0;te<n.length;te++)Z(n[te],te);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var he=e.dataTransfer.getData("Text");if(he){var pe;if(t.state.draggingText&&!t.state.draggingText.copy&&(pe=t.listSelections()),qr(t.doc,Cn(r,r)),pe)for(var Ce=0;Ce<pe.length;++Ce)nr(t.doc,"",pe[Ce].anchor,pe[Ce].head,"drag");t.replaceSelection(he,"around","paste"),t.display.input.focus()}}catch(we){}}}function Al(e,t){if(G&&(!e.state.draggingText||+new Date-io<100)){de(t);return}if(Ne(e,t)||cn(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!m){var r=p("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),d&&r.parentNode.removeChild(r)}}function Rl(e,t){var r=Fn(e,t);if(!r)return;var n=document.createDocumentFragment();ms(e,r,n),e.display.dragCursor||(e.display.dragCursor=p("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),x(e.display.dragCursor,n)}function no(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ro(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<t.length;n++){var c=t[n].CodeMirror;c&&r.push(c)}r.length&&r[0].operation(function(){for(var k=0;k<r.length;k++)e(r[k])})}var ao=!1;function Ol(){if(ao)return;Ll(),ao=!0}function Ll(){var e;De(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ro(Il)},100))}),De(window,"blur",function(){return ro(Qn)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ln={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"},kr=0;kr<10;kr++)Ln[kr+48]=Ln[kr+96]=String(kr);for(var ia=65;ia<=90;ia++)Ln[ia]=String.fromCharCode(ia);for(var Mr=1;Mr<=12;Mr++)Ln[Mr+111]=Ln[Mr+63235]="F"+Mr;var fn={};fn.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"},fn.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"},fn.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"},fn.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"]},fn.default=o?fn.macDefault:fn.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,n,c,k,K=0;K<t.length-1;K++){var Q=t[K];if(/^(cmd|meta|m)$/i.test(Q))k=!0;else if(/^a(lt)?$/i.test(Q))r=!0;else if(/^(c|ctrl|control)$/i.test(Q))n=!0;else if(/^s(hift)?$/i.test(Q))c=!0;else throw new Error("Unrecognized modifier name: "+Q)}return r&&(e="Alt-"+e),n&&(e="Ctrl-"+e),k&&(e="Cmd-"+e),c&&(e="Shift-"+e),e}function kl(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if(n=="..."){delete e[r];continue}for(var c=qe(r.split(" "),Dl),k=0;k<c.length;k++){var K=void 0,Q=void 0;k==c.length-1?(Q=c.join(" "),K=n):(Q=c.slice(0,k+1).join(" "),K="...");var Z=t[Q];if(!Z)t[Q]=K;else if(Z!=K)throw new Error("Inconsistent bindings for "+Q)}delete e[r]}for(var te in t)e[te]=t[te];return e}function ar(e,t,r,n){t=na(t);var c=t.call?t.call(e,n):t[e];if(c===!1)return"nothing";if(c==="...")return"multi";if(c!=null&&r(c))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return ar(e,t.fallthrough,r,n);for(var k=0;k<t.fallthrough.length;k++){var K=ar(e,t.fallthrough[k],r,n);if(K)return K}}}function so(e){var t=typeof e=="string"?e:Ln[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function oo(e,t,r){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(S?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(S?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!r&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function lo(e,t){if(d&&e.keyCode==34&&e.char)return!1;var r=Ln[e.keyCode];return r==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(r=e.code),oo(r,e,t))}function na(e){return typeof e=="string"?fn[e]:e}function sr(e,t){for(var r=e.doc.sel.ranges,n=[],c=0;c<r.length;c++){for(var k=t(r[c]);n.length&&Rt(k.from,Pe(n).to)<=0;){var K=n.pop();if(Rt(K.from,k.from)<0){k.from=K.from;break}}n.push(k)}Gi(e,function(){for(var Q=n.length-1;Q>=0;Q--)nr(e.doc,"",n[Q].from,n[Q].to,"+delete");Zn(e)})}function Fa(e,t,r){var n=Se(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Ua(e,t,r){var n=Fa(e,t.ch,r);return n==null?null:new Ye(t.line,n,r<0?"after":"before")}function Ba(e,t,r,n,c){if(e){t.doc.direction=="rtl"&&(c=-c);var k=$e(r,t.doc.direction);if(k){var K=c<0?Pe(k):k[0],Q=c<0==(K.level==1),Z=Q?"after":"before",te;if(K.level>0||t.doc.direction=="rtl"){var he=Xn(t,r);te=c<0?r.text.length-1:0;var pe=on(t,he,te).top;te=Be(function(Ce){return on(t,he,Ce).top==pe},c<0==(K.level==1)?K.from:K.to-1,te),Z=="before"&&(te=Fa(r,te,1))}else te=c<0?K.to:K.from;return new Ye(n,te,Z)}}return new Ye(n,c<0?r.text.length:0,c<0?"before":"after")}function Ml(e,t,r,n){var c=$e(t,e.doc.direction);if(!c)return Ua(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var k=Ve(c,r.ch,r.sticky),K=c[k];if(e.doc.direction=="ltr"&&K.level%2==0&&(n>0?K.to>r.ch:K.from<r.ch))return Ua(t,r,n);var Q=function(st,ft){return Fa(t,st instanceof Ye?st.ch:st,ft)},Z,te=function(st){return e.options.lineWrapping?(Z=Z||Xn(e,t),ds(e,t,Z,st)):{begin:0,end:t.text.length}},he=te(r.sticky=="before"?Q(r,-1):r.ch);if(e.doc.direction=="rtl"||K.level==1){var pe=K.level==1==n<0,Ce=Q(r,pe?1:-1);if(Ce!=null&&(pe?Ce<=K.to&&Ce<=he.end:Ce>=K.from&&Ce>=he.begin)){var we=pe?"before":"after";return new Ye(r.line,Ce,we)}}var Fe=function(st,ft,ot){for(var pt=function(Zt,yi){return yi?new Ye(r.line,Q(Zt,1),"before"):new Ye(r.line,Zt,"after")};st>=0&&st<c.length;st+=ft){var At=c[st],xt=ft>0==(At.level!=1),kt=xt?ot.begin:Q(ot.end,-1);if(At.from<=kt&&kt<At.to)return pt(kt,xt);if(kt=xt?At.from:Q(At.to,-1),ot.begin<=kt&&kt<ot.end)return pt(kt,xt)}},Ke=Fe(k+n,n,he);if(Ke)return Ke;var Ze=n>0?he.end:Q(he.begin,-1);return Ze!=null&&!(n>0&&Ze==t.text.length)&&(Ke=Fe(n>0?0:c.length-1,n,te(Ze)),Ke)?Ke:null}var Pr={selectAll:Vs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ee)},killLine:function(e){return sr(e,function(t){if(t.empty()){var r=ht(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:Ye(t.head.line+1,0)}:{from:t.head,to:Ye(t.head.line,r)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return sr(e,function(t){return{from:Ye(t.from().line,0),to:E(e.doc,Ye(t.to().line+1,0))}})},delLineLeft:function(e){return sr(e,function(t){return{from:Ye(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return sr(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return sr(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},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(Ye(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Ye(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return uo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ho(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Pl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},Ae)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},Ae)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?ho(e,t.head):n},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=[],r=e.listSelections(),n=e.options.tabSize,c=0;c<r.length;c++){var k=r[c].from(),K=X(e.getLine(k.line),k.ch,n);t.push(ue(n-K%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Gi(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var c=t[n].head,k=ht(e.doc,c.line).text;if(k){if(c.ch==k.length&&(c=new Ye(c.line,c.ch-1)),c.ch>0)c=new Ye(c.line,c.ch+1),e.replaceRange(k.charAt(c.ch-1)+k.charAt(c.ch-2),Ye(c.line,c.ch-2),c,"+transpose");else if(c.line>e.doc.first){var K=ht(e.doc,c.line-1).text;K&&(c=new Ye(c.line,1),e.replaceRange(k.charAt(0)+e.doc.lineSeparator()+K.charAt(K.length-1),Ye(c.line-1,K.length-1),c,"+transpose"))}}r.push(new Yt(c,c))}e.setSelections(r)})},newlineAndIndent:function(e){return Gi(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Zn(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function uo(e,t){var r=ht(e.doc,t),n=Oi(r);return n!=r&&(t=It(n)),Ba(!0,e,n,t,1)}function Pl(e,t){var r=ht(e.doc,t),n=Yn(r);return n!=r&&(t=It(n)),Ba(!0,e,r,t,-1)}function ho(e,t){var r=uo(e,t.line),n=ht(e.doc,r.line),c=$e(n,e.doc.direction);if(!c||c[0].level==0){var k=Math.max(r.ch,n.text.search(/\S/)),K=t.line==r.line&&t.ch<=k&&t.ch;return Ye(r.line,K?0:k,r.sticky)}return r}function ra(e,t,r){if(typeof t=="string"&&(t=Pr[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,c=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),c=t(e)!=Re}finally{e.display.shift=n,e.state.suppressEdits=!1}return c}function Nl(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var c=ar(t,e.state.keyMaps[n],r,e);if(c)return c}return e.options.extraKeys&&ar(t,e.options.extraKeys,r,e)||ar(t,e.options.keyMap,r,e)}var Fl=new ee;function Nr(e,t,r,n){var c=e.state.keySeq;if(c){if(so(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Fl.set(50,function(){e.state.keySeq==c&&(e.state.keySeq=null,e.display.input.reset())}),co(e,c+" "+t,r,n))return!0}return co(e,t,r,n)}function co(e,t,r,n){var c=Nl(e,t,n);return c=="multi"&&(e.state.keySeq=t),c=="handled"&&xi(e,"keyHandled",e,t,r),(c=="handled"||c=="multi")&&(ne(r),xa(e)),!!c}function fo(e,t){var r=lo(t,!0);return r?t.shiftKey&&!e.state.keySeq?Nr(e,"Shift-"+r,t,function(n){return ra(e,n,!0)})||Nr(e,r,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return ra(e,n)}):Nr(e,r,t,function(n){return ra(e,n)}):!1}function Ul(e,t,r){return Nr(e,"'"+r+"'",t,function(n){return ra(e,n,!0)})}var ja=null;function po(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=N(),Ne(t,e))return;G&&W<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var n=fo(t,e);d&&(ja=n?r:null,!n&&r==88&&!Ut&&(o?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),M&&!o&&!n&&r==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;B(t,"CodeMirror-crosshair");function r(n){(n.keyCode==18||!n.altKey)&&(C(t,"CodeMirror-crosshair"),ut(document,"keyup",r),ut(document,"mouseover",r))}De(document,"keyup",r),De(document,"mouseover",r)}function mo(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ne(this,e)}function go(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(cn(t.display,e)||Ne(t,e)||e.ctrlKey&&!e.altKey||o&&e.metaKey)return;var r=e.keyCode,n=e.charCode;if(d&&r==ja){ja=null,ne(e);return}if(d&&(!e.which||e.which<10)&&fo(t,e))return;var c=String.fromCharCode(n==null?r:n);if(c=="\b")return;if(Ul(t,e,c))return;t.display.input.onKeyPress(e)}var jl=400,Ha=function(e,t,r){this.time=e,this.pos=t,this.button=r};Ha.prototype.compare=function(e,t,r){return this.time+jl>e&&Rt(t,this.pos)==0&&r==this.button};var Fr,Ur;function Hl(e,t){var r=+new Date;return Ur&&Ur.compare(r,e,t)?(Fr=Ur=null,"triple"):Fr&&Fr.compare(r,e,t)?(Ur=new Ha(r,e,t),Fr=null,"double"):(Fr=new Ha(r,e,t),Ur=null,"single")}function vo(e){var t=this,r=t.display;if(Ne(t,e)||r.activeTouch&&r.input.supportsTouch())return;if(r.input.ensurePolled(),r.shift=e.shiftKey,cn(r,e)){i||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(Wa(t,e))return;var n=Fn(t,e),c=Le(e),k=n?Hl(n,c):"single";if(window.focus(),c==1&&t.state.selectingText&&t.state.selectingText(e),n&&Wl(t,c,n,k,e))return;c==1?n?Kl(t,n,k,e):ye(e)==r.scroller&&ne(e):c==2?(n&&Zr(t.doc,n),setTimeout(function(){return r.input.focus()},20)):c==3&&(L?t.display.input.onContextMenu(e):vs(t))}function Wl(e,t,r,n,c){var k="Click";return n=="double"?k="Double"+k:n=="triple"&&(k="Triple"+k),k=(t==1?"Left":t==2?"Middle":"Right")+k,Nr(e,oo(k,c),c,function(K){if(typeof K=="string"&&(K=Pr[K]),!K)return!1;var Q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Q=K(e,r)!=Re}finally{e.state.suppressEdits=!1}return Q})}function Gl(e,t,r){var n=e.getOption("configureMouse"),c=n?n(e,t,r):{};if(c.unit==null){var k=s?r.shiftKey&&r.metaKey:r.altKey;c.unit=k?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(c.extend==null||e.doc.extend)&&(c.extend=e.doc.extend||r.shiftKey),c.addNew==null&&(c.addNew=o?r.metaKey:r.ctrlKey),c.moveOnDrag==null&&(c.moveOnDrag=!(o?r.altKey:r.ctrlKey)),c}function Kl(e,t,r,n){G?setTimeout(P(gs,e),0):e.curOp.focus=N();var c=Gl(e,r,n),k=e.doc.sel,K;e.options.dragDrop&&Ue&&!e.isReadOnly()&&r=="single"&&(K=k.contains(t))>-1&&(Rt((K=k.ranges[K]).from(),t)<0||t.xRel>0)&&(Rt(K.to(),t)>0||t.xRel<0)?zl(e,n,t,c):Vl(e,n,t,c)}function zl(e,t,r,n){var c=e.display,k=!1,K=gi(e,function(te){i&&(c.scroller.draggable=!1),e.state.draggingText=!1,ut(c.wrapper.ownerDocument,"mouseup",K),ut(c.wrapper.ownerDocument,"mousemove",Q),ut(c.scroller,"dragstart",Z),ut(c.scroller,"drop",K),k||(ne(te),n.addNew||Zr(e.doc,r,null,null,n.extend),i&&!m||G&&W==9?setTimeout(function(){c.wrapper.ownerDocument.body.focus({preventScroll:!0}),c.input.focus()},20):c.input.focus())}),Q=function(te){k=k||Math.abs(t.clientX-te.clientX)+Math.abs(t.clientY-te.clientY)>=10},Z=function(){return k=!0};i&&(c.scroller.draggable=!0),e.state.draggingText=K,K.copy=!n.moveOnDrag,c.scroller.dragDrop&&c.scroller.dragDrop(),De(c.wrapper.ownerDocument,"mouseup",K),De(c.wrapper.ownerDocument,"mousemove",Q),De(c.scroller,"dragstart",Z),De(c.scroller,"drop",K),vs(e),setTimeout(function(){return c.input.focus()},20)}function yo(e,t,r){if(r=="char")return new Yt(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new Yt(Ye(t.line,0),E(e.doc,Ye(t.line+1,0)));var n=r(e,t);return new Yt(n.from,n.to)}function Vl(e,t,r,n){var c=e.display,k=e.doc;ne(t);var K,Q,Z=k.sel,te=Z.ranges;if(n.addNew&&!n.extend?(Q=k.sel.contains(r),Q>-1?K=te[Q]:K=new Yt(r,r)):(K=k.sel.primary(),Q=k.sel.primIndex),n.unit=="rectangle")n.addNew||(K=new Yt(r,r)),r=Fn(e,t,!0,!0),Q=-1;else{var he=yo(e,r,n.unit);n.extend?K=Pa(K,he.anchor,he.head,n.extend):K=he}n.addNew?Q==-1?(Q=te.length,Ai(k,tn(e,te.concat([K]),Q),{scroll:!1,origin:"*mouse"})):te.length>1&&te[Q].empty()&&n.unit=="char"&&!n.extend?(Ai(k,tn(e,te.slice(0,Q).concat(te.slice(Q+1)),0),{scroll:!1,origin:"*mouse"}),Z=k.sel):Na(k,Q,K,Te):(Q=0,Ai(k,new Yi([K],0),Te),Z=k.sel);var pe=r;function Ce(ot){if(Rt(pe,ot)==0)return;if(pe=ot,n.unit=="rectangle"){for(var pt=[],At=e.options.tabSize,xt=X(ht(k,r.line).text,r.ch,At),kt=X(ht(k,ot.line).text,ot.ch,At),Zt=Math.min(xt,kt),yi=Math.max(xt,kt),ii=Math.min(r.line,ot.line),Ki=Math.min(e.lastLine(),Math.max(r.line,ot.line));ii<=Ki;ii++){var Ui=ht(k,ii).text,oi=Oe(Ui,Zt,At);Zt==yi?pt.push(new Yt(Ye(ii,oi),Ye(ii,oi))):Ui.length>oi&&pt.push(new Yt(Ye(ii,oi),Ye(ii,Oe(Ui,yi,At))))}pt.length||pt.push(new Yt(r,r)),Ai(k,tn(e,Z.ranges.slice(0,Q).concat(pt),Q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(ot)}else{var Bi=K,Ti=yo(e,ot,n.unit),di=Bi.anchor,li;Rt(Ti.anchor,di)>0?(li=Ti.head,di=yn(Bi.from(),Ti.anchor)):(li=Ti.anchor,di=vn(Bi.to(),Ti.head));var ni=Z.ranges.slice(0);ni[Q]=Yl(e,new Yt(E(k,di),li)),Ai(k,tn(e,ni,Q),Te)}}var we=c.wrapper.getBoundingClientRect(),Fe=0;function Ke(ot){var pt=++Fe,At=Fn(e,ot,!0,n.unit=="rectangle");if(!At)return;if(Rt(At,pe)!=0){e.curOp.focus=N(),Ce(At);var xt=Vr(c,k);(At.line>=xt.to||At.line<xt.from)&&setTimeout(gi(e,function(){Fe==pt&&Ke(ot)}),150)}else{var kt=ot.clientY<we.top?-20:ot.clientY>we.bottom?20:0;kt&&setTimeout(gi(e,function(){if(Fe!=pt)return;c.scroller.scrollTop+=kt,Ke(ot)}),50)}}function Ze(ot){e.state.selectingText=!1,Fe=Infinity,ot&&(ne(ot),c.input.focus()),ut(c.wrapper.ownerDocument,"mousemove",st),ut(c.wrapper.ownerDocument,"mouseup",ft),k.history.lastSelOrigin=null}var st=gi(e,function(ot){ot.buttons===0||!Le(ot)?Ze(ot):Ke(ot)}),ft=gi(e,Ze);e.state.selectingText=ft,De(c.wrapper.ownerDocument,"mousemove",st),De(c.wrapper.ownerDocument,"mouseup",ft)}function Yl(e,t){var r=t.anchor,n=t.head,c=ht(e.doc,r.line);if(Rt(r,n)==0&&r.sticky==n.sticky)return t;var k=$e(c);if(!k)return t;var K=Ve(k,r.ch,r.sticky),Q=k[K];if(Q.from!=r.ch&&Q.to!=r.ch)return t;var Z=K+(Q.from==r.ch==(Q.level!=1)?0:1);if(Z==0||Z==k.length)return t;var te;if(n.line!=r.line)te=(n.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var he=Ve(k,n.ch,n.sticky),pe=he-K||(n.ch-r.ch)*(Q.level==1?-1:1);he==Z-1||he==Z?te=pe<0:te=pe>0}var Ce=k[Z+(te?-1:0)],we=te==(Ce.level==1),Fe=we?Ce.from:Ce.to,Ke=we?"after":"before";return r.ch==Fe&&r.sticky==Ke?t:new Yt(new Ye(r.line,Fe,Ke),n)}function bo(e,t,r,n){var c,k;if(t.touches)c=t.touches[0].clientX,k=t.touches[0].clientY;else try{c=t.clientX,k=t.clientY}catch(Ce){return!1}if(c>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&ne(t);var K=e.display,Q=K.lineDiv.getBoundingClientRect();if(k>Q.bottom||!fe(e,r))return oe(t);k-=Q.top-K.viewOffset;for(var Z=0;Z<e.display.gutterSpecs.length;++Z){var te=K.gutters.childNodes[Z];if(te&&te.getBoundingClientRect().right>=c){var he=ui(e.doc,k),pe=e.display.gutterSpecs[Z];return ke(e,r,e,he,pe.className,t),oe(t)}}}function Wa(e,t){return bo(e,t,"gutterClick",!0)}function _o(e,t){if(cn(e.display,t)||Xl(e,t))return;if(Ne(e,t,"contextmenu"))return;L||e.display.input.onContextMenu(t)}function Xl(e,t){return fe(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-"),yr(e)}var or={toString:function(){return"CodeMirror.Init"}},xo={},aa={};function $l(e){var t=e.optionHandlers;function r(n,c,k,K){e.defaults[n]=c,k&&(t[n]=K?function(Q,Z,te){te!=or&&k(Q,Z,te)}:k)}e.defineOption=r,e.Init=or,r("value","",function(n,c){return n.setValue(c)},!0),r("mode",null,function(n,c){n.doc.modeOption=c,Da(n)},!0),r("indentUnit",2,Da,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(n){Cr(n),yr(n),Ni(n)},!0),r("lineSeparator",null,function(n,c){if(n.doc.lineSep=c,!c)return;var k=[],K=n.doc.first;n.doc.iter(function(Z){for(var te=0;;){var he=Z.text.indexOf(c,te);if(he==-1)break;te=he+c.length,k.push(Ye(K,he))}K++});for(var Q=k.length-1;Q>=0;Q--)nr(n.doc,c,k[Q],Ye(k[Q].line,k[Q].ch+c.length))}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,c,k){n.state.specialChars=new RegExp(c.source+(c.test(" ")?"":"| "),"g"),k!=or&&n.refresh()}),r("specialCharPlaceholder",Qt,function(n){return n.refresh()},!0),r("electricChars",!0),r("inputStyle",h?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(n,c){return n.getInputField().spellcheck=c},!0),r("autocorrect",!1,function(n,c){return n.getInputField().autocorrect=c},!0),r("autocapitalize",!1,function(n,c){return n.getInputField().autocapitalize=c},!0),r("rtlMoveVisually",!A),r("wholeLineUpdateBefore",!0),r("theme","default",function(n){Eo(n),Sr(n)},!0),r("keyMap","default",function(n,c,k){var K=na(c),Q=k!=or&&na(k);Q&&Q.detach&&Q.detach(n,K),K.attach&&K.attach(n,Q||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Ql,!0),r("gutters",[],function(n,c){n.display.gutterSpecs=La(c,n.options.lineNumbers),Sr(n)},!0),r("fixedGutter",!0,function(n,c){n.display.gutters.style.left=c?_a(n.display)+"px":"0",n.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(n){return qn(n)},!0),r("scrollbarStyle","native",function(n){Ts(n),qn(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),r("lineNumbers",!1,function(n,c){n.display.gutterSpecs=La(n.options.gutters,c),Sr(n)},!0),r("firstLineNumber",1,Sr,!0),r("lineNumberFormatter",function(n){return n},Sr,!0),r("showCursorWhenSelecting",!1,br,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(n,c){c=="nocursor"&&(Qn(n),n.display.input.blur()),n.display.input.readOnlyChanged(c)}),r("screenReaderLabel",null,function(n,c){c=c===""?null:c,n.display.input.screenReaderLabelChanged(c)}),r("disableInput",!1,function(n,c){c||n.display.input.reset()},!0),r("dragDrop",!0,Jl),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,br,!0),r("singleCursorHeightPerLine",!0,br,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Cr,!0),r("addModeClass",!1,Cr,!0),r("pollInterval",100),r("undoDepth",200,function(n,c){return n.doc.history.undoDepth=c}),r("historyEventDelay",1250),r("viewportMargin",10,function(n){return n.refresh()},!0),r("maxHighlightLength",1e4,Cr,!0),r("moveInputWithCursor",!0,function(n,c){c||n.display.input.resetPosition()}),r("tabindex",null,function(n,c){return n.display.input.getField().tabIndex=c||""}),r("autofocus",null),r("direction","ltr",function(n,c){return n.doc.setDirection(c)},!0),r("phrases",null)}function Jl(e,t,r){var n=r&&r!=or;if(!t!=!n){var c=e.display.dragFunctions,k=t?De:ut;k(e.display.scroller,"dragstart",c.start),k(e.display.scroller,"dragenter",c.enter),k(e.display.scroller,"dragover",c.over),k(e.display.scroller,"dragleave",c.leave),k(e.display.scroller,"drop",c.drop)}}function Ql(e){e.options.lineWrapping?(B(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(C(e.display.wrapper,"CodeMirror-wrap"),jr(e)),Ea(e),Ni(e),yr(e),setTimeout(function(){return qn(e)},100)}function ti(e,t){var r=this;if(!(this instanceof ti))return new ti(e,t);this.options=t=t?b(t):{},b(xo,t,!1);var n=t.value;typeof n=="string"?n=new Fi(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var c=new ti.inputStyles[t.inputStyle](this),k=this.display=new hl(e,n,c,t);k.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 ee,keySeq:null,specialChars:null},t.autofocus&&!h&&k.input.focus(),G&&W<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Zl(this),Ol(),Hn(this),this.curOp.forceUpdate=!0,ks(this,n),t.autofocus&&!h||this.hasFocus()?setTimeout(function(){r.hasFocus()&&!r.state.focused&&Ta(r)},20):Qn(this);for(var K in aa)aa.hasOwnProperty(K)&&aa[K](this,t[K],or);Cs(this),t.finishInit&&t.finishInit(this);for(var Q=0;Q<Ga.length;++Q)Ga[Q](this);Wn(this),i&&t.lineWrapping&&getComputedStyle(k.lineDiv).textRendering=="optimizelegibility"&&(k.lineDiv.style.textRendering="auto")}ti.defaults=xo,ti.optionHandlers=aa;function Zl(e){var t=e.display;De(t.scroller,"mousedown",gi(e,vo)),G&&W<11?De(t.scroller,"dblclick",gi(e,function(Z){if(Ne(e,Z))return;var te=Fn(e,Z);if(!te||Wa(e,Z)||cn(e.display,Z))return;ne(Z);var he=e.findWordAt(te);Zr(e.doc,he.anchor,he.head)})):De(t.scroller,"dblclick",function(Z){return Ne(e,Z)||ne(Z)}),De(t.scroller,"contextmenu",function(Z){return _o(e,Z)}),De(t.input.getField(),"contextmenu",function(Z){t.scroller.contains(Z.target)||_o(e,Z)});var r,n={end:0};function c(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function k(Z){if(Z.touches.length!=1)return!1;var te=Z.touches[0];return te.radiusX<=1&&te.radiusY<=1}function K(Z,te){if(te.left==null)return!0;var he=te.left-Z.left,pe=te.top-Z.top;return he*he+pe*pe>20*20}De(t.scroller,"touchstart",function(Z){if(!Ne(e,Z)&&!k(Z)&&!Wa(e,Z)){t.input.ensurePolled(),clearTimeout(r);var te=+new Date;t.activeTouch={start:te,moved:!1,prev:te-n.end<=300?n:null},Z.touches.length==1&&(t.activeTouch.left=Z.touches[0].pageX,t.activeTouch.top=Z.touches[0].pageY)}}),De(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),De(t.scroller,"touchend",function(Z){var te=t.activeTouch;if(te&&!cn(t,Z)&&te.left!=null&&!te.moved&&new Date-te.start<300){var he=e.coordsChar(t.activeTouch,"page"),pe;!te.prev||K(te,te.prev)?pe=new Yt(he,he):!te.prev.prev||K(te,te.prev.prev)?pe=e.findWordAt(he):pe=new Yt(Ye(he.line,0),E(e.doc,Ye(he.line+1,0))),e.setSelection(pe.anchor,pe.head),e.focus(),ne(Z)}c()}),De(t.scroller,"touchcancel",c),De(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Er(e,t.scroller.scrollTop),Bn(e,t.scroller.scrollLeft,!0),ke(e,"scroll",e))}),De(t.scroller,"mousewheel",function(Z){return Os(e,Z)}),De(t.scroller,"DOMMouseScroll",function(Z){return Os(e,Z)}),De(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(Z){Ne(e,Z)||de(Z)},over:function(Z){Ne(e,Z)||(Rl(e,Z),de(Z))},start:function(Z){return Al(e,Z)},drop:gi(e,Cl),leave:function(Z){Ne(e,Z)||no(e)}};var Q=t.input.getField();De(Q,"keyup",function(Z){return mo.call(e,Z)}),De(Q,"keydown",gi(e,po)),De(Q,"keypress",gi(e,go)),De(Q,"focus",function(Z){return Ta(e,Z)}),De(Q,"blur",function(Z){return Qn(e,Z)})}var Ga=[];ti.defineInitHook=function(e){return Ga.push(e)};function Br(e,t,r,n){var c=e.doc,k;r==null&&(r="add"),r=="smart"&&(c.mode.indent?k=it(e,t).state:r="prev");var K=e.options.tabSize,Q=ht(c,t),Z=X(Q.text,null,K);Q.stateAfter&&(Q.stateAfter=null);var te=Q.text.match(/^\s*/)[0],he;if(!n&&!/\S/.test(Q.text))he=0,r="not";else if(r=="smart"&&(he=c.mode.indent(k,Q.text.slice(te.length),Q.text),he==Re||he>150)){if(!n)return;r="prev"}r=="prev"?t>c.first?he=X(ht(c,t-1).text,null,K):he=0:r=="add"?he=Z+e.options.indentUnit:r=="subtract"?he=Z-e.options.indentUnit:typeof r=="number"&&(he=Z+r),he=Math.max(0,he);var pe="",Ce=0;if(e.options.indentWithTabs)for(var we=Math.floor(he/K);we;--we)Ce+=K,pe+=" ";if(Ce<he&&(pe+=ue(he-Ce)),pe!=te)return nr(c,pe,Ye(t,0),Ye(t,te.length),"+input"),Q.stateAfter=null,!0;for(var Fe=0;Fe<c.sel.ranges.length;Fe++){var Ke=c.sel.ranges[Fe];if(Ke.head.line==t&&Ke.head.ch<te.length){var Ze=Ye(t,te.length);Na(c,Fe,new Yt(Ze,Ze));break}}}var nn=null;function sa(e){nn=e}function Ka(e,t,r,n,c){var k=e.doc;e.display.shift=!1,n||(n=k.sel);var K=+new Date-200,Q=c=="paste"||e.state.pasteIncoming>K,Z=yt(t),te=null;if(Q&&n.ranges.length>1)if(nn&&nn.text.join(`
|
|
`)==t){if(n.ranges.length%nn.text.length==0){te=[];for(var he=0;he<nn.text.length;he++)te.push(k.splitLines(nn.text[he]))}}else Z.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(te=qe(Z,function(st){return[st]}));for(var pe=e.curOp.updateInput,Ce=n.ranges.length-1;Ce>=0;Ce--){var we=n.ranges[Ce],Fe=we.from(),Ke=we.to();we.empty()&&(r&&r>0?Fe=Ye(Fe.line,Fe.ch-r):e.state.overwrite&&!Q?Ke=Ye(Ke.line,Math.min(ht(k,Ke.line).text.length,Ke.ch+Pe(Z).length)):Q&&nn&&nn.lineWise&&nn.text.join(`
|
|
`)==Z.join(`
|
|
`)&&(Fe=Ke=Ye(Fe.line,0)));var Ze={from:Fe,to:Ke,text:te?te[Ce%te.length]:Z,origin:c||(Q?"paste":e.state.cutIncoming>K?"cut":"+input")};ir(e.doc,Ze),xi(e,"inputRead",e,Ze)}t&&!Q&&wo(e,t),Zn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=pe),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function To(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Gi(t,function(){return Ka(t,r,0,null,"paste")}),!0}function wo(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var c=r.ranges[n];if(c.head.ch>100||n&&r.ranges[n-1].head.line==c.head.line)continue;var k=e.getModeAt(c.head),K=!1;if(k.electricChars){for(var Q=0;Q<k.electricChars.length;Q++)if(t.indexOf(k.electricChars.charAt(Q))>-1){K=Br(e,c.head.line,"smart");break}}else k.electricInput&&(k.electricInput.test(ht(e.doc,c.head.line).text.slice(0,c.head.ch))&&(K=Br(e,c.head.line,"smart")));K&&xi(e,"electricInput",e,c.head.line)}}function So(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var c=e.doc.sel.ranges[n].head.line,k={anchor:Ye(c,0),head:Ye(c+1,0)};r.push(k),t.push(e.getRange(k.anchor,k.head))}return{text:t,ranges:r}}function Co(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ao(){var e=p("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=p("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return i?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,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,c){var k=this.options,K=k[n];if(k[n]==c&&n!="mode")return;k[n]=c,t.hasOwnProperty(n)&&gi(this,t[n])(this,c,K),ke(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,c){this.state.keyMaps[c?"push":"unshift"](na(n))},removeKeyMap:function(n){for(var c=this.state.keyMaps,k=0;k<c.length;++k)if(c[k]==n||c[k].name==n)return c.splice(k,1),!0},addOverlay:Li(function(n,c){var k=n.token?n:e.getMode(this.options,n);if(k.startState)throw new Error("Overlays may not be stateful.");ze(this.state.overlays,{mode:k,modeSpec:n,opaque:c&&c.opaque,priority:c&&c.priority||0},function(K){return K.priority}),this.state.modeGen++,Ni(this)}),removeOverlay:Li(function(n){for(var c=this.state.overlays,k=0;k<c.length;++k){var K=c[k].modeSpec;if(K==n||typeof n=="string"&&K.name==n){c.splice(k,1),this.state.modeGen++,Ni(this);return}}}),indentLine:Li(function(n,c,k){typeof c!="string"&&typeof c!="number"&&(c==null?c=this.options.smartIndent?"smart":"prev":c=c?"add":"subtract"),ki(this.doc,n)&&Br(this,n,c,k)}),indentSelection:Li(function(n){for(var c=this.doc.sel.ranges,k=-1,K=0;K<c.length;K++){var Q=c[K];if(Q.empty())Q.head.line>k&&(Br(this,Q.head.line,n,!0),k=Q.head.line,K==this.doc.sel.primIndex&&Zn(this));else{var Z=Q.from(),te=Q.to(),he=Math.max(k,Z.line);k=Math.min(this.lastLine(),te.line-(te.ch?0:1))+1;for(var pe=he;pe<k;++pe)Br(this,pe,n);var Ce=this.doc.sel.ranges;Z.ch==0&&c.length==Ce.length&&Ce[K].from().ch>0&&Na(this.doc,K,new Yt(Z,Ce[K].to()),Ee)}}}),getTokenAt:function(n,c){return qt(this,n,c)},getLineTokens:function(n,c){return qt(this,Ye(n),c,!0)},getTokenTypeAt:function(n){n=E(this.doc,n);var c=je(this,ht(this.doc,n.line)),k=0,K=(c.length-1)/2,Q=n.ch,Z;if(Q==0)Z=c[2];else for(;;){var te=k+K>>1;if((te?c[te*2-1]:0)>=Q)K=te;else if(c[te*2+1]<Q)k=te+1;else{Z=c[te*2+2];break}}var he=Z?Z.indexOf("overlay "):-1;return he<0?Z:he==0?null:Z.slice(0,he-1)},getModeAt:function(n){var c=this.doc.mode;return c.innerMode?e.innerMode(c,this.getTokenAt(n).state).mode:c},getHelper:function(n,c){return this.getHelpers(n,c)[0]},getHelpers:function(n,c){var k=[];if(!r.hasOwnProperty(c))return k;var K=r[c],Q=this.getModeAt(n);if(typeof Q[c]=="string")K[Q[c]]&&k.push(K[Q[c]]);else if(Q[c])for(var Z=0;Z<Q[c].length;Z++){var te=K[Q[c][Z]];te&&k.push(te)}else Q.helperType&&K[Q.helperType]?k.push(K[Q.helperType]):K[Q.name]&&k.push(K[Q.name]);for(var he=0;he<K._global.length;he++){var pe=K._global[he];pe.pred(Q,this)&&ae(k,pe.val)==-1&&k.push(pe.val)}return k},getStateAfter:function(n,c){var k=this.doc;return n=V(k,n==null?k.first+k.size-1:n),it(this,n+1,c).state},cursorCoords:function(n,c){var k,K=this.doc.sel.primary();return n==null?k=K.head:typeof n=="object"?k=E(this.doc,n):k=n?K.from():K.to(),en(this,k,c||"page")},charCoords:function(n,c){return ma(this,E(this.doc,n),c||"page")},coordsChar:function(n,c){return n=ls(this,n,c||"page"),va(this,n.left,n.top)},lineAtHeight:function(n,c){return n=ls(this,{top:n,left:0},c||"page").top,ui(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,c,k){var K=!1,Q;if(typeof n=="number"){var Z=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>Z&&(n=Z,K=!0),Q=ht(this.doc,n)}else Q=n;return Wr(this,Q,{top:0,left:0},c||"page",k||K).top+(K?this.doc.height-qi(Q):0)},defaultTextHeight:function(){return $n(this.display)},defaultCharWidth:function(){return Jn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,c,k,K,Q){var Z=this.display;n=en(this,E(this.doc,n));var te=n.bottom,he=n.left;if(c.style.position="absolute",c.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(c),Z.sizer.appendChild(c),K=="over")te=n.top;else if(K=="above"||K=="near"){var pe=Math.max(Z.wrapper.clientHeight,this.doc.height),Ce=Math.max(Z.sizer.clientWidth,Z.lineSpace.clientWidth);(K=="above"||n.bottom+c.offsetHeight>pe)&&n.top>c.offsetHeight?te=n.top-c.offsetHeight:n.bottom+c.offsetHeight<=pe&&(te=n.bottom),he+c.offsetWidth>Ce&&(he=Ce-c.offsetWidth)}c.style.top=te+"px",c.style.left=c.style.right="",Q=="right"?(he=Z.sizer.clientWidth-c.offsetWidth,c.style.right="0px"):(Q=="left"?he=0:Q=="middle"&&(he=(Z.sizer.clientWidth-c.offsetWidth)/2),c.style.left=he+"px"),k&&Jo(this,{left:he,top:te,right:he+c.offsetWidth,bottom:te+c.offsetHeight})},triggerOnKeyDown:Li(po),triggerOnKeyPress:Li(go),triggerOnKeyUp:mo,triggerOnMouseDown:Li(vo),execCommand:function(n){if(Pr.hasOwnProperty(n))return Pr[n].call(null,this)},triggerElectric:Li(function(n){wo(this,n)}),findPosH:function(n,c,k,K){var Q=1;c<0&&(Q=-1,c=-c);for(var Z=E(this.doc,n),te=0;te<c&&!(Z=za(this.doc,Z,Q,k,K),Z.hitSide);++te);return Z},moveH:Li(function(n,c){var k=this;this.extendSelectionsBy(function(K){return k.display.shift||k.doc.extend||K.empty()?za(k.doc,K.head,n,c,k.options.rtlMoveVisually):n<0?K.from():K.to()},Ae)}),deleteH:Li(function(n,c){var k=this.doc.sel,K=this.doc;k.somethingSelected()?K.replaceSelection("",null,"+delete"):sr(this,function(Q){var Z=za(K,Q.head,n,c,!1);return n<0?{from:Z,to:Q.head}:{from:Q.head,to:Z}})}),findPosV:function(n,c,k,K){var Q=1,Z=K;c<0&&(Q=-1,c=-c);for(var te=E(this.doc,n),he=0;he<c;++he){var pe=en(this,te,"div");if(Z==null?Z=pe.left:pe.left=Z,te=Ro(this,pe,Q,k),te.hitSide)break}return te},moveV:Li(function(n,c){var k=this,K=this.doc,Q=[],Z=!this.display.shift&&!K.extend&&K.sel.somethingSelected();if(K.extendSelectionsBy(function(he){if(Z)return n<0?he.from():he.to();var pe=en(k,he.head,"div");he.goalColumn!=null&&(pe.left=he.goalColumn),Q.push(pe.left);var Ce=Ro(k,pe,n,c);return c=="page"&&he==K.sel.primary()&&Sa(k,ma(k,Ce,"div").top-pe.top),Ce},Ae),Q.length)for(var te=0;te<K.sel.ranges.length;te++)K.sel.ranges[te].goalColumn=Q[te]}),findWordAt:function(n){var c=this.doc,k=ht(c,n.line).text,K=n.ch,Q=n.ch;if(k){var Z=this.getHelper(n,"wordChars");(n.sticky=="before"||Q==k.length)&&K?--K:++Q;for(var te=k.charAt(K),he=Ge(te,Z)?function(pe){return Ge(pe,Z)}:/\s/.test(te)?function(pe){return/\s/.test(pe)}:function(pe){return!/\s/.test(pe)&&!Ge(pe)};K>0&&he(k.charAt(K-1));)--K;for(;Q<k.length&&he(k.charAt(Q));)++Q}return new Yt(Ye(n.line,K),Ye(n.line,Q))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?B(this.display.cursorDiv,"CodeMirror-overwrite"):C(this.display.cursorDiv,"CodeMirror-overwrite"),ke(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==N()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Li(function(n,c){_r(this,n,c)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-sn(this)-this.display.barHeight,width:n.scrollWidth-sn(this)-this.display.barWidth,clientHeight:ca(this),clientWidth:Pn(this)}},scrollIntoView:Li(function(n,c){n==null?(n={from:this.doc.sel.primary().head,to:null},c==null&&(c=this.options.cursorScrollMargin)):typeof n=="number"?n={from:Ye(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=c||0,n.from.line!=null?Qo(this,n):bs(this,n.from,n.to,n.margin)}),setSize:Li(function(n,c){var k=this,K=function(Z){return typeof Z=="number"||/^\d+$/.test(String(Z))?Z+"px":Z};n!=null&&(this.display.wrapper.style.width=K(n)),c!=null&&(this.display.wrapper.style.height=K(c)),this.options.lineWrapping&&as(this);var Q=this.display.viewFrom;this.doc.iter(Q,this.display.viewTo,function(Z){if(Z.widgets){for(var te=0;te<Z.widgets.length;te++)if(Z.widgets[te].noHScroll){wn(k,Q,"widget");break}}++Q}),this.curOp.forceUpdate=!0,ke(this,"refresh",this)}),operation:function(n){return Gi(this,n)},startOperation:function(){return Hn(this)},endOperation:function(){return Wn(this)},refresh:Li(function(){var n=this.display.cachedTextHeight;Ni(this),this.curOp.forceUpdate=!0,yr(this),_r(this,this.doc.scrollLeft,this.doc.scrollTop),Ra(this.display),(n==null||Math.abs(n-$n(this.display))>.5||this.options.lineWrapping)&&Ea(this),ke(this,"refresh",this)}),swapDoc:Li(function(n){var c=this.doc;return c.cm=null,this.state.selectingText&&this.state.selectingText(),ks(this,n),yr(this),this.display.input.reset(),_r(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,xi(this,"swapDoc",this,c),c}),phrase:function(n){var c=this.options.phrases;return c&&Object.prototype.hasOwnProperty.call(c,n)?c[n]:n},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}},ve(e),e.registerHelper=function(n,c,k){r.hasOwnProperty(n)||(r[n]=e[n]={_global:[]}),r[n][c]=k},e.registerGlobalHelper=function(n,c,k,K){e.registerHelper(n,c,K),r[n]._global.push({pred:k,val:K})}}function za(e,t,r,n,c){var k=t,K=r,Q=ht(e,t.line),Z=c&&e.direction=="rtl"?-r:r;function te(){var ft=t.line+Z;return ft<e.first||ft>=e.first+e.size?!1:(t=new Ye(ft,t.ch,t.sticky),Q=ht(e,ft))}function he(ft){var ot;if(n=="codepoint"){var pt=Q.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(pt)?ot=null:ot=new Ye(t.line,Math.max(0,Math.min(Q.text.length,t.ch+r*(pt>=55296&&pt<56320?2:1))),-r)}else c?ot=Ml(e.cm,Q,t,r):ot=Ua(Q,t,r);if(ot==null)if(!ft&&te())t=Ba(c,e.cm,Q,t.line,Z);else return!1;else t=ot;return!0}if(n=="char"||n=="codepoint")he();else if(n=="column")he(!0);else if(n=="word"||n=="group")for(var pe=null,Ce=n=="group",we=e.cm&&e.cm.getHelper(t,"wordChars"),Fe=!0;!(r<0&&!he(!Fe));Fe=!1){var Ke=Q.text.charAt(t.ch)||`
|
|
`,Ze=Ge(Ke,we)?"w":Ce&&Ke==`
|
|
`?"n":!Ce||/\s/.test(Ke)?null:"p";if(Ce&&!Fe&&!Ze&&(Ze="s"),pe&&pe!=Ze){r<0&&(r=1,he(),t.sticky="after");break}if(Ze&&(pe=Ze),r>0&&!he(!Fe))break}var st=ea(e,t,k,K,!0);return mn(k,st)&&(st.hitSide=!0),st}function Ro(e,t,r,n){var c=e.doc,k=t.left,K;if(n=="page"){var Q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Z=Math.max(Q-.5*$n(e.display),3);K=(r>0?t.bottom:t.top)+r*Z}else n=="line"&&(K=r>0?t.bottom+3:t.top-3);for(var te;!(te=va(e,k,K),!te.outside);){if(r<0?K<=0:K>=c.height){te.hitSide=!0;break}K+=r*5}return te}var $t=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ee,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};$t.prototype.init=function(e){var t=this,r=this,n=r.cm,c=r.div=e.lineDiv;Co(c,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function k(Q){for(var Z=Q.target;Z;Z=Z.parentNode){if(Z==c)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Z.className))break}return!1}De(c,"paste",function(Q){if(!k(Q)||Ne(n,Q)||To(Q,n))return;W<=11&&setTimeout(gi(n,function(){return t.updateFromDOM()}),20)}),De(c,"compositionstart",function(Q){t.composing={data:Q.data,done:!1}}),De(c,"compositionupdate",function(Q){t.composing||(t.composing={data:Q.data,done:!1})}),De(c,"compositionend",function(Q){t.composing&&(Q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),De(c,"touchstart",function(){return r.forceCompositionEnd()}),De(c,"input",function(){t.composing||t.readFromDOMSoon()});function K(Q){if(!k(Q)||Ne(n,Q))return;if(n.somethingSelected())sa({lineWise:!1,text:n.getSelections()}),Q.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var Z=So(n);sa({lineWise:!0,text:Z.text}),Q.type=="cut"&&n.operation(function(){n.setSelections(Z.ranges,0,Ee),n.replaceSelection("",null,"cut")})}else return;if(Q.clipboardData){Q.clipboardData.clearData();var te=nn.text.join(`
|
|
`);if(Q.clipboardData.setData("Text",te),Q.clipboardData.getData("Text")==te){Q.preventDefault();return}}var he=Ao(),pe=he.firstChild;n.display.lineSpace.insertBefore(he,n.display.lineSpace.firstChild),pe.value=nn.text.join(`
|
|
`);var Ce=document.activeElement;j(pe),setTimeout(function(){n.display.lineSpace.removeChild(he),Ce.focus(),Ce==c&&r.showPrimarySelection()},50)}De(c,"copy",K),De(c,"cut",K)},$t.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},$t.prototype.prepareSelection=function(){var e=ps(this.cm,!1);return e.focus=document.activeElement==this.div,e},$t.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},$t.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},$t.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),c=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||c.line<t.display.viewFrom){e.removeAllRanges();return}var k=oa(t,e.anchorNode,e.anchorOffset),K=oa(t,e.focusNode,e.focusOffset);if(k&&!k.bad&&K&&!K.bad&&Rt(yn(k,K),n)==0&&Rt(vn(k,K),c)==0)return;var Q=t.display.view,Z=n.line>=t.display.viewFrom&&Oo(t,n)||{node:Q[0].measure.map[2],offset:0},te=c.line<t.display.viewTo&&Oo(t,c);if(!te){var he=Q[Q.length-1].measure,pe=he.maps?he.maps[he.maps.length-1]:he.map;te={node:pe[pe.length-1],offset:pe[pe.length-2]-pe[pe.length-3]}}if(!Z||!te){e.removeAllRanges();return}var Ce=e.rangeCount&&e.getRangeAt(0),we;try{we=v(Z.node,Z.offset,te.offset,te.node)}catch(Fe){}we&&(!M&&t.state.focused?(e.collapse(Z.node,Z.offset),we.collapsed||(e.removeAllRanges(),e.addRange(we))):(e.removeAllRanges(),e.addRange(we)),Ce&&e.anchorNode==null?e.addRange(Ce):M&&this.startGracePeriod()),this.rememberSelection()},$t.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)},$t.prototype.showMultipleSelections=function(e){x(this.cm.display.cursorDiv,e.cursors),x(this.cm.display.selectionDiv,e.selection)},$t.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},$t.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return y(this.div,t)},$t.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},$t.prototype.blur=function(){this.div.blur()},$t.prototype.getField=function(){return this.div},$t.prototype.supportsTouch=function(){return!0},$t.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Gi(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)},$t.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},$t.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(l&&g&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var r=oa(t,e.anchorNode,e.anchorOffset),n=oa(t,e.focusNode,e.focusOffset);r&&n&&Gi(t,function(){Ai(t.doc,Cn(r,n),Ee),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},$t.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),c=r.to();if(n.ch==0&&n.line>e.firstLine()&&(n=Ye(n.line-1,ht(e.doc,n.line-1).length)),c.ch==ht(e.doc,c.line).text.length&&c.line<e.lastLine()&&(c=Ye(c.line+1,0)),n.line<t.viewFrom||c.line>t.viewTo-1)return!1;var k,K,Q;n.line==t.viewFrom||(k=Un(e,n.line))==0?(K=It(t.view[0].line),Q=t.view[0].node):(K=It(t.view[k].line),Q=t.view[k-1].node.nextSibling);var Z=Un(e,c.line),te,he;if(Z==t.view.length-1?(te=t.viewTo-1,he=t.lineDiv.lastChild):(te=It(t.view[Z+1].line)-1,he=t.view[Z+1].node.previousSibling),!Q)return!1;for(var pe=e.doc.splitLines(tu(e,Q,he,K,te)),Ce=_i(e.doc,Ye(K,0),Ye(te,ht(e.doc,te).text.length));pe.length>1&&Ce.length>1;)if(Pe(pe)==Pe(Ce))pe.pop(),Ce.pop(),te--;else if(pe[0]==Ce[0])pe.shift(),Ce.shift(),K++;else break;for(var we=0,Fe=0,Ke=pe[0],Ze=Ce[0],st=Math.min(Ke.length,Ze.length);we<st&&Ke.charCodeAt(we)==Ze.charCodeAt(we);)++we;for(var ft=Pe(pe),ot=Pe(Ce),pt=Math.min(ft.length-(pe.length==1?we:0),ot.length-(Ce.length==1?we:0));Fe<pt&&ft.charCodeAt(ft.length-Fe-1)==ot.charCodeAt(ot.length-Fe-1);)++Fe;if(pe.length==1&&Ce.length==1&&K==n.line)for(;we&&we>n.ch&&ft.charCodeAt(ft.length-Fe-1)==ot.charCodeAt(ot.length-Fe-1);)we--,Fe++;pe[pe.length-1]=ft.slice(0,ft.length-Fe).replace(/^\u200b+/,""),pe[0]=pe[0].slice(we).replace(/\u200b+$/,"");var At=Ye(K,we),xt=Ye(te,Ce.length?Pe(Ce).length-Fe:0);if(pe.length>1||pe[0]||Rt(At,xt))return nr(e.doc,pe,At,xt,"+input"),!0},$t.prototype.ensurePolled=function(){this.forceCompositionEnd()},$t.prototype.reset=function(){this.forceCompositionEnd()},$t.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},$t.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)},$t.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Gi(this.cm,function(){return Ni(e.cm)})},$t.prototype.setUneditable=function(e){e.contentEditable="false"},$t.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||gi(this.cm,Ka)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},$t.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},$t.prototype.onContextMenu=function(){},$t.prototype.resetPosition=function(){},$t.prototype.needsContentAttribute=!0;function Oo(e,t){var r=fa(e,t.line);if(!r||r.hidden)return null;var n=ht(e.doc,t.line),c=es(r,n,t.line),k=$e(n,e.doc.direction),K="left";if(k){var Q=Ve(k,t.ch);K=Q%2?"right":"left"}var Z=ns(c.map,t.ch,K);return Z.offset=Z.collapse=="right"?Z.end:Z.start,Z}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function lr(e,t){return t&&(e.bad=!0),e}function tu(e,t,r,n,c){var k="",K=!1,Q=e.doc.lineSeparator(),Z=!1;function te(we){return function(Fe){return Fe.id==we}}function he(){K&&(k+=Q,Z&&(k+=Q),K=Z=!1)}function pe(we){we&&(he(),k+=we)}function Ce(we){if(we.nodeType==1){var Fe=we.getAttribute("cm-text");if(Fe){pe(Fe);return}var Ke=we.getAttribute("cm-marker"),Ze;if(Ke){var st=e.findMarks(Ye(n,0),Ye(c+1,0),te(+Ke));st.length&&(Ze=st[0].find(0))&&pe(_i(e.doc,Ze.from,Ze.to).join(Q));return}if(we.getAttribute("contenteditable")=="false")return;var ft=/^(pre|div|p|li|table|br)$/i.test(we.nodeName);if(!/^br$/i.test(we.nodeName)&&we.textContent.length==0)return;ft&&he();for(var ot=0;ot<we.childNodes.length;ot++)Ce(we.childNodes[ot]);/^(pre|p)$/i.test(we.nodeName)&&(Z=!0),ft&&(K=!0)}else we.nodeType==3&&pe(we.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ce(t),t==r);)t=t.nextSibling,Z=!1;return k}function oa(e,t,r){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[r],!n)return lr(e.clipPos(Ye(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var c=0;c<e.display.view.length;c++){var k=e.display.view[c];if(k.node==n)return iu(k,t,r)}}function iu(e,t,r){var n=e.text.firstChild,c=!1;if(!t||!y(n,t))return lr(Ye(It(e.line),0),!0);if(t==n&&(c=!0,t=n.childNodes[r],r=0,!t)){var k=e.rest?Pe(e.rest):e.line;return lr(Ye(It(k),k.text.length),c)}var K=t.nodeType==3?t:null,Q=t;for(!K&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(K=t.firstChild,r&&(r=K.nodeValue.length));Q.parentNode!=n;)Q=Q.parentNode;var Z=e.measure,te=Z.maps;function he(Ze,st,ft){for(var ot=-1;ot<(te?te.length:0);ot++)for(var pt=ot<0?Z.map:te[ot],At=0;At<pt.length;At+=3){var xt=pt[At+2];if(xt==Ze||xt==st){var kt=It(ot<0?e.line:e.rest[ot]),Zt=pt[At]+ft;return(ft<0||xt!=Ze)&&(Zt=pt[At+(ft?1:0)]),Ye(kt,Zt)}}}var pe=he(K,Q,r);if(pe)return lr(pe,c);for(var Ce=Q.nextSibling,we=K?K.nodeValue.length-r:0;Ce;Ce=Ce.nextSibling){if(pe=he(Ce,Ce.firstChild,0),pe)return lr(Ye(pe.line,pe.ch-we),c);we+=Ce.textContent.length}for(var Fe=Q.previousSibling,Ke=r;Fe;Fe=Fe.previousSibling){if(pe=he(Fe,Fe.firstChild,-1),pe)return lr(Ye(pe.line,pe.ch+Ke),c);Ke+=Fe.textContent.length}}var ai=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ee,this.hasSelection=!1,this.composing=null};ai.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var c=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),f&&(c.style.width="0px"),De(c,"input",function(){G&&W>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),De(c,"paste",function(K){if(Ne(n,K)||To(K,n))return;n.state.pasteIncoming=+new Date,r.fastPoll()});function k(K){if(Ne(n,K))return;if(n.somethingSelected())sa({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var Q=So(n);sa({lineWise:!0,text:Q.text}),K.type=="cut"?n.setSelections(Q.ranges,null,Ee):(r.prevInput="",c.value=Q.text.join(`
|
|
`),j(c))}else return;K.type=="cut"&&(n.state.cutIncoming=+new Date)}De(c,"cut",k),De(c,"copy",k),De(e.scroller,"paste",function(K){if(cn(e,K)||Ne(n,K))return;if(!c.dispatchEvent){n.state.pasteIncoming=+new Date,r.focus();return}var Q=new Event("paste");Q.clipboardData=K.clipboardData,c.dispatchEvent(Q)}),De(e.lineSpace,"selectstart",function(K){cn(e,K)||ne(K)}),De(c,"compositionstart",function(){var K=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:K,range:n.markText(K,n.getCursor("to"),{className:"CodeMirror-composing"})}}),De(c,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},ai.prototype.createField=function(e){this.wrapper=Ao(),this.textarea=this.wrapper.firstChild},ai.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ai.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=ps(e);if(e.options.moveInputWithCursor){var c=en(e,r.sel.primary().head,"div"),k=t.wrapper.getBoundingClientRect(),K=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,c.top+K.top-k.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,c.left+K.left-k.left))}return n},ai.prototype.showSelection=function(e){var t=this.cm,r=t.display;x(r.cursorDiv,e.cursors),x(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ai.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&j(this.textarea),G&&W>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",G&&W>=9&&(this.hasSelection=null))},ai.prototype.getField=function(){return this.textarea},ai.prototype.supportsTouch=function(){return!1},ai.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!h||N()!=this.textarea))try{this.textarea.focus()}catch(e){}},ai.prototype.blur=function(){this.textarea.blur()},ai.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ai.prototype.receivedFocus=function(){this.slowPoll()},ai.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()})},ai.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function r(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,r)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,r)},ai.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||tt(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var c=r.value;if(c==n&&!t.somethingSelected())return!1;if(G&&W>=9&&this.hasSelection===c||o&&/[\uf700-\uf7ff]/.test(c))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var k=c.charCodeAt(0);if(k==8203&&!n&&(n="\u200B"),k==8666)return this.reset(),this.cm.execCommand("undo")}for(var K=0,Q=Math.min(n.length,c.length);K<Q&&n.charCodeAt(K)==c.charCodeAt(K);)++K;return Gi(t,function(){Ka(t,c.slice(K),n.length-K,null,e.composing?"*compose":null),c.length>1e3||c.indexOf(`
|
|
`)>-1?r.value=e.prevInput="":e.prevInput=c,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ai.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ai.prototype.onKeyPress=function(){G&&W>=9&&(this.hasSelection=null),this.fastPoll()},ai.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,c=t.textarea;t.contextMenuPending&&t.contextMenuPending();var k=Fn(r,e),K=n.scroller.scrollTop;if(!k||d)return;var Q=r.options.resetSelectionOnContextMenu;Q&&r.doc.sel.contains(k)==-1&&gi(r,Ai)(r.doc,Cn(k),Ee);var Z=c.style.cssText,te=t.wrapper.style.cssText,he=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",c.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-he.top-5)+"px; left: "+(e.clientX-he.left-5)+`px;
|
|
z-index: 1000; background: `+(G?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var pe;i&&(pe=window.scrollY),n.input.focus(),i&&window.scrollTo(null,pe),n.input.reset(),r.somethingSelected()||(c.value=t.prevInput=" "),t.contextMenuPending=we,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll);function Ce(){if(c.selectionStart!=null){var Ke=r.somethingSelected(),Ze="\u200B"+(Ke?c.value:"");c.value="\u21DA",c.value=Ze,t.prevInput=Ke?"":"\u200B",c.selectionStart=1,c.selectionEnd=Ze.length,n.selForContextMenu=r.doc.sel}}function we(){if(t.contextMenuPending!=we)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=te,c.style.cssText=Z,G&&W<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=K),c.selectionStart!=null){(!G||G&&W<9)&&Ce();var Ke=0,Ze=function(){n.selForContextMenu==r.doc.sel&&c.selectionStart==0&&c.selectionEnd>0&&t.prevInput=="\u200B"?gi(r,Vs)(r):Ke++<10?n.detectingSelectAll=setTimeout(Ze,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(Ze,200)}}if(G&&W>=9&&Ce(),L){de(e);var Fe=function(){ut(window,"mouseup",Fe),setTimeout(we,20)};De(window,"mouseup",Fe)}else setTimeout(we,50)},ai.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ai.prototype.setUneditable=function(){},ai.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?b(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var r=N();t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function n(){e.value=Q.getValue()}var c;if(e.form&&(De(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var k=e.form;c=k.submit;try{var K=k.submit=function(){n(),k.submit=c,k.submit(),k.submit=K}}catch(Z){}}t.finishInit=function(Z){Z.save=n,Z.getTextArea=function(){return e},Z.toTextArea=function(){Z.toTextArea=isNaN,n(),e.parentNode.removeChild(Z.getWrapperElement()),e.style.display="",e.form&&(ut(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=c))}},e.style.display="none";var Q=ti(function(Z){return e.parentNode.insertBefore(Z,e.nextSibling)},t);return Q}function ru(e){e.off=ut,e.on=De,e.wheelEventPixels=dl,e.Doc=Fi,e.splitLines=yt,e.countColumn=X,e.findColumn=Oe,e.isWordChar=Me,e.Pass=Re,e.signal=ke,e.Line=Mn,e.changeEnd=An,e.scrollbarModel=xs,e.Pos=Ye,e.cmpPos=Rt,e.modes=ei,e.mimeModes=Dt,e.resolveMode=bt,e.getMode=fi,e.modeExtensions=_t,e.extendMode=wt,e.copyState=Bt,e.startState=Mt,e.innerMode=Lt,e.commands=Pr,e.keyMap=fn,e.keyName=lo,e.isModifierKey=so,e.lookupKey=ar,e.normalizeKeyMap=kl,e.StringStream=Et,e.SharedTextMarker=Dr,e.TextMarker=On,e.LineWidget=Ir,e.e_preventDefault=ne,e.e_stopPropagation=re,e.e_stop=de,e.addClass=B,e.contains=y,e.rmClass=C,e.keyNames=Ln}$l(ti),ql(ti);var au="iter insert remove copy getEditor constructor".split(" ");for(var la in Fi.prototype)Fi.prototype.hasOwnProperty(la)&&ae(au,la)<0&&(ti.prototype[la]=function(e){return function(){return e.apply(this.doc,arguments)}}(Fi.prototype[la]));return ve(Fi),ti.inputStyles={textarea:ai,contenteditable:$t},ti.defineMode=function(e){!ti.defaults.mode&&e!="null"&&(ti.defaults.mode=e),ci.apply(this,arguments)},ti.defineMIME=Di,ti.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ti.defineMIME("text/plain","null"),ti.defineExtension=function(e,t){ti.prototype[e]=t},ti.defineDocExtension=function(e,t){Fi.prototype[e]=t},ti.fromTextArea=nu,ru(ti),ti.version="5.58.2",ti})},Y1PL:function(at,ge,J){"use strict";J.r(ge),J.d(ge,"ResizableTextArea",function(){return ae});var ie=J("wx14"),$=J("1OyB"),M=J("vuIU"),Y=J("Ji7U"),F=J("LK+K"),U=J("q1tI"),G=J("VTBJ"),W=J("rePB"),i=J("Zm9Q"),D=J("Kwbf"),g=J("c+Xe"),d=J("m+aA"),m=J("bdgK"),u=new Map;function a(Ee){Ee.forEach(function(Te){var Ae,Oe=Te.target;(Ae=u.get(Oe))===null||Ae===void 0||Ae.forEach(function(ce){return ce(Oe)})})}var f=new m.default(a),l=null,h=null;function o(Ee,Te){u.has(Ee)||(u.set(Ee,new Set),f.observe(Ee)),u.get(Ee).add(Te)}function s(Ee,Te){u.has(Ee)&&(u.get(Ee).delete(Te),u.get(Ee).size||(f.unobserve(Ee),u.delete(Ee)))}var A=function(Ee){Object(Y.a)(Ae,Ee);var Te=Object(F.a)(Ae);function Ae(){return Object($.a)(this,Ae),Te.apply(this,arguments)}return Object(M.a)(Ae,[{key:"render",value:function(){return this.props.children}}]),Ae}(U.Component),_=U.createContext(null);function S(Ee){var Te=Ee.children,Ae=Ee.onBatchResize,Oe=U.useRef(0),ce=U.useRef([]),ue=U.useContext(_),Pe=U.useCallback(function(qe,ze,et){Oe.current+=1;var nt=Oe.current;ce.current.push({size:qe,element:ze,data:et}),Promise.resolve().then(function(){nt===Oe.current&&(Ae==null||Ae(ce.current),ce.current=[])}),ue==null||ue(qe,ze,et)},[Ae,ue]);return U.createElement(_.Provider,{value:Pe},Te)}function L(Ee){var Te=Ee.children,Ae=Ee.disabled,Oe=U.useRef(null),ce=U.useRef(null),ue=U.useContext(_),Pe=U.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),qe=U.isValidElement(Te)&&Object(g.c)(Te),ze=qe?Te.ref:null,et=U.useMemo(function(){return Object(g.a)(ze,Oe)},[ze,Oe]),nt=U.useRef(Ee);nt.current=Ee;var Ie=U.useCallback(function(Me){var Ge=nt.current,se=Ge.onResize,be=Ge.data,xe=Me.getBoundingClientRect(),Se=xe.width,Be=xe.height,He=Me.offsetWidth,Xe=Me.offsetHeight,Ve=Math.floor(Se),lt=Math.floor(Be);if(Pe.current.width!==Ve||Pe.current.height!==lt||Pe.current.offsetWidth!==He||Pe.current.offsetHeight!==Xe){var $e={width:Ve,height:lt,offsetWidth:He,offsetHeight:Xe};Pe.current=$e;var Qe=He===Math.round(Se)?Se:He,De=Xe===Math.round(Be)?Be:Xe,ct=Object(G.a)(Object(G.a)({},$e),{},{offsetWidth:Qe,offsetHeight:De});ue==null||ue(ct,Me,be),se&&Promise.resolve().then(function(){se(ct,Me)})}},[]);return U.useEffect(function(){var Me=Object(d.a)(Oe.current)||Object(d.a)(ce.current);return Me&&!Ae&&o(Me,Ie),function(){return s(Me,Ie)}},[Oe.current,Ae]),U.createElement(A,{ref:ce},qe?U.cloneElement(Te,{ref:et}):Te)}var O="rc-observer-key";function C(Ee){var Te=Ee.children,Ae=Object(i.a)(Te);return Ae.map(function(Oe,ce){var ue=(Oe==null?void 0:Oe.key)||"".concat(O,"-").concat(ce);return U.createElement(L,Object(ie.a)({},Ee,{key:ue}),Oe)})}C.Collection=S;var w=C,x=J("bT9E"),p=J("TSYQ"),T=J.n(p),v=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important
|
|
`,y=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],N={},B;function R(Ee){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ae=Ee.getAttribute("id")||Ee.getAttribute("data-reactid")||Ee.getAttribute("name");if(Te&&N[Ae])return N[Ae];var Oe=window.getComputedStyle(Ee),ce=Oe.getPropertyValue("box-sizing")||Oe.getPropertyValue("-moz-box-sizing")||Oe.getPropertyValue("-webkit-box-sizing"),ue=parseFloat(Oe.getPropertyValue("padding-bottom"))+parseFloat(Oe.getPropertyValue("padding-top")),Pe=parseFloat(Oe.getPropertyValue("border-bottom-width"))+parseFloat(Oe.getPropertyValue("border-top-width")),qe=y.map(function(et){return"".concat(et,":").concat(Oe.getPropertyValue(et))}).join(";"),ze={sizingStyle:qe,paddingSize:ue,borderSize:Pe,boxSizing:ce};return Te&&Ae&&(N[Ae]=ze),ze}function j(Ee){var Te=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;B||(B=document.createElement("textarea"),B.setAttribute("tab-index","-1"),B.setAttribute("aria-hidden","true"),document.body.appendChild(B)),Ee.getAttribute("wrap")?B.setAttribute("wrap",Ee.getAttribute("wrap")):B.removeAttribute("wrap");var ce=R(Ee,Te),ue=ce.paddingSize,Pe=ce.borderSize,qe=ce.boxSizing,ze=ce.sizingStyle;B.setAttribute("style","".concat(ze,";").concat(v)),B.value=Ee.value||Ee.placeholder||"";var et=Number.MIN_SAFE_INTEGER,nt=Number.MAX_SAFE_INTEGER,Ie=B.scrollHeight,Me;if(qe==="border-box"?Ie+=Pe:qe==="content-box"&&(Ie-=ue),Ae!==null||Oe!==null){B.value=" ";var Ge=B.scrollHeight-ue;Ae!==null&&(et=Ge*Ae,qe==="border-box"&&(et=et+ue+Pe),Ie=Math.max(et,Ie)),Oe!==null&&(nt=Ge*Oe,qe==="border-box"&&(nt=nt+ue+Pe),Me=Ie>nt?"":"hidden",Ie=Math.min(nt,Ie))}return{height:Ie,minHeight:et,maxHeight:nt,overflowY:Me,resize:"none"}}var P=J("Gytx"),b=J.n(P),X;(function(Ee){Ee[Ee.NONE=0]="NONE",Ee[Ee.RESIZING=1]="RESIZING",Ee[Ee.RESIZED=2]="RESIZED"})(X||(X={}));var ee=function(Ee){Object(Y.a)(Ae,Ee);var Te=Object(F.a)(Ae);function Ae(Oe){var ce;return Object($.a)(this,Ae),ce=Te.call(this,Oe),ce.nextFrameActionId=void 0,ce.resizeFrameId=void 0,ce.textArea=void 0,ce.saveTextArea=function(ue){ce.textArea=ue},ce.handleResize=function(ue){var Pe=ce.state.resizeStatus,qe=ce.props,ze=qe.autoSize,et=qe.onResize;if(Pe!==X.NONE)return;typeof et=="function"&&et(ue),ze&&ce.resizeOnNextFrame()},ce.resizeOnNextFrame=function(){cancelAnimationFrame(ce.nextFrameActionId),ce.nextFrameActionId=requestAnimationFrame(ce.resizeTextarea)},ce.resizeTextarea=function(){var ue=ce.props.autoSize;if(!ue||!ce.textArea)return;var Pe=ue.minRows,qe=ue.maxRows,ze=j(ce.textArea,!1,Pe,qe);ce.setState({textareaStyles:ze,resizeStatus:X.RESIZING},function(){cancelAnimationFrame(ce.resizeFrameId),ce.resizeFrameId=requestAnimationFrame(function(){ce.setState({resizeStatus:X.RESIZED},function(){ce.resizeFrameId=requestAnimationFrame(function(){ce.setState({resizeStatus:X.NONE}),ce.fixFirefoxAutoScroll()})})})})},ce.renderTextArea=function(){var ue=ce.props,Pe=ue.prefixCls,qe=Pe===void 0?"rc-textarea":Pe,ze=ue.autoSize,et=ue.onResize,nt=ue.className,Ie=ue.disabled,Me=ce.state,Ge=Me.textareaStyles,se=Me.resizeStatus,be=Object(x.a)(ce.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),xe=T()(qe,nt,Object(W.a)({},"".concat(qe,"-disabled"),Ie));"value"in be&&(be.value=be.value||"");var Se=Object(G.a)(Object(G.a)(Object(G.a)({},ce.props.style),Ge),se===X.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return U.createElement(w,{onResize:ce.handleResize,disabled:!(ze||et)},U.createElement("textarea",Object(ie.a)({},be,{className:xe,style:Se,ref:ce.saveTextArea})))},ce.state={textareaStyles:{},resizeStatus:X.NONE},ce}return Object(M.a)(Ae,[{key:"componentDidUpdate",value:function(ce){(ce.value!==this.props.value||!b()(ce.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 ce=this.textArea.selectionStart,ue=this.textArea.selectionEnd;this.textArea.setSelectionRange(ce,ue)}}catch(Pe){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ae}(U.Component),ae=ee,le=function(Ee){Object(Y.a)(Ae,Ee);var Te=Object(F.a)(Ae);function Ae(Oe){var ce;Object($.a)(this,Ae),ce=Te.call(this,Oe),ce.resizableTextArea=void 0,ce.focus=function(){ce.resizableTextArea.textArea.focus()},ce.saveTextArea=function(Pe){ce.resizableTextArea=Pe},ce.handleChange=function(Pe){var qe=ce.props.onChange;ce.setValue(Pe.target.value,function(){ce.resizableTextArea.resizeTextarea()}),qe&&qe(Pe)},ce.handleKeyDown=function(Pe){var qe=ce.props,ze=qe.onPressEnter,et=qe.onKeyDown;Pe.keyCode===13&&ze&&ze(Pe),et&&et(Pe)};var ue=typeof Oe.value=="undefined"||Oe.value===null?Oe.defaultValue:Oe.value;return ce.state={value:ue},ce}return Object(M.a)(Ae,[{key:"setValue",value:function(ce,ue){"value"in this.props||this.setState({value:ce},ue)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return U.createElement(ae,Object(ie.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ce){return"value"in ce?{value:ce.value}:null}}]),Ae}(U.Component),Re=ge.default=le},ZW9T:function(at,ge,J){"use strict";J.d(ge,"a",function(){return P});var ie=J("k1fw"),$=J("oBTY"),M=J("miYZ"),Y=J("tsqr"),F=J("rAM+"),U=J("tJVT"),G=J("PpiC"),W=J("q1tI"),i=J.n(W),D=J("bdgK"),g=J("9og8"),d=J("WmNS"),m=J.n(d),u={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"]},a={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(`
|
|
`)}]},l={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
|
|
`)}]},h=J("5VLF"),o=J.n(h),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"]}},A=function(X,ee){return ee.map(function(ae){return{label:ae,kind:X.languages.CompletionItemKind.Keyword,insertText:ae}})},_=function(X){return Object.keys(s.tables).map(function(ee){return{label:ee,kind:X.languages.CompletionItemKind.Variable,insertText:ee}})},S=function(X,ee){var ae=s.tables[X];return ae?ae.map(function(le){return{label:le,kind:ee.languages.CompletionItemKind.Field,insertText:le}}):[]};function L(b,X,ee,ae,le){var Re=X.getWordUntilPosition(ee),Ee={startLineNumber:ee.lineNumber,endLineNumber:ee.lineNumber,startColumn:Re.startColumn,endColumn:Re.endColumn},Te=ae.map(function(Ae){return{label:Ae,kind:b.languages.CompletionItemKind.Keyword,insertText:Ae,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ee}});return le.map(function(Ae){Te.push(Object(ie.a)(Object(ie.a)({},Ae),{},{range:Ee}))}),Te}var O=function(b){s.languages.map(function(le){return b.languages.registerDocumentFormattingEditProvider(le,{provideDocumentFormattingEdits:function(Ee,Te,Ae){return Object(g.a)(m.a.mark(function Oe(){var ce;return m.a.wrap(function(Pe){for(;;)switch(Pe.prev=Pe.next){case 0:return ce=o()(Ee.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}),Pe.abrupt("return",[{range:Ee.getFullModelRange(),text:ce}]);case 2:case"end":return Pe.stop()}},Oe)}))()}}),le});var X=f.quickKey.map(function(le){return{label:le.label,kind:b.languages.CompletionItemKind.Method,insertText:le.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ee=l.quickKey.map(function(le){return{label:le.label,kind:b.languages.CompletionItemKind.Method,insertText:le.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ae=a.quickKey.map(function(le){return{label:le.label,kind:b.languages.CompletionItemKind.Method,insertText:le.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}});b.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Re,Ee){var Te=Re.getWordUntilPosition(Ee),Ae={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},Oe=Re.getLineContent(Ee.lineNumber).substring(Te.startColumn-2,Te.endColumn);return{suggestions:[].concat(Object($.a)(f.keywords.map(function(ce){return{label:ce,kind:b.languages.CompletionItemKind.Function,documentation:ce,insertText:ce,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})),Object($.a)(f.quickKey.map(function(ce){return{label:ce.label,kind:b.languages.CompletionItemKind.Function,documentation:ce.content,insertText:Oe.startsWith("#")?ce.content.replace(/#/,""):ce.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})))}}}),b.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Re,Ee){var Te=Re.getWordUntilPosition(Ee),Ae={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn};return{suggestions:Object($.a)(u.keywords.map(function(Oe){return{label:Oe,kind:b.languages.CompletionItemKind.Function,documentation:Oe,insertText:Oe,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}}))}}}),b.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Re,Ee){var Te=Re.getWordUntilPosition(Ee),Ae={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},Oe=Re.getLineContent(Ee.lineNumber).substring(Te.startColumn-2,Te.endColumn);return{suggestions:[].concat(Object($.a)(a.keywords.map(function(ce){return{label:ce,kind:b.languages.CompletionItemKind.Function,documentation:ce,insertText:ce,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})),Object($.a)(a.quickKey.map(function(ce){return{label:ce.label,kind:b.languages.CompletionItemKind.Function,documentation:ce.content,insertText:Oe.startsWith("#")?ce.content.replace(/#/,""):ce.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})))}}}),b.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Re,Ee){var Te=Re.getWordUntilPosition(Ee),Ae={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},Oe=Re.getLineContent(Ee.lineNumber).substring(Te.startColumn-2,Te.endColumn);return{suggestions:[].concat(Object($.a)(l.keywords.map(function(ce){return{label:ce,kind:b.languages.CompletionItemKind.Function,documentation:ce,insertText:ce,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})),Object($.a)(l.quickKey.map(function(ce){return{label:ce.label,kind:b.languages.CompletionItemKind.Function,documentation:ce.content,insertText:Oe.startsWith("#")?ce.content.replace(/#/,""):ce.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})))}}})},C="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",w=J("fjLI"),x=J("LvDl"),p=J("+ua5");function T(b){return/^\d+$/.test(b)?"".concat(b,"px"):b}function v(){}var y=!1,N={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function B(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],X=b;if(Array.isArray(b)){for(var ee=0;ee<b.length;ee++){var ae=N[b[ee]];if(ae)return ae}return X[0]}return N[X]||X}var R=null,j=ge.b=function(b){var X=b.width,ee=X===void 0?"100%":X,ae=b.height,le=ae===void 0?"100%":ae,Re=b.value,Ee=b.language,Te=Ee===void 0?"javascript":Ee,Ae=b.style,Oe=Ae===void 0?{}:Ae,ce=b.options,ue=ce===void 0?{}:ce,Pe=b.overrideServices,qe=Pe===void 0?{}:Pe,ze=b.theme,et=ze===void 0?"vs-dark":ze,nt=b.onEditBlur,Ie=b.onSave,Me=b.autoHeight,Ge=Me===void 0?!1:Me,se=b.forbidCopy,be=se===void 0?!1:se,xe=b.onChange,Se=xe===void 0?v:xe,Be=b.editorDidMount,He=Be===void 0?v:Be,Xe=b.onFocus,Ve=Xe===void 0?v:Xe,lt=b.filename,$e=lt===void 0?"educoder.txt":lt,Qe=b.errorLine,De=b.errorContent,ct=De===void 0?"":De,ut=Object(G.a)(b,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),ke=Object(W.useRef)(),Ne=Object(W.useRef)({}),_e=Object(W.useRef)(),fe=Object(W.useRef)(),ve=Object(W.useRef)(!1),ne=Object(W.useRef)(),re=Object(W.useState)(!1),oe=Object(U.a)(re,2),de=oe[0],ye=oe[1];function Le(){var _t;return ke.current&&(_t=new D.default(function(wt){var Bt=Object(F.a)(wt),Lt;try{for(Bt.s();!(Lt=Bt.n()).done;){var Mt=Lt.value;(Mt.target.offsetHeight>0||Mt.target.offsetWidth>0)&&Ne.current.instance.layout()}}catch(Et){Bt.e(Et)}finally{Bt.f()}}),_t.observe(ke.current)),_t}function Ue(){Y.b.warn(decodeURIComponent(C))}var Je=function(){var wt=Ne.current.instance;if(Re!=null&&wt&&de){var Bt=wt.getModel();Bt&&Re!==Bt.getValue()&&(y=!0,Bt.setValue(Re),wt.layout(),y=!1)}};Object(W.useEffect)(function(){fe.current&&clearTimeout(fe.current),fe.current=setTimeout(function(){Je()},500)},[Re,de,Ne.current]),Object(W.useEffect)(function(){if(Qe&&Ne.current&&Ne.current.instance){var _t=Ne.current.instance;_t.changeViewZones(function(Bt){var Lt=document.createElement("div");Lt.style.padding="10px 20px",Lt.style.width="calc(100% - 20px)",Lt.className="my-error-line-wrp",Lt.innerHTML=ct,Bt.addZone({afterLineNumber:Qe||11,heightInLines:3,domNode:Lt})});var wt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};_t.addOverlayWidget(wt),_t.revealPositionInCenter({lineNumber:20,column:1})}},[Qe,Ne.current,de]);function dt(){var _t=Ne.current.instance;if(_t){var wt=_t.getSelection(),Bt=Ne.current.pastePos||{},Lt=new R.Range(Bt.startLineNumber||wt.endLineNumber,Bt.startColumn||wt.endColumn,Bt.endLineNumber||wt.endLineNumber,Bt.endColumn||wt.endColumn);setTimeout(function(){_t.executeEdits("",[{range:Lt,text:""}])},300)}}function rt(_t){(window.navigator.platform.match("Mac")?_t.metaKey:_t.ctrlKey)&&_t.keyCode==83&&(_t.preventDefault(),Ie())}var mt=function(){if(Ge&&Ne.current.instance){var wt=Ne.current.instance.getContentHeight();bt(wt<le?le:wt)}else bt(le)};function yt(_t){var wt=document.createEvent("MouseEvents");wt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),_t.dispatchEvent(wt)}function tt(_t,wt){var Bt=window.URL||window.webkitURL||window,Lt=new Blob([wt]),Mt=document.createElementNS("http://www.w3.org/1999/xhtml","a");Mt.href=Bt.createObjectURL(Lt),Mt.download=_t,yt(Mt)}Object(W.useEffect)(function(){mt()},[mt]),Object(W.useEffect)(function(){ke.current&&!de&&Promise.all([J.e(17),J.e(28)]).then(J.t.bind(null,"M/lh",7)).then(function(_t){try{R=_t,Ne.current.instance=R.editor.create(ke.current,{value:Re,language:B(Te),theme:et,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},qe);var wt=Ne.current.instance,Bt=w.d._menuItems,Lt=Object($.a)(Bt).find(function(Ht){return Ht[0]._debugName=="EditorContext"}),Mt=Lt[1],Et=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],ht=function(zt,It){var ui=zt._first;do{var ki,Xi,Ye=It.includes((ki=ui.element)===null||ki===void 0||((Xi=ki.command)===null||Xi===void 0)?void 0:Xi.id);Ye&&zt._remove(ui)}while(ui=ui.next)};if(He(wt,R),setTimeout(function(){mt(),Ne.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){tt($e||"educoder.txt",wt.getValue())}}),wt.getDomNode().addEventListener("input",function(){_e.current.autoFormat&&wt.getAction("editor.action.formatDocument").run()})},500),Ne.current.subscription=wt.onDidChangeModelContent(function(Ht){ve.current?clearTimeout(ne.current):(mt(),Se(wt.getValue(),Ht)),ne.current=setTimeout(function(){ve.current=!1},500)}),window.Monaco||O(R,B(Te)),be&&(ht(Mt,Et),ke.current.classList.add("noCopyPaste"),wt.onKeyDown(function(Ht){var zt=Ht.keyCode,It=Ht.ctrlKey,ui=Ht.metaKey;(zt===33||zt===52)&&(ui||It)&&(Ue(),Ht.preventDefault())})),window.Monaco=R,nt&&wt.onDidBlurEditorWidget(function(){nt(wt.getValue())}),Ve&&wt.onDidFocusEditorText(function(){Ve(wt.getValue())}),be){wt.addCommand(R.KeyMod.CtrlCmd|R.KeyCode.KEY_V,function(){return Ue(),null}),wt.onDidPaste(function(Ht){Ne.current.pastePos=Ht});try{window.addEventListener("paste",dt)}catch(Ht){}}var _i=Le();return ye(!0),function(){var Ht=Ne.current.instance;Ht.dispose();var zt=Ht.getModel();zt&&zt.dispose(),Ne.current.subscription&&Ne.current.subscription.dispose(),be&&window.removeEventListener("paste",dt),_i.unobserve(ke.current)}}catch(Ht){}})},[]),Object(W.useEffect)(function(){var _t=Ne.current.instance;if(_t&&de)return document.addEventListener("keydown",rt,!1),function(){document.removeEventListener("keydown",rt)}},[Ie,de]),Object(W.useEffect)(function(){var _t=Ne.current.instance;if(_t&&de){var wt=B(Te);R.editor.setModelLanguage(_t.getModel(),wt),console.log("language:",Te,_t.getModel(),wt)}},[Te,de]),Object(W.useEffect)(function(){var _t=Ne.current.instance;_t&&de&&R.editor.setTheme(et)},[et,de]),Object(W.useEffect)(function(){var _t=Ne.current.instance;_e.current=ue,_t&&de&&(_t.updateOptions(Object(ie.a)({},ue)),setTimeout(function(){_t.getModel().updateOptions(Object(ie.a)({},ue))},200))},[JSON.stringify(ue),de]),Object(W.useEffect)(function(){var _t=Ne.current.instance;_t&&de&&_t.layout()},[ee,le,de]);var Ut=Object(W.useState)(T(ee)),Ct=Object(U.a)(Ut,2),Jt=Ct[0],ei=Ct[1],Dt=Object(W.useState)(T(le)),ci=Object(U.a)(Dt,2),Di=ci[0],bt=ci[1],fi=Object(ie.a)(Object(ie.a)({},Oe),{},{width:Jt,height:Di});return i.a.createElement("div",{className:"my-monaco-editor",ref:ke,style:fi})};function P(b){var X=b.width,ee=X===void 0?"100%":X,ae=b.height,le=ae===void 0?"100%":ae,Re=b.original,Ee=b.modified,Te=b.language,Ae=b.options,Oe=Ae===void 0?{}:Ae,ce=Object(W.useRef)(),ue=Object(W.useState)(null),Pe=Object(U.a)(ue,2),qe=Pe[0],ze=Pe[1];function et(Ge){var se;return ce.current&&(se=new D.default(function(be){var xe=Object(F.a)(be),Se;try{for(xe.s();!(Se=xe.n()).done;){var Be=Se.value;(Be.target.offsetHeight>0||Be.target.offsetWidth>0)&&Ge.layout()}}catch(He){xe.e(He)}finally{xe.f()}}),se.observe(ce.current)),se}Object(W.useEffect)(function(){ce.current&&Promise.all([J.e(17),J.e(28)]).then(J.t.bind(null,"M/lh",7)).then(function(Ge){R=Ge;var se=R.editor.createDiffEditor(ce.current,Object(ie.a)(Object(ie.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}));ze(se);var be=et(se);return function(){se.dispose();var xe=se.getModel();xe&&xe.dispose(),be.unobserve(ce.current)}})},[]),Object(W.useEffect)(function(){qe&&qe.setModel({original:R.editor.createModel(Re,Te),modified:R.editor.createModel(Ee,Te)})},[Re,Ee,Te,qe]);var nt=T(ee),Ie=T(le),Me={width:nt,height:Ie};return i.a.createElement("div",{className:"my-diff-editor",ref:ce,style:Me})}},ZpRC:function(at,ge,J){"use strict";function ie(g){return typeof g=="object"&&g!=null&&g.nodeType===1}function $(g,d){return(!d||g!=="hidden")&&g!=="visible"&&g!=="clip"}function M(g,d){if(g.clientHeight<g.scrollHeight||g.clientWidth<g.scrollWidth){var m=getComputedStyle(g,null);return $(m.overflowY,d)||$(m.overflowX,d)||function(u){var a=function(f){if(!f.ownerDocument||!f.ownerDocument.defaultView)return null;try{return f.ownerDocument.defaultView.frameElement}catch(l){return null}}(u);return!!a&&(a.clientHeight<u.scrollHeight||a.clientWidth<u.scrollWidth)}(g)}return!1}function Y(g,d,m,u,a,f,l,h){return f<g&&l>d||f>g&&l<d?0:f<=g&&h<=m||l>=d&&h>=m?f-g-u:l>d&&h<m||f<g&&h>m?l-d+a:0}var F=function(g,d){var m=window,u=d.scrollMode,a=d.block,f=d.inline,l=d.boundary,h=d.skipOverflowHiddenElements,o=typeof l=="function"?l:function(Ge){return Ge!==l};if(!ie(g))throw new TypeError("Invalid target");for(var s=document.scrollingElement||document.documentElement,A=[],_=g;ie(_)&&o(_);){if((_=_.parentElement)===s){A.push(_);break}_!=null&&_===document.body&&M(_)&&!M(document.documentElement)||_!=null&&M(_,h)&&A.push(_)}for(var S=m.visualViewport?m.visualViewport.width:innerWidth,L=m.visualViewport?m.visualViewport.height:innerHeight,O=window.scrollX||pageXOffset,C=window.scrollY||pageYOffset,w=g.getBoundingClientRect(),x=w.height,p=w.width,T=w.top,v=w.right,y=w.bottom,N=w.left,B=a==="start"||a==="nearest"?T:a==="end"?y:T+x/2,R=f==="center"?N+p/2:f==="end"?v:N,j=[],P=0;P<A.length;P++){var b=A[P],X=b.getBoundingClientRect(),ee=X.height,ae=X.width,le=X.top,Re=X.right,Ee=X.bottom,Te=X.left;if(u==="if-needed"&&T>=0&&N>=0&&y<=L&&v<=S&&T>=le&&y<=Ee&&N>=Te&&v<=Re)return j;var Ae=getComputedStyle(b),Oe=parseInt(Ae.borderLeftWidth,10),ce=parseInt(Ae.borderTopWidth,10),ue=parseInt(Ae.borderRightWidth,10),Pe=parseInt(Ae.borderBottomWidth,10),qe=0,ze=0,et="offsetWidth"in b?b.offsetWidth-b.clientWidth-Oe-ue:0,nt="offsetHeight"in b?b.offsetHeight-b.clientHeight-ce-Pe:0;if(s===b)qe=a==="start"?B:a==="end"?B-L:a==="nearest"?Y(C,C+L,L,ce,Pe,C+B,C+B+x,x):B-L/2,ze=f==="start"?R:f==="center"?R-S/2:f==="end"?R-S:Y(O,O+S,S,Oe,ue,O+R,O+R+p,p),qe=Math.max(0,qe+C),ze=Math.max(0,ze+O);else{qe=a==="start"?B-le-ce:a==="end"?B-Ee+Pe+nt:a==="nearest"?Y(le,Ee,ee,ce,Pe+nt,B,B+x,x):B-(le+ee/2)+nt/2,ze=f==="start"?R-Te-Oe:f==="center"?R-(Te+ae/2)+et/2:f==="end"?R-Re+ue+et:Y(Te,Re,ae,Oe,ue+et,R,R+p,p);var Ie=b.scrollLeft,Me=b.scrollTop;B+=Me-(qe=Math.max(0,Math.min(Me+qe,b.scrollHeight-ee+nt))),R+=Ie-(ze=Math.max(0,Math.min(Ie+ze,b.scrollWidth-ae+et)))}j.push({el:b,top:qe,left:ze})}return j};function U(g){return g===Object(g)&&Object.keys(g).length!==0}function G(g,d){d===void 0&&(d="auto");var m="scrollBehavior"in document.body.style;g.forEach(function(u){var a=u.el,f=u.top,l=u.left;a.scroll&&m?a.scroll({top:f,left:l,behavior:d}):(a.scrollTop=f,a.scrollLeft=l)})}function W(g){return g===!1?{block:"end",inline:"nearest"}:U(g)?g:{block:"start",inline:"nearest"}}function i(g,d){var m=!g.ownerDocument.documentElement.contains(g);if(U(d)&&typeof d.behavior=="function")return d.behavior(m?[]:F(g,d));if(m)return;var u=W(d);return G(F(g,u),u.behavior)}var D=ge.a=i},bT9E:function(at,ge,J){"use strict";J.d(ge,"a",function(){return $});var ie=J("VTBJ");function $(M,Y){var F=Object(ie.a)({},M);return Array.isArray(Y)&&Y.forEach(function(U){delete F[U]}),F}},c5Ni:function(at,ge,J){},ccQJ:function(at,ge){at.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHAAAAAqCAYAAABr9d/aAAAAAXNSR0IArs4c6QAAEZlJREFUeF7tnAl0FFW6x//Ve8wGhEXCYkDZGVoWkQe4gYOPUUAQiLLICKPoHBXckLgAggvqe4OIwwAKw6bmyWZAGYYAGjIiCISwPBEIELKQjaS7k15qrzn3VnV1d9JJOiHKnAOX0+d0qm/dqv5+/e23YNCEY86FtG4s6/kLL0ngZby4xj71TBMuf2OpMBJgmkIqi8+nxztE1zxOEp7jZMnMyxJ4SRRYSVoGKAs3DZjpaorr3FijpgSuCqCiKIZF57f/yScLb7Oi2IpXJHCSqL4IRFkCJ4tlvCK/MfTO5z97i2HkGxCaVgKNBvhB/s57WF5cykmCncDyQytiveAkCTEmQzWY4nEezKxjd8/JaNqvcH2v1mCAfyv6LqmKZT/gZWECSzVNpJrm4DkcdThQ6PUBioKWZhPaRVsARtHgqvPKnU6UF5dAFMTrXfJuAJfJiwGTxzBIjzEy37r+/IWjIYKJGOD64uPRlWLpXFYUX+Yk0aZqnQCvLOCY04XTLhdkWYEiyxQgeTGyjASbCbE2A0RIIMAFWYKiKHBVOFB5xaHOvzH8EhDBMJkGg7JMejZ1WyRiqRegoijMmtL9kzheeJ+VxXaqqVS16ecqFw5XVMAjCIACQINHocgqRHLMaABirIDRAigMOawADCCIAlwl5fC6qiK51+trDoMDRsY4R3zu8x/q+uJ1Avz8yoGBnMAv5SRxEPFrBBwBmO/zIqO8FGUsSyH5gSmKBi5IC3WYsgKTCYiKNsBkYSBrEBWGAe/xwVlyBYKPvb4gRfBtGTBLH2k79qVNEydK4aaHBbjFc6Qt7+Hf4yTxcU4SGT+4CoFFRnkZTle5dA3TTWaQ1ilE+2Q5xJwqkmpaGUWBxcbAFmcCjAxVXKKNRCuJJlaVVEAWr3P/WIMUkx4fZ53ofGKts/pHIQB3KuesQrnjRVYWXuNkKYZoHSsJ8EkCfqi4goOucvCCSIVNQASbymCQBCD5nGqnBq765wYosMSaYI23QDGoAIl5lSUZnnIHvOXajySCX+l1MuV0fJxtcHWIOsDdnl8SWa4qkxXFzn6NI37ueJUDu8uK4BR41cdpvs2vZcEm1O/z9GPUBwYFNsHna+bWYGJgbW6BMcasaiL9B0i8AGduEeTrPVoN+XUy6ePbjh0ZbE51gDscWXZO5LIJNBIt5vs8SCstwEWvO8Rc+jVvRZ+HkNz+d3R5ryggcfu7cI6bH3K5uC9ScHHUXCTExtPjq49n4IWj26nmkhdDlFTzl6YoI8ytomCMMkFWDSsc5wsgsfx1omCRfU3iE+VZX872zw4B6OZ92UT7ClgvluSegSJLWpDiN5fEj4FIHSvso0IBpr0N5yNvhQLcOBcXx6QEAGZnYPbRNN0/6mZYi2BJEBR1W3MYrEZqTp05DQMYZbJgSNtu2JN/Mqw0hnfojRm97qOfTdu9nKY0ZIzpPADJXf+Lvp+86xPNBtQu0Pva98Kz9hF0wvhvP6p3fmRoIp9lNBiH+qNTHeBWxyG7m+OzSZSZx7rxSe7ZoLTAn9epIMlrVd8xmNjBr4E82m5dBNfERdRnkmEzmhG3fg4ujn09FODhbZr2+U2rpoWaJhKAzE0mNVc8XxixBsaYbfhm9Bzcldgds/evx7Lju2pIZGbv+/G3YTPo8ejl0+ATVe1OGTAG7wx+lL43L5sMiZj3OsYTPe/F6vtn6vMPJi9Cj+btIicAIPPyLxiZtrhB5+iTGRxQnk8dQv7WAaaWZNq9kpStmk83VuTlVPN5wf5Pxqp+BGAfuqZX5NF2y0K4kt/GmnOHqJZO73on4ta9govj3ggAPPY9Zv9UHSABqUatxHfaujYHE2Wid+bKiRxgrxbt8Y8xc9E+NoHe0+IjaXjtQGqIgH4tgMcnvY+eCe0bBCOj4Gfct3VRg84JnmwwYhxJ9nWAG0oy7R6Bpz4wz+vG6rzzQVFmKDwi6JX9xiC5oz0AcPNbcCQvwp3fLKGR509jXkL82jnIHf9mEMDvMOvgVj3BDxcA2bonaAAZuBpoQltHxWPLgy9gSGI3el/rTmdgxp6Vas4JoLEAyY/j/o6qtVma/Q9U10BigpvbokNgdI5rjZQ7HqbHFh7agnx3ecjnRR4nduYeazRAMMx3yvNfDtMBri7JtPt4lmpgIevB2tzzgSRdiybV3E41pysHPBwK8KsF2HjXJKw9c4iq9bQuAzF571pcnDAvADCLANwcJocMVG2sPRLA3GSmrraqARrol4TFaELaQy/jgVvsWHEyHSk/pOKhTv3ox8QH/rHnPfQ9ActLar45unN/TOgyiL4nvpEAL/I4sK/g/9W5ve7Dp8Ofou+NH0+iawSb0HAmd2Cb20BMKxm3f/EqTlzJazys8GeKcWZDax3gioJ9dq/EZ5MvVch6sfHShZp5XlB5bOWAsUhOuj2ggf83DwMTOuKJ2wZSgGt++REHiy8gN3mBDvCzo/sw++CW0CRfSzP8AY2tZysw0SrAypxCyI2IQq1GM2b2Ho6Pj+9CzxbtcWrKhw0WXnreCTzw9XsRATQZjGgZFRtyjb6tkrB91Cv02ANfv4ufKwpDPi/1uvQgqsE3p51ggOFxHeDHBfvsrMDSKLTQ60bqpVwSboZqS1Aet/KOcSEAb/7iDVgNJpyfOA8MA3Ta+CY4UUDuo2+FAjywKSTBDyT7aoRr7dVKDWKIBp6/3CiAwQLp3jwRWY+pIIigyYsMcm9qxhl6nNUCm735pzBqhwq+Pg0kmr3r4ZQGcRj81TwcLD7XoHOqT2YYbNAB/m/BLjvLCdmky3CZdWNz7iXotU2tKB3ss2Z1G4qntdD7steFYd8uw6gOvfH5sGn0OpPT1yDtQja2D38S7WOb02MrT2Rgxc/7a5jQ4KqOtU9rMDdZqHCrcuoHSFKHv947vYYg0i4cAXkFj8b6wP9UgGDwvQ5w8YVddp/EZvOyiMusF1/nXtJrlyHdheDiNdXIQPto3T1TMLaTala3nj+Gx9PXgNFMJC2/6VUc9Rx13dAAyWq/GUy0CtAdAcB4y01wPL26BkASOCw4tPk3Bzhh50co8Tqp6V4x7E/0+tPTVyDHVYzOcW2wdsQz9FhTaCAYnNUBLryww86JAs0Di3xefJufH1LH9GsJEfrYDr3RM74NzDDAZDDAzBhgYgyY0uUOEI0gg+RYG04fpHZeEEWIWifj9JVCbP3lcKCW6k/itcqMxd4GiCGNYMB9jvhANa+sbUSbrdj98Gv6x3e0uZWayWsF8JY1z9KIM1wQ0zuhA05M/qApAbpDALp54gMlFPvc2HWpsGa4r0Wj0QYTPhn0CMYlqWlEpGPb2SN45p9rUcl6Q4rhgUK3Amu/RCjRZrqkh/hAX8NKaaVPrkTLqLjrAyCYKh3gq2e22nmJpwBLfF7sySsI6fUFitgB8zez22C8N3A0zFpgUBtIQRLx2v7NWJ61p0Z3IlizyTWsAxIBakIZeJsAIIkG46030Vsj+dqs20fS96QKQnYUkDGl21BM10psv9/2jl6JySq9iEre16Ag5jfWwIAJJQA9IvGBEkq9XnyXV1hrPy9YY/ontMf64X9Ehxg1UKk+CqoqMOWblfipMCesT6XtJhINam0ny4B2tH1PfKCX+sC6TWj161XXwMzxC/TEPlJL4Z83dNN8HCg6WwPg87f/N5bc/Th1E6QkN6JjHz0K/Y0BBoKYF8+k2j286gPLWB/+lVdUZz8vUIhWMPqW3+HzEWqNsfp4bPtybD+XpWseLQYoWidCgxYc3VoGtqc+kHTqfSQP9P3nAXx38KN4dcBoXHSV4tZ1s64ZQIZh1usm9LkzqXYvx1GAV1gfDlxSAdbXzyNzPhoyATN6DQ0LcPXx7/Hc7vVa6qBWcsI2g2k0C5jv7ADEWuilWWpCrw5grCWKBlhkpI16GUMTu4PkeBN3fqTf74t9H8TrA8fSv9t8OhOi1qUg5pNUWaqnEX///dN4vMfd+LHoLIZsmn/NABoMzFQd4MxTG+xeQcgmm3OveLw4XFASUonxJ9zBPsvfzzs7dRESY5pRAZypKKYmsVuLtvTvwioHuix/UdNmbVuH3g/0F7K17r0swzKoI5RYK41CfecuQ7kKE7ri5B7YTGbkVpahmTUaxLySCHV2xjpapfGP+roR1QGem7YEnePbYMPpTExLX36tAIaW0qYTgCQKlUQ4fCyy8kuD2j7+1o/WDwwC0KdFO/wwcS6Vxarj3yMlYxMF+O5d4zGz7zB6fPDf5+FYUW5Izkh8X41+oCzDPDgJiLPS83w5l6E0UgNXntyDe9r1wKpT+/BR9k5M7X4X1o34M12367oXaF4WKcDb4m/GkMSudPqRkgs4qZXmJu1ahtSzB64NwOrF7ClZq+2sLNJSmovjcOxSiR5Y+AvYodqnQk0Z8AdqPp9JX4fduadCqiwjknphxcgZ+CxrH97Zv00Hpnbjw/QDSVlraBKYGCvtynPnihqtgX44Oy4cxZhv/od2KcbeOhA5zmJ0Xf9CiLmvTwODJ//lrqmY3fcPkGQZrT59Ck7OUy/Ae7csxC2xLWkw9VTv4XS5/l+m4FgZKVc2btRoJyUTgBJHuxHk6SIXy6KwzAUv0QBSTdG3DKqC9wN4pf8DWH1iP8q9VTW7F4qMBGs0ZvS9D+9nfh12a4a6tgJDMxuMPVtDIRtI6d4YgMspapAGJthiUTD9r7Ca1DySRIlT/vkJTQVIr5CYz2XZuzBr/7pGASTVlexJi+k6W3IOgVRdyKgvCr0j9XXsG/cGiD8mw8G60frTmfU2jmtFG66h+2jW6sQqwfsvVpI6+Tfuku66s4qDq9wDSdC2V/gjx1o28QY2NAV12v1djJCdbFoJzmKEsVtrGNrEqLs1/BubeAnchRKy+zfin+ic/qOweMgkOr/Y48ToHR/CyXlxKHkRmttiUOatRL/UFBS6KxoMkPjQPWNfR7/WnWghvOfGl3GxsjQigKSdNP/OR/BgUj+cdRbhw6M7sOGXzIi/V/WJYbdUkEkjz31s9ZaIL3GylMLKQgypi5KthaQ/5nH54Cv30W1/1ZP64F3YwTli6O409Tz9c4aBIakZTEkJUIwkllJ7A2R9scwFsbxKvU4DRv/WnXH40XdwqjwfD6a9jwrOjcPJ76B7i3bU5N2/7W1kFJ6usWJ9JrSFLYZqUJ+Wt9BzFxzcjIU/bdHXMTCMXkL0CBw9/mv1A2vd1BT8rfrvX9KWE72LWVmYKsoSQ0wagahICjxlXnBOXwBEtX6eP/XwwwuY20BrytgmBsYuCYDNrO4HJRdnANHhBl/sBMSwm5AjQrlo0ER8kLUDVbyPzl885DHM6T8aL2VuwJJjO8OuUR9AI2PAquFP0k58OBMcbtFfB2Ad2wrD3USnvfMHKrKyVIEyiJo3rX8m+gS4L1dB8vBByb4aoVbvMJAdbLqfi7XA1KUVDPE2desgQ3ZmKxA9HITiCsjehtU9IyKq+ajdeSdqnX53ux7Uj5Hx5o9f1brLbFSn/thx8WhEl02Mbq7vgFt5ci9KfVf9jGvdG3truyvycEvnvQsmi4q0GGDaqRtvyT8GnMMLtrASCi+G7d77zSVjMcLcqTmMbeOgFs5UeDIvgitxQHJ6IhLK9Tspwq31dQmoz/EPox2lVSkwKC9JsmLz76KWRRlccSW4y1VQJDXQ0X0dA1g6NIOxYzPNz2lBiqyAv1IJvoxsn7/xeFldcm/Uwy11LZj03fwkQZI+lKGMp5u9tJBf4gRwl5wQSispRFNCNIydW8AQZdaeRFLNpeBygyt2QCFR7Y1RuwSa4vGyuuTbft+b9wiKshSKYvc/z0Cfaaj0UaUyNrMFUgJynOXBFlVA8tx4hKwOuTb9A551QZyvzDes2is9KTHyIllRWvmDfmoUtSqrJMsiV+IQ+fJK2w2FC5IAg6BHrJHPKIb0GDO++dUesa5L+J2PLI53uyrnSwyehQIz0UiZUUgb4RMmrtlbjgFzrzoEuwE/vATqfcS6IYJrue+NbrIiL1Egw8iYXrgy7O0b/9FPQwTYiLn/BnX/q1dppgJNAAAAAElFTkSuQmCC"},dejd:function(at,ge,J){},dmUQ:function(at,ge,J){"use strict";var ie=J("Ff2n"),$=J("rePB"),M=J("1OyB"),Y=J("vuIU"),F=J("Ji7U"),U=J("md7G"),G=J("foSv"),W=J("q1tI"),i=J.n(W),D=J("TSYQ"),g=J.n(D),d=J("4IlW");function m(x,p){var T=Object.keys(x);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(x);p&&(v=v.filter(function(y){return Object.getOwnPropertyDescriptor(x,y).enumerable})),T.push.apply(T,v)}return T}function u(x){for(var p=1;p<arguments.length;p++){var T=arguments[p]!=null?arguments[p]:{};p%2?m(Object(T),!0).forEach(function(v){Object($.a)(x,v,T[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(T)):m(Object(T)).forEach(function(v){Object.defineProperty(x,v,Object.getOwnPropertyDescriptor(T,v))})}return x}function a(x){var p=f();return function(){var v=Object(G.a)(x),y;if(p){var N=Object(G.a)(this).constructor;y=Reflect.construct(v,arguments,N)}else y=v.apply(this,arguments);return Object(U.a)(this,y)}}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(x){return!1}}function l(){}function h(x){x.preventDefault()}var o=function(p){return p.replace(/[^\w.-]+/g,"")},s=200,A=600,_=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,S=function(p){return p!=null},L=function(p,T){return T===p||typeof T=="number"&&typeof p=="number"&&isNaN(T)&&isNaN(p)},O=function(x){Object(F.a)(T,x);var p=a(T);function T(v){var y;Object(M.a)(this,T),y=p.call(this,v),y.onKeyDown=function(R){var j=y.props,P=j.onKeyDown,b=j.onPressEnter;if(R.keyCode===d.a.UP){var X=y.getRatio(R);y.up(R,X,null),y.stop()}else if(R.keyCode===d.a.DOWN){var ee=y.getRatio(R);y.down(R,ee,null),y.stop()}else R.keyCode===d.a.ENTER&&b&&b(R);if(y.recordCursorPosition(),y.lastKeyCode=R.keyCode,P){for(var ae=arguments.length,le=new Array(ae>1?ae-1:0),Re=1;Re<ae;Re++)le[Re-1]=arguments[Re];P.apply(void 0,[R].concat(le))}},y.onKeyUp=function(R){var j=y.props.onKeyUp;if(y.stop(),y.recordCursorPosition(),j){for(var P=arguments.length,b=new Array(P>1?P-1:0),X=1;X<P;X++)b[X-1]=arguments[X];j.apply(void 0,[R].concat(b))}},y.onChange=function(R){var j=y.props.onChange;y.state.focused&&(y.inputting=!0),y.rawInput=y.props.parser(y.getValueFromEvent(R)),y.setState({inputValue:y.rawInput}),j(y.toNumber(y.rawInput))},y.onMouseUp=function(){var R=y.props.onMouseUp;y.recordCursorPosition(),R&&R.apply(void 0,arguments)},y.onFocus=function(){var R;y.setState({focused:!0}),(R=y.props).onFocus.apply(R,arguments)},y.onBlur=function(){var R=y.props.onBlur;y.inputting=!1,y.setState({focused:!1});var j=y.getCurrentValidValue(y.state.inputValue),P=y.setValue(j,l);if(R){var b=y.input.value,X=y.getInputDisplayValue({focus:!1,value:P});y.input.value=X&&Number(X),R.apply(void 0,arguments),y.input.value=b}},y.getRatio=function(R){var j=1;return R.metaKey||R.ctrlKey?j=.1:R.shiftKey&&(j=10),j},y.getFullNum=function(R){return isNaN(R)?R:/e/i.test(String(R))?Number(R).toFixed(18).replace(/\.?0+$/,""):R},y.getPrecision=function(R){if(S(y.props.precision))return y.props.precision;var j=String(R);if(j.indexOf("e-")>=0)return parseInt(j.slice(j.indexOf("e-")+2),10);var P=0;return j.indexOf(".")>=0&&(P=j.length-j.indexOf(".")-1),P},y.getInputDisplayValue=function(R){var j=R||y.state,P=j.focused,b=j.inputValue,X=j.value,ee;P?ee=b:ee=y.toPrecisionAsStep(X),ee==null&&(ee="");var ae=y.formatWrapper(ee);return S(y.props.decimalSeparator)&&(ae=ae.toString().replace(".",y.props.decimalSeparator)),ae},y.recordCursorPosition=function(){try{y.cursorStart=y.input.selectionStart,y.cursorEnd=y.input.selectionEnd,y.currentValue=y.input.value,y.cursorBefore=y.input.value.substring(0,y.cursorStart),y.cursorAfter=y.input.value.substring(y.cursorEnd)}catch(R){}},y.restoreByAfter=function(R){if(R===void 0)return!1;var j=y.input.value,P=j.lastIndexOf(R);if(P===-1)return!1;var b=y.cursorBefore.length;return y.lastKeyCode===d.a.DELETE&&y.cursorBefore.charAt(b-1)===R[0]?(y.fixCaret(b,b),!0):P+R.length===j.length?(y.fixCaret(P,P),!0):!1},y.partRestoreByAfter=function(R){return R===void 0?!1:Array.prototype.some.call(R,function(j,P){var b=R.substring(P);return y.restoreByAfter(b)})},y.isNotCompleteNumber=function(R){return isNaN(R)||R===""||R===null||R&&R.toString().indexOf(".")===R.toString().length-1},y.stop=function(){y.autoStepTimer&&clearTimeout(y.autoStepTimer)},y.down=function(R,j,P){y.pressingUpOrDown=!0,y.step("down",R,j,P)},y.up=function(R,j,P){y.pressingUpOrDown=!0,y.step("up",R,j,P)},y.saveInput=function(R){y.input=R};var N=v.value;N===void 0&&(N=v.defaultValue),y.state={focused:v.autoFocus};var B=y.getValidValue(y.toNumber(N));return y.state=u(u({},y.state),{},{inputValue:y.toPrecisionAsStep(B),value:B}),y}return Object(Y.a)(T,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(y){var N=this.props,B=N.value,R=N.onChange,j=N.max,P=N.min,b=this.state.focused;if(y){if(!L(y.value,B)||!L(y.max,j)||!L(y.min,P)){var X=b?B:this.getValidValue(B),ee;this.pressingUpOrDown?ee=X:this.inputting?ee=this.rawInput:ee=this.toPrecisionAsStep(X),this.setState({value:X,inputValue:ee})}var ae="value"in this.props?B:this.state.value;"max"in this.props&&y.max!==j&&typeof ae=="number"&&ae>j&&R&&R(j),"min"in this.props&&y.min!==P&&typeof ae=="number"&&ae<P&&R&&R(P)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var le=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===d.a.BACKSPACE?le=this.cursorStart-1:this.lastKeyCode===d.a.DELETE&&(le=this.cursorStart):le=this.input.value.length,this.fixCaret(le,le)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case d.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case d.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Re){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(y){var N=y;return N===""?N="":this.isNotCompleteNumber(parseFloat(N))?N=this.state.value:N=this.getValidValue(N),this.toNumber(N)}},{key:"getValueFromEvent",value:function(y){var N=y.target.value.trim().replace(/。/g,".");return S(this.props.decimalSeparator)&&(N=N.replace(this.props.decimalSeparator,".")),N}},{key:"getValidValue",value:function(y){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,R=parseFloat(y);return isNaN(R)?y:(R<N&&(R=N),R>B&&(R=B),R)}},{key:"setValue",value:function(y,N){var B=this.props.precision,R=this.isNotCompleteNumber(parseFloat(y))?null:parseFloat(y),j=this.state.value,P=j===void 0?null:j,b=this.state.inputValue,X=b===void 0?null:b,ee=typeof R=="number"?R.toFixed(B):"".concat(R),ae=R!==P||ee!=="".concat(X);return"value"in this.props?(X=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:X},N)):this.setState({value:R,inputValue:this.toPrecisionAsStep(y)},N),ae&&this.props.onChange(R),R}},{key:"getMaxPrecision",value:function(y){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.props,R=B.precision,j=B.step;if(S(R))return R;var P=this.getPrecision(N),b=this.getPrecision(j),X=this.getPrecision(y);return y?Math.max(X,P+b):P+b}},{key:"getPrecisionFactor",value:function(y){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.getMaxPrecision(y,N);return Math.pow(10,B)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(y){return this.props.formatter?this.props.formatter(y):y}},{key:"toPrecisionAsStep",value:function(y){if(this.isNotCompleteNumber(y)||y==="")return y;var N=Math.abs(this.getMaxPrecision(y));return isNaN(N)?y.toString():Number(y).toFixed(N)}},{key:"toNumber",value:function(y){var N=this.props.precision,B=this.state.focused,R=y&&y.length>16&&B;return this.isNotCompleteNumber(y)||R?y:S(N)?Math.round(y*Math.pow(10,N))/Math.pow(10,N):Number(y)}},{key:"upStep",value:function(y,N){var B=this.props.step,R=this.getPrecisionFactor(y,N),j=Math.abs(this.getMaxPrecision(y,N)),P=((R*y+R*B*N)/R).toFixed(j);return this.toNumber(P)}},{key:"downStep",value:function(y,N){var B=this.props.step,R=this.getPrecisionFactor(y,N),j=Math.abs(this.getMaxPrecision(y,N)),P=((R*y-R*B*N)/R).toFixed(j);return this.toNumber(P)}},{key:"step",value:function(y,N){var B=this,R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,j=arguments.length>3?arguments[3]:void 0;this.stop(),N&&(N.persist(),N.preventDefault());var P=this.props;if(P.disabled)return;var b=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(b))return;var X=this["".concat(y,"Step")](b,R),ee=X>P.max||X<P.min;if(X>P.max?X=P.max:X<P.min&&(X=P.min),this.setValue(X,null),this.setState({focused:!0},function(){B.pressingUpOrDown=!1}),ee)return;this.autoStepTimer=setTimeout(function(){B[y](N,R,!0)},j?s:A)}},{key:"fixCaret",value:function(y,N){if(y===void 0||N===void 0||!this.input||!this.input.value)return;try{var B=this.input.selectionStart,R=this.input.selectionEnd;(y!==B||N!==R)&&this.input.setSelectionRange(y,N)}catch(j){}}},{key:"render",value:function(){var y,N=this.props,B=N.prefixCls,R=N.disabled,j=N.readOnly,P=N.useTouch,b=N.autoComplete,X=N.upHandler,ee=N.downHandler,ae=N.className,le=N.max,Re=N.min,Ee=N.style,Te=N.title,Ae=N.onMouseEnter,Oe=N.onMouseLeave,ce=N.onMouseOver,ue=N.onMouseOut,Pe=N.required,qe=N.onClick,ze=N.tabIndex,et=N.type,nt=N.placeholder,Ie=N.id,Me=N.inputMode,Ge=N.pattern,se=N.step,be=N.maxLength,xe=N.autoFocus,Se=N.name,Be=N.onPaste,He=N.onInput,Xe=Object(ie.a)(N,["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"]),Ve=this.state,lt=Ve.value,$e=Ve.focused,Qe=g()(B,(y={},Object($.a)(y,ae,!!ae),Object($.a)(y,"".concat(B,"-disabled"),R),Object($.a)(y,"".concat(B,"-focused"),$e),y)),De={};Object.keys(Xe).forEach(function(de){(de.substr(0,5)==="data-"||de.substr(0,5)==="aria-"||de==="role")&&(De[de]=Xe[de])});var ct=!j&&!R,ut=this.getInputDisplayValue(null),ke=(lt||lt===0)&&(isNaN(lt)||Number(lt)>=le),Ne=(lt||lt===0)&&(isNaN(lt)||Number(lt)<=Re),_e=ke||R||j,fe=Ne||R||j,ve=g()("".concat(B,"-handler"),"".concat(B,"-handler-up"),Object($.a)({},"".concat(B,"-handler-up-disabled"),_e)),ne=g()("".concat(B,"-handler"),"".concat(B,"-handler-down"),Object($.a)({},"".concat(B,"-handler-down-disabled"),fe)),re=P?{onTouchStart:_e?l:this.up,onTouchEnd:this.stop}:{onMouseDown:_e?l:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},oe=P?{onTouchStart:fe?l:this.down,onTouchEnd:this.stop}:{onMouseDown:fe?l:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return i.a.createElement("div",{className:Qe,style:Ee,title:Te,onMouseEnter:Ae,onMouseLeave:Oe,onMouseOver:ce,onMouseOut:ue,onFocus:function(){return null},onBlur:function(){return null}},i.a.createElement("div",{className:"".concat(B,"-handler-wrap")},i.a.createElement("span",Object.assign({unselectable:"on"},re,{role:"button","aria-label":"Increase Value","aria-disabled":_e,className:ve}),X||i.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-up-inner"),onClick:h})),i.a.createElement("span",Object.assign({unselectable:"on"},oe,{role:"button","aria-label":"Decrease Value","aria-disabled":fe,className:ne}),ee||i.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-down-inner"),onClick:h}))),i.a.createElement("div",{className:"".concat(B,"-input-wrap")},i.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Re,"aria-valuemax":le,"aria-valuenow":lt,required:Pe,type:et,placeholder:nt,onPaste:Be,onClick:qe,onMouseUp:this.onMouseUp,className:"".concat(B,"-input"),tabIndex:ze,autoComplete:b,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:ct?this.onKeyDown:l,onKeyUp:ct?this.onKeyUp:l,autoFocus:xe,maxLength:be,readOnly:j,disabled:R,max:le,min:Re,step:se,name:Se,title:Te,id:Ie,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ut),pattern:Ge,inputMode:Me,onInput:He},De))))}}]),T}(i.a.Component);O.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:_,min:-_,step:1,style:{},onChange:l,onKeyDown:l,onPressEnter:l,onFocus:l,onBlur:l,parser:o,required:!1,autoComplete:"off"};var C=O,w=ge.a=C},fB9n:function(at,ge,J){"use strict";J.r(ge);var ie=J("14J3"),$=J("BMrR"),M=J("jCWc"),Y=J("kPKH"),F=J("k1fw"),U=J("9og8"),G=J("tJVT"),W=J("PpiC"),i=J("WmNS"),D=J.n(i),g=J("q1tI"),d=J.n(g),m=J("55Ip"),u=J("9kvl"),a=J("T2oS"),f=J("W9HT"),l=J("oBTY"),h=J("B9cy"),o=J("Ol7k"),s=J("lUTK"),A=J("BvKs"),_=J("Ty5D"),S=J("wd/R"),L=J.n(S),O=J("RotF"),C=J.n(O),w=J("m3rI"),x=J("9Bee"),p=J("SbmS"),T=J.n(p),v=A.a.SubMenu,y=o.a.Sider,N=o.a.Content,B=function(Me){var Ge=Me.messages,se=Me.globalSetting,be=Me.loading,xe=Me.user,Se=Me.dispatch,Be=Object(W.a)(Me,["messages","globalSetting","loading","user","dispatch"]),He=Object(_.i)(),Xe=Object(_.h)(),Ve=xe.userInfo,lt=Object(g.useState)(!1),$e=Object(G.a)(lt,2),Qe=$e[0],De=$e[1],ct=Object(g.useState)({per_page:20,page:1}),ut=Object(G.a)(ct,2),ke=ut[0],Ne=ut[1],_e=Object(g.useState)({per_page:20,page:1}),fe=Object(G.a)(_e,2),ve=fe[0],ne=fe[1],re=Object(g.useState)([]),oe=Object(G.a)(re,2),de=oe[0],ye=oe[1];Object(g.useEffect)(function(){ke.page=1,Ue()},[He.userId]);var Le=function(dt){var rt,mt;u.d.push("/messages/".concat(xe==null||((rt=xe.userInfo)===null||rt===void 0)?void 0:rt.login,"/message_detail?target_ids=").concat(dt==null||((mt=dt.target)===null||mt===void 0)?void 0:mt.id))},Ue=function(){var Je=Object(U.a)(D.a.mark(function dt(){var rt,mt;return D.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:return De(!1),tt.next=3,Se({type:"messages/getPrivateMessages",payload:Object(F.a)(Object(F.a)({},He),ve)});case 3:rt=tt.sent,rt!=null&&rt.private_messages&&(ye([].concat(Object(l.a)(de),Object(l.a)(rt.private_messages))),((mt=rt.private_messages)===null||mt===void 0?void 0:mt.length)===20&&De(!0));case 5:case"end":return tt.stop()}},dt)}));return function(){return Je.apply(this,arguments)}}();return d.a.createElement("aside",{className:T.a.listRightMessage},d.a.createElement(C.a,{loadMore:function(){ve.page++,Ue()},hasMore:Qe,useWindow:!1},d.a.createElement(f.a,{spinning:be["messages/getPrivateMessages"]},d.a.createElement("div",{className:"minH500"},de==null?void 0:de.map(function(Je,dt){var rt,mt;return d.a.createElement("aside",{key:dt},d.a.createElement($.a,{onClick:function(){return Le(Je)}},d.a.createElement(Y.a,{flex:"58px"},d.a.createElement("img",{src:w.a.IMG_SERVER+"/images/"+(Je==null||((rt=Je.target)===null||rt===void 0)?void 0:rt.image_url),alt:""})),d.a.createElement(Y.a,{flex:"1"},d.a.createElement($.a,null,d.a.createElement(Y.a,{span:24},d.a.createElement($.a,null,d.a.createElement(Y.a,{flex:"1"},d.a.createElement("span",{className:T.a.userName},Je==null||((mt=Je.target)===null||mt===void 0)?void 0:mt.name)),d.a.createElement(Y.a,null,d.a.createElement("span",{className:"ml15 c-grey-c"},L()(Je.send_time).fromNow())))),d.a.createElement(Y.a,{span:24},d.a.createElement("div",{className:["mt15",T.a.content].join(" ")},d.a.createElement(x.a,{value:Je.content||""})))))))})))))},R=Object(u.a)(function(Ie){var Me=Ie.messages,Ge=Ie.loading,se=Ie.user,be=Ie.globalSetting;return{messages:Me,globalSetting:be,user:se,loading:Ge.effects}})(B),j=J("+L6B"),P=J("2/Rp"),b=J("miYZ"),X=J("tsqr"),ee=J("y8nQ"),ae=J("Vl3Y"),le=J("kaH+"),Re=J("1vsH"),Ee=J("5WQS"),Te=J("Ot1p"),Ae=J("dhSg"),Oe=A.a.SubMenu,ce=o.a.Sider,ue=o.a.Content,Pe=function(Me){var Ge=Me.messages,se=Me.globalSetting,be=Me.loading,xe=Me.user,Se=Me.dispatch,Be=Object(W.a)(Me,["messages","globalSetting","loading","user","dispatch"]),He=Object(_.i)(),Xe=Object(_.h)(),Ve=Xe.query,lt=Object(g.useState)({per_page:20,page:1}),$e=Object(G.a)(lt,2),Qe=$e[0],De=$e[1],ct=Object(g.useState)([]),ut=Object(G.a)(ct,2),ke=ut[0],Ne=ut[1],_e=Object(g.useState)(!1),fe=Object(G.a)(_e,2),ve=fe[0],ne=fe[1],re=Object(g.useState)(!1),oe=Object(G.a)(re,2),de=oe[0],ye=oe[1],Le=Object(g.useState)(""),Ue=Object(G.a)(Le,2),Je=Ue[0],dt=Ue[1],rt=Object(g.useRef)(),mt=ae.a.useForm(),yt=Object(G.a)(mt,1),tt=yt[0],Ut=Object(g.useState)([]),Ct=Object(G.a)(Ut,2),Jt=Ct[0],ei=Ct[1],Dt=Object(g.useState)(!0),ci=Object(G.a)(Dt,2),Di=ci[0],bt=ci[1];Object(g.useEffect)(function(){Qe.page=1,fi()},[Ve.target_ids]);var fi=function(){var Lt=Object(U.a)(D.a.mark(function Mt(){var Et,ht;return D.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:return ne(!1),Ht.next=3,Se({type:"messages/getPrivateMessageDetails",payload:Object(F.a)(Object(F.a)({},He),{},{target_id:Ve==null?void 0:Ve.target_ids},Qe)});case 3:Et=Ht.sent,Et!=null&&Et.messages&&(Jt=Et==null?void 0:Et.messages,((ht=Jt)===null||ht===void 0?void 0:ht.length)===20&&setTimeout(function(){ne(!0),bt(!1)},500),Qe.page===1?Ne(Object(l.a)(Et==null?void 0:Et.messages.reverse())):Ne([].concat(Object(l.a)(ke),Object(l.a)(Et==null?void 0:Et.messages.reverse()))));case 5:case"end":return Ht.stop()}},Mt)}));return function(){return Lt.apply(this,arguments)}}();Object(g.useEffect)(function(){console.log("newData.length:",Qe,Jt.length,Jt),Qe.page===1&&Di&&(rt.current.scrollTop=rt.current.scrollHeight)},[ke]),Object(g.useEffect)(function(){rt.current.onclick=function(Lt){Lt.target.nodeName==="IMG"&&Lt.target.alt!==""&&Ae.a.publish("preview-image",Lt.target.src)}},[]);var _t=function(){var Lt=Object(U.a)(D.a.mark(function Mt(Et,ht){var _i;return D.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return zt.next=2,Object(Ee.a)(Object(F.a)(Object(F.a)({},He),{},{id:Et.id}));case 2:_i=zt.sent,_i.status===0&&(ke.splice(ht,1),Ne(Object(l.a)(ke)));case 4:case"end":return zt.stop()}},Mt)}));return function(Et,ht){return Lt.apply(this,arguments)}}(),wt=function(){var Lt=Object(U.a)(D.a.mark(function Mt(){return D.a.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:if(!(Je==="")){ht.next=3;break}return X.b.error("\u8BF7\u8F93\u5165\u60A8\u7684\u56DE\u590D"),ht.abrupt("return",!1);case 3:return dt(""),ye(!0),ht.next=7,Object(Ee.g)(Object(F.a)(Object(F.a)({},He),{},{content:Je,target_id:Ve==null?void 0:Ve.target_ids}));case 7:ye(!1),Qe.page=1,tt.resetFields(),fi();case 11:case"end":return ht.stop()}},Mt)}));return function(){return Lt.apply(this,arguments)}}(),Bt=Object(g.useMemo)(function(){var Lt=xe||{},Mt=Lt.userInfo;return(Mt==null?void 0:Mt.is_teacher)&&(Mt==null?void 0:Mt.professional_certification)},[xe]);return d.a.createElement("section",null,d.a.createElement("aside",{className:T.a.listMessage,ref:rt},d.a.createElement(C.a,{isReverse:!0,loadMore:function(){Qe.page++,fi()},hasMore:ve,useWindow:!1},!ve&&d.a.createElement("div",{className:"tc mt20 animated fadeIn"},d.a.createElement("span",{className:T.a.msgDate},"\u6CA1\u6709\u4FE1\u606F\u4E86\uFF5E\uFF5E")),d.a.createElement(f.a,{spinning:be["messages/getPrivateMessageDetails"]},d.a.createElement("aside",{className:"minH500"},ke==null?void 0:ke.map(function(Lt,Mt){var Et;return d.a.createElement("aside",{key:Mt},d.a.createElement($.a,{justify:"center"},d.a.createElement(Y.a,{flex:"1",className:"tc"},d.a.createElement("span",{className:T.a.msgDate},L()(Lt.send_time).format("YYYY-MM-DD")))),d.a.createElement($.a,{onClick:function(){return Object(Re.K)(Lt)}},d.a.createElement(Y.a,{flex:"58px"},d.a.createElement("img",{src:w.a.IMG_SERVER+"/images/"+(Lt==null||((Et=Lt.sender)===null||Et===void 0)?void 0:Et.image_url),alt:""})),d.a.createElement(Y.a,null,d.a.createElement("div",{className:T.a.msg},d.a.createElement(x.a,{value:Lt.content||""}),d.a.createElement("span",{onClick:function(){return _t(Lt,Mt)},className:["current",T.a.deleteMsg].join(" ")},"\u5220\u9664"))),d.a.createElement(Y.a,null,d.a.createElement("span",{className:"c-grey-c ml10"},L()(Lt.send_time).format("HH:mm")))))}))))),d.a.createElement("aside",{className:"pl30 pr30 mb30 mt30"},Bt?d.a.createElement(ae.a,{form:tt},d.a.createElement(ae.a.Item,{name:"content"},d.a.createElement(Te.a,{placeholder:"\u8BF7\u8F93\u5165\u4F60\u7684\u56DE\u590D",height:150,onChange:function(Mt){return dt(Mt)}})),d.a.createElement($.a,null,d.a.createElement(Y.a,{flex:"1"},d.a.createElement("span",{className:"c-red font14"},"\u5728\u95EE\u9898\u53CD\u9988\u65F6\uFF0C\u8BF7\u540C\u65F6\u53D1\u9001\u95EE\u9898\u53D1\u751F\u9875\u7684\u7F51\u5740\u94FE\u63A5\uFF0C\u4EE5\u4FBF\u6211\u4EEC\u9AD8\u6548\u7684\u4E3A\u60A8\u670D\u52A1")),d.a.createElement(Y.a,null,d.a.createElement(P.a,{loading:de,type:"primary",onClick:function(){return wt()}},"\u56DE\u590D")))):d.a.createElement("p",{className:"c-red font14",style:{textAlign:"center"}},"\u4EC5\u804C\u4E1A\u8BA4\u8BC1\u7684\u6559\u5E08\u53EF\u4EE5\u4F7F\u7528\u79C1\u4FE1\u529F\u80FD")),d.a.createElement(le.a,null))},qe=Object(u.a)(function(Ie){var Me=Ie.messages,Ge=Ie.loading,se=Ie.user,be=Ie.globalSetting;return{messages:Me,globalSetting:be,user:se,loading:Ge.effects}})(Pe),ze=J("30zm"),et=function(Me){var Ge,se=Me.messages,be=Me.globalSetting,xe=Me.loading,Se=Me.user,Be=Me.dispatch,He=Object(W.a)(Me,["messages","globalSetting","loading","user","dispatch"]),Xe=He.match.params,Ve=He.location.query,lt=Se.userInfo,$e=se.tidingsList,Qe=se.privateMessageDetails,De=Object(g.useState)({per_page:20,page:1}),ct=Object(G.a)(De,2),ut=ct[0],ke=ct[1],Ne=Object(g.useState)({per_page:20,page:1}),_e=Object(G.a)(Ne,2),fe=_e[0],ve=_e[1],ne=Object(g.useState)([]),re=Object(G.a)(ne,2),oe=re[0],de=re[1],ye=Object(g.useState)([]),Le=Object(G.a)(ye,2),Ue=Le[0],Je=Le[1];Object(g.useEffect)(function(){ut.page=1},[Xe.userId]);var dt=function(){var mt=Object(U.a)(D.a.mark(function yt(){var tt;return D.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:return Ct.next=2,Be({type:"messages/getPrivateMessageDetails",payload:Object(F.a)(Object(F.a)({},Xe),{},{target_id:Ve==null?void 0:Ve.target_ids})});case 2:tt=Ct.sent,tt!=null&&tt.messages&&de(tt.messages);case 4:case"end":return Ct.stop()}},yt)}));return function(){return mt.apply(this,arguments)}}(),rt=function(){var mt=Object(U.a)(D.a.mark(function yt(){var tt;return D.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:return Ct.next=2,Be({type:"messages/getPrivateMessages",payload:Object(F.a)(Object(F.a)({},Xe),fe)});case 2:tt=Ct.sent,tt!=null&&tt.private_messages&&Je(tt.private_messages);case 4:case"end":return Ct.stop()}},yt)}));return function(){return mt.apply(this,arguments)}}();return d.a.createElement("section",{className:T.a.bg},d.a.createElement("section",{className:"edu-container mt20"},d.a.createElement($.a,{gutter:[20,20]},d.a.createElement(ze.a,null),d.a.createElement(Y.a,{flex:"1"},d.a.createElement("aside",{className:"bg-white"},d.a.createElement("aside",{className:["font16",T.a.topBar].join(" ")},d.a.createElement($.a,null,d.a.createElement(Y.a,{flex:"30px",className:"tc"},d.a.createElement(m.a,{to:"/messages/".concat(Xe.userId,"/private_messages"),className:"iconfont icon-zuojiantou c-black pl10"})),d.a.createElement(Y.a,{flex:"1",className:"tc"},Qe==null||((Ge=Qe.target)===null||Ge===void 0)?void 0:Ge.name,"\u4E0E\u4F60\u7684\u79C1\u4FE1"),d.a.createElement(Y.a,{flex:"290px",className:"tl"},d.a.createElement("span",{className:"pl30"},"\u79C1\u4FE1\u5217\u8868")))),d.a.createElement($.a,null,d.a.createElement(Y.a,{flex:"1"},d.a.createElement(qe,null)),d.a.createElement(Y.a,{flex:"290px"},d.a.createElement(R,null))))))))},nt=ge.default=Object(u.a)(function(Ie){var Me=Ie.messages,Ge=Ie.loading,se=Ie.user,be=Ie.globalSetting;return{messages:Me,globalSetting:be,user:se,loading:Ge.effects}})(et)},fjLI:function(at,ge,J){"use strict";J.d(ge,"f",function(){return m}),J.d(ge,"b",function(){return u}),J.d(ge,"a",function(){return a}),J.d(ge,"d",function(){return f}),J.d(ge,"e",function(){return l}),J.d(ge,"c",function(){return h});var ie=J("8HAY"),$=J("Vhoy"),M=J("MI8n"),Y=J("JYp7"),F=J("pmY6"),U=J("24hK"),G=J("nnTU"),W=J("T8No"),i=J("Cg/j"),D=J("t9D7"),g=function(o,s,A,_){var S=arguments.length,L=S<3?s:_===null?_=Object.getOwnPropertyDescriptor(s,A):_,O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(o,s,A,_);else for(var C=o.length-1;C>=0;C--)(O=o[C])&&(L=(S<3?O(L):S>3?O(s,A,L):O(s,A))||L);return S>3&&L&&Object.defineProperty(s,A,L),L},d=function(o,s){return function(A,_){s(A,_,o)}};function m(o){return o.command!==void 0}class u{constructor(o){this.id=u._idPool++,this._debugName=o}}u._idPool=0,u.CommandPalette=new u("CommandPalette"),u.EditorContext=new u("EditorContext"),u.SimpleEditorContext=new u("SimpleEditorContext"),u.EditorContextCopy=new u("EditorContextCopy"),u.EditorContextPeek=new u("EditorContextPeek"),u.MenubarEditMenu=new u("MenubarEditMenu"),u.MenubarCopy=new u("MenubarCopy"),u.MenubarGoMenu=new u("MenubarGoMenu"),u.MenubarSelectionMenu=new u("MenubarSelectionMenu"),u.InlineCompletionsActions=new u("InlineCompletionsActions");const a=Object(i.c)("menuService"),f=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new M.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:o=>o===u.CommandPalette}}addCommand(o){return this.addCommands(Y.a.single(o))}addCommands(o){for(const s of o)this._commands.set(s.id,s);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(F.i)(()=>{let s=!1;for(const A of o)s=this._commands.delete(A.id)||s;s&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(o){return this._commands.get(o)}getCommands(){const o=new Map;return this._commands.forEach((s,A)=>o.set(A,s)),o}appendMenuItem(o,s){return this.appendMenuItems(Y.a.single({id:o,item:s}))}appendMenuItems(o){const s=new Set,A=new U.a;for(const{id:_,item:S}of o){let L=this._menuItems.get(_);L||(L=new U.a,this._menuItems.set(_,L)),A.push(L.push(S)),s.add(_)}return this._onDidChangeMenu.fire(s),Object(F.i)(()=>{if(A.size>0){for(let _ of A)_();this._onDidChangeMenu.fire(s),A.clear()}})}getMenuItems(o){let s;return this._menuItems.has(o)?s=[...this._menuItems.get(o)]:s=[],o===u.CommandPalette&&this._appendImplicitItems(s),s}_appendImplicitItems(o){const s=new Set;for(const A of o)m(A)&&(s.add(A.command.id),A.alt&&s.add(A.alt.id));this._commands.forEach((A,_)=>{s.has(_)||o.push({command:A})})}};class l extends ie.e{constructor(o,s,A,_){super(`submenuitem.${o.submenu.id}`,typeof o.title=="string"?o.title:o.title.value,[],"submenu");this.item=o,this._menuService=s,this._contextKeyService=A,this._options=_}get actions(){const o=[],s=this._menuService.createMenu(this.item.submenu,this._contextKeyService),A=s.getActions(this._options);s.dispose();for(const[,_]of A)_.length>0&&(o.push(..._),o.push(new ie.d));return o.length&&o.pop(),o}}let h=class o{constructor(s,A,_,S,L){var O,C;if(this._commandService=L,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=(C=typeof s.tooltip=="string"?s.tooltip:(O=s.tooltip)===null||O===void 0?void 0:O.value)!==null&&C!==void 0?C:"",this.enabled=!s.precondition||S.contextMatchesRules(s.precondition),this.checked=void 0,s.toggled){const w=s.toggled.condition?s.toggled:{condition:s.toggled};this.checked=S.contextMatchesRules(w.condition),this.checked&&w.tooltip&&(this.tooltip=typeof w.tooltip=="string"?w.tooltip:w.tooltip.value),w.title&&(this.label=typeof w.title=="string"?w.title:w.title.value)}this.item=s,this.alt=A?new o(A,void 0,_,S,L):void 0,this._options=_,D.d.isThemeIcon(s.icon)&&(this.class=$.a.asClassName(s.icon))}dispose(){}run(...s){var A,_;let S=[];return((A=this._options)===null||A===void 0?void 0:A.arg)&&(S=[...S,this._options.arg]),((_=this._options)===null||_===void 0?void 0:_.shouldForwardArgs)&&(S=[...S,...s]),this._commandService.executeCommand(this.id,...S)}};h=g([d(3,W.b),d(4,G.b)],h)},ic2d:function(at,ge,J){"use strict";J.d(ge,"a",function(){return Y});var ie=J("FWmy"),$=J("746U");class M{constructor(){this.data=new Map}add(F,U){ie.a($.l(F)),ie.a($.k(U)),ie.a(!this.data.has(F),"There is already an extension with this id"),this.data.set(F,U)}as(F){return this.data.get(F)||null}}const Y=new M},kSUc:function(at,ge,J){},"kaH+":function(at,ge,J){"use strict";var ie=J("+L6B"),$=J("2/Rp"),M=J("tJVT"),Y=J("q1tI"),F=J.n(Y),U=J("UZu5"),G=J.n(U),W=J("dhSg"),i=J("rLCj"),D=J("dF/Y"),g=J("4i/N");ge.a=function(){var d=Object(Y.useState)(""),m=Object(M.a)(d,2),u=m[0],a=m[1],f=Object(Y.useState)(0),l=Object(M.a)(f,2),h=l[0],o=l[1],s=Object(Y.useRef)("");Object(Y.useEffect)(function(){var w=W.a.subscribe("preview-image",function(x){a(x),document.body.style.overflow="hidden"});return w},[]),Object(Y.useEffect)(function(){return document.addEventListener("keydown",A),function(){document.removeEventListener("keydown",A)}},[]),Object(Y.useEffect)(function(){s.current=u},[u]);function A(w){w.keyCode==27&&s.current&&_()}function _(){document.body.style.overflow="auto",a("")}function S(){o(h+90)}var L=Object(Y.useRef)(),O=Object(Y.useRef)(),C=function(x){(x.nativeEvent.target===L.current||x.nativeEvent.target===O.current)&&_()};return F.a.createElement(Y.Fragment,null,u?F.a.createElement("div",{className:"image-preview-container",ref:L,onClick:C},F.a.createElement("div",{className:"button-group"},F.a.createElement($.a,{onClick:S},"\u65CB\u8F6C",F.a.createElement(i.a,null)),F.a.createElement($.a,{href:u},"\u4E0B\u8F7D",F.a.createElement(D.a,null)),F.a.createElement($.a,{onClick:_},"\u5173\u95ED",F.a.createElement(g.a,null))),F.a.createElement("div",{className:"preview-wrp-group",ref:O},F.a.createElement("img",{className:"image-preview",src:u,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(h,"deg)")}}))):null)}},kzJb:function(at,ge,J){at.exports={wrap:"wrap___1_zGE",avatarWrap:"avatarWrap___1PHMh",avatar:"avatar___3tqlX",updateAvatarWrap:"updateAvatarWrap___z2gMm",img:"img___2NUme",updateAvatar:"updateAvatar___3wWy1",name_role:"name_role___3grmk",name:"name___2jxfA",role:"role___2C0k4",manage:"manage___2eiWG",colorGary:"colorGary___2ozEK",colorGreen:"colorGreen___14gmo",colorRed:"colorRed___2eVnN",item:"item___3nPxu",active:"active___3T4Rf",newTip:"newTip___1Ta-b"}},lZu9:function(at,ge,J){(function(ie){ie(J("VrN/"),J("1eCo"),J("8EBN"))})(function(ie){"use strict";ie.defineMode("markdown",function($,M){var Y=ie.getMode($,"text/html"),F=Y.name=="null";function U(P){if(ie.findModeByName){var b=ie.findModeByName(P);b&&(P=b.mime||b.mimes[0])}var X=ie.getMode($,P);return X.name=="null"?null:X}M.highlightFormatting===void 0&&(M.highlightFormatting=!1),M.maxBlockquoteDepth===void 0&&(M.maxBlockquoteDepth=0),M.taskLists===void 0&&(M.taskLists=!1),M.strikethrough===void 0&&(M.strikethrough=!1),M.emoji===void 0&&(M.emoji=!1),M.fencedCodeBlockHighlighting===void 0&&(M.fencedCodeBlockHighlighting=!0),M.fencedCodeBlockDefaultMode===void 0&&(M.fencedCodeBlockDefaultMode="text/plain"),M.xml===void 0&&(M.xml=!0),M.tokenTypeOverrides===void 0&&(M.tokenTypeOverrides={});var G={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 W in G)G.hasOwnProperty(W)&&M.tokenTypeOverrides[W]&&(G[W]=M.tokenTypeOverrides[W]);var i=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,g=/^\[(x| )\](?=\s)/i,d=M.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,m=/^ {0,3}(?:\={1,}|-{2,})\s*$/,u=/^[^#!\[\]*_\\<>` "'(~:]+/,a=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,f=/^\s*\[[^\]]+?\]:.*$/,l=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,h=" ";function o(P,b,X){return b.f=b.inline=X,X(P,b)}function s(P,b,X){return b.f=b.block=X,X(P,b)}function A(P){return!P||!/\S/.test(P.string)}function _(P){if(P.linkTitle=!1,P.linkHref=!1,P.linkText=!1,P.em=!1,P.strong=!1,P.strikethrough=!1,P.quote=0,P.indentedCode=!1,P.f==L){var b=F;if(!b){var X=ie.innerMode(Y,P.htmlState);b=X.mode.name=="xml"&&X.state.tagStart===null&&!X.state.context&&X.state.tokenize.isInText}b&&(P.f=x,P.block=S,P.htmlState=null)}return P.trailingSpace=0,P.trailingSpaceNewLine=!1,P.prevLine=P.thisLine,P.thisLine={stream:null},null}function S(P,b){var X=P.column()===b.indentation,ee=A(b.prevLine.stream),ae=b.indentedCode,le=b.prevLine.hr,Re=b.list!==!1,Ee=(b.listStack[b.listStack.length-1]||0)+3;b.indentedCode=!1;var Te=b.indentation;if(b.indentationDiff===null&&(b.indentationDiff=b.indentation,Re)){for(b.list=null;Te<b.listStack[b.listStack.length-1];)b.listStack.pop(),b.listStack.length?b.indentation=b.listStack[b.listStack.length-1]:b.list=!1;b.list!==!1&&(b.indentationDiff=Te-b.listStack[b.listStack.length-1])}var Ae=!ee&&!le&&!b.prevLine.header&&(!Re||!ae)&&!b.prevLine.fencedCodeEnd,Oe=(b.list===!1||le||ee)&&b.indentation<=Ee&&P.match(i),ce=null;if(b.indentationDiff>=4&&(ae||b.prevLine.fencedCodeEnd||b.prevLine.header||ee))return P.skipToEnd(),b.indentedCode=!0,G.code;if(P.eatSpace())return null;if(X&&b.indentation<=Ee&&(ce=P.match(d))&&ce[1].length<=6)return b.quote=0,b.header=ce[1].length,b.thisLine.header=!0,M.highlightFormatting&&(b.formatting="header"),b.f=b.inline,C(b);if(b.indentation<=Ee&&P.eat(">"))return b.quote=X?1:b.quote+1,M.highlightFormatting&&(b.formatting="quote"),P.eatSpace(),C(b);if(!Oe&&!b.setext&&X&&b.indentation<=Ee&&(ce=P.match(D))){var ue=ce[1]?"ol":"ul";return b.indentation=Te+P.current().length,b.list=!0,b.quote=0,b.listStack.push(b.indentation),b.em=!1,b.strong=!1,b.code=!1,b.strikethrough=!1,M.taskLists&&P.match(g,!1)&&(b.taskList=!0),b.f=b.inline,M.highlightFormatting&&(b.formatting=["list","list-"+ue]),C(b)}else{if(X&&b.indentation<=Ee&&(ce=P.match(a,!0)))return b.quote=0,b.fencedEndRE=new RegExp(ce[1]+"+ *$"),b.localMode=M.fencedCodeBlockHighlighting&&U(ce[2]||M.fencedCodeBlockDefaultMode),b.localMode&&(b.localState=ie.startState(b.localMode)),b.f=b.block=O,M.highlightFormatting&&(b.formatting="code-block"),b.code=-1,C(b);if(b.setext||(!Ae||!Re)&&!b.quote&&b.list===!1&&!b.code&&!Oe&&!f.test(P.string)&&(ce=P.lookAhead(1))&&(ce=ce.match(m)))return b.setext?(b.header=b.setext,b.setext=0,P.skipToEnd(),M.highlightFormatting&&(b.formatting="header")):(b.header=ce[0].charAt(0)=="="?1:2,b.setext=b.header),b.thisLine.header=!0,b.f=b.inline,C(b);if(Oe)return P.skipToEnd(),b.hr=!0,b.thisLine.hr=!0,G.hr;if(P.peek()==="[")return o(P,b,N)}return o(P,b,b.inline)}function L(P,b){var X=Y.token(P,b.htmlState);if(!F){var ee=ie.innerMode(Y,b.htmlState);(ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText||b.md_inside&&P.current().indexOf(">")>-1)&&(b.f=x,b.block=S,b.htmlState=null)}return X}function O(P,b){var X=b.listStack[b.listStack.length-1]||0,ee=b.indentation<X,ae=X+3;if(b.fencedEndRE&&b.indentation<=ae&&(ee||P.match(b.fencedEndRE))){M.highlightFormatting&&(b.formatting="code-block");var le;return ee||(le=C(b)),b.localMode=b.localState=null,b.block=S,b.f=x,b.fencedEndRE=null,b.code=0,b.thisLine.fencedCodeEnd=!0,ee?s(P,b,b.block):le}else return b.localMode?b.localMode.token(P,b.localState):(P.skipToEnd(),G.code)}function C(P){var b=[];if(P.formatting){b.push(G.formatting),typeof P.formatting=="string"&&(P.formatting=[P.formatting]);for(var X=0;X<P.formatting.length;X++)b.push(G.formatting+"-"+P.formatting[X]),P.formatting[X]==="header"&&b.push(G.formatting+"-"+P.formatting[X]+"-"+P.header),P.formatting[X]==="quote"&&(!M.maxBlockquoteDepth||M.maxBlockquoteDepth>=P.quote?b.push(G.formatting+"-"+P.formatting[X]+"-"+P.quote):b.push("error"))}if(P.taskOpen)return b.push("meta"),b.length?b.join(" "):null;if(P.taskClosed)return b.push("property"),b.length?b.join(" "):null;if(P.linkHref?b.push(G.linkHref,"url"):(P.strong&&b.push(G.strong),P.em&&b.push(G.em),P.strikethrough&&b.push(G.strikethrough),P.emoji&&b.push(G.emoji),P.linkText&&b.push(G.linkText),P.code&&b.push(G.code),P.image&&b.push(G.image),P.imageAltText&&b.push(G.imageAltText,"link"),P.imageMarker&&b.push(G.imageMarker)),P.header&&b.push(G.header,G.header+"-"+P.header),P.quote&&(b.push(G.quote),!M.maxBlockquoteDepth||M.maxBlockquoteDepth>=P.quote?b.push(G.quote+"-"+P.quote):b.push(G.quote+"-"+M.maxBlockquoteDepth)),P.list!==!1){var ee=(P.listStack.length-1)%3;ee?ee===1?b.push(G.list2):b.push(G.list3):b.push(G.list1)}return P.trailingSpaceNewLine?b.push("trailing-space-new-line"):P.trailingSpace&&b.push("trailing-space-"+(P.trailingSpace%2?"a":"b")),b.length?b.join(" "):null}function w(P,b){return P.match(u,!0)?C(b):void 0}function x(P,b){var X=b.text(P,b);if(typeof X!="undefined")return X;if(b.list)return b.list=null,C(b);if(b.taskList){var ee=P.match(g,!0)[1]===" ";return ee?b.taskOpen=!0:b.taskClosed=!0,M.highlightFormatting&&(b.formatting="task"),b.taskList=!1,C(b)}if(b.taskOpen=!1,b.taskClosed=!1,b.header&&P.match(/^#+$/,!0))return M.highlightFormatting&&(b.formatting="header"),C(b);var ae=P.next();if(b.linkTitle){b.linkTitle=!1;var le=ae;ae==="("&&(le=")"),le=(le+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Re="^\\s*(?:[^"+le+"\\\\]+|\\\\\\\\|\\\\.)"+le;if(P.match(new RegExp(Re),!0))return G.linkHref}if(ae==="`"){var Ee=b.formatting;M.highlightFormatting&&(b.formatting="code"),P.eatWhile("`");var Te=P.current().length;if(b.code==0&&(!b.quote||Te==1))return b.code=Te,C(b);if(Te==b.code){var Ae=C(b);return b.code=0,Ae}else return b.formatting=Ee,C(b)}else if(b.code)return C(b);if(ae==="\\"&&(P.next(),M.highlightFormatting)){var Oe=C(b),ce=G.formatting+"-escape";return Oe?Oe+" "+ce:ce}if(ae==="!"&&P.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return b.imageMarker=!0,b.image=!0,M.highlightFormatting&&(b.formatting="image"),C(b);if(ae==="["&&b.imageMarker&&P.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return b.imageMarker=!1,b.imageAltText=!0,M.highlightFormatting&&(b.formatting="image"),C(b);if(ae==="]"&&b.imageAltText){M.highlightFormatting&&(b.formatting="image");var Oe=C(b);return b.imageAltText=!1,b.image=!1,b.inline=b.f=T,Oe}if(ae==="["&&!b.image)return b.linkText&&P.match(/^.*?\]/)||(b.linkText=!0,M.highlightFormatting&&(b.formatting="link")),C(b);if(ae==="]"&&b.linkText){M.highlightFormatting&&(b.formatting="link");var Oe=C(b);return b.linkText=!1,b.inline=b.f=P.match(/\(.*?\)| ?\[.*?\]/,!1)?T:x,Oe}if(ae==="<"&&P.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=p,M.highlightFormatting&&(b.formatting="link");var Oe=C(b);return Oe?Oe+=" ":Oe="",Oe+G.linkInline}if(ae==="<"&&P.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=p,M.highlightFormatting&&(b.formatting="link");var Oe=C(b);return Oe?Oe+=" ":Oe="",Oe+G.linkEmail}if(M.xml&&ae==="<"&&P.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ue=P.string.indexOf(">",P.pos);if(ue!=-1){var Pe=P.string.substring(P.start,ue);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Pe)&&(b.md_inside=!0)}return P.backUp(1),b.htmlState=ie.startState(Y),s(P,b,L)}if(M.xml&&ae==="<"&&P.match(/^\/\w*?>/))return b.md_inside=!1,"tag";if(ae==="*"||ae==="_"){for(var qe=1,ze=P.pos==1?" ":P.string.charAt(P.pos-2);qe<3&&P.eat(ae);)qe++;var et=P.peek()||" ",nt=!/\s/.test(et)&&(!l.test(et)||/\s/.test(ze)||l.test(ze)),Ie=!/\s/.test(ze)&&(!l.test(ze)||/\s/.test(et)||l.test(et)),Me=null,Ge=null;if(qe%2&&(!b.em&&nt&&(ae==="*"||!Ie||l.test(ze))?Me=!0:b.em==ae&&Ie&&(ae==="*"||!nt||l.test(et))&&(Me=!1)),qe>1&&(!b.strong&&nt&&(ae==="*"||!Ie||l.test(ze))?Ge=!0:b.strong==ae&&Ie&&(ae==="*"||!nt||l.test(et))&&(Ge=!1)),Ge!=null||Me!=null){M.highlightFormatting&&(b.formatting=Me==null?"strong":Ge==null?"em":"strong em"),Me===!0&&(b.em=ae),Ge===!0&&(b.strong=ae);var Ae=C(b);return Me===!1&&(b.em=!1),Ge===!1&&(b.strong=!1),Ae}}else if(ae===" "&&(P.eat("*")||P.eat("_"))){if(P.peek()===" ")return C(b);P.backUp(1)}if(M.strikethrough){if(ae==="~"&&P.eatWhile(ae)){if(b.strikethrough){M.highlightFormatting&&(b.formatting="strikethrough");var Ae=C(b);return b.strikethrough=!1,Ae}else if(P.match(/^[^\s]/,!1))return b.strikethrough=!0,M.highlightFormatting&&(b.formatting="strikethrough"),C(b)}else if(ae===" "&&P.match(/^~~/,!0)){if(P.peek()===" ")return C(b);P.backUp(2)}}if(M.emoji&&ae===":"&&P.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){b.emoji=!0,M.highlightFormatting&&(b.formatting="emoji");var se=C(b);return b.emoji=!1,se}return ae===" "&&(P.match(/^ +$/,!1)?b.trailingSpace++:b.trailingSpace&&(b.trailingSpaceNewLine=!0)),C(b)}function p(P,b){var X=P.next();if(X===">"){b.f=b.inline=x,M.highlightFormatting&&(b.formatting="link");var ee=C(b);return ee?ee+=" ":ee="",ee+G.linkInline}return P.match(/^[^>]+/,!0),G.linkInline}function T(P,b){if(P.eatSpace())return null;var X=P.next();return X==="("||X==="["?(b.f=b.inline=y(X==="("?")":"]"),M.highlightFormatting&&(b.formatting="link-string"),b.linkHref=!0,C(b)):"error"}var v={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function y(P){return function(b,X){var ee=b.next();if(ee===P){X.f=X.inline=x,M.highlightFormatting&&(X.formatting="link-string");var ae=C(X);return X.linkHref=!1,ae}return b.match(v[P]),X.linkHref=!0,C(X)}}function N(P,b){return P.match(/^([^\]\\]|\\.)*\]:/,!1)?(b.f=B,P.next(),M.highlightFormatting&&(b.formatting="link"),b.linkText=!0,C(b)):o(P,b,x)}function B(P,b){if(P.match(/^\]:/,!0)){b.f=b.inline=R,M.highlightFormatting&&(b.formatting="link");var X=C(b);return b.linkText=!1,X}return P.match(/^([^\]\\]|\\.)+/,!0),G.linkText}function R(P,b){return P.eatSpace()?null:(P.match(/^[^\s]+/,!0),P.peek()===void 0?b.linkTitle=!0:P.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),b.f=b.inline=x,G.linkHref+" url")}var j={startState:function(){return{f:S,prevLine:{stream:null},thisLine:{stream:null},block:S,htmlState:null,indentation:0,inline:x,text:w,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(P){return{f:P.f,prevLine:P.prevLine,thisLine:P.thisLine,block:P.block,htmlState:P.htmlState&&ie.copyState(Y,P.htmlState),indentation:P.indentation,localMode:P.localMode,localState:P.localMode?ie.copyState(P.localMode,P.localState):null,inline:P.inline,text:P.text,formatting:!1,linkText:P.linkText,linkTitle:P.linkTitle,linkHref:P.linkHref,code:P.code,em:P.em,strong:P.strong,strikethrough:P.strikethrough,emoji:P.emoji,header:P.header,setext:P.setext,hr:P.hr,taskList:P.taskList,list:P.list,listStack:P.listStack.slice(0),quote:P.quote,indentedCode:P.indentedCode,trailingSpace:P.trailingSpace,trailingSpaceNewLine:P.trailingSpaceNewLine,md_inside:P.md_inside,fencedEndRE:P.fencedEndRE}},token:function(P,b){if(b.formatting=!1,P!=b.thisLine.stream){if(b.header=0,b.hr=!1,P.match(/^\s*$/,!0))return _(b),null;if(b.prevLine=b.thisLine,b.thisLine={stream:P},b.taskList=!1,b.trailingSpace=0,b.trailingSpaceNewLine=!1,!b.localState&&(b.f=b.block,b.f!=L)){var X=P.match(/^\s*/,!0)[0].replace(/\t/g,h).length;if(b.indentation=X,b.indentationDiff=null,X>0)return null}}return b.f(P,b)},innerMode:function(P){return P.block==L?{state:P.htmlState,mode:Y}:P.localState?{state:P.localState,mode:P.localMode}:{state:P,mode:j}},indent:function(P,b,X){return P.block==L&&Y.indent?Y.indent(P.htmlState,b,X):P.localState&&P.localMode.indent?P.localMode.indent(P.localState,b,X):ie.Pass},blankLine:_,getType:C,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return j},"xml"),ie.defineMIME("text/markdown","markdown"),ie.defineMIME("text/x-markdown","markdown")})},nEHx:function(at,ge,J){"use strict";J.d(ge,"a",function(){return ie});var ie;(function($){$.DARK="dark",$.LIGHT="light",$.HIGH_CONTRAST="hc"})(ie||(ie={}))},nnTU:function(at,ge,J){"use strict";J.d(ge,"b",function(){return G}),J.d(ge,"a",function(){return W});var ie=J("MI8n"),$=J("JYp7"),M=J("pmY6"),Y=J("24hK"),F=J("746U"),U=J("Cg/j");const G=Object(U.c)("commandService"),W=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ie.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(i,D){if(!i)throw new Error("invalid command");if(typeof i=="string"){if(!D)throw new Error("invalid command");return this.registerCommand({id:i,handler:D})}if(i.description){const a=[];for(let l of i.description.args)a.push(l.constraint);const f=i.handler;i.handler=function(l,...h){return Object(F.o)(h,a),f(l,...h)}}const{id:g}=i;let d=this._commands.get(g);d||(d=new Y.a,this._commands.set(g,d));let m=d.unshift(i),u=Object(M.i)(()=>{m();const a=this._commands.get(g);(a==null?void 0:a.isEmpty())&&this._commands.delete(g)});return this._onDidRegisterCommand.fire(g),u}registerCommandAlias(i,D){return W.registerCommand(i,(g,...d)=>g.get(G).executeCommand(D,...d))}getCommand(i){const D=this._commands.get(i);return!D||D.isEmpty()?void 0:$.a.first(D)}getCommands(){const i=new Map;for(const D of this._commands.keys()){const g=this.getCommand(D);g&&i.set(D,g)}return i}};W.registerCommand("noop",()=>{})},osHv:function(at,ge,J){(function(ie){ie(J("VrN/"))})(function(ie){"use strict";var $=ie.Pos;function M(l,h){return l.line-h.line||l.ch-h.ch}var Y="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",F=Y+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",U=new RegExp("<(/?)(["+Y+"]["+F+"]*)","g");function G(l,h,o,s){this.line=h,this.ch=o,this.cm=l,this.text=l.getLine(h),this.min=s?Math.max(s.from,l.firstLine()):l.firstLine(),this.max=s?Math.min(s.to-1,l.lastLine()):l.lastLine()}function W(l,h){var o=l.cm.getTokenTypeAt($(l.line,h));return o&&/\btag\b/.test(o)}function i(l){return l.line>=l.max?void 0:(l.ch=0,l.text=l.cm.getLine(++l.line),!0)}function D(l){return l.line<=l.min?void 0:(l.text=l.cm.getLine(--l.line),l.ch=l.text.length,!0)}function g(l){for(;;){var h=l.text.indexOf(">",l.ch);if(h==-1){if(i(l))continue;return}if(!W(l,h+1)){l.ch=h+1;continue}var o=l.text.lastIndexOf("/",h),s=o>-1&&!/\S/.test(l.text.slice(o+1,h));return l.ch=h+1,s?"selfClose":"regular"}}function d(l){for(;;){var h=l.ch?l.text.lastIndexOf("<",l.ch-1):-1;if(h==-1){if(D(l))continue;return}if(!W(l,h+1)){l.ch=h;continue}U.lastIndex=h,l.ch=h;var o=U.exec(l.text);if(o&&o.index==h)return o}}function m(l){for(;;){U.lastIndex=l.ch;var h=U.exec(l.text);if(!h){if(i(l))continue;return}if(!W(l,h.index+1)){l.ch=h.index+1;continue}return l.ch=h.index+h[0].length,h}}function u(l){for(;;){var h=l.ch?l.text.lastIndexOf(">",l.ch-1):-1;if(h==-1){if(D(l))continue;return}if(!W(l,h+1)){l.ch=h;continue}var o=l.text.lastIndexOf("/",h),s=o>-1&&!/\S/.test(l.text.slice(o+1,h));return l.ch=h+1,s?"selfClose":"regular"}}function a(l,h){for(var o=[];;){var s=m(l),A,_=l.line,S=l.ch-(s?s[0].length:0);if(!s||!(A=g(l)))return;if(A=="selfClose")continue;if(s[1]){for(var L=o.length-1;L>=0;--L)if(o[L]==s[2]){o.length=L;break}if(L<0&&(!h||h==s[2]))return{tag:s[2],from:$(_,S),to:$(l.line,l.ch)}}else o.push(s[2])}}function f(l,h){for(var o=[];;){var s=u(l);if(!s)return;if(s=="selfClose"){d(l);continue}var A=l.line,_=l.ch,S=d(l);if(!S)return;if(S[1])o.push(S[2]);else{for(var L=o.length-1;L>=0;--L)if(o[L]==S[2]){o.length=L;break}if(L<0&&(!h||h==S[2]))return{tag:S[2],from:$(l.line,l.ch),to:$(A,_)}}}}ie.registerHelper("fold","xml",function(l,h){for(var o=new G(l,h.line,0);;){var s=m(o);if(!s||o.line!=h.line)return;var A=g(o);if(!A)return;if(!s[1]&&A!="selfClose"){var _=$(o.line,o.ch),S=a(o,s[2]);return S&&M(S.from,_)>0?{from:_,to:S.from}:null}}}),ie.findMatchingTag=function(l,h,o){var s=new G(l,h.line,h.ch,o);if(s.text.indexOf(">")==-1&&s.text.indexOf("<")==-1)return;var A=g(s),_=A&&$(s.line,s.ch),S=A&&d(s);if(!A||!S||M(s,h)>0)return;var L={from:$(s.line,s.ch),to:_,tag:S[2]};return A=="selfClose"?{open:L,close:null,at:"open"}:S[1]?{open:f(s,S[2]),close:L,at:"close"}:(s=new G(l,_.line,_.ch,o),{open:L,close:a(s,S[2]),at:"open"})},ie.findEnclosingTag=function(l,h,o,s){for(var A=new G(l,h.line,h.ch,o);;){var _=f(A,s);if(!_)break;var S=new G(l,h.line,h.ch,o),L=a(S,_.tag);if(L)return{open:_,close:L}}},ie.scanForClosingTag=function(l,h,o,s){var A=new G(l,h.line,h.ch,s?{from:0,to:s}:null);return a(A,o)}})},p5ED:function(at,ge,J){"use strict";var ie=J("+L6B"),$=J("2/Rp"),M=J("5Dmo"),Y=J("3S7+"),F=J("k1fw"),U=J("9og8"),G=J("tJVT"),W=J("WmNS"),i=J.n(W),D=J("q1tI"),g=J.n(D),d=J("vHTk"),m=J.n(d),u=J("yEEn"),a=J("ZW9T"),f=J("1vsH"),l=J("V0Rq"),h=J("m3rI");ge.a=function(o){var s,A,_,S,L,O,C,w=o.editOffice,x=w===void 0?"view":w,p=o.data,T=o.theme,v=o.type,y=o.filename,N=o.monacoEditor,B=o.className,R=o.style,j=o.close,P=o.onClose,b=o.hasMask,X=o.disabledDownload,ee=Object(D.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ae=Object(G.a)(ee,2),le=ae[0],Re=ae[1],Ee=Object(D.useState)(""),Te=Object(G.a)(Ee,2),Ae=Te[0],Oe=Te[1],ce=Object(D.useState)(),ue=Object(G.a)(ce,2),Pe=ue[0],qe=ue[1],ze=window.ENV==="build"?"/react/build":"",et=h.a.PROXY_SERVER||location.origin,nt,Ie=1024*1024,Me=10*Ie,Ge=Object(D.useRef)();(s=p)!==null&&s!==void 0&&s.startsWith("/api")&&v!=="txt"&&(p=h.a.API_SERVER+p),v==="office"&&(nt=Object(f.U)(p).filesize,nt>Me&&(v="other")),y&&N&&(N.filename=y),Object(D.useEffect)(function(){var Se,Be,He=(Se=document.cookie)===null||Se===void 0||((Be=Se.replace(/\s/g,""))===null||Be===void 0)?void 0:Be.split(";");He==null||He.map(function(Xe){var Ve=Xe.split("=");Ve[0]==="_educoder_session"&&Oe(Ve[1])})},[]),Object(D.useEffect)(function(){v==="office"&&se()},[v,p]);var se=function(){var Se=Object(U.a)(i.a.mark(function Be(){var He,Xe,Ve;return i.a.wrap(function($e){for(;;)switch($e.prev=$e.next){case 0:return console.log("data:",p),He=p,p.startsWith("http")||(He=location.origin+He),Xe=new URL(He).pathname.split("/").pop(),$e.next=6,Object(l.V)({attachment_id:Xe});case 6:Ve=$e.sent,qe(Ve);case 8:case"end":return $e.stop()}},Be)}));return function(){return Se.apply(this,arguments)}}(),be=function(){if(p.startsWith("http")||p.startsWith("blob:")){xe();return}Object(f.z)(y||"educoder",p,y)},xe=function(){Object(f.x)(y||"educoder",decodeURIComponent(p))};return g.a.createElement("div",{style:Object(F.a)({},R||{}),className:"".concat(b&&m.a.bgBlack," ").concat(v?m.a.wrp:"hide")},j&&g.a.createElement("div",{className:m.a.close,ref:Ge},!X&&g.a.createElement(Y.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ge.current}},g.a.createElement("span",{onClick:xe},g.a.createElement("i",{className:"icon-quxiaozhiding"}))),g.a.createElement(Y.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ge.current}},g.a.createElement("span",{className:"",onClick:P},g.a.createElement("i",{className:"icon-guanbi1"})))),g.a.createElement("div",{className:"".concat(m.a[B]," ").concat(B," ").concat(m.a.monaco," ").concat(v==="txt"?"show":"hide")},v==="txt"&&g.a.createElement(a.b,N)),v==="audio"&&g.a.createElement("audio",{src:"".concat(((A=p)===null||A===void 0?void 0:A.indexOf("http://"))>-1||((_=p)===null||_===void 0?void 0:_.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(p),autoPlay:!0}),v==="video"&&g.a.createElement(g.a.Fragment,null,((S=p)===null||S===void 0?void 0:S.indexOf("http"))>-1?g.a.createElement("video",{controls:!0,src:"".concat(p),autoPlay:!0}):g.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(p),autoPlay:!0})),v==="office"&&Pe&&g.a.createElement("iframe",{src:"".concat(ze,"/office.html?key=").concat(Pe.key,"&url=").concat(et+Pe.url,"&callbackUrl=").concat(et+Pe.callbackUrl,"&fileType=").concat(Pe.fileType,"&title=").concat(Pe.title,"&model=").concat(x,"&officeServer=").concat(h.a.OFFICE_SERVER,"&disabledDownload=").concat(!!X)}),v==="html"&&g.a.createElement("iframe",{src:p+"&disposition=inline"}),v==="pdf"&&g.a.createElement("iframe",{src:"".concat(ze,"/js/pdfview/index.html?url=").concat(p,"&disabledDownload=").concat(!!X)}),v==="image"&&g.a.createElement("img",{src:"".concat(((L=p)===null||L===void 0?void 0:L.indexOf("http://"))>-1||((O=p)===null||O===void 0?void 0:O.indexOf("https://"))>-1||(C=p)!==null&&C!==void 0&&C.startsWith("/api")?"":"data:image/png;base64,").concat(p)}),v==="other"&&g.a.createElement("div",null,g.a.createElement($.a,{type:"primary",size:"large",onClick:be},g.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),v==="download"&&g.a.createElement($.a,{type:"primary",size:"large",onClick:be},g.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(at,ge,J){},pmY6:function(at,ge,J){"use strict";J.d(ge,"h",function(){return D}),J.d(ge,"g",function(){return d}),J.d(ge,"f",function(){return m}),J.d(ge,"e",function(){return u}),J.d(ge,"i",function(){return a}),J.d(ge,"b",function(){return f}),J.d(ge,"a",function(){return l}),J.d(ge,"d",function(){return h}),J.d(ge,"c",function(){return o});var ie=J("C/vA"),$=J("JYp7");const M=!1;let Y=null;function F(s){Y=s}if(M){const s="__is_disposable_tracked__";F(new class{trackDisposable(A){const _=new Error("Potentially leaked disposable").stack;setTimeout(()=>{A[s]||console.log(_)},3e3)}setParent(A,_){if(A&&A!==l.None)try{A[s]=!0}catch(S){}}markAsDisposed(A){if(A&&A!==l.None)try{A[s]=!0}catch(_){}}markAsSingleton(A){}})}function U(s){return Y==null||Y.trackDisposable(s),s}function G(s){Y==null||Y.markAsDisposed(s)}function W(s,A){Y==null||Y.setParent(s,A)}function i(s,A){if(!Y)return;for(const _ of s)Y.setParent(_,A)}function D(s){return Y==null||Y.markAsSingleton(s),s}class g extends Error{constructor(s){super(`Encountered errors while disposing of store. Errors: [${s.join(", ")}]`);this.errors=s}}function d(s){return typeof s.dispose=="function"&&s.dispose.length===0}function m(s){if($.a.is(s)){let A=[];for(const _ of s)if(_)try{_.dispose()}catch(S){A.push(S)}if(A.length===1)throw A[0];if(A.length>1)throw new g(A);return Array.isArray(s)?[]:s}else if(s)return s.dispose(),s}function u(...s){const A=a(()=>m(s));return i(s,A),A}function a(s){const A=U({dispose:Object(ie.a)(()=>{G(A),s()})});return A}class f{constructor(){this._toDispose=new Set,this._isDisposed=!1,U(this)}dispose(){if(this._isDisposed)return;G(this),this._isDisposed=!0,this.clear()}clear(){try{m(this._toDispose.values())}finally{this._toDispose.clear()}}add(s){if(!s)return s;if(s===this)throw new Error("Cannot register a disposable on itself!");return W(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 l{constructor(){this._store=new f,U(this),W(this._store,this)}dispose(){G(this),this._store.dispose()}_register(s){if(s===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(s)}}l.None=Object.freeze({dispose(){}});class h{constructor(){this._isDisposed=!1,U(this)}get value(){return this._isDisposed?void 0:this._value}set value(s){var A;if(this._isDisposed||s===this._value)return;(A=this._value)===null||A===void 0||A.dispose(),s&&W(s,this),this._value=s}clear(){this.value=void 0}dispose(){var s;this._isDisposed=!0,G(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&&W(s,null),s}}class o{constructor(s){this.object=s}dispose(){}}},psGv:function(at,ge,J){var ie,$;(function(){var M;(function(){"use strict";var G=[,,function(g){function d(a){this.__parent=a,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=[]}d.prototype.clone_empty=function(){var a=new d(this.__parent);return a.set_indent(this.__indent_count,this.__alignment_count),a},d.prototype.item=function(a){return a<0?this.__items[this.__items.length+a]:this.__items[a]},d.prototype.has_match=function(a){for(var f=this.__items.length-1;f>=0;f--)if(this.__items[f].match(a))return!0;return!1},d.prototype.set_indent=function(a,f){this.is_empty()&&(this.__indent_count=a||0,this.__alignment_count=f||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},d.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)},d.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},d.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var a=this.__parent.current_line;return a.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),a.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),a.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,a.__items[0]===" "&&(a.__items.splice(0,1),a.__character_count-=1),!0}return!1},d.prototype.is_empty=function(){return this.__items.length===0},d.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},d.prototype.push=function(a){this.__items.push(a);var f=a.lastIndexOf(`
|
|
`);f!==-1?this.__character_count=a.length-f:this.__character_count+=a.length},d.prototype.pop=function(){var a=null;return this.is_empty()||(a=this.__items.pop(),this.__character_count-=a.length),a},d.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},d.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},d.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},d.prototype.toString=function(){var a="";return this.is_empty()?this.__parent.indent_empty_lines&&(a=this.__parent.get_indent_string(this.__indent_count)):(a=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),a+=this.__items.join("")),a};function m(a,f){this.__cache=[""],this.__indent_size=a.indent_size,this.__indent_string=a.indent_char,a.indent_with_tabs||(this.__indent_string=new Array(a.indent_size+1).join(a.indent_char)),f=f||"",a.indent_level>0&&(f=new Array(a.indent_level+1).join(this.__indent_string)),this.__base_string=f,this.__base_string_length=f.length}m.prototype.get_indent_size=function(a,f){var l=this.__base_string_length;return f=f||0,a<0&&(l=0),l+=a*this.__indent_size,l+=f,l},m.prototype.get_indent_string=function(a,f){var l=this.__base_string;return f=f||0,a<0&&(a=0,l=""),f+=a*this.__indent_size,this.__ensure_cache(f),l+=this.__cache[f],l},m.prototype.__ensure_cache=function(a){for(;a>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var a=this.__cache.length,f=0,l="";this.__indent_size&&a>=this.__indent_size&&(f=Math.floor(a/this.__indent_size),a-=f*this.__indent_size,l=new Array(f+1).join(this.__indent_string)),a&&(l+=new Array(a+1).join(" ")),this.__cache.push(l)};function u(a,f){this.__indent_cache=new m(a,f),this.raw=!1,this._end_with_newline=a.end_with_newline,this.indent_size=a.indent_size,this.wrap_line_length=a.wrap_line_length,this.indent_empty_lines=a.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new d(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}u.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},u.prototype.get_line_number=function(){return this.__lines.length},u.prototype.get_indent_string=function(a,f){return this.__indent_cache.get_indent_string(a,f)},u.prototype.get_indent_size=function(a,f){return this.__indent_cache.get_indent_size(a,f)},u.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},u.prototype.add_new_line=function(a){return this.is_empty()||!a&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},u.prototype.get_code=function(a){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 l=this.__lines.join(`
|
|
`);return a!==`
|
|
`&&(l=l.replace(/[\n]/g,a)),l},u.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},u.prototype.set_indent=function(a,f){return a=a||0,f=f||0,this.next_line.set_indent(a,f),this.__lines.length>1?(this.current_line.set_indent(a,f),!0):(this.current_line.set_indent(),!1)},u.prototype.add_raw_token=function(a){for(var f=0;f<a.newlines;f++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(a.whitespace_before),this.current_line.push(a.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},u.prototype.add_token=function(a){this.__add_space_before_token(),this.current_line.push(a),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},u.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(" "))},u.prototype.remove_indent=function(a){for(var f=this.__lines.length;a<f;)this.__lines[a]._remove_indent(),a++;this.current_line._remove_wrap_indent()},u.prototype.trim=function(a){for(a=a===void 0?!1:a,this.current_line.trim();a&&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},u.prototype.just_added_newline=function(){return this.current_line.is_empty()},u.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},u.prototype.ensure_empty_line_above=function(a,f){for(var l=this.__lines.length-2;l>=0;){var h=this.__lines[l];if(h.is_empty())break;if(h.item(0).indexOf(a)!==0&&h.item(-1)!==f){this.__lines.splice(l+1,0,new d(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},g.exports.Output=u},function(g){function d(m,u,a,f){this.type=m,this.text=u,this.comments_before=null,this.newlines=a||0,this.whitespace_before=f||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}g.exports.Token=d},,,function(g){function d(a,f){this.raw_options=m(a,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"])}d.prototype._get_array=function(a,f){var l=this.raw_options[a],h=f||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(h=l.concat()):typeof l=="string"&&(h=l.split(/[^a-zA-Z0-9_\/\-]+/)),h},d.prototype._get_boolean=function(a,f){var l=this.raw_options[a],h=l===void 0?!!f:!!l;return h},d.prototype._get_characters=function(a,f){var l=this.raw_options[a],h=f||"";return typeof l=="string"&&(h=l.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),h},d.prototype._get_number=function(a,f){var l=this.raw_options[a];f=parseInt(f,10),isNaN(f)&&(f=0);var h=parseInt(l,10);return isNaN(h)&&(h=f),h},d.prototype._get_selection=function(a,f,l){var h=this._get_selection_list(a,f,l);if(h.length!==1)throw new Error("Invalid Option Value: The option '"+a+`' can only be one of the following values:
|
|
`+f+`
|
|
You passed in: '`+this.raw_options[a]+"'");return h[0]},d.prototype._get_selection_list=function(a,f,l){if(!f||f.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[f[0]],!this._is_valid_selection(l,f))throw new Error("Invalid Default Value!");var h=this._get_array(a,l);if(!this._is_valid_selection(h,f))throw new Error("Invalid Option Value: The option '"+a+`' can contain only the following values:
|
|
`+f+`
|
|
You passed in: '`+this.raw_options[a]+"'");return h},d.prototype._is_valid_selection=function(a,f){return a.length&&f.length&&!a.some(function(l){return f.indexOf(l)===-1})};function m(a,f){var l={};a=u(a);var h;for(h in a)h!==f&&(l[h]=a[h]);if(f&&a[f])for(h in a[f])l[h]=a[f][h];return l}function u(a){var f={},l;for(l in a){var h=l.replace(/-/g,"_");f[h]=a[l]}return f}g.exports.Options=d,g.exports.normalizeOpts=u,g.exports.mergeOpts=m},,function(g){var d=RegExp.prototype.hasOwnProperty("sticky");function m(u){this.__input=u||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position<this.__input_length},m.prototype.next=function(){var u=null;return this.hasNext()&&(u=this.__input.charAt(this.__position),this.__position+=1),u},m.prototype.peek=function(u){var a=null;return u=u||0,u+=this.__position,u>=0&&u<this.__input_length&&(a=this.__input.charAt(u)),a},m.prototype.__match=function(u,a){u.lastIndex=a;var f=u.exec(this.__input);return f&&!(d&&u.sticky)&&(f.index!==a&&(f=null)),f},m.prototype.test=function(u,a){return a=a||0,a+=this.__position,a>=0&&a<this.__input_length?!!this.__match(u,a):!1},m.prototype.testChar=function(u,a){var f=this.peek(a);return u.lastIndex=0,f!==null&&u.test(f)},m.prototype.match=function(u){var a=this.__match(u,this.__position);return a?this.__position+=a[0].length:a=null,a},m.prototype.read=function(u,a,f){var l="",h;return u&&(h=this.match(u),h&&(l+=h[0])),a&&(h||!u)&&(l+=this.readUntil(a,f)),l},m.prototype.readUntil=function(u,a){var f="",l=this.__position;u.lastIndex=this.__position;var h=u.exec(this.__input);return h?(l=h.index,a&&(l+=h[0].length)):l=this.__input_length,f=this.__input.substring(this.__position,l),this.__position=l,f},m.prototype.readUntilAfter=function(u){return this.readUntil(u,!0)},m.prototype.get_regexp=function(u,a){var f=null,l="g";return a&&d&&(l="y"),typeof u=="string"&&u!==""?f=new RegExp(u,l):u&&(f=new RegExp(u.source,l)),f},m.prototype.get_literal_regexp=function(u){return RegExp(u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(u){var a=this.__position,f=this.readUntilAfter(u);return this.__position=a,f},m.prototype.lookBack=function(u){var a=this.__position-1;return a>=u.length&&this.__input.substring(a-u.length,a).toLowerCase()===u},g.exports.InputScanner=m},function(g,d,m){var u=m(8).InputScanner,a=m(3).Token,f=m(10).TokenStream,l=m(11).WhitespacePattern,h={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(s,A){this._input=new u(s),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 f,this._reset();for(var s,A=new a(h.START,""),_=null,S=[],L=new f;A.type!==h.EOF;){for(s=this._get_next_token(A,_);this._is_comment(s);)L.add(s),s=this._get_next_token(A,_);L.isEmpty()||(s.comments_before=L,L=new f),s.parent=_,this._is_opening(s)?(S.push(_),_=s):_&&this._is_closing(s,_)&&(s.opened=_,_.closed=s,_=S.pop(),s.parent=_),s.previous=A,A.next=s,this.__tokens.add(s),A=s}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(s,A){this._readWhitespace();var _=this._input.read(/.+/g);return _?this._create_token(h.RAW,_):this._create_token(h.EOF,"")},o.prototype._is_comment=function(s){return!1},o.prototype._is_opening=function(s){return!1},o.prototype._is_closing=function(s,A){return!1},o.prototype._create_token=function(s,A){var _=new a(s,A,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return _},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},g.exports.Tokenizer=o,g.exports.TOKEN=h},function(g){function d(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}d.prototype.restart=function(){this.__position=0},d.prototype.isEmpty=function(){return this.__tokens_length===0},d.prototype.hasNext=function(){return this.__position<this.__tokens_length},d.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__tokens[this.__position],this.__position+=1),m},d.prototype.peek=function(m){var u=null;return m=m||0,m+=this.__position,m>=0&&m<this.__tokens_length&&(u=this.__tokens[m]),u},d.prototype.add=function(m){this.__parent_token&&(m.parent=this.__parent_token),this.__tokens.push(m),this.__tokens_length+=1},g.exports.TokenStream=d},function(g,d,m){var u=m(12).Pattern;function a(f,l){u.call(this,f,l),l?this._line_regexp=this._input.get_regexp(l._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}a.prototype=new u,a.prototype.__set_whitespace_patterns=function(f,l){f+="\\t ",l+="\\n\\r",this._match_pattern=this._input.get_regexp("["+f+l+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+l+"]")},a.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 l=this.__split(this._newline_regexp,f);this.newline_count=l.length-1,this.whitespace_before_token=l[this.newline_count]}return f},a.prototype.matching=function(f,l){var h=this._create();return h.__set_whitespace_patterns(f,l),h._update(),h},a.prototype._create=function(){return new a(this._input,this)},a.prototype.__split=function(f,l){f.lastIndex=0;for(var h=0,o=[],s=f.exec(l);s;)o.push(l.substring(h,s.index)),h=s.index+s[0].length,s=f.exec(l);return h<l.length?o.push(l.substring(h,l.length)):o.push(""),o},g.exports.WhitespacePattern=a},function(g){function d(m,u){this._input=m,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,u&&(this._starting_pattern=this._input.get_regexp(u._starting_pattern,!0),this._match_pattern=this._input.get_regexp(u._match_pattern,!0),this._until_pattern=this._input.get_regexp(u._until_pattern),this._until_after=u._until_after)}d.prototype.read=function(){var m=this._input.read(this._starting_pattern);return(!this._starting_pattern||m)&&(m+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),m},d.prototype.read_match=function(){return this._input.match(this._match_pattern)},d.prototype.until_after=function(m){var u=this._create();return u._until_after=!0,u._until_pattern=this._input.get_regexp(m),u._update(),u},d.prototype.until=function(m){var u=this._create();return u._until_after=!1,u._until_pattern=this._input.get_regexp(m),u._update(),u},d.prototype.starting_with=function(m){var u=this._create();return u._starting_pattern=this._input.get_regexp(m,!0),u._update(),u},d.prototype.matching=function(m){var u=this._create();return u._match_pattern=this._input.get_regexp(m,!0),u._update(),u},d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){},g.exports.Pattern=d},function(g){function d(m,u){m=typeof m=="string"?m:m.source,u=typeof u=="string"?u:u.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+u,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+u,"g")}d.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var u={};this.__directive_pattern.lastIndex=0;for(var a=this.__directive_pattern.exec(m);a;)u[a[1]]=a[2],a=this.__directive_pattern.exec(m);return u},d.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},g.exports.Directives=d},function(g,d,m){var u=m(12).Pattern,a={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function f(l,h){u.call(this,l,h),this.__template_pattern=null,this._disabled=Object.assign({},a),this._excluded=Object.assign({},a),h&&(this.__template_pattern=this._input.get_regexp(h.__template_pattern),this._excluded=Object.assign(this._excluded,h._excluded),this._disabled=Object.assign(this._disabled,h._disabled));var o=new u(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}/)}}f.prototype=new u,f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){this.__set_templated_pattern()},f.prototype.disable=function(l){var h=this._create();return h._disabled[l]=!0,h._update(),h},f.prototype.read_options=function(l){var h=this._create();for(var o in a)h._disabled[o]=l.templating.indexOf(o)===-1;return h._update(),h},f.prototype.exclude=function(l){var h=this._create();return h._excluded[l]=!0,h._update(),h},f.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 h=this._read_template();h;)this._match_pattern?h+=this._input.read(this._match_pattern):h+=this._input.readUntil(this.__template_pattern),l+=h,h=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},f.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("|")+")")},f.prototype._read_template=function(){var l="",h=this._input.peek();if(h==="<"){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 h==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(l=l||this.__patterns.handlebars_comment.read(),l=l||this.__patterns.handlebars_unescaped.read(),l=l||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(l=l||this.__patterns.django_value.read()),this._excluded.django||(l=l||this.__patterns.django_comment.read(),l=l||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(l=l||this.__patterns.smarty_comment.read(),l=l||this.__patterns.smarty_literal.read(),l=l||this.__patterns.smarty.read()));return l},g.exports.TemplatablePattern=f},,,,function(g,d,m){var u=m(19).Beautifier,a=m(20).Options;function f(l,h,o,s){var A=new u(l,h,o,s);return A.beautify()}g.exports=f,g.exports.defaultOptions=function(){return new a}},function(g,d,m){var u=m(20).Options,a=m(2).Output,f=m(21).Tokenizer,l=m(21).TOKEN,h=/\r\n|[\r\n]/,o=/\r\n|[\r\n]/g,s=function(T,v){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=T.max_preserve_newlines,this.preserve_newlines=T.preserve_newlines,this._output=new a(T,v)};s.prototype.current_line_has_match=function(T){return this._output.current_line.has_match(T)},s.prototype.set_space_before_token=function(T,v){this._output.space_before_token=T,this._output.non_breaking_space=v},s.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},s.prototype.add_raw_token=function(T){this._output.add_raw_token(T)},s.prototype.print_preserved_newlines=function(T){var v=0;T.type!==l.TEXT&&T.previous.type!==l.TEXT&&(v=T.newlines?1:0),this.preserve_newlines&&(v=T.newlines<this.max_preserve_newlines+1?T.newlines:this.max_preserve_newlines+1);for(var y=0;y<v;y++)this.print_newline(y>0);return v!==0},s.prototype.traverse_whitespace=function(T){return T.whitespace_before||T.newlines?(this.print_preserved_newlines(T)||(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(T){this._output.add_new_line(T)},s.prototype.print_token=function(T){T.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(T.text))},s.prototype.indent=function(){this.indent_level++},s.prototype.get_full_indent=function(T){return T=this.indent_level+(T||0),T<1?"":this._output.get_indent_string(T)};var A=function(T){for(var v=null,y=T.next;y.type!==l.EOF&&T.closed!==y;){if(y.type===l.ATTRIBUTE&&y.text==="type"){y.next&&y.next.type===l.EQUALS&&y.next.next&&y.next.next.type===l.VALUE&&(v=y.next.next.text);break}y=y.next}return v},_=function(T,v){var y=null,N=null;return v.closed?(T==="script"?y="text/javascript":T==="style"&&(y="text/css"),y=A(v)||y,y.search("text/css")>-1?N="css":y.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?N="javascript":y.search(/(text|application|dojo)\/(x-)?(html)/)>-1?N="html":y.search(/test\/null/)>-1&&(N="null"),N):null};function S(T,v){return v.indexOf(T)!==-1}function L(T,v,y){this.parent=T||null,this.tag=v?v.tag_name:"",this.indent_level=y||0,this.parser_token=v||null}function O(T){this._printer=T,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(T){var v=new L(this._current_frame,T,this._printer.indent_level);this._current_frame=v},O.prototype._try_pop_frame=function(T){var v=null;return T&&(v=T.parser_token,this._printer.indent_level=T.indent_level,this._current_frame=T.parent),v},O.prototype._get_frame=function(T,v){for(var y=this._current_frame;y&&!(T.indexOf(y.tag)!==-1);){if(v&&v.indexOf(y.tag)!==-1){y=null;break}y=y.parent}return y},O.prototype.try_pop=function(T,v){var y=this._get_frame([T],v);return this._try_pop_frame(y)},O.prototype.indent_to_tag=function(T){var v=this._get_frame(T);v&&(this._printer.indent_level=v.indent_level)};function C(T,v,y,N){this._source_text=T||"",v=v||{},this._js_beautify=y,this._css_beautify=N,this._tag_stack=null;var B=new u(v,"html");this._options=B,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}C.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var T=this._source_text,v=this._options.eol;this._options.eol==="auto"&&(v=`
|
|
`,T&&h.test(T)&&(v=T.match(h)[0])),T=T.replace(o,`
|
|
`);var y=T.match(/^[\t ]*/)[0],N={text:"",type:""},B=new w,R=new s(this._options,y),j=new f(T,this._options).tokenize();this._tag_stack=new O(R);for(var P=null,b=j.next();b.type!==l.EOF;)b.type===l.TAG_OPEN||b.type===l.COMMENT?(P=this._handle_tag_open(R,b,B,N),B=P):b.type===l.ATTRIBUTE||b.type===l.EQUALS||b.type===l.VALUE||b.type===l.TEXT&&!B.tag_complete?P=this._handle_inside_tag(R,b,B,j):b.type===l.TAG_CLOSE?P=this._handle_tag_close(R,b,B):b.type===l.TEXT?P=this._handle_text(R,b,B):R.add_raw_token(b),N=P,b=j.next();var X=R._output.get_code(v);return X},C.prototype._handle_tag_close=function(T,v,y){var N={text:v.text,type:v.type};return T.alignment_size=0,y.tag_complete=!0,T.set_space_before_token(v.newlines||v.whitespace_before!=="",!0),y.is_unformatted?T.add_raw_token(v):(y.tag_start_char==="<"&&(T.set_space_before_token(v.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&y.has_wrapped_attrs&&T.print_newline(!1)),T.print_token(v)),y.indent_content&&!(y.is_unformatted||y.is_content_unformatted)&&(T.indent(),y.indent_content=!1),!y.is_inline_element&&!(y.is_unformatted||y.is_content_unformatted)&&T.set_wrap_point(),N},C.prototype._handle_inside_tag=function(T,v,y,N){var B=y.has_wrapped_attrs,R={text:v.text,type:v.type};if(T.set_space_before_token(v.newlines||v.whitespace_before!=="",!0),y.is_unformatted)T.add_raw_token(v);else if(y.tag_start_char==="{"&&v.type===l.TEXT)T.print_preserved_newlines(v)?(v.newlines=0,T.add_raw_token(v)):T.print_token(v);else{if(v.type===l.ATTRIBUTE?(T.set_space_before_token(!0),y.attr_count+=1):(v.type===l.EQUALS||v.type===l.VALUE&&v.previous.type===l.EQUALS)&&T.set_space_before_token(!1),v.type===l.ATTRIBUTE&&y.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(T.traverse_whitespace(v),B=B||v.newlines!==0),this._is_wrap_attributes_force)){var j=y.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&y.attr_count===1){var P=!0,b=0,X;do{if(X=N.peek(b),X.type===l.ATTRIBUTE){P=!1;break}b+=1}while(b<4&&X.type!==l.EOF&&X.type!==l.TAG_CLOSE);j=!P}j&&(T.print_newline(!1),B=!0)}T.print_token(v),B=B||T.previous_token_wrapped(),y.has_wrapped_attrs=B}return R},C.prototype._handle_text=function(T,v,y){var N={text:v.text,type:"TK_CONTENT"};return y.custom_beautifier_name?this._print_custom_beatifier_text(T,v,y):y.is_unformatted||y.is_content_unformatted?T.add_raw_token(v):(T.traverse_whitespace(v),T.print_token(v)),N},C.prototype._print_custom_beatifier_text=function(T,v,y){var N=this;if(v.text!==""){var B=v.text,R,j=1,P="",b="";y.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?R=this._js_beautify:y.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?R=this._css_beautify:y.custom_beautifier_name==="html"&&(R=function(Ee,Te){var Ae=new C(Ee,Te,N._js_beautify,N._css_beautify);return Ae.beautify()}),this._options.indent_scripts==="keep"?j=0:this._options.indent_scripts==="separate"&&(j=-T.indent_level);var X=T.get_full_indent(j);if(B=B.replace(/\n[ \t]*$/,""),y.custom_beautifier_name!=="html"&&B[0]==="<"&&B.match(/^(<!--|<!\[CDATA\[)/)){var ee=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(B);if(!ee){T.add_raw_token(v);return}P=X+ee[1]+`
|
|
`,B=ee[4],ee[5]&&(b=X+ee[5]),B=B.replace(/\n[ \t]*$/,""),(ee[2]||ee[3].indexOf(`
|
|
`)!==-1)&&(ee=ee[3].match(/[ \t]+$/),ee&&(v.whitespace_before=ee[0]))}if(B)if(R){var ae=function(){this.eol=`
|
|
`};ae.prototype=this._options.raw_options;var le=new ae;B=R(X+B,le)}else{var Re=v.whitespace_before;Re&&(B=B.replace(new RegExp(`
|
|
(`+Re+")?","g"),`
|
|
`)),B=X+B.replace(/\n/g,`
|
|
`+X)}P&&(B?B=P+B+`
|
|
`+b:B=P+b),T.print_newline(!1),B&&(v.text=B,v.whitespace_before="",v.newlines=0,T.add_raw_token(v),T.print_newline(!0))}},C.prototype._handle_tag_open=function(T,v,y,N){var B=this._get_tag_open_token(v);return(y.is_unformatted||y.is_content_unformatted)&&!y.is_empty_element&&v.type===l.TAG_OPEN&&v.text.indexOf("</")===0?(T.add_raw_token(v),B.start_tag_token=this._tag_stack.try_pop(B.tag_name)):(T.traverse_whitespace(v),this._set_tag_position(T,v,B,y,N),B.is_inline_element||T.set_wrap_point(),T.print_token(v)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(B.alignment_size=v.text.length+1),!B.tag_complete&&!B.is_unformatted&&(T.alignment_size=B.alignment_size),B};var w=function(T,v){if(this.parent=T||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!v)this.tag_complete=!0;else{var y;this.tag_start_char=v.text[0],this.text=v.text,this.tag_start_char==="<"?(y=v.text.match(/^<([^\s>]*)/),this.tag_check=y?y[1]:""):(y=v.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=y?y[1]:"",(v.text.startsWith("{{#>")||v.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&v.next!==null?this.tag_check=v.next.text.split(" ")[0]:this.tag_check=v.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),v.type===l.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||v.closed&&v.closed.text==="/>";var N=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(N=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(N)))}};C.prototype._get_tag_open_token=function(T){var v=new w(this._tag_stack.get_parser_token(),T);return v.alignment_size=this._options.wrap_attributes_indent_size,v.is_end_tag=v.is_end_tag||S(v.tag_check,this._options.void_elements),v.is_empty_element=v.tag_complete||v.is_start_tag&&v.is_end_tag,v.is_unformatted=!v.tag_complete&&S(v.tag_check,this._options.unformatted),v.is_content_unformatted=!v.is_empty_element&&S(v.tag_check,this._options.content_unformatted),v.is_inline_element=S(v.tag_name,this._options.inline)||v.tag_name.includes("-")||v.tag_start_char==="{",v},C.prototype._set_tag_position=function(T,v,y,N,B){if(y.is_empty_element||(y.is_end_tag?y.start_tag_token=this._tag_stack.try_pop(y.tag_name):(this._do_optional_end_element(y)&&(y.is_inline_element||T.print_newline(!1)),this._tag_stack.record_tag(y),(y.tag_name==="script"||y.tag_name==="style")&&!(y.is_unformatted||y.is_content_unformatted)&&(y.custom_beautifier_name=_(y.tag_check,v)))),S(y.tag_check,this._options.extra_liners)&&(T.print_newline(!1),T._output.just_added_blankline()||T.print_newline(!0)),y.is_empty_element){if(y.tag_start_char==="{"&&y.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),y.indent_content=!0;var R=T.current_line_has_match(/{{#if/);R||T.print_newline(!1)}y.tag_name==="!--"&&B.type===l.TAG_CLOSE&&N.is_end_tag&&y.text.indexOf(`
|
|
`)===-1||(y.is_inline_element||y.is_unformatted||T.print_newline(!1),this._calcluate_parent_multiline(T,y))}else if(y.is_end_tag){var j=!1;j=y.start_tag_token&&y.start_tag_token.multiline_content,j=j||!y.is_inline_element&&!(N.is_inline_element||N.is_unformatted)&&!(B.type===l.TAG_CLOSE&&y.start_tag_token===N)&&B.type!=="TK_CONTENT",(y.is_content_unformatted||y.is_unformatted)&&(j=!1),j&&T.print_newline(!1)}else y.indent_content=!y.custom_beautifier_name,y.tag_start_char==="<"&&(y.tag_name==="html"?y.indent_content=this._options.indent_inner_html:y.tag_name==="head"?y.indent_content=this._options.indent_head_inner_html:y.tag_name==="body"&&(y.indent_content=this._options.indent_body_inner_html)),!(y.is_inline_element||y.is_unformatted)&&(B.type!=="TK_CONTENT"||y.is_content_unformatted)&&T.print_newline(!1),this._calcluate_parent_multiline(T,y)},C.prototype._calcluate_parent_multiline=function(T,v){v.parent&&T._output.just_added_newline()&&!((v.is_inline_element||v.is_unformatted)&&v.parent.is_inline_element)&&(v.parent.multiline_content=!0)};var x=["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"],p=["a","audio","del","ins","map","noscript","video"];C.prototype._do_optional_end_element=function(T){var v=null;if(T.is_empty_element||!T.is_start_tag||!T.parent)return;if(T.tag_name==="body")v=v||this._tag_stack.try_pop("head");else if(T.tag_name==="li")v=v||this._tag_stack.try_pop("li",["ol","ul"]);else if(T.tag_name==="dd"||T.tag_name==="dt")v=v||this._tag_stack.try_pop("dt",["dl"]),v=v||this._tag_stack.try_pop("dd",["dl"]);else if(T.parent.tag_name==="p"&&x.indexOf(T.tag_name)!==-1){var y=T.parent.parent;(!y||p.indexOf(y.tag_name)===-1)&&(v=v||this._tag_stack.try_pop("p"))}else T.tag_name==="rp"||T.tag_name==="rt"?(v=v||this._tag_stack.try_pop("rt",["ruby","rtc"]),v=v||this._tag_stack.try_pop("rp",["ruby","rtc"])):T.tag_name==="optgroup"?v=v||this._tag_stack.try_pop("optgroup",["select"]):T.tag_name==="option"?v=v||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):T.tag_name==="colgroup"?v=v||this._tag_stack.try_pop("caption",["table"]):T.tag_name==="thead"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"])):T.tag_name==="tbody"||T.tag_name==="tfoot"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"]),v=v||this._tag_stack.try_pop("thead",["table"]),v=v||this._tag_stack.try_pop("tbody",["table"])):T.tag_name==="tr"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"]),v=v||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(T.tag_name==="th"||T.tag_name==="td")&&(v=v||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),v=v||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return T.parent=this._tag_stack.get_parser_token(),v},g.exports.Beautifier=C},function(g,d,m){var u=m(6).Options;function a(f){u.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"])}a.prototype=new u,g.exports.Options=a},function(g,d,m){var u=m(9).Tokenizer,a=m(9).TOKEN,f=m(13).Directives,l=m(14).TemplatablePattern,h=m(12).Pattern,o={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:a.START,RAW:a.RAW,EOF:a.EOF},s=new f(/<\!--/,/-->/),A=function(_,S){u.call(this,_,S),this._current_tag_name="";var L=new l(this._input).read_options(this._options),O=new h(this._input);if(this.__patterns={word:L.until(/[\n\r\t <]/),single_quote:L.until_after(/'/),double_quote:L.until_after(/"/),attribute:L.until(/[\n\r\t =>]|\/>/),element_name:L.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 C=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=O.matching(C).until_after(C)}};A.prototype=new u,A.prototype._is_comment=function(_){return!1},A.prototype._is_opening=function(_){return _.type===o.TAG_OPEN},A.prototype._is_closing=function(_,S){return _.type===o.TAG_CLOSE&&S&&((_.text===">"||_.text==="/>")&&S.text[0]==="<"||_.text==="}}"&&S.text[0]==="{"&&S.text[1]==="{")},A.prototype._reset=function(){this._current_tag_name=""},A.prototype._get_next_token=function(_,S){var L=null;this._readWhitespace();var O=this._input.peek();return O===null?this._create_token(o.EOF,""):(L=L||this._read_open_handlebars(O,S),L=L||this._read_attribute(O,_,S),L=L||this._read_close(O,S),L=L||this._read_raw_content(O,_,S),L=L||this._read_content_word(O),L=L||this._read_comment_or_cdata(O),L=L||this._read_processing(O),L=L||this._read_open(O,S),L=L||this._create_token(o.UNKNOWN,this._input.next()),L)},A.prototype._read_comment_or_cdata=function(_){var S=null,L=null,O=null;if(_==="<"){var C=this._input.peek(1);C==="!"&&(L=this.__patterns.comment.read(),L?(O=s.get_directives(L),O&&O.ignore==="start"&&(L+=s.readIgnored(this._input))):L=this.__patterns.cdata.read()),L&&(S=this._create_token(o.COMMENT,L),S.directives=O)}return S},A.prototype._read_processing=function(_){var S=null,L=null,O=null;if(_==="<"){var C=this._input.peek(1);(C==="!"||C==="?")&&(L=this.__patterns.conditional_comment.read(),L=L||this.__patterns.processing.read()),L&&(S=this._create_token(o.COMMENT,L),S.directives=O)}return S},A.prototype._read_open=function(_,S){var L=null,O=null;return S||_==="<"&&(L=this._input.next(),this._input.peek()==="/"&&(L+=this._input.next()),L+=this.__patterns.element_name.read(),O=this._create_token(o.TAG_OPEN,L)),O},A.prototype._read_open_handlebars=function(_,S){var L=null,O=null;return S||this._options.indent_handlebars&&_==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(L=this.__patterns.handlebars_comment.read(),L=L||this.__patterns.handlebars.read(),O=this._create_token(o.COMMENT,L)):(L=this.__patterns.handlebars_open.read(),O=this._create_token(o.TAG_OPEN,L))),O},A.prototype._read_close=function(_,S){var L=null,O=null;return S&&(S.text[0]==="<"&&(_===">"||_==="/"&&this._input.peek(1)===">")?(L=this._input.next(),_==="/"&&(L+=this._input.next()),O=this._create_token(o.TAG_CLOSE,L)):S.text[0]==="{"&&_==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),O=this._create_token(o.TAG_CLOSE,"}}"))),O},A.prototype._read_attribute=function(_,S,L){var O=null,C="";if(L&&L.text[0]==="<")if(_==="=")O=this._create_token(o.EQUALS,this._input.next());else if(_==='"'||_==="'"){var w=this._input.next();_==='"'?w+=this.__patterns.double_quote.read():w+=this.__patterns.single_quote.read(),O=this._create_token(o.VALUE,w)}else C=this.__patterns.attribute.read(),C&&(S.type===o.EQUALS?O=this._create_token(o.VALUE,C):O=this._create_token(o.ATTRIBUTE,C));return O},A.prototype._is_content_unformatted=function(_){return this._options.void_elements.indexOf(_)===-1&&(this._options.content_unformatted.indexOf(_)!==-1||this._options.unformatted.indexOf(_)!==-1)},A.prototype._read_raw_content=function(_,S,L){var O="";if(L&&L.text[0]==="{")O=this.__patterns.handlebars_raw_close.read();else if(S.type===o.TAG_CLOSE&&S.opened.text[0]==="<"&&S.text[0]!=="/"){var C=S.opened.text.substr(1).toLowerCase();if(C==="script"||C==="style"){var w=this._read_comment_or_cdata(_);if(w)return w.type=o.TEXT,w;O=this._input.readUntil(new RegExp("</"+C+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(C)&&(O=this._input.readUntil(new RegExp("</"+C+"[\\n\\r\\t ]*?>","ig")))}return O?this._create_token(o.TEXT,O):null},A.prototype._read_content_word=function(_){var S="";if(this._options.unformatted_content_delimiter&&(_===this._options.unformatted_content_delimiter[0]&&(S=this.__patterns.unformatted_content_delimiter.read())),S||(S=this.__patterns.word.read()),S)return this._create_token(o.TEXT,S)},g.exports.Tokenizer=A,g.exports.TOKEN=o}],W={};function i(g){var d=W[g];if(d!==void 0)return d.exports;var m=W[g]={exports:{}};return G[g](m,m.exports,i),m.exports}var D=i(18);M=D})();var Y=M;if(!0)!(ie=[J,J("6UM0"),J("TXwP")],$=function(G){var W=J("6UM0"),i=J("TXwP");return{html_beautify:function(D,g){return Y(D,g,W.js_beautify,i.css_beautify)}}}.apply(ge,ie),$!==void 0&&(at.exports=$));else var F,U})()},"rAM+":function(at,ge,J){"use strict";J.d(ge,"a",function(){return $});var ie=J("Qw5x");function $(M,Y){var F;if(typeof Symbol=="undefined"||M[Symbol.iterator]==null){if(Array.isArray(M)||(F=Object(ie.a)(M))||Y&&M&&typeof M.length=="number"){F&&(M=F);var U=0,G=function(){};return{s:G,n:function(){return U>=M.length?{done:!0}:{done:!1,value:M[U++]}},e:function(d){throw d},f:G}}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 W=!0,i=!1,D;return{s:function(){F=M[Symbol.iterator]()},n:function(){var d=F.next();return W=d.done,d},e:function(d){i=!0,D=d},f:function(){try{!W&&F.return!=null&&F.return()}finally{if(i)throw D}}}}},rUJ1:function(at,ge){const J=/[&<>"']/,ie=/[&<>"']/g,$=/[<>"']|&(?!#?\w+;)/,M=/[<>"']|&(?!#?\w+;)/g,Y={"&":"&","<":"<",">":">",'"':""","'":"'"},F=O=>Y[O];function U(O,C){if(C){if(J.test(O))return O.replace(ie,F)}else if($.test(O))return O.replace(M,F);return O}const G=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function W(O){return O.replace(G,(C,w)=>(w=w.toLowerCase(),w==="colon"?":":w.charAt(0)==="#"?w.charAt(1)==="x"?String.fromCharCode(parseInt(w.substring(2),16)):String.fromCharCode(+w.substring(1)):""))}const i=/(^|[^\[])\^/g;function D(O,C){O=O.source||O,C=C||"";const w={replace:(x,p)=>(p=p.source||p,p=p.replace(i,"$1"),O=O.replace(x,p),w),getRegex:()=>new RegExp(O,C)};return w}const g=/[^\w:]/g,d=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function m(O,C,w){if(O){let x;try{x=decodeURIComponent(W(w)).replace(g,"").toLowerCase()}catch(p){return null}if(x.indexOf("javascript:")===0||x.indexOf("vbscript:")===0||x.indexOf("data:")===0)return null}C&&!d.test(w)&&(w=h(C,w));try{w=encodeURI(w).replace(/%25/g,"%")}catch(x){return null}return w}const u={},a=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function h(O,C){u[" "+O]||(a.test(O)?u[" "+O]=O+"/":u[" "+O]=_(O,"/",!0)),O=u[" "+O];const w=O.indexOf(":")===-1;return C.substring(0,2)==="//"?w?C:O.replace(f,"$1")+C:C.charAt(0)==="/"?w?C:O.replace(l,"$1")+C:O+C}const o={exec:function(){}};function s(O){let C=1,w,x;for(;C<arguments.length;C++){w=arguments[C];for(x in w)Object.prototype.hasOwnProperty.call(w,x)&&(O[x]=w[x])}return O}function A(O,C){const w=O.replace(/\|/g,(T,v,y)=>{let N=!1,B=v;for(;--B>=0&&y[B]==="\\";)N=!N;return N?"|":" |"}),x=w.split(/ \|/);let p=0;if(x.length>C)x.splice(C);else for(;x.length<C;)x.push("");for(;p<x.length;p++)x[p]=x[p].trim().replace(/\\\|/g,"|");return x}function _(O,C,w){const x=O.length;if(x===0)return"";let p=0;for(;p<x;){const T=O.charAt(x-p-1);if(T===C&&!w)p++;else if(T!==C&&w)p++;else break}return O.substr(0,x-p)}function S(O,C){if(O.indexOf(C[1])===-1)return-1;const w=O.length;let x=0,p=0;for(;p<w;p++)if(O[p]==="\\")p++;else if(O[p]===C[0])x++;else if(O[p]===C[1]&&(x--,x<0))return p;return-1}function L(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")}at.exports={escape:U,unescape:W,edit:D,cleanUrl:m,resolveUrl:h,noopTest:o,merge:s,splitCells:A,rtrim:_,findClosingBracket:S,checkSanitizeDeprecation:L}},t9D7:function(at,ge,J){"use strict";J.d(ge,"b",function(){return G}),J.d(ge,"g",function(){return i}),J.d(ge,"d",function(){return D}),J.d(ge,"e",function(){return g}),J.d(ge,"a",function(){return d}),J.d(ge,"f",function(){return a}),J.d(ge,"c",function(){return f});var ie=J("Vhoy"),$=J("MI8n"),M=J("pmY6"),Y=J("Cg/j"),F=J("ic2d"),U=J("nEHx");const G=Object(Y.c)("themeService");var W;(function(l){function h(o){return o&&typeof o=="object"&&typeof o.id=="string"}l.isThemeColor=h})(W||(W={}));function i(l){return{id:l}}var D;(function(l){function h(L){return L&&typeof L=="object"&&typeof L.id=="string"&&(typeof L.color=="undefined"||W.isThemeColor(L.color))}l.isThemeIcon=h;const o=new RegExp(`^\\$\\((${ie.a.iconNameExpression}(?:${ie.a.iconModifierExpression})?)\\)$`);function s(L){const O=o.exec(L);if(!O)return;let[,C]=O;return{id:C}}l.fromString=s;function A(L,O){let C=L.id;const w=C.lastIndexOf("~");return w!==-1&&(C=C.substring(0,w)),O&&(C=`${C}~${O}`),{id:C}}l.modify=A;function _(L,O){var C,w;return L.id===O.id&&((C=L.color)===null||C===void 0?void 0:C.id)===((w=O.color)===null||w===void 0?void 0:w.id)}l.isEqual=_;function S(L,O){return{id:L.id,color:O?i(O):void 0}}l.asThemeIcon=S,l.asClassNameArray=ie.a.asClassNameArray,l.asClassName=ie.a.asClassName,l.asCSSSelector=ie.a.asCSSSelector})(D||(D={}));function g(l){switch(l){case U.a.DARK:return"vs-dark";case U.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const d={ThemingContribution:"base.contributions.theming"};class m{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new $.b}onColorThemeChange(l){return this.themingParticipants.push(l),this.onThemingParticipantAddedEmitter.fire(l),Object(M.i)(()=>{const h=this.themingParticipants.indexOf(l);this.themingParticipants.splice(h,1)})}getThemingParticipants(){return this.themingParticipants}}let u=new m;F.a.add(d.ThemingContribution,u);function a(l){return u.onColorThemeChange(l)}class f extends M.a{constructor(l){super();this.themeService=l,this.theme=l.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(h=>this.onThemeChange(h)))}onThemeChange(l){this.theme=l,this.updateStyles()}updateStyles(){}}},ulZh:function(at,ge,J){typeof window!="undefined"&&function($,M){at.exports=M()}(this,function(){return function(ie){var $={};function M(Y){if($[Y])return $[Y].exports;var F=$[Y]={i:Y,l:!1,exports:{}};return ie[Y].call(F.exports,F,F.exports,M),F.l=!0,F.exports}return M.m=ie,M.c=$,M.d=function(Y,F,U){M.o(Y,F)||Object.defineProperty(Y,F,{enumerable:!0,get:U})},M.r=function(Y){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Y,"__esModule",{value:!0})},M.t=function(Y,F){if(F&1&&(Y=M(Y)),F&8)return Y;if(F&4&&typeof Y=="object"&&Y&&Y.__esModule)return Y;var U=Object.create(null);if(M.r(U),Object.defineProperty(U,"default",{enumerable:!0,value:Y}),F&2&&typeof Y!="string")for(var G in Y)M.d(U,G,function(W){return Y[W]}.bind(null,G));return U},M.n=function(Y){var F=Y&&Y.__esModule?function(){return Y.default}:function(){return Y};return M.d(F,"a",F),F},M.o=function(Y,F){return Object.prototype.hasOwnProperty.call(Y,F)},M.p="/dist/",M(M.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ie,$,M){"use strict";var Y=Object.prototype.hasOwnProperty,F="~";function U(){}Object.create&&(U.prototype=Object.create(null),new U().__proto__||(F=!1));function G(g,d,m){this.fn=g,this.context=d,this.once=m||!1}function W(g,d,m,u,a){if(typeof m!="function")throw new TypeError("The listener must be a function");var f=new G(m,u||g,a),l=F?F+d:d;return g._events[l]?g._events[l].fn?g._events[l]=[g._events[l],f]:g._events[l].push(f):(g._events[l]=f,g._eventsCount++),g}function i(g,d){--g._eventsCount===0?g._events=new U:delete g._events[d]}function D(){this._events=new U,this._eventsCount=0}D.prototype.eventNames=function(){var d=[],m,u;if(this._eventsCount===0)return d;for(u in m=this._events)Y.call(m,u)&&d.push(F?u.slice(1):u);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(m)):d},D.prototype.listeners=function(d){var m=F?F+d:d,u=this._events[m];if(!u)return[];if(u.fn)return[u.fn];for(var a=0,f=u.length,l=new Array(f);a<f;a++)l[a]=u[a].fn;return l},D.prototype.listenerCount=function(d){var m=F?F+d:d,u=this._events[m];return u?u.fn?1:u.length:0},D.prototype.emit=function(d,m,u,a,f,l){var h=F?F+d:d;if(!this._events[h])return!1;var o=this._events[h],s=arguments.length,A,_;if(o.fn){o.once&&this.removeListener(d,o.fn,void 0,!0);switch(s){case 1:return o.fn.call(o.context),!0;case 2:return o.fn.call(o.context,m),!0;case 3:return o.fn.call(o.context,m,u),!0;case 4:return o.fn.call(o.context,m,u,a),!0;case 5:return o.fn.call(o.context,m,u,a,f),!0;case 6:return o.fn.call(o.context,m,u,a,f,l),!0}for(_=1,A=new Array(s-1);_<s;_++)A[_-1]=arguments[_];o.fn.apply(o.context,A)}else{var S=o.length,L;for(_=0;_<S;_++){o[_].once&&this.removeListener(d,o[_].fn,void 0,!0);switch(s){case 1:o[_].fn.call(o[_].context);break;case 2:o[_].fn.call(o[_].context,m);break;case 3:o[_].fn.call(o[_].context,m,u);break;case 4:o[_].fn.call(o[_].context,m,u,a);break;default:if(!A)for(L=1,A=new Array(s-1);L<s;L++)A[L-1]=arguments[L];o[_].fn.apply(o[_].context,A)}}}return!0},D.prototype.on=function(d,m,u){return W(this,d,m,u,!1)},D.prototype.once=function(d,m,u){return W(this,d,m,u,!0)},D.prototype.removeListener=function(d,m,u,a){var f=F?F+d:d;if(!this._events[f])return this;if(!m)return i(this,f),this;var l=this._events[f];if(l.fn)l.fn===m&&(!a||l.once)&&(!u||l.context===u)&&i(this,f);else{for(var h=0,o=[],s=l.length;h<s;h++)(l[h].fn!==m||a&&!l[h].once||u&&l[h].context!==u)&&o.push(l[h]);o.length?this._events[f]=o.length===1?o[0]:o:i(this,f)}return this},D.prototype.removeAllListeners=function(d){var m;return d?(m=F?F+d:d,this._events[m]&&i(this,m)):(this._events=new U,this._eventsCount=0),this},D.prototype.off=D.prototype.removeListener,D.prototype.addListener=D.prototype.on,D.prefixed=F,D.EventEmitter=D,ie.exports=D},"./node_modules/url-toolkit/src/url-toolkit.js":function(ie,$,M){(function(Y){var F=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,U=/^([^\/?#]*)([^]*)$/,G=/(?:\/|^)\.(?=\/)/g,W=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,i={buildAbsoluteURL:function(D,g,d){if(d=d||{},D=D.trim(),g=g.trim(),!g){if(!d.alwaysNormalize)return D;var m=i.parseURL(D);if(!m)throw new Error("Error trying to parse base URL.");return m.path=i.normalizePath(m.path),i.buildURLFromParts(m)}var u=i.parseURL(g);if(!u)throw new Error("Error trying to parse relative URL.");if(u.scheme)return d.alwaysNormalize?(u.path=i.normalizePath(u.path),i.buildURLFromParts(u)):g;var a=i.parseURL(D);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&a.path[0]!=="/"){var f=U.exec(a.path);a.netLoc=f[1],a.path=f[2]}a.netLoc&&!a.path&&(a.path="/");var l={scheme:a.scheme,netLoc:u.netLoc,path:null,params:u.params,query:u.query,fragment:u.fragment};if(!u.netLoc&&(l.netLoc=a.netLoc,u.path[0]!=="/"))if(!u.path)l.path=a.path,u.params||(l.params=a.params,u.query||(l.query=a.query));else{var h=a.path,o=h.substring(0,h.lastIndexOf("/")+1)+u.path;l.path=i.normalizePath(o)}return l.path===null&&(l.path=d.alwaysNormalize?i.normalizePath(u.path):u.path),i.buildURLFromParts(l)},parseURL:function(D){var g=F.exec(D);return g?{scheme:g[1]||"",netLoc:g[2]||"",path:g[3]||"",params:g[4]||"",query:g[5]||"",fragment:g[6]||""}:null},normalizePath:function(D){for(D=D.split("").reverse().join("").replace(G,"");D.length!==(D=D.replace(W,"")).length;);return D.split("").reverse().join("")},buildURLFromParts:function(D){return D.scheme+D.netLoc+D.path+D.params+D.query+D.fragment}};ie.exports=i})(this)},"./node_modules/webworkify-webpack/index.js":function(ie,$,M){function Y(d){var m={};function u(f){if(m[f])return m[f].exports;var l=m[f]={i:f,l:!1,exports:{}};return d[f].call(l.exports,l,l.exports,u),l.l=!0,l.exports}u.m=d,u.c=m,u.i=function(f){return f},u.d=function(f,l,h){u.o(f,l)||Object.defineProperty(f,l,{configurable:!1,enumerable:!0,get:h})},u.r=function(f){Object.defineProperty(f,"__esModule",{value:!0})},u.n=function(f){var l=f&&f.__esModule?function(){return f.default}:function(){return f};return u.d(l,"a",l),l},u.o=function(f,l){return Object.prototype.hasOwnProperty.call(f,l)},u.p="/",u.oe=function(f){throw console.error(f),f};var a=u(u.s=ENTRY_MODULE);return a.default||a}var F="[\\.|\\-|\\+|\\w|/|@]+",U="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+F+").*?\\)";function G(d){return(d+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function W(d){return!isNaN(1*d)}function i(d,m,u){var a={};a[u]=[];var f=m.toString(),l=f.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!l)return a;for(var h=l[1],o=new RegExp("(\\\\n|\\W)"+G(h)+U,"g"),s;s=o.exec(f);){if(s[3]==="dll-reference")continue;a[u].push(s[3])}for(o=new RegExp("\\("+G(h)+'\\("(dll-reference\\s('+F+'))"\\)\\)'+U,"g");s=o.exec(f);)d[s[2]]||(a[u].push(s[1]),d[s[2]]=M(s[1]).m),a[s[2]]=a[s[2]]||[],a[s[2]].push(s[4]);for(var A=Object.keys(a),_=0;_<A.length;_++)for(var S=0;S<a[A[_]].length;S++)W(a[A[_]][S])&&(a[A[_]][S]=1*a[A[_]][S]);return a}function D(d){var m=Object.keys(d);return m.reduce(function(u,a){return u||d[a].length>0},!1)}function g(d,m){for(var u={main:[m]},a={main:[]},f={main:{}};D(u);)for(var l=Object.keys(u),h=0;h<l.length;h++){var o=l[h],s=u[o],A=s.pop();if(f[o]=f[o]||{},f[o][A]||!d[o][A])continue;f[o][A]=!0,a[o]=a[o]||[],a[o].push(A);for(var _=i(d,d[o][A],o),S=Object.keys(_),L=0;L<S.length;L++)u[S[L]]=u[S[L]]||[],u[S[L]]=u[S[L]].concat(_[S[L]])}return a}ie.exports=function(d,m){m=m||{};var u={main:M.m},a=m.all?{main:Object.keys(u.main)}:g(u,d),f="";Object.keys(a).filter(function(A){return A!=="main"}).forEach(function(A){for(var _=0;a[A][_];)_++;a[A].push(_),u[A][_]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",f=f+"var "+A+" = ("+Y.toString().replace("ENTRY_MODULE",JSON.stringify(_))+")({"+a[A].map(function(S){return""+JSON.stringify(S)+": "+u[A][S].toString()}).join(",")+`});
|
|
`}),f=f+"new (("+Y.toString().replace("ENTRY_MODULE",JSON.stringify(d))+")({"+a.main.map(function(A){return""+JSON.stringify(A)+": "+u.main[A].toString()}).join(",")+"}))(self);";var l=new window.Blob([f],{type:"text/javascript"});if(m.bare)return l;var h=window.URL||window.webkitURL||window.mozURL||window.msURL,o=h.createObjectURL(l),s=new window.Worker(o);return s.objectURL=o,s}},"./src/config.ts":function(ie,$,M){"use strict";M.r($),M.d($,"hlsDefaultConfig",function(){return L}),M.d($,"mergeConfig",function(){return C}),M.d($,"enableStreamingMode",function(){return w});var Y=M("./src/controller/abr-controller.ts"),F=M("./src/controller/audio-stream-controller.ts"),U=M("./src/controller/audio-track-controller.ts"),G=M("./src/controller/subtitle-stream-controller.ts"),W=M("./src/controller/subtitle-track-controller.ts"),i=M("./src/controller/buffer-controller.ts"),D=M("./src/controller/timeline-controller.ts"),g=M("./src/controller/cap-level-controller.ts"),d=M("./src/controller/fps-controller.ts"),m=M("./src/controller/eme-controller.ts"),u=M("./src/controller/cmcd-controller.ts"),a=M("./src/utils/xhr-loader.ts"),f=M("./src/utils/fetch-loader.ts"),l=M("./src/utils/cues.ts"),h=M("./src/utils/mediakeys-helper.ts"),o=M("./src/utils/logger.ts");function s(){return s=Object.assign||function(x){for(var p=1;p<arguments.length;p++){var T=arguments[p];for(var v in T)Object.prototype.hasOwnProperty.call(T,v)&&(x[v]=T[v])}return x},s.apply(this,arguments)}function A(x,p){var T=Object.keys(x);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(x);p&&(v=v.filter(function(y){return Object.getOwnPropertyDescriptor(x,y).enumerable})),T.push.apply(T,v)}return T}function _(x){for(var p=1;p<arguments.length;p++){var T=arguments[p]!=null?arguments[p]:{};p%2?A(Object(T),!0).forEach(function(v){S(x,v,T[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(T)):A(Object(T)).forEach(function(v){Object.defineProperty(x,v,Object.getOwnPropertyDescriptor(T,v))})}return x}function S(x,p,T){return p in x?Object.defineProperty(x,p,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[p]=T,x}var L=_(_({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:a.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Y.default,bufferController:i.default,capLevelController:g.default,fpsController:d.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:h.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},O()),{},{subtitleStreamController:G.SubtitleStreamController,subtitleTrackController:W.default,timelineController:D.TimelineController,audioStreamController:F.default,audioTrackController:U.default,emeController:m.default,cmcdController:u.default});function O(){return{cueHandler:l.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function C(x,p){if((p.liveSyncDurationCount||p.liveMaxLatencyDurationCount)&&(p.liveSyncDuration||p.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(p.liveMaxLatencyDurationCount!==void 0&&(p.liveSyncDurationCount===void 0||p.liveMaxLatencyDurationCount<=p.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(p.liveMaxLatencyDuration!==void 0&&(p.liveSyncDuration===void 0||p.liveMaxLatencyDuration<=p.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return s({},x,p)}function w(x){var p=x.loader;if(p!==f.default&&p!==a.default)o.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),x.progressive=!1;else{var T=Object(f.fetchSupported)();T&&(x.loader=f.default,x.progressive=!0,x.enableSoftwareAES=!0,o.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ie,$,M){"use strict";M.r($);var Y=M("./src/polyfills/number.ts"),F=M("./src/utils/ewma-bandwidth-estimator.ts"),U=M("./src/events.ts"),G=M("./src/utils/buffer-helper.ts"),W=M("./src/errors.ts"),i=M("./src/types/loader.ts"),D=M("./src/utils/logger.ts");function g(u,a){for(var f=0;f<a.length;f++){var l=a[f];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(u,l.key,l)}}function d(u,a,f){return a&&g(u.prototype,a),f&&g(u,f),u}var m=function(){function u(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 l=f.config;this.bwEstimator=new F.default(l.abrEwmaSlowVoD,l.abrEwmaFastVoD,l.abrEwmaDefaultEstimate),this.registerListeners()}var a=u.prototype;return a.registerListeners=function(){var l=this.hls;l.on(U.Events.FRAG_LOADING,this.onFragLoading,this),l.on(U.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(U.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.on(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(U.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var l=this.hls;l.off(U.Events.FRAG_LOADING,this.onFragLoading,this),l.off(U.Events.FRAG_LOADED,this.onFragLoaded,this),l.off(U.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.off(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(U.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},a.onFragLoading=function(l,h){var o=h.frag;if(o.type===i.PlaylistLevelType.MAIN&&!this.timer){var s;this.fragCurrent=o,this.partCurrent=(s=h.part)!=null?s:null,this.timer=self.setInterval(this.onCheck,100)}},a.onLevelLoaded=function(l,h){var o=this.hls.config;h.details.live?this.bwEstimator.update(o.abrEwmaSlowLive,o.abrEwmaFastLive):this.bwEstimator.update(o.abrEwmaSlowVoD,o.abrEwmaFastVoD)},a._abandonRulesCheck=function(){var l=this.fragCurrent,h=this.partCurrent,o=this.hls,s=o.autoLevelEnabled,A=o.config,_=o.media;if(!l||!_)return;var S=h?h.stats:l.stats,L=h?h.duration:l.duration;if(S.aborted){D.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()-S.loading.start,C=Math.abs(_.playbackRate);if(O<=500*L/C)return;var w=o.levels,x=o.minAutoLevel,p=w[l.level],T=S.total||Math.max(S.loaded,Math.round(L*p.maxBitrate/8)),v=Math.max(1,S.bwEstimate?S.bwEstimate/8:S.loaded*1e3/O),y=(T-S.loaded)/v,N=_.currentTime,B=(G.BufferHelper.bufferInfo(_,N,A.maxBufferHole).end-N)/C;if(B>=2*L/C||y<=B)return;var R=Number.POSITIVE_INFINITY,j;for(j=l.level-1;j>x;j--){var P=w[j].maxBitrate;if(R=L*P/(8*.8*v),R<B)break}if(R>=y)return;var b=this.bwEstimator.getEstimate();D.logger.warn("Fragment "+l.sn+(h?" part "+h.index:"")+" of level "+l.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+j+`
|
|
Current BW estimate: `+(Object(Y.isFiniteNumber)(b)?(b/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+y.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+R.toFixed(3)+` s
|
|
Time to underbuffer: `+B.toFixed(3)+" s"),o.nextLoadLevel=j,this.bwEstimator.sample(O,S.loaded),this.clearTimer(),l.loader&&(this.fragCurrent=this.partCurrent=null,l.loader.abort()),o.trigger(U.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:l,part:h,stats:S})},a.onFragLoaded=function(l,h){var o=h.frag,s=h.part;if(o.type===i.PlaylistLevelType.MAIN&&Object(Y.isFiniteNumber)(o.sn)){var A=s?s.stats:o.stats,_=s?s.duration:o.duration;if(this.clearTimer(),this.lastLoadedFragLevel=o.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var S=this.hls.levels[o.level],L=(S.loaded?S.loaded.bytes:0)+A.loaded,O=(S.loaded?S.loaded.duration:0)+_;S.loaded={bytes:L,duration:O},S.realBitrate=Math.round(8*L/O)}if(o.bitrateTest){var C={stats:A,frag:o,part:s,id:o.type};this.onFragBuffered(U.Events.FRAG_BUFFERED,C),o.bitrateTest=!1}}},a.onFragBuffered=function(l,h){var o=h.frag,s=h.part,A=s?s.stats:o.stats;if(A.aborted)return;if(o.type!==i.PlaylistLevelType.MAIN||o.sn==="initSegment")return;var _=A.parsing.end-A.loading.start;this.bwEstimator.sample(_,A.loaded),A.bwEstimate=this.bwEstimator.getEstimate(),o.bitrateTest?this.bitrateTestDelay=_/1e3:this.bitrateTestDelay=0},a.onError=function(l,h){switch(h.details){case W.ErrorDetails.FRAG_LOAD_ERROR:case W.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},a.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},a.getNextABRAutoLevel=function(){var l=this.fragCurrent,h=this.partCurrent,o=this.hls,s=o.maxAutoLevel,A=o.config,_=o.minAutoLevel,S=o.media,L=h?h.duration:l?l.duration:0,O=S?S.currentTime:0,C=S&&S.playbackRate!==0?Math.abs(S.playbackRate):1,w=this.bwEstimator?this.bwEstimator.getEstimate():A.abrEwmaDefaultEstimate,x=(G.BufferHelper.bufferInfo(S,O,A.maxBufferHole).end-O)/C,p=this.findBestLevel(w,_,s,x,A.abrBandWidthFactor,A.abrBandWidthUpFactor);if(p>=0)return p;D.logger.trace((x?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var T=L?Math.min(L,A.maxStarvationDelay):A.maxStarvationDelay,v=A.abrBandWidthFactor,y=A.abrBandWidthUpFactor;if(!x){var N=this.bitrateTestDelay;if(N){var B=L?Math.min(L,A.maxLoadingDelay):A.maxLoadingDelay;T=B-N,D.logger.trace("bitrate test took "+Math.round(1e3*N)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*T)+" ms"),v=y=1}}return p=this.findBestLevel(w,_,s,x+T,v,y),Math.max(p,0)},a.findBestLevel=function(l,h,o,s,A,_){for(var S,L=this.fragCurrent,O=this.partCurrent,C=this.lastLoadedFragLevel,w=this.hls.levels,x=w[C],p=!!(x!=null&&(S=x.details)!==null&&S!==void 0&&S.live),T=x==null?void 0:x.codecSet,v=O?O.duration:L?L.duration:0,y=o;y>=h;y--){var N=w[y];if(!N||T&&N.codecSet!==T)continue;var B=N.details,R=(O?B==null?void 0:B.partTarget:B==null?void 0:B.averagetargetduration)||v,j=void 0;y<=C?j=A*l:j=_*l;var P=w[y].maxBitrate,b=P*R/j;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+y+"/"+Math.round(j)+"/"+P+"/"+R+"/"+s+"/"+b),j>P&&(!b||p&&!this.bitrateTestDelay||b<s))return y}return-1},d(u,[{key:"nextAutoLevel",get:function(){var l=this._nextAutoLevel,h=this.bwEstimator;if(l!==-1&&(!h||!h.canEstimate()))return l;var o=this.getNextABRAutoLevel();return l!==-1&&(o=Math.min(l,o)),o},set:function(l){this._nextAutoLevel=l}}]),u}();$.default=m},"./src/controller/audio-stream-controller.ts":function(ie,$,M){"use strict";M.r($);var Y=M("./src/polyfills/number.ts"),F=M("./src/controller/base-stream-controller.ts"),U=M("./src/events.ts"),G=M("./src/utils/buffer-helper.ts"),W=M("./src/controller/fragment-tracker.ts"),i=M("./src/types/level.ts"),D=M("./src/types/loader.ts"),g=M("./src/loader/fragment.ts"),d=M("./src/demux/chunk-cache.ts"),m=M("./src/demux/transmuxer-interface.ts"),u=M("./src/types/transmuxer.ts"),a=M("./src/controller/fragment-finders.ts"),f=M("./src/utils/discontinuities.ts"),l=M("./src/errors.ts"),h=M("./src/utils/logger.ts");function o(){return o=Object.assign||function(L){for(var O=1;O<arguments.length;O++){var C=arguments[O];for(var w in C)Object.prototype.hasOwnProperty.call(C,w)&&(L[w]=C[w])}return L},o.apply(this,arguments)}function s(L,O){L.prototype=Object.create(O.prototype),L.prototype.constructor=L,A(L,O)}function A(L,O){return A=Object.setPrototypeOf||function(w,x){return w.__proto__=x,w},A(L,O)}var _=100,S=function(L){s(O,L);function O(w,x){var p;return p=L.call(this,w,x,"[audio-stream-controller]")||this,p.videoBuffer=null,p.videoTrackCC=-1,p.waitingVideoCC=-1,p.audioSwitch=!1,p.trackId=-1,p.waitingData=null,p.mainDetails=null,p.bufferFlushed=!1,p._registerListeners(),p}var C=O.prototype;return C.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},C._registerListeners=function(){var x=this.hls;x.on(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.on(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.on(U.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),x.on(U.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.on(U.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),x.on(U.Events.ERROR,this.onError,this),x.on(U.Events.BUFFER_RESET,this.onBufferReset,this),x.on(U.Events.BUFFER_CREATED,this.onBufferCreated,this),x.on(U.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.on(U.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),x.on(U.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C._unregisterListeners=function(){var x=this.hls;x.off(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.off(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.off(U.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),x.off(U.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.off(U.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),x.off(U.Events.ERROR,this.onError,this),x.off(U.Events.BUFFER_RESET,this.onBufferReset,this),x.off(U.Events.BUFFER_CREATED,this.onBufferCreated,this),x.off(U.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.off(U.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),x.off(U.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C.onInitPtsFound=function(x,p){var T=p.frag,v=p.id,y=p.initPTS;if(v==="main"){var N=T.cc;this.initPTS[T.cc]=y,this.log("InitPTS for cc: "+N+" found from main: "+y),this.videoTrackCC=N,this.state===F.State.WAITING_INIT_PTS&&this.tick()}},C.startLoad=function(x){if(!this.levels){this.startPosition=x,this.state=F.State.STOPPED;return}var p=this.lastCurrentTime;this.stopLoad(),this.setInterval(_),this.fragLoadError=0,p>0&&x===-1?(this.log("Override startPosition with lastCurrentTime @"+p.toFixed(3)),this.state=F.State.IDLE):(this.loadedmetadata=!1,this.state=F.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=x,this.tick()},C.doTick=function(){switch(this.state){case F.State.IDLE:this.doTickIdle();break;case F.State.WAITING_TRACK:{var x,p=this.levels,T=this.trackId,v=p==null||((x=p[T])===null||x===void 0)?void 0:x.details;if(v){if(this.waitForCdnTuneIn(v))break;this.state=F.State.WAITING_INIT_PTS}break}case F.State.FRAG_LOADING_WAITING_RETRY:{var y,N=performance.now(),B=this.retryDate;(!B||N>=B||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=F.State.IDLE);break}case F.State.WAITING_INIT_PTS:{var R=this.waitingData;if(R){var j=R.frag,P=R.part,b=R.cache,X=R.complete;if(this.initPTS[j.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=F.State.FRAG_LOADING;var ee=b.flush(),ae={frag:j,part:P,payload:ee,networkDetails:null};this._handleFragmentLoadProgress(ae),X&&L.prototype._handleFragmentLoadComplete.call(this,ae)}else if(this.videoTrackCC!==this.waitingVideoCC)h.logger.log("Waiting fragment cc ("+j.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var le=this.getLoadPosition(),Re=G.BufferHelper.bufferInfo(this.mediaBuffer,le,this.config.maxBufferHole),Ee=Object(a.fragmentWithinToleranceTest)(Re.end,this.config.maxFragLookUpTolerance,j);Ee<0&&(h.logger.log("Waiting fragment cc ("+j.cc+") @ "+j.start+" cancelled because another fragment at "+Re.end+" is needed"),this.clearWaitingFragment())}}else this.state=F.State.IDLE}}this.onTickEnd()},C.clearWaitingFragment=function(){var x=this.waitingData;x&&(this.fragmentTracker.removeFragment(x.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=F.State.IDLE)},C.onTickEnd=function(){var x=this.media;if(!x||!x.readyState)return;var p=this.mediaBuffer?this.mediaBuffer:x,T=p.buffered;!this.loadedmetadata&&T.length&&(this.loadedmetadata=!0),this.lastCurrentTime=x.currentTime},C.doTickIdle=function(){var x,p,T=this.hls,v=this.levels,y=this.media,N=this.trackId,B=T.config;if(!v||!v[N])return;if(!y&&(this.startFragRequested||!B.startFragPrefetch))return;var R=v[N],j=R.details;if(!j||j.live&&this.levelLastLoaded!==N||this.waitForCdnTuneIn(j)){this.state=F.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,g.ElementaryStreamTypes.AUDIO,D.PlaylistLevelType.AUDIO));var P=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,D.PlaylistLevelType.AUDIO);if(P===null)return;var b=P.len,X=this.getMaxBufferLength(),ee=this.audioSwitch;if(b>=X&&!ee)return;if(!ee&&this._streamEnded(P,j)){T.trigger(U.Events.BUFFER_EOS,{type:"audio"}),this.state=F.State.ENDED;return}var ae=j.fragments,le=ae[0].start,Re=P.end;if(ee){var Ee=this.getLoadPosition();Re=Ee,j.PTSKnown&&Ee<le&&((P.end>le||P.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),y.currentTime=le+.05))}var Te=this.getNextFragment(Re,j);if(!Te){this.bufferFlushed=!0;return}((x=Te.decryptdata)===null||x===void 0?void 0:x.keyFormat)==="identity"&&!((p=Te.decryptdata)!==null&&p!==void 0&&p.key)?this.loadKey(Te,j):this.loadFragment(Te,j,Re)},C.getMaxBufferLength=function(){var x=L.prototype.getMaxBufferLength.call(this),p=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,D.PlaylistLevelType.MAIN);return p===null?x:Math.max(x,p.len)},C.onMediaDetaching=function(){this.videoBuffer=null,L.prototype.onMediaDetaching.call(this)},C.onAudioTracksUpdated=function(x,p){var T=p.audioTracks;this.resetTransmuxer(),this.levels=T.map(function(v){return new i.Level(v)})},C.onAudioTrackSwitching=function(x,p){var T=!!p.url;this.trackId=p.id;var v=this.fragCurrent;v!=null&&v.loader&&v.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),T?this.setInterval(_):this.resetTransmuxer(),T?(this.audioSwitch=!0,this.state=F.State.IDLE):this.state=F.State.STOPPED,this.tick()},C.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},C.onLevelLoaded=function(x,p){this.mainDetails=p.details},C.onAudioTrackLoaded=function(x,p){var T,v=this.levels,y=p.details,N=p.id;if(!v){this.warn("Audio tracks were reset while loading level "+N);return}this.log("Track "+N+" loaded ["+y.startSN+","+y.endSN+"],duration:"+y.totalduration);var B=v[N],R=0;if(y.live||(T=B.details)!==null&&T!==void 0&&T.live){var j=this.mainDetails;if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed||!j)return;!B.details&&y.hasProgramDateTime&&j.hasProgramDateTime?(Object(f.alignMediaPlaylistByPDT)(y,j),R=y.fragments[0].start):R=this.alignPlaylists(y,B.details)}B.details=y,this.levelLastLoaded=N,!this.startFragRequested&&(this.mainDetails||!y.live)&&this.setStartPosition(B.details,R),this.state===F.State.WAITING_TRACK&&!this.waitForCdnTuneIn(y)&&(this.state=F.State.IDLE),this.tick()},C._handleFragmentLoadProgress=function(x){var p,T=x.frag,v=x.part,y=x.payload,N=this.config,B=this.trackId,R=this.levels;if(!R){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+T.sn+" of level "+T.level+" will not be buffered");return}var j=R[B];console.assert(j,"Audio track is defined on fragment load progress");var P=j.details;console.assert(P,"Audio track details are defined on fragment load progress");var b=N.defaultAudioCodec||j.audioCodec||"mp4a.40.2",X=this.transmuxer;X||(X=this.transmuxer=new m.default(this.hls,D.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ee=this.initPTS[T.cc],ae=(p=T.initSegment)===null||p===void 0?void 0:p.data;if(ee!==void 0){var le=!1,Re=v?v.index:-1,Ee=Re!==-1,Te=new u.ChunkMetadata(T.level,T.sn,T.stats.chunkCount,y.byteLength,Re,Ee);X.push(y,ae,b,"",T,v,P.totalduration,le,Te,ee)}else{h.logger.log("Unknown video PTS for cc "+T.cc+", waiting for video PTS before demuxing audio frag "+T.sn+" of ["+P.startSN+" ,"+P.endSN+"],track "+B);var Ae=this.waitingData=this.waitingData||{frag:T,part:v,cache:new d.default,complete:!1},Oe=Ae.cache;Oe.push(new Uint8Array(y)),this.waitingVideoCC=this.videoTrackCC,this.state=F.State.WAITING_INIT_PTS}},C._handleFragmentLoadComplete=function(x){if(this.waitingData){this.waitingData.complete=!0;return}L.prototype._handleFragmentLoadComplete.call(this,x)},C.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},C.onBufferCreated=function(x,p){var T=p.tracks.audio;T&&(this.mediaBuffer=T.buffer),p.tracks.video&&(this.videoBuffer=p.tracks.video.buffer)},C.onFragBuffered=function(x,p){var T=p.frag,v=p.part;if(T.type!==D.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(T)){this.warn("Fragment "+T.sn+(v?" p: "+v.index:"")+" of level "+T.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}T.sn!=="initSegment"&&(this.fragPrevious=T,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(U.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(T,v)},C.onError=function(x,p){switch(p.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(D.PlaylistLevelType.AUDIO,p);break;case l.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case l.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==F.State.ERROR&&this.state!==F.State.STOPPED&&(this.state=p.fatal?F.State.ERROR:F.State.IDLE,this.warn(p.details+" while loading frag, switching to "+this.state+" state"));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(p.parent==="audio"&&(this.state===F.State.PARSING||this.state===F.State.PARSED)){var T=!0,v=this.getFwdBufferInfo(this.mediaBuffer,D.PlaylistLevelType.AUDIO);v&&v.len>.5&&(T=!this.reduceMaxBufferLength(v.len)),T&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},C.onBufferFlushed=function(x,p){var T=p.type;T===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},C._handleTransmuxComplete=function(x){var p,T="audio",v=this.hls,y=x.remuxResult,N=x.chunkMeta,B=this.getCurrentContext(N);if(!B){this.warn("The loading context changed while buffering fragment "+N.sn+" of level "+N.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(N.level);return}var R=B.frag,j=B.part,P=y.audio,b=y.text,X=y.id3,ee=y.initSegment;if(this.fragContextChanged(R))return;if(this.state=F.State.PARSING,this.audioSwitch&&P&&this.completeAudioSwitch(),ee!=null&&ee.tracks&&(this._bufferInitSegment(ee.tracks,R,N),v.trigger(U.Events.FRAG_PARSING_INIT_SEGMENT,{frag:R,id:T,tracks:ee.tracks})),P){var ae=P.startPTS,le=P.endPTS,Re=P.startDTS,Ee=P.endDTS;j&&(j.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:ae,endPTS:le,startDTS:Re,endDTS:Ee}),R.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,ae,le,Re,Ee),this.bufferFragmentData(P,R,j,N)}if(X!=null&&(p=X.samples)!==null&&p!==void 0&&p.length){var Te=o({frag:R,id:T},X);v.trigger(U.Events.FRAG_PARSING_METADATA,Te)}if(b){var Ae=o({frag:R,id:T},b);v.trigger(U.Events.FRAG_PARSING_USERDATA,Ae)}},C._bufferInitSegment=function(x,p,T){if(this.state!==F.State.PARSING)return;x.video&&delete x.video;var v=x.audio;if(!v)return;v.levelCodec=v.codec,v.id="audio",this.log("Init audio buffer, container:"+v.container+", codecs[parsed]=["+v.codec+"]"),this.hls.trigger(U.Events.BUFFER_CODECS,x);var y=v.initSegment;if(y!=null&&y.byteLength){var N={type:"audio",frag:p,part:null,chunkMeta:T,parent:p.type,data:y};this.hls.trigger(U.Events.BUFFER_APPENDING,N)}this.tick()},C.loadFragment=function(x,p,T){var v=this.fragmentTracker.getState(x);this.fragCurrent=x,(this.audioSwitch||v===W.FragmentState.NOT_LOADED||v===W.FragmentState.PARTIAL)&&(x.sn==="initSegment"?this._loadInitSegment(x):p.live&&!Object(Y.isFiniteNumber)(this.initPTS[x.cc])?(this.log("Waiting for video PTS in continuity counter "+x.cc+" of live stream before loading audio fragment "+x.sn+" of level "+this.trackId),this.state=F.State.WAITING_INIT_PTS):(this.startFragRequested=!0,L.prototype.loadFragment.call(this,x,p,T)))},C.completeAudioSwitch=function(){var x=this.hls,p=this.media,T=this.trackId;p&&(this.log("Switching audio track : flushing all audio"),L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,x.trigger(U.Events.AUDIO_TRACK_SWITCHED,{id:T})},O}(F.default);$.default=S},"./src/controller/audio-track-controller.ts":function(ie,$,M){"use strict";M.r($);var Y=M("./src/events.ts"),F=M("./src/errors.ts"),U=M("./src/controller/base-playlist-controller.ts"),G=M("./src/types/loader.ts");function W(m,u){for(var a=0;a<u.length;a++){var f=u[a];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(m,f.key,f)}}function i(m,u,a){return u&&W(m.prototype,u),a&&W(m,a),m}function D(m,u){m.prototype=Object.create(u.prototype),m.prototype.constructor=m,g(m,u)}function g(m,u){return g=Object.setPrototypeOf||function(f,l){return f.__proto__=l,f},g(m,u)}var d=function(m){D(u,m);function u(f){var l;return l=m.call(this,f,"[audio-track-controller]")||this,l.tracks=[],l.groupId=null,l.tracksInGroup=[],l.trackId=-1,l.trackName="",l.selectDefaultTrack=!0,l.registerListeners(),l}var a=u.prototype;return a.registerListeners=function(){var l=this.hls;l.on(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.on(Y.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.on(Y.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var l=this.hls;l.off(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.off(Y.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.off(Y.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,m.prototype.destroy.call(this)},a.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},a.onManifestParsed=function(l,h){this.tracks=h.audioTracks||[]},a.onAudioTrackLoaded=function(l,h){var o=h.id,s=h.details,A=this.tracksInGroup[o];if(!A){this.warn("Invalid audio track id "+o);return}var _=A.details;A.details=h.details,this.log("audioTrack "+o+" loaded ["+s.startSN+"-"+s.endSN+"]"),o===this.trackId&&(this.retryCount=0,this.playlistLoaded(o,h,_))},a.onLevelLoading=function(l,h){this.switchLevel(h.level)},a.onLevelSwitching=function(l,h){this.switchLevel(h.level)},a.switchLevel=function(l){var h=this.hls.levels[l];if(!(h!=null&&h.audioGroupIds))return;var o=h.audioGroupIds[h.urlId];if(this.groupId!==o){this.groupId=o;var s=this.tracks.filter(function(_){return!o||_.groupId===o});this.selectDefaultTrack&&!s.some(function(_){return _.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=s;var A={audioTracks:s};this.log("Updating audio tracks, "+s.length+' track(s) found in "'+o+'" group-id'),this.hls.trigger(Y.Events.AUDIO_TRACKS_UPDATED,A),this.selectInitialTrack()}},a.onError=function(l,h){if(m.prototype.onError.call(this,l,h),h.fatal||!h.context)return;h.context.type===G.PlaylistContextType.AUDIO_TRACK&&h.context.id===this.trackId&&h.context.groupId===this.groupId&&this.retryLoadingOrFail(h)},a.setAudioTrack=function(l){var h=this.tracksInGroup;if(l<0||l>=h.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var o=h[this.trackId];this.log("Now switching to audio-track index "+l);var s=h[l],A=s.id,_=s.groupId,S=_===void 0?"":_,L=s.name,O=s.type,C=s.url;if(this.trackId=l,this.trackName=L,this.selectDefaultTrack=!1,this.hls.trigger(Y.Events.AUDIO_TRACK_SWITCHING,{id:A,groupId:S,name:L,type:O,url:C}),s.details&&!s.details.live)return;var w=this.switchParams(s.url,o==null?void 0:o.details);this.loadPlaylist(w)},a.selectInitialTrack=function(){var l=this.tracksInGroup;console.assert(l.length,"Initial audio track should be selected when tracks are known");var h=this.trackName,o=this.findTrackId(h)||this.findTrackId();o!==-1?this.setAudioTrack(o):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(Y.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},a.findTrackId=function(l){for(var h=this.tracksInGroup,o=0;o<h.length;o++){var s=h[o];if((!this.selectDefaultTrack||s.default)&&(!l||l===s.name))return s.id}return-1},a.loadPlaylist=function(l){var h=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(h)){var o=h.id,s=h.groupId,A=h.url;if(l)try{A=l.addDirectives(A)}catch(_){this.warn("Could not construct new URL with HLS Delivery Directives: "+_)}this.log("loading audio-track playlist for id: "+o),this.clearTimer(),this.hls.trigger(Y.Events.AUDIO_TRACK_LOADING,{url:A,id:o,groupId:s,deliveryDirectives:l||null})}},i(u,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(l){this.selectDefaultTrack=!1,this.setAudioTrack(l)}}]),u}(U.default);$.default=d},"./src/controller/base-playlist-controller.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return i});var Y=M("./src/polyfills/number.ts"),F=M("./src/types/level.ts"),U=M("./src/controller/level-helper.ts"),G=M("./src/utils/logger.ts"),W=M("./src/errors.ts"),i=function(){function D(d,m){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=G.logger.log.bind(G.logger,m+":"),this.warn=G.logger.warn.bind(G.logger,m+":"),this.hls=d}var g=D.prototype;return g.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},g.onError=function(m,u){u.fatal&&u.type===W.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},g.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},g.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},g.stopLoad=function(){this.canLoad=!1,this.clearTimer()},g.switchParams=function(m,u){var a=u==null?void 0:u.renditionReports;if(a)for(var f=0;f<a.length;f++){var l=a[f],h=""+l.URI;if(h===m.substr(-h.length)){var o=parseInt(l["LAST-MSN"]),s=parseInt(l["LAST-PART"]);if(u&&this.hls.config.lowLatencyMode){var A=Math.min(u.age-u.partTarget,u.targetduration);s!==void 0&&A>u.partTarget&&(s+=1)}if(Object(Y.isFiniteNumber)(o))return new F.HlsUrlParameters(o,Object(Y.isFiniteNumber)(s)?s:void 0,F.HlsSkip.No)}}},g.loadPlaylist=function(m){},g.shouldLoadTrack=function(m){return this.canLoad&&m&&!!m.url&&(!m.details||m.details.live)},g.playlistLoaded=function(m,u,a){var f=this,l=u.details,h=u.stats,o=h.loading.end?Math.max(0,self.performance.now()-h.loading.end):0;if(l.advancedDateTime=Date.now()-o,l.live||a!=null&&a.live){if(l.reloaded(a),a&&this.log("live playlist "+m+" "+(l.advanced?"REFRESHED "+l.lastPartSn+"-"+l.lastPartIndex:"MISSED")),a&&l.fragments.length>0&&Object(U.mergeDetails)(a,l),!this.canLoad||!l.live)return;var s,A=void 0,_=void 0;if(l.canBlockReload&&l.endSN&&l.advanced){var S=this.hls.config.lowLatencyMode,L=l.lastPartSn,O=l.endSN,C=l.lastPartIndex,w=C!==-1,x=L===O,p=S?0:C;w?(A=x?O+1:L,_=x?p:C+1):A=O+1;var T=l.age,v=T+l.ageHeader,y=Math.min(v-l.partTarget,l.targetduration*1.5);if(y>0){if(a&&y>a.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+a.tuneInGoal+" to: "+y+" with playlist age: "+l.age),y=0;else{var N=Math.floor(y/l.targetduration);if(A+=N,_!==void 0){var B=Math.round(y%l.targetduration/l.partTarget);_+=B}this.log("CDN Tune-in age: "+l.ageHeader+"s last advanced "+T.toFixed(2)+"s goal: "+y+" skip sn "+N+" to part "+_)}l.tuneInGoal=y}if(s=this.getDeliveryDirectives(l,u.deliveryDirectives,A,_),S||!x){this.loadPlaylist(s);return}}else s=this.getDeliveryDirectives(l,u.deliveryDirectives,A,_);var R=Object(U.computeReloadInterval)(l,h);A!==void 0&&l.canBlockReload&&(R-=l.partTarget||1),this.log("reload live playlist "+m+" in "+Math.round(R)+" ms"),this.timer=self.setTimeout(function(){return f.loadPlaylist(s)},R)}else this.clearTimer()},g.getDeliveryDirectives=function(m,u,a,f){var l=Object(F.getSkipValue)(m,a);return u!=null&&u.skip&&m.deltaUpdateFailed&&(a=u.msn,f=u.part,l=F.HlsSkip.No),new F.HlsUrlParameters(a,f,l)},g.retryLoadingOrFail=function(m){var u=this,a=this.hls.config,f=this.retryCount<a.levelLoadingMaxRetry;if(f){var l;if(this.retryCount++,m.details.indexOf("LoadTimeOut")>-1&&(l=m.context)!==null&&l!==void 0&&l.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+m.details+'"'),this.loadPlaylist();else{var h=Math.min(Math.pow(2,this.retryCount)*a.levelLoadingRetryDelay,a.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return u.loadPlaylist()},h),this.warn("retry playlist loading #"+this.retryCount+" in "+h+' ms after "'+m.details+'"')}}else this.warn('cannot recover from error "'+m.details+'"'),this.clearTimer(),m.fatal=!0;return f},D}()},"./src/controller/base-stream-controller.ts":function(ie,$,M){"use strict";M.r($),M.d($,"State",function(){return O}),M.d($,"default",function(){return C});var Y=M("./src/polyfills/number.ts"),F=M("./src/task-loop.ts"),U=M("./src/controller/fragment-tracker.ts"),G=M("./src/utils/buffer-helper.ts"),W=M("./src/utils/logger.ts"),i=M("./src/events.ts"),D=M("./src/errors.ts"),g=M("./src/types/transmuxer.ts"),d=M("./src/utils/mp4-tools.ts"),m=M("./src/utils/discontinuities.ts"),u=M("./src/controller/fragment-finders.ts"),a=M("./src/controller/level-helper.ts"),f=M("./src/loader/fragment-loader.ts"),l=M("./src/crypt/decrypter.ts"),h=M("./src/utils/time-ranges.ts"),o=M("./src/types/loader.ts");function s(w,x){for(var p=0;p<x.length;p++){var T=x[p];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(w,T.key,T)}}function A(w,x,p){return x&&s(w.prototype,x),p&&s(w,p),w}function _(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w}function S(w,x){w.prototype=Object.create(x.prototype),w.prototype.constructor=w,L(w,x)}function L(w,x){return L=Object.setPrototypeOf||function(T,v){return T.__proto__=v,T},L(w,x)}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"},C=function(w){S(x,w);function x(T,v,y){var N;return N=w.call(this)||this,N.hls=void 0,N.fragPrevious=null,N.fragCurrent=null,N.fragmentTracker=void 0,N.transmuxer=null,N._state=O.STOPPED,N.media=void 0,N.mediaBuffer=void 0,N.config=void 0,N.bitrateTest=!1,N.lastCurrentTime=0,N.nextLoadPosition=0,N.startPosition=0,N.loadedmetadata=!1,N.fragLoadError=0,N.retryDate=0,N.levels=null,N.fragmentLoader=void 0,N.levelLastLoaded=null,N.startFragRequested=!1,N.decrypter=void 0,N.initPTS=[],N.onvseeking=null,N.onvended=null,N.logPrefix="",N.log=void 0,N.warn=void 0,N.logPrefix=y,N.log=W.logger.log.bind(W.logger,y+":"),N.warn=W.logger.warn.bind(W.logger,y+":"),N.hls=T,N.fragmentLoader=new f.default(T.config),N.fragmentTracker=v,N.config=T.config,N.decrypter=new l.default(T,T.config),T.on(i.Events.KEY_LOADED,N.onKeyLoaded,_(N)),N}var p=x.prototype;return p.doTick=function(){this.onTickEnd()},p.onTickEnd=function(){},p.startLoad=function(v){},p.stopLoad=function(){this.fragmentLoader.abort();var v=this.fragCurrent;v&&this.fragmentTracker.removeFragment(v),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=O.STOPPED},p._streamEnded=function(v,y){var N=this.fragCurrent,B=this.fragmentTracker;if(!y.live&&N&&N.sn===y.endSN&&!v.nextStart){var R=B.getState(N);return R===U.FragmentState.PARTIAL||R===U.FragmentState.OK}return!1},p.onMediaAttached=function(v,y){var N=this.media=this.mediaBuffer=y.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),N.addEventListener("seeking",this.onvseeking),N.addEventListener("ended",this.onvended);var B=this.config;this.levels&&B.autoStartLoad&&this.state===O.STOPPED&&this.startLoad(B.startPosition)},p.onMediaDetaching=function(){var v=this.media;v!=null&&v.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),v&&(v.removeEventListener("seeking",this.onvseeking),v.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},p.onMediaSeeking=function(){var v=this.config,y=this.fragCurrent,N=this.media,B=this.mediaBuffer,R=this.state,j=N?N.currentTime:0,P=G.BufferHelper.bufferInfo(B||N,j,v.maxBufferHole);if(this.log("media seeking to "+(Object(Y.isFiniteNumber)(j)?j.toFixed(3):j)+", state: "+R),R===O.ENDED)this.resetLoadingState();else if(y&&!P.len){var b=v.maxFragLookUpTolerance,X=y.start-b,ee=y.start+y.duration+b,ae=j>ee;(j<X||ae)&&(ae&&y.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),y.loader.abort()),this.resetLoadingState())}N&&(this.lastCurrentTime=j),!this.loadedmetadata&&!P.len&&(this.nextLoadPosition=this.startPosition=j),this.tickImmediate()},p.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},p.onKeyLoaded=function(v,y){if(this.state!==O.KEY_LOADING||y.frag!==this.fragCurrent||!this.levels)return;this.state=O.IDLE;var N=this.levels[y.frag.level].details;N&&this.loadFragment(y.frag,N,y.frag.start)},p.onHandlerDestroying=function(){this.stopLoad(),w.prototype.onHandlerDestroying.call(this)},p.onHandlerDestroyed=function(){this.state=O.STOPPED,this.hls.off(i.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,w.prototype.onHandlerDestroyed.call(this)},p.loadKey=function(v,y){this.log("Loading key for "+v.sn+" of ["+y.startSN+"-"+y.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+v.level),this.state=O.KEY_LOADING,this.fragCurrent=v,this.hls.trigger(i.Events.KEY_LOADING,{frag:v})},p.loadFragment=function(v,y,N){this._loadFragForPlayback(v,y,N)},p._loadFragForPlayback=function(v,y,N){var B=this,R=function(P){if(B.fragContextChanged(v)){B.warn("Fragment "+v.sn+(P.part?" p: "+P.part.index:"")+" of level "+v.level+" was dropped during download."),B.fragmentTracker.removeFragment(v);return}v.stats.chunkCount++,B._handleFragmentLoadProgress(P)};this._doFragLoad(v,y,N,R).then(function(j){if(!j)return;B.fragLoadError=0;var P=B.state;if(B.fragContextChanged(v)){(P===O.FRAG_LOADING||P===O.BACKTRACKING||!B.fragCurrent&&P===O.PARSING)&&(B.fragmentTracker.removeFragment(v),B.state=O.IDLE);return}if("payload"in j&&(B.log("Loaded fragment "+v.sn+" of level "+v.level),B.hls.trigger(i.Events.FRAG_LOADED,j),B.state===O.BACKTRACKING)){B.fragmentTracker.backtrack(v,j),B.resetFragmentLoading(v);return}B._handleFragmentLoadComplete(j)}).catch(function(j){B.warn(j),B.resetFragmentLoading(v)})},p.flushMainBuffer=function(v,y,N){if(N===void 0&&(N=null),!(v-y))return;var B={startOffset:v,endOffset:y,type:N};this.fragLoadError=0,this.hls.trigger(i.Events.BUFFER_FLUSHING,B)},p._loadInitSegment=function(v){var y=this;this._doFragLoad(v).then(function(N){if(!N||y.fragContextChanged(v)||!y.levels)throw new Error("init load aborted");return N}).then(function(N){var B=y.hls,R=N.payload,j=v.decryptdata;if(R&&R.byteLength>0&&j&&j.key&&j.iv&&j.method==="AES-128"){var P=self.performance.now();return y.decrypter.webCryptoDecrypt(new Uint8Array(R),j.key.buffer,j.iv.buffer).then(function(b){var X=self.performance.now();return B.trigger(i.Events.FRAG_DECRYPTED,{frag:v,payload:b,stats:{tstart:P,tdecrypt:X}}),N.payload=b,N})}return N}).then(function(N){var B=y.fragCurrent,R=y.hls,j=y.levels;if(!j)throw new Error("init load aborted, missing levels");var P=j[v.level].details;console.assert(P,"Level details are defined when init segment is loaded");var b=v.stats;y.state=O.IDLE,y.fragLoadError=0,v.data=new Uint8Array(N.payload),b.parsing.start=b.buffering.start=self.performance.now(),b.parsing.end=b.buffering.end=self.performance.now(),N.frag===B&&R.trigger(i.Events.FRAG_BUFFERED,{stats:b,frag:B,part:null,id:v.type}),y.tick()}).catch(function(N){y.warn(N),y.resetFragmentLoading(v)})},p.fragContextChanged=function(v){var y=this.fragCurrent;return!v||!y||v.level!==y.level||v.sn!==y.sn||v.urlId!==y.urlId},p.fragBufferedComplete=function(v,y){var N=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+v.type+" sn: "+v.sn+(y?" part: "+y.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+v.level+" "+h.default.toString(G.BufferHelper.getBuffered(N))),this.state=O.IDLE,this.tick()},p._handleFragmentLoadComplete=function(v){var y=this.transmuxer;if(!y)return;var N=v.frag,B=v.part,R=v.partsLoaded,j=!R||R.length===0||R.some(function(b){return!b}),P=new g.ChunkMetadata(N.level,N.sn,N.stats.chunkCount+1,0,B?B.index:-1,!j);y.flush(P)},p._handleFragmentLoadProgress=function(v){},p._doFragLoad=function(v,y,N,B){var R=this;if(N===void 0&&(N=null),!this.levels)throw new Error("frag load aborted, missing levels");if(N=Math.max(v.start,N||0),this.config.lowLatencyMode&&y){var j=y.partList;if(j&&B){N>v.end&&y.fragmentHint&&(v=y.fragmentHint);var P=this.getNextPart(j,v,N);if(P>-1){var b=j[P];return this.log("Loading part sn: "+v.sn+" p: "+b.index+" cc: "+v.cc+" of playlist ["+y.startSN+"-"+y.endSN+"] parts [0-"+P+"-"+(j.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+v.level+", target: "+parseFloat(N.toFixed(3))),this.nextLoadPosition=b.start+b.duration,this.state=O.FRAG_LOADING,this.hls.trigger(i.Events.FRAG_LOADING,{frag:v,part:j[P],targetBufferTime:N}),this.doFragPartsLoad(v,j,P,B).catch(function(X){return R.handleFragLoadError(X)})}else if(!v.url||this.loadedEndOfParts(j,N))return Promise.resolve(null)}}return this.log("Loading fragment "+v.sn+" cc: "+v.cc+" "+(y?"of ["+y.startSN+"-"+y.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+v.level+", target: "+parseFloat(N.toFixed(3))),Object(Y.isFiniteNumber)(v.sn)&&!this.bitrateTest&&(this.nextLoadPosition=v.start+v.duration),this.state=O.FRAG_LOADING,this.hls.trigger(i.Events.FRAG_LOADING,{frag:v,targetBufferTime:N}),this.fragmentLoader.load(v,B).catch(function(X){return R.handleFragLoadError(X)})},p.doFragPartsLoad=function(v,y,N,B){var R=this;return new Promise(function(j,P){var b=[],X=function ee(ae){var le=y[ae];R.fragmentLoader.loadPart(v,le,B).then(function(Re){b[le.index]=Re;var Ee=Re.part;R.hls.trigger(i.Events.FRAG_LOADED,Re);var Te=y[ae+1];if(Te&&Te.fragment===v)ee(ae+1);else return j({frag:v,part:Ee,partsLoaded:b})}).catch(P)};X(N)})},p.handleFragLoadError=function(v){var y=v.data;return y&&y.details===D.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(y.frag,y.part):this.hls.trigger(i.Events.ERROR,y),null},p._handleTransmuxerFlush=function(v){var y=this.getCurrentContext(v);if(!y||this.state!==O.PARSING){this.fragCurrent||(this.state=O.IDLE);return}var N=y.frag,B=y.part,R=y.level,j=self.performance.now();N.stats.parsing.end=j,B&&(B.stats.parsing.end=j),this.updateLevelTiming(N,B,R,v.partial)},p.getCurrentContext=function(v){var y=this.levels,N=v.level,B=v.sn,R=v.part;if(!y||!y[N])return this.warn("Levels object was unset while buffering fragment "+B+" of level "+N+". The current chunk will not be buffered."),null;var j=y[N],P=R>-1?Object(a.getPartWith)(j,B,R):null,b=P?P.fragment:Object(a.getFragmentWithSN)(j,B,this.fragCurrent);return b?{frag:b,part:P,level:j}:null},p.bufferFragmentData=function(v,y,N,B){if(!v||this.state!==O.PARSING)return;var R=v.data1,j=v.data2,P=R;if(R&&j&&(P=Object(d.appendUint8Array)(R,j)),!P||!P.length)return;var b={type:v.type,frag:y,part:N,chunkMeta:B,parent:y.type,data:P};this.hls.trigger(i.Events.BUFFER_APPENDING,b),v.dropped&&v.independent&&!N&&this.flushBufferGap(y)},p.flushBufferGap=function(v){var y=this.media;if(!y)return;if(!G.BufferHelper.isBuffered(y,y.currentTime)){this.flushMainBuffer(0,v.start);return}var N=y.currentTime,B=G.BufferHelper.bufferInfo(y,N,0),R=v.duration,j=Math.min(this.config.maxFragLookUpTolerance*2,R*.25),P=Math.max(Math.min(v.start-j,B.end-j),N+j);v.start-P>j&&this.flushMainBuffer(P,v.start)},p.getFwdBufferInfo=function(v,y){var N=this.config,B=this.getLoadPosition();if(!Object(Y.isFiniteNumber)(B))return null;var R=G.BufferHelper.bufferInfo(v,B,N.maxBufferHole);if(R.len===0&&R.nextStart!==void 0){var j=this.fragmentTracker.getBufferedFrag(B,y);if(j&&R.nextStart<j.end)return G.BufferHelper.bufferInfo(v,B,Math.max(R.nextStart,N.maxBufferHole))}return R},p.getMaxBufferLength=function(v){var y=this.config,N;return v?N=Math.max(8*y.maxBufferSize/v,y.maxBufferLength):N=y.maxBufferLength,Math.min(N,y.maxMaxBufferLength)},p.reduceMaxBufferLength=function(v){var y=this.config,N=v||y.maxBufferLength;return y.maxMaxBufferLength>=N?(y.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+y.maxMaxBufferLength+"s"),!0):!1},p.getNextFragment=function(v,y){var N,B,R=y.fragments,j=R.length;if(!j)return null;var P=this.config,b=R[0].start,X;if(y.live){var ee=P.initialLiveManifestSize;if(j<ee)return this.warn("Not enough fragments to start playback (have: "+j+", need: "+ee+")"),null;!y.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(X=this.getInitialLiveFragment(y,R),this.startPosition=X?this.hls.liveSyncPosition||X.start:v)}else v<=b&&(X=R[0]);if(!X){var ae=P.lowLatencyMode?y.partEnd:y.fragmentEnd;X=this.getFragmentAtPosition(v,ae,y)}return(N=X)!==null&&N!==void 0&&N.initSegment&&!((B=X)!==null&&B!==void 0&&B.initSegment.data)&&!this.bitrateTest&&(X=X.initSegment),X},p.getNextPart=function(v,y,N){for(var B=-1,R=!1,j=!0,P=0,b=v.length;P<b;P++){var X=v[P];if(j=j&&!X.independent,B>-1&&N<X.start)break;var ee=X.loaded;!ee&&(R||X.independent||j)&&X.fragment===y&&(B=P),R=ee}return B},p.loadedEndOfParts=function(v,y){var N=v[v.length-1];return N&&y>N.start&&N.loaded},p.getInitialLiveFragment=function(v,y){var N=this.fragPrevious,B=null;if(N){if(v.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+N.programDateTime),B=Object(u.findFragmentByPDT)(y,N.endProgramDateTime,this.config.maxFragLookUpTolerance)),!B){var R=N.sn+1;if(R>=v.startSN&&R<=v.endSN){var j=y[R-v.startSN];N.cc===j.cc&&(B=j,this.log("Live playlist, switching playlist, load frag with next SN: "+B.sn))}B||(B=Object(u.findFragWithCC)(y,N.cc),B&&this.log("Live playlist, switching playlist, load frag with same CC: "+B.sn))}}else{var P=this.hls.liveSyncPosition;P!==null&&(B=this.getFragmentAtPosition(P,this.bitrateTest?v.fragmentEnd:v.edge,v))}return B},p.getFragmentAtPosition=function(v,y,N){var B=this.config,R=this.fragPrevious,j=N.fragments,P=N.endSN,b=N.fragmentHint,X=B.maxFragLookUpTolerance,ee=!!(B.lowLatencyMode&&N.partList&&b);ee&&b&&!this.bitrateTest&&(j=j.concat(b),P=b.sn);var ae;if(v<y){var le=v>y-X?0:X;ae=Object(u.findFragmentByPTS)(R,j,v,le)}else ae=j[j.length-1];if(ae){var Re=ae.sn-N.startSN,Ee=R&&ae.level===R.level,Te=j[Re+1],Ae=this.fragmentTracker.getState(ae);if(Ae===U.FragmentState.BACKTRACKED){ae=null;for(var Oe=Re;j[Oe]&&this.fragmentTracker.getState(j[Oe])===U.FragmentState.BACKTRACKED;)R?ae=j[Oe--]:ae=j[--Oe];ae||(ae=Te)}else R&&ae.sn===R.sn&&!ee&&(Ee&&(ae.sn<P&&this.fragmentTracker.getState(Te)!==U.FragmentState.OK?(this.log("SN "+ae.sn+" just loaded, load next one: "+Te.sn),ae=Te):ae=null))}return ae},p.synchronizeToLiveEdge=function(v){var y=this.config,N=this.media;if(!N)return;var B=this.hls.liveSyncPosition,R=N.currentTime,j=v.fragments[0].start,P=v.edge,b=R>=j-y.maxFragLookUpTolerance&&R<=P;if(B!==null&&N.duration>B&&(R<B||!b)){var X=y.liveMaxLatencyDuration!==void 0?y.liveMaxLatencyDuration:y.liveMaxLatencyDurationCount*v.targetduration;(!b&&N.readyState<4||R<P-X)&&(this.loadedmetadata||(this.nextLoadPosition=B),N.readyState&&(this.warn("Playback: "+R.toFixed(3)+" is located too far from the end of live sliding playlist: "+P+", reset currentTime to : "+B.toFixed(3)),N.currentTime=B))}},p.alignPlaylists=function(v,y){var N=this.levels,B=this.levelLastLoaded,R=this.fragPrevious,j=B!==null?N[B]:null,P=v.fragments.length;if(!P)return this.warn("No fragments in live playlist"),0;var b=v.fragments[0].start,X=!y,ee=v.alignedSliding&&Object(Y.isFiniteNumber)(b);if(X||!ee&&!b){Object(m.alignStream)(R,j,v);var ae=v.fragments[0].start;return this.log("Live playlist sliding: "+ae.toFixed(2)+" start-sn: "+(y?y.startSN:"na")+"->"+v.startSN+" prev-sn: "+(R?R.sn:"na")+" fragments: "+P),ae}return b},p.waitForCdnTuneIn=function(v){var y=3;return v.live&&v.canBlockReload&&v.tuneInGoal>Math.max(v.partHoldBack,v.partTarget*y)},p.setStartPosition=function(v,y){var N=this.startPosition;if(N<y&&(N=-1),N===-1||this.lastCurrentTime===-1){var B=v.startTimeOffset;Object(Y.isFiniteNumber)(B)?(N=y+B,B<0&&(N+=v.totalduration),N=Math.min(Math.max(y,N),y+v.totalduration),this.log("Start time offset "+B+" found in playlist, adjust startPosition to "+N),this.startPosition=N):v.live?N=this.hls.liveSyncPosition||y:this.startPosition=N=0,this.lastCurrentTime=N}this.nextLoadPosition=N},p.getLoadPosition=function(){var v=this.media,y=0;return this.loadedmetadata&&v?y=v.currentTime:this.nextLoadPosition&&(y=this.nextLoadPosition),y},p.handleFragLoadAborted=function(v,y){this.transmuxer&&v.sn!=="initSegment"&&v.stats.aborted&&(this.warn("Fragment "+v.sn+(y?" part"+y.index:"")+" of level "+v.level+" was aborted"),this.resetFragmentLoading(v))},p.resetFragmentLoading=function(v){(!this.fragCurrent||!this.fragContextChanged(v))&&(this.state=O.IDLE)},p.onFragmentOrKeyLoadError=function(v,y){if(y.fatal)return;var N=y.frag;if(!N||N.type!==v)return;var B=this.fragCurrent;console.assert(B&&N.sn===B.sn&&N.level===B.level&&N.urlId===B.urlId,"Frag load error must match current frag to retry");var R=this.config;if(this.fragLoadError+1<=R.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(N.level))return;var j=Math.min(Math.pow(2,this.fragLoadError)*R.fragLoadingRetryDelay,R.fragLoadingMaxRetryTimeout);this.warn("Fragment "+N.sn+" of "+v+" "+N.level+" failed to load, retrying in "+j+"ms"),this.retryDate=self.performance.now()+j,this.fragLoadError++,this.state=O.FRAG_LOADING_WAITING_RETRY}else y.levelRetry?(v===o.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=O.IDLE):(W.logger.error(y.details+" reaches max retry, redispatch as fatal ..."),y.fatal=!0,this.hls.stopLoad(),this.state=O.ERROR)},p.afterBufferFlushed=function(v,y,N){if(!v)return;var B=G.BufferHelper.getBuffered(v);this.fragmentTracker.detectEvictedFragments(y,B,N),this.state===O.ENDED&&this.resetLoadingState()},p.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=O.IDLE},p.resetLiveStartWhenNotLoaded=function(v){if(!this.loadedmetadata){this.startFragRequested=!1;var y=this.levels?this.levels[v].details:null;if(y!=null&&y.live)return this.startPosition=-1,this.setStartPosition(y,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},p.updateLevelTiming=function(v,y,N,B){var R=this,j=N.details;console.assert(!!j,"level.details must be defined");var P=Object.keys(v.elementaryStreams).reduce(function(b,X){var ee=v.elementaryStreams[X];if(ee){var ae=ee.endPTS-ee.startPTS;if(ae<=0)return R.warn("Could not parse fragment "+v.sn+" "+X+" duration reliably ("+ae+") resetting transmuxer to fallback to playlist timing"),R.resetTransmuxer(),b||!1;var le=B?0:Object(a.updateFragPTSDTS)(j,v,ee.startPTS,ee.endPTS,ee.startDTS,ee.endDTS);return R.hls.trigger(i.Events.LEVEL_PTS_UPDATED,{details:j,level:N,drift:le,type:X,frag:v,start:ee.startPTS,end:ee.endPTS}),!0}return b},!1);P?(this.state=O.PARSED,this.hls.trigger(i.Events.FRAG_PARSED,{frag:v,part:y})):this.resetLoadingState()},p.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},A(x,[{key:"state",get:function(){return this._state},set:function(v){var y=this._state;y!==v&&(this._state=v,this.log(y+"->"+v))}}]),x}(F.default)},"./src/controller/buffer-controller.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return u});var Y=M("./src/polyfills/number.ts"),F=M("./src/events.ts"),U=M("./src/utils/logger.ts"),G=M("./src/errors.ts"),W=M("./src/utils/buffer-helper.ts"),i=M("./src/utils/mediasource-helper.ts"),D=M("./src/loader/fragment.ts"),g=M("./src/controller/buffer-operation-queue.ts"),d=Object(i.getMediaSource)(),m=/([ha]vc.)(?:\.[^.,]+)+/,u=function(){function a(l){var h=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 o=h.hls,s=h.media,A=h.mediaSource;U.logger.log("[buffer-controller]: Media source opened"),s&&(h.updateMediaElementDuration(),o.trigger(F.Events.MEDIA_ATTACHED,{media:s})),A&&A.removeEventListener("sourceopen",h._onMediaSourceOpen),h.checkPendingTracks()},this._onMediaSourceClose=function(){U.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){U.logger.log("[buffer-controller]: Media source ended")},this.hls=l,this._initSourceBuffer(),this.registerListeners()}var f=a.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 h=this.hls;h.on(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(F.Events.BUFFER_RESET,this.onBufferReset,this),h.on(F.Events.BUFFER_APPENDING,this.onBufferAppending,this),h.on(F.Events.BUFFER_CODECS,this.onBufferCodecs,this),h.on(F.Events.BUFFER_EOS,this.onBufferEos,this),h.on(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),h.on(F.Events.LEVEL_UPDATED,this.onLevelUpdated,this),h.on(F.Events.FRAG_PARSED,this.onFragParsed,this),h.on(F.Events.FRAG_CHANGED,this.onFragChanged,this)},f.unregisterListeners=function(){var h=this.hls;h.off(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(F.Events.BUFFER_RESET,this.onBufferReset,this),h.off(F.Events.BUFFER_APPENDING,this.onBufferAppending,this),h.off(F.Events.BUFFER_CODECS,this.onBufferCodecs,this),h.off(F.Events.BUFFER_EOS,this.onBufferEos,this),h.off(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),h.off(F.Events.LEVEL_UPDATED,this.onLevelUpdated,this),h.off(F.Events.FRAG_PARSED,this.onFragParsed,this),h.off(F.Events.FRAG_CHANGED,this.onFragChanged,this)},f._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new g.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},f.onManifestParsed=function(h,o){var s=2;(o.audio&&!o.video||!o.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,this.details=null,U.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},f.onMediaAttaching=function(h,o){var s=this.media=o.media;if(s&&d){var A=this.mediaSource=new d;A.addEventListener("sourceopen",this._onMediaSourceOpen),A.addEventListener("sourceended",this._onMediaSourceEnded),A.addEventListener("sourceclose",this._onMediaSourceClose),s.src=self.URL.createObjectURL(A),this._objectUrl=s.src}},f.onMediaDetaching=function(){var h=this.media,o=this.mediaSource,s=this._objectUrl;if(o){if(U.logger.log("[buffer-controller]: media source detaching"),o.readyState==="open")try{o.endOfStream()}catch(A){U.logger.warn("[buffer-controller]: onMediaDetaching: "+A.message+" while calling endOfStream")}this.onBufferReset(),o.removeEventListener("sourceopen",this._onMediaSourceOpen),o.removeEventListener("sourceended",this._onMediaSourceEnded),o.removeEventListener("sourceclose",this._onMediaSourceClose),h&&(s&&self.URL.revokeObjectURL(s),h.src===s?(h.removeAttribute("src"),h.load()):U.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(F.Events.MEDIA_DETACHED,void 0)},f.onBufferReset=function(){var h=this;this.getSourceBufferTypes().forEach(function(o){var s=h.sourceBuffer[o];try{s&&(h.removeBufferListeners(o),h.mediaSource&&h.mediaSource.removeSourceBuffer(s),h.sourceBuffer[o]=void 0)}catch(A){U.logger.warn("[buffer-controller]: Failed to reset the "+o+" buffer",A)}}),this._initSourceBuffer()},f.onBufferCodecs=function(h,o){var s=this,A=this.getSourceBufferTypes().length;if(Object.keys(o).forEach(function(_){if(A){var S=s.tracks[_];if(S&&typeof S.buffer.changeType=="function"){var L=o[_],O=L.codec,C=L.levelCodec,w=L.container,x=(S.levelCodec||S.codec).replace(m,"$1"),p=(C||O).replace(m,"$1");if(x!==p){var T=w+";codecs="+(C||O);s.appendChangeType(_,T)}}}else s.pendingTracks[_]=o[_]}),A)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},f.appendChangeType=function(h,o){var s=this,A=this.operationQueue,_={execute:function(){var L=s.sourceBuffer[h];L&&(U.logger.log("[buffer-controller]: changing "+h+" sourceBuffer type to "+o),L.changeType(o)),A.shiftAndExecuteNext(h)},onStart:function(){},onComplete:function(){},onError:function(L){U.logger.warn("[buffer-controller]: Failed to change "+h+" SourceBuffer type",L)}};A.append(_,h)},f.onBufferAppending=function(h,o){var s=this,A=this.hls,_=this.operationQueue,S=this.tracks,L=o.data,O=o.type,C=o.frag,w=o.part,x=o.chunkMeta,p=x.buffering[O],T=self.performance.now();p.start=T;var v=C.stats.buffering,y=w?w.stats.buffering:null;v.start===0&&(v.start=T),y&&y.start===0&&(y.start=T);var N=S.audio,B=O==="audio"&&x.id===1&&(N==null?void 0:N.container)==="audio/mpeg",R={execute:function(){if(p.executeStart=self.performance.now(),B){var P=s.sourceBuffer[O];if(P){var b=C.start-P.timestampOffset;Math.abs(b)>=.1&&(U.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+C.start+" (delta: "+b+") sn: "+C.sn+")"),P.timestampOffset=C.start)}}s.appendExecutor(L,O)},onStart:function(){},onComplete:function(){var P=self.performance.now();p.executeEnd=p.end=P,v.first===0&&(v.first=P),y&&y.first===0&&(y.first=P);var b=s.sourceBuffer,X={};for(var ee in b)X[ee]=W.BufferHelper.getBuffered(b[ee]);s.appendError=0,s.hls.trigger(F.Events.BUFFER_APPENDED,{type:O,frag:C,part:w,chunkMeta:x,parent:C.type,timeRanges:X})},onError:function(P){U.logger.error("[buffer-controller]: Error encountered while trying to append to the "+O+" SourceBuffer",P);var b={type:G.ErrorTypes.MEDIA_ERROR,parent:C.type,details:G.ErrorDetails.BUFFER_APPEND_ERROR,err:P,fatal:!1};P.code===DOMException.QUOTA_EXCEEDED_ERR?b.details=G.ErrorDetails.BUFFER_FULL_ERROR:(s.appendError++,b.details=G.ErrorDetails.BUFFER_APPEND_ERROR,s.appendError>A.config.appendErrorMaxRetry&&(U.logger.error("[buffer-controller]: Failed "+A.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),b.fatal=!0)),A.trigger(F.Events.ERROR,b)}};_.append(R,O)},f.onBufferFlushing=function(h,o){var s=this,A=this.operationQueue,_=function(L){return{execute:s.removeExecutor.bind(s,L,o.startOffset,o.endOffset),onStart:function(){},onComplete:function(){s.hls.trigger(F.Events.BUFFER_FLUSHED,{type:L})},onError:function(C){U.logger.warn("[buffer-controller]: Failed to remove from "+L+" SourceBuffer",C)}}};o.type?A.append(_(o.type),o.type):this.getSourceBufferTypes().forEach(function(S){A.append(_(S),S)})},f.onFragParsed=function(h,o){var s=this,A=o.frag,_=o.part,S=[],L=_?_.elementaryStreams:A.elementaryStreams;L[D.ElementaryStreamTypes.AUDIOVIDEO]?S.push("audiovideo"):(L[D.ElementaryStreamTypes.AUDIO]&&S.push("audio"),L[D.ElementaryStreamTypes.VIDEO]&&S.push("video"));var O=function(){var w=self.performance.now();A.stats.buffering.end=w,_&&(_.stats.buffering.end=w);var x=_?_.stats:A.stats;s.hls.trigger(F.Events.FRAG_BUFFERED,{frag:A,part:_,stats:x,id:A.type})};S.length===0&&U.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+A.type+" level: "+A.level+" sn: "+A.sn),this.blockBuffers(O,S)},f.onFragChanged=function(h,o){this.flushBackBuffer()},f.onBufferEos=function(h,o){var s=this,A=this.getSourceBufferTypes().reduce(function(_,S){var L=s.sourceBuffer[S];return(!o.type||o.type===S)&&(L&&!L.ended&&(L.ended=!0,U.logger.log("[buffer-controller]: "+S+" sourceBuffer now EOS"))),_&&!!(!L||L.ended)},!0);A&&this.blockBuffers(function(){var _=s.mediaSource;if(!_||_.readyState!=="open")return;_.endOfStream()})},f.onLevelUpdated=function(h,o){var s=o.details;if(!s.fragments.length)return;this.details=s,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},f.flushBackBuffer=function(){var h=this.hls,o=this.details,s=this.media,A=this.sourceBuffer;if(!s||o===null)return;var _=this.getSourceBufferTypes();if(!_.length)return;var S=o.live&&h.config.liveBackBufferLength!==null?h.config.liveBackBufferLength:h.config.backBufferLength;if(!Object(Y.isFiniteNumber)(S)||S<0)return;var L=s.currentTime,O=o.levelTargetDuration,C=Math.max(S,O),w=Math.floor(L/O)*O-C;_.forEach(function(x){var p=A[x];if(p){var T=W.BufferHelper.getBuffered(p);T.length>0&&w>T.start(0)&&(h.trigger(F.Events.BACK_BUFFER_REACHED,{bufferEnd:w}),o.live&&h.trigger(F.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:w}),h.trigger(F.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:w,type:x}))}})},f.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var h=this.details,o=this.hls,s=this.media,A=this.mediaSource,_=h.fragments[0].start+h.totalduration,S=s.duration,L=Object(Y.isFiniteNumber)(A.duration)?A.duration:0;h.live&&o.config.liveDurationInfinity?(U.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),A.duration=Infinity,this.updateSeekableRange(h)):(_>L&&_>S||!Object(Y.isFiniteNumber)(S))&&(U.logger.log("[buffer-controller]: Updating Media Source duration to "+_.toFixed(3)),A.duration=_)},f.updateSeekableRange=function(h){var o=this.mediaSource,s=h.fragments,A=s.length;if(A&&h.live&&o!==null&&o!==void 0&&o.setLiveSeekableRange){var _=Math.max(0,s[0].start),S=Math.max(_,_+h.totalduration);o.setLiveSeekableRange(_,S)}},f.checkPendingTracks=function(){var h=this.bufferCodecEventsExpected,o=this.operationQueue,s=this.pendingTracks,A=Object.keys(s).length;if(A&&!h||A===2){this.createSourceBuffers(s),this.pendingTracks={};var _=this.getSourceBufferTypes();if(_.length===0){this.hls.trigger(F.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}_.forEach(function(S){o.executeNext(S)})}},f.createSourceBuffers=function(h){var o=this.sourceBuffer,s=this.mediaSource;if(!s)throw Error("createSourceBuffers called when mediaSource was null");var A=0;for(var _ in h)if(!o[_]){var S=h[_];if(!S)throw Error("source buffer exists for track "+_+", however track does not");var L=S.levelCodec||S.codec,O=S.container+";codecs="+L;U.logger.log("[buffer-controller]: creating sourceBuffer("+O+")");try{var C=o[_]=s.addSourceBuffer(O),w=_;this.addBufferListener(w,"updatestart",this._onSBUpdateStart),this.addBufferListener(w,"updateend",this._onSBUpdateEnd),this.addBufferListener(w,"error",this._onSBUpdateError),this.tracks[_]={buffer:C,codec:L,container:S.container,levelCodec:S.levelCodec,id:S.id},A++}catch(x){U.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+x.message),this.hls.trigger(F.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:x,mimeType:O})}}A&&this.hls.trigger(F.Events.BUFFER_CREATED,{tracks:this.tracks})},f._onSBUpdateStart=function(h){var o=this.operationQueue,s=o.current(h);s.onStart()},f._onSBUpdateEnd=function(h){var o=this.operationQueue,s=o.current(h);s.onComplete(),o.shiftAndExecuteNext(h)},f._onSBUpdateError=function(h,o){U.logger.error("[buffer-controller]: "+h+" SourceBuffer error",o),this.hls.trigger(F.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var s=this.operationQueue.current(h);s&&s.onError(o)},f.removeExecutor=function(h,o,s){var A=this.media,_=this.mediaSource,S=this.operationQueue,L=this.sourceBuffer,O=L[h];if(!A||!_||!O){U.logger.warn("[buffer-controller]: Attempting to remove from the "+h+" SourceBuffer, but it does not exist"),S.shiftAndExecuteNext(h);return}var C=Object(Y.isFiniteNumber)(A.duration)?A.duration:Infinity,w=Object(Y.isFiniteNumber)(_.duration)?_.duration:Infinity,x=Math.max(0,o),p=Math.min(s,C,w);p>x?(U.logger.log("[buffer-controller]: Removing ["+x+","+p+"] from the "+h+" SourceBuffer"),console.assert(!O.updating,h+" sourceBuffer must not be updating"),O.remove(x,p)):S.shiftAndExecuteNext(h)},f.appendExecutor=function(h,o){var s=this.operationQueue,A=this.sourceBuffer,_=A[o];if(!_){U.logger.warn("[buffer-controller]: Attempting to append to the "+o+" SourceBuffer, but it does not exist"),s.shiftAndExecuteNext(o);return}_.ended=!1,console.assert(!_.updating,o+" sourceBuffer must not be updating"),_.appendBuffer(h)},f.blockBuffers=function(h,o){var s=this;if(o===void 0&&(o=this.getSourceBufferTypes()),!o.length){U.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(h);return}var A=this.operationQueue,_=o.map(function(S){return A.appendBlocker(S)});Promise.all(_).then(function(){h(),o.forEach(function(S){var L=s.sourceBuffer[S];(!L||!L.updating)&&A.shiftAndExecuteNext(S)})})},f.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},f.addBufferListener=function(h,o,s){var A=this.sourceBuffer[h];if(!A)return;var _=s.bind(this,h);this.listeners[h].push({event:o,listener:_}),A.addEventListener(o,_)},f.removeBufferListeners=function(h){var o=this.sourceBuffer[h];if(!o)return;this.listeners[h].forEach(function(s){o.removeEventListener(s.event,s.listener)})},a}()},"./src/controller/buffer-operation-queue.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return F});var Y=M("./src/utils/logger.ts"),F=function(){function U(W){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=W}var G=U.prototype;return G.append=function(i,D){var g=this.queues[D];g.push(i),g.length===1&&this.buffers[D]&&this.executeNext(D)},G.insertAbort=function(i,D){var g=this.queues[D];g.unshift(i),this.executeNext(D)},G.appendBlocker=function(i){var D,g=new Promise(function(m){D=m}),d={execute:D,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(d,i),g},G.executeNext=function(i){var D=this.buffers,g=this.queues,d=D[i],m=g[i];if(m.length){var u=m[0];try{u.execute()}catch(a){Y.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),u.onError(a),(!d||!d.updating)&&(m.shift(),this.executeNext(i))}}},G.shiftAndExecuteNext=function(i){this.queues[i].shift(),this.executeNext(i)},G.current=function(i){return this.queues[i][0]},U}()},"./src/controller/cap-level-controller.ts":function(ie,$,M){"use strict";M.r($);var Y=M("./src/events.ts");function F(W,i){for(var D=0;D<i.length;D++){var g=i[D];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(W,g.key,g)}}function U(W,i,D){return i&&F(W.prototype,i),D&&F(W,D),W}var G=function(){function W(D){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=D,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var i=W.prototype;return i.setStreamController=function(g){this.streamController=g},i.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},i.registerListeners=function(){var g=this.hls;g.on(Y.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.on(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.on(Y.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},i.unregisterListener=function(){var g=this.hls;g.off(Y.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.off(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.off(Y.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},i.onFpsDropLevelCapping=function(g,d){W.isLevelAllowed(d.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(d.droppedLevel)},i.onMediaAttaching=function(g,d){this.media=d.media instanceof HTMLVideoElement?d.media:null},i.onManifestParsed=function(g,d){var m=this.hls;this.restrictedLevels=[],this.firstLevel=d.firstLevel,m.config.capLevelToPlayerSize&&d.video&&this.startCapping()},i.onBufferCodecs=function(g,d){var m=this.hls;m.config.capLevelToPlayerSize&&d.video&&this.startCapping()},i.onMediaDetaching=function(){this.stopCapping()},i.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var g=this.hls.levels;if(g.length){var d=this.hls;d.autoLevelCapping=this.getMaxLevel(g.length-1),d.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=d.autoLevelCapping}}},i.getMaxLevel=function(g){var d=this,m=this.hls.levels;if(!m.length)return-1;var u=m.filter(function(a,f){return W.isLevelAllowed(f,d.restrictedLevels)&&f<=g});return this.clientRect=null,W.getMaxLevelByMediaSize(u,this.mediaWidth,this.mediaHeight)},i.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},i.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},i.getDimensions=function(){if(this.clientRect)return this.clientRect;var g=this.media,d={width:0,height:0};if(g){var m=g.getBoundingClientRect();d.width=m.width,d.height=m.height,!d.width&&!d.height&&(d.width=m.right-m.left||g.width||0,d.height=m.bottom-m.top||g.height||0)}return this.clientRect=d,d},W.isLevelAllowed=function(g,d){return d===void 0&&(d=[]),d.indexOf(g)===-1},W.getMaxLevelByMediaSize=function(g,d,m){if(!g||!g.length)return-1;for(var u=function(o,s){return s?o.width!==s.width||o.height!==s.height:!0},a=g.length-1,f=0;f<g.length;f+=1){var l=g[f];if((l.width>=d||l.height>=m)&&u(l,g[f+1])){a=f;break}}return a},U(W,[{key:"mediaWidth",get:function(){return this.getDimensions().width*W.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*W.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var g=1;try{g=self.devicePixelRatio}catch(d){}return g}}]),W}();$.default=G},"./src/controller/cmcd-controller.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return u});var Y=M("./src/events.ts"),F=M("./src/types/cmcd.ts"),U=M("./src/utils/buffer-helper.ts"),G=M("./src/utils/logger.ts");function W(a,f){for(var l=0;l<f.length;l++){var h=f[l];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(a,h.key,h)}}function i(a,f,l){return f&&W(a.prototype,f),l&&W(a,l),a}function D(a,f){var l=typeof Symbol!="undefined"&&a[Symbol.iterator]||a["@@iterator"];if(l)return(l=l.call(a)).next.bind(l);if(Array.isArray(a)||(l=g(a))||f&&a&&typeof a.length=="number"){l&&(a=l);var h=0;return function(){return h>=a.length?{done:!0}:{done:!1,value:a[h++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g(a,f){if(!a)return;if(typeof a=="string")return d(a,f);var l=Object.prototype.toString.call(a).slice(8,-1);if(l==="Object"&&a.constructor&&(l=a.constructor.name),l==="Map"||l==="Set")return Array.from(a);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return d(a,f)}function d(a,f){(f==null||f>a.length)&&(f=a.length);for(var l=0,h=new Array(f);l<f;l++)h[l]=a[l];return h}function m(){return m=Object.assign||function(a){for(var f=1;f<arguments.length;f++){var l=arguments[f];for(var h in l)Object.prototype.hasOwnProperty.call(l,h)&&(a[h]=l[h])}return a},m.apply(this,arguments)}var u=function(){function a(l){var h=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(){h.initialized&&(h.starved=!0),h.buffering=!0},this.onPlaying=function(){h.initialized||(h.initialized=!0),h.buffering=!1},this.applyPlaylistData=function(A){try{h.apply(A,{ot:F.CMCDObjectType.MANIFEST,su:!h.initialized})}catch(_){G.logger.warn("Could not generate manifest CMCD data.",_)}},this.applyFragmentData=function(A){try{var _=A.frag,S=h.hls.levels[_.level],L=h.getObjectType(_),O={d:_.duration*1e3,ot:L};(L===F.CMCDObjectType.VIDEO||L===F.CMCDObjectType.AUDIO||L==F.CMCDObjectType.MUXED)&&(O.br=S.bitrate/1e3,O.tb=h.getTopBandwidth(L),O.bl=h.getBufferLength(L)),h.apply(A,O)}catch(C){G.logger.warn("Could not generate segment CMCD data.",C)}},this.hls=l;var o=this.config=l.config,s=o.cmcd;s!=null&&(o.pLoader=this.createPlaylistLoader(),o.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||a.uuid(),this.cid=s.contentId,this.useHeaders=s.useHeaders===!0,this.registerListeners())}var f=a.prototype;return f.registerListeners=function(){var h=this.hls;h.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),h.on(Y.Events.BUFFER_CREATED,this.onBufferCreated,this)},f.unregisterListeners=function(){var h=this.hls;h.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),h.off(Y.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(h,o){this.media=o.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(h,o){var s,A;this.audioBuffer=(s=o.tracks.audio)===null||s===void 0?void 0:s.buffer,this.videoBuffer=(A=o.tracks.video)===null||A===void 0?void 0:A.buffer},f.createData=function(){var h;return{v:F.CMCDVersion,sf:F.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(h=this.media)===null||h===void 0?void 0:h.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},f.apply=function(h,o){o===void 0&&(o={}),m(o,this.createData());var s=o.ot===F.CMCDObjectType.INIT||o.ot===F.CMCDObjectType.VIDEO||o.ot===F.CMCDObjectType.MUXED;if(this.starved&&s&&(o.bs=!0,o.su=!0,this.starved=!1),o.su==null&&(o.su=this.buffering),this.useHeaders){var A=a.toHeaders(o);if(!Object.keys(A).length)return;h.headers||(h.headers={}),m(h.headers,A)}else{var _=a.toQuery(o);if(!_)return;h.url=a.appendQueryToUri(h.url,_)}},f.getObjectType=function(h){var o=h.type;return o==="subtitle"?F.CMCDObjectType.TIMED_TEXT:h.sn==="initSegment"?F.CMCDObjectType.INIT:o==="audio"?F.CMCDObjectType.AUDIO:o==="main"?this.hls.audioTracks.length?F.CMCDObjectType.VIDEO:F.CMCDObjectType.MUXED:void 0},f.getTopBandwidth=function(h){for(var o=0,s=h===F.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,A=D(s),_;!(_=A()).done;){var S=_.value;S.bitrate>o&&(o=S.bitrate)}return o>0?o:NaN},f.getBufferLength=function(h){var o=this.hls.media,s=h===F.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!s||!o)return NaN;var A=U.BufferHelper.bufferInfo(s,o.currentTime,this.config.maxBufferHole);return A.len*1e3},f.createPlaylistLoader=function(){var h=this.config.pLoader,o=this.applyPlaylistData,s=h||this.config.loader;return function(){function A(S){this.loader=void 0,this.loader=new s(S)}var _=A.prototype;return _.destroy=function(){this.loader.destroy()},_.abort=function(){this.loader.abort()},_.load=function(L,O,C){o(L),this.loader.load(L,O,C)},i(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},f.createFragmentLoader=function(){var h=this.config.fLoader,o=this.applyFragmentData,s=h||this.config.loader;return function(){function A(S){this.loader=void 0,this.loader=new s(S)}var _=A.prototype;return _.destroy=function(){this.loader.destroy()},_.abort=function(){this.loader.abort()},_.load=function(L,O,C){o(L),this.loader.load(L,O,C)},i(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},a.uuid=function(){var h=URL.createObjectURL(new Blob),o=h.toString();return URL.revokeObjectURL(h),o.substr(o.lastIndexOf("/")+1)},a.serialize=function(h){for(var o=[],s=function(B){return!Number.isNaN(B)&&B!=null&&B!==""&&B!==!1},A=function(B){return Math.round(B)},_=function(B){return A(B/100)*100},S=function(B){return encodeURIComponent(B)},L={br:A,d:A,bl:_,dl:_,mtp:_,nor:S,rtp:_,tb:A},O=Object.keys(h||{}).sort(),C=D(O),w;!(w=C()).done;){var x=w.value,p=h[x];if(!s(p))continue;if(x==="v"&&p===1)continue;if(x=="pr"&&p===1)continue;var T=L[x];T&&(p=T(p));var v=typeof p,y=void 0;x==="ot"||x==="sf"||x==="st"?y=x+"="+p:v==="boolean"?y=x:v==="number"?y=x+"="+p:y=x+"="+JSON.stringify(p),o.push(y)}return o.join(",")},a.toHeaders=function(h){for(var o=Object.keys(h),s={},A=["Object","Request","Session","Status"],_=[{},{},{},{}],S={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},L=0,O=o;L<O.length;L++){var C=O[L],w=S[C]!=null?S[C]:1;_[w][C]=h[C]}for(var x=0;x<_.length;x++){var p=a.serialize(_[x]);p&&(s["CMCD-"+A[x]]=p)}return s},a.toQuery=function(h){return"CMCD="+encodeURIComponent(a.serialize(h))},a.appendQueryToUri=function(h,o){if(!o)return h;var s=h.includes("?")?"&":"?";return""+h+s+o},a}()},"./src/controller/eme-controller.ts":function(ie,$,M){"use strict";M.r($);var Y=M("./src/events.ts"),F=M("./src/errors.ts"),U=M("./src/utils/logger.ts"),G=M("./src/utils/mediakeys-helper.ts");function W(u,a){for(var f=0;f<a.length;f++){var l=a[f];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(u,l.key,l)}}function i(u,a,f){return a&&W(u.prototype,a),f&&W(u,f),u}var D=3,g=function(a,f,l){var h={audioCapabilities:[],videoCapabilities:[]};return a.forEach(function(o){h.audioCapabilities.push({contentType:'audio/mp4; codecs="'+o+'"',robustness:l.audioRobustness||""})}),f.forEach(function(o){h.videoCapabilities.push({contentType:'video/mp4; codecs="'+o+'"',robustness:l.videoRobustness||""})}),[h]},d=function(a,f,l,h){switch(a){case G.KeySystems.WIDEVINE:return g(f,l,h);default:throw new Error("Unknown key-system: "+a)}},m=function(){function u(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 a=u.prototype;return a.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},a._registerListeners=function(){this.hls.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a._unregisterListeners=function(){this.hls.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a.getLicenseServerUrl=function(l){switch(l){case G.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+l+'"')},a._attemptKeySystemAccess=function(l,h,o){var s=this,A=d(l,h,o,this._drmSystemOptions);U.logger.log("Requesting encrypted media key-system access");var _=this.requestMediaKeySystemAccess(l,A);this.mediaKeysPromise=_.then(function(S){return s._onMediaKeySystemAccessObtained(l,S)}),_.catch(function(S){U.logger.error('Failed to obtain key-system "'+l+'" access:',S)})},a._onMediaKeySystemAccessObtained=function(l,h){var o=this;U.logger.log('Access for key-system "'+l+'" obtained');var s={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:h,mediaKeySystemDomain:l};this._mediaKeysList.push(s);var A=Promise.resolve().then(function(){return h.createMediaKeys()}).then(function(_){return s.mediaKeys=_,U.logger.log('Media-keys created for key-system "'+l+'"'),o._onMediaKeysCreated(),_});return A.catch(function(_){U.logger.error("Failed to create media-keys:",_)}),A},a._onMediaKeysCreated=function(){var l=this;this._mediaKeysList.forEach(function(h){h.mediaKeysSession||(h.mediaKeysSession=h.mediaKeys.createSession(),l._onNewMediaKeySession(h.mediaKeysSession))})},a._onNewMediaKeySession=function(l){var h=this;U.logger.log("New key-system session "+l.sessionId),l.addEventListener("message",function(o){h._onKeySessionMessage(l,o.message)},!1)},a._onKeySessionMessage=function(l,h){U.logger.log("Got EME message event, creating license request"),this._requestLicense(h,function(o){U.logger.log("Received license data (length: "+(o&&o.byteLength)+"), updating key-session"),l.update(o)})},a.onMediaEncrypted=function(l){var h=this;if(U.logger.log('Media is encrypted using "'+l.initDataType+'" init data type'),!this.mediaKeysPromise){U.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(Y.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var o=function(A){if(!h._media)return;h._attemptSetMediaKeys(A),h._generateRequestWithPreferredKeySession(l.initDataType,l.initData)};this.mediaKeysPromise.then(o).catch(o)},a._attemptSetMediaKeys=function(l){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var h=this._mediaKeysList[0];if(!h||!h.mediaKeys){U.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(Y.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}U.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(h.mediaKeys),this._hasSetMediaKeys=!0}},a._generateRequestWithPreferredKeySession=function(l,h){var o=this,s=this._mediaKeysList[0];if(!s){U.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(Y.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(s.mediaKeysSessionInitialized){U.logger.warn("Key-Session already initialized but requested again");return}var A=s.mediaKeysSession;if(!A){U.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(Y.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!h){U.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(Y.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}U.logger.log('Generating key-session request for "'+l+'" init data type'),s.mediaKeysSessionInitialized=!0,A.generateRequest(l,h).then(function(){U.logger.debug("Key-session generation succeeded")}).catch(function(_){U.logger.error("Error generating key-session request:",_),o.hls.trigger(Y.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},a._createLicenseXhr=function(l,h,o){var s=new XMLHttpRequest;s.responseType="arraybuffer",s.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,s,l,h,o);var A=this._licenseXhrSetup;if(A)try{A.call(this.hls,s,l),A=void 0}catch(_){U.logger.error(_)}try{s.readyState||s.open("POST",l,!0),A&&A.call(this.hls,s,l)}catch(_){throw new Error("issue setting up KeySystem license XHR "+_)}return s},a._onLicenseRequestReadyStageChange=function(l,h,o,s){switch(l.readyState){case 4:if(l.status===200){this._requestLicenseFailureCount=0,U.logger.log("License request succeeded");var A=l.response,_=this._licenseResponseCallback;if(_)try{A=_.call(this.hls,l,h)}catch(L){U.logger.error(L)}s(A)}else{if(U.logger.error("License Request XHR failed ("+h+"). Status: "+l.status+" ("+l.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>D){this.hls.trigger(Y.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var S=D-this._requestLicenseFailureCount+1;U.logger.warn("Retrying license request, "+S+" attempts left"),this._requestLicense(o,s)}break}},a._generateLicenseRequestChallenge=function(l,h){switch(l.mediaKeySystemDomain){case G.KeySystems.WIDEVINE:return h}throw new Error("unsupported key-system: "+l.mediaKeySystemDomain)},a._requestLicense=function(l,h){U.logger.log("Requesting content license for key-system");var o=this._mediaKeysList[0];if(!o){U.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(Y.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var s=this.getLicenseServerUrl(o.mediaKeySystemDomain),A=this._createLicenseXhr(s,l,h);U.logger.log("Sending license request to URL: "+s);var _=this._generateLicenseRequestChallenge(o,l);A.send(_)}catch(S){U.logger.error("Failure requesting DRM license: "+S),this.hls.trigger(Y.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},a.onMediaAttached=function(l,h){if(!this._emeEnabled)return;var o=h.media;this._media=o,o.addEventListener("encrypted",this._onMediaEncrypted)},a.onMediaDetached=function(){var l=this._media,h=this._mediaKeysList;if(!l)return;l.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(h.map(function(o){if(o.mediaKeysSession)return o.mediaKeysSession.close().catch(function(){})})).then(function(){return l.setMediaKeys(null)}).catch(function(){})},a.onManifestParsed=function(l,h){if(!this._emeEnabled)return;var o=h.levels.map(function(A){return A.audioCodec}).filter(function(A){return!!A}),s=h.levels.map(function(A){return A.videoCodec}).filter(function(A){return!!A});this._attemptKeySystemAccess(G.KeySystems.WIDEVINE,o,s)},i(u,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),u}();$.default=m},"./src/controller/fps-controller.ts":function(ie,$,M){"use strict";M.r($);var Y=M("./src/events.ts"),F=M("./src/utils/logger.ts"),U=function(){function G(i){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=i,this.registerListeners()}var W=G.prototype;return W.setStreamController=function(D){this.streamController=D},W.registerListeners=function(){this.hls.on(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},W.unregisterListeners=function(){this.hls.off(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching)},W.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},W.onMediaAttaching=function(D,g){var d=this.hls.config;if(d.capLevelOnFPSDrop){var m=g.media instanceof self.HTMLVideoElement?g.media:null;this.media=m,m&&typeof m.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),d.fpsDroppedMonitoringPeriod)}},W.checkFPS=function(D,g,d){var m=performance.now();if(g){if(this.lastTime){var u=m-this.lastTime,a=d-this.lastDroppedFrames,f=g-this.lastDecodedFrames,l=1e3*a/u,h=this.hls;if(h.trigger(Y.Events.FPS_DROP,{currentDropped:a,currentDecoded:f,totalDroppedFrames:d}),l>0&&a>h.config.fpsDroppedMonitoringThreshold*f){var o=h.currentLevel;F.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+o),o>0&&(h.autoLevelCapping===-1||h.autoLevelCapping>=o)&&(o=o-1,h.trigger(Y.Events.FPS_DROP_LEVEL_CAPPING,{level:o,droppedLevel:h.currentLevel}),h.autoLevelCapping=o,this.streamController.nextLevelSwitch())}}this.lastTime=m,this.lastDroppedFrames=d,this.lastDecodedFrames=g}},W.checkFPSInterval=function(){var D=this.media;if(D)if(this.isVideoPlaybackQualityAvailable){var g=D.getVideoPlaybackQuality();this.checkFPS(D,g.totalVideoFrames,g.droppedVideoFrames)}else this.checkFPS(D,D.webkitDecodedFrameCount,D.webkitDroppedFrameCount)},G}();$.default=U},"./src/controller/fragment-finders.ts":function(ie,$,M){"use strict";M.r($),M.d($,"findFragmentByPDT",function(){return U}),M.d($,"findFragmentByPTS",function(){return G}),M.d($,"fragmentWithinToleranceTest",function(){return W}),M.d($,"pdtWithinToleranceTest",function(){return i}),M.d($,"findFragWithCC",function(){return D});var Y=M("./src/polyfills/number.ts"),F=M("./src/utils/binary-search.ts");function U(g,d,m){if(d===null||!Array.isArray(g)||!g.length||!Object(Y.isFiniteNumber)(d))return null;var u=g[0].programDateTime;if(d<(u||0))return null;var a=g[g.length-1].endProgramDateTime;if(d>=(a||0))return null;m=m||0;for(var f=0;f<g.length;++f){var l=g[f];if(i(d,m,l))return l}return null}function G(g,d,m,u){m===void 0&&(m=0),u===void 0&&(u=0);var a=null;if(g?a=d[g.sn-d[0].sn+1]||null:m===0&&d[0].start===0&&(a=d[0]),a&&W(m,u,a)===0)return a;var f=F.default.search(d,W.bind(null,m,u));return f||a}function W(g,d,m){g===void 0&&(g=0),d===void 0&&(d=0);var u=Math.min(d,m.duration+(m.deltaPTS?m.deltaPTS:0));return m.start+m.duration-u<=g?1:m.start-u>g&&m.start?-1:0}function i(g,d,m){var u=Math.min(d,m.duration+(m.deltaPTS?m.deltaPTS:0))*1e3,a=m.endProgramDateTime||0;return a-u>g}function D(g,d){return F.default.search(g,function(m){return m.cc<d?1:m.cc>d?-1:0})}},"./src/controller/fragment-tracker.ts":function(ie,$,M){"use strict";M.r($),M.d($,"FragmentState",function(){return U}),M.d($,"FragmentTracker",function(){return G});var Y=M("./src/events.ts"),F=M("./src/types/loader.ts"),U;(function(D){D.NOT_LOADED="NOT_LOADED",D.BACKTRACKED="BACKTRACKED",D.APPENDING="APPENDING",D.PARTIAL="PARTIAL",D.OK="OK"})(U||(U={}));var G=function(){function D(d){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=d,this._registerListeners()}var g=D.prototype;return g._registerListeners=function(){var m=this.hls;m.on(Y.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.on(Y.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.on(Y.Events.FRAG_LOADED,this.onFragLoaded,this)},g._unregisterListeners=function(){var m=this.hls;m.off(Y.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.off(Y.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.off(Y.Events.FRAG_LOADED,this.onFragLoaded,this)},g.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},g.getAppendedFrag=function(m,u){if(u===F.PlaylistLevelType.MAIN){var a=this.activeFragment,f=this.activeParts;if(!a)return null;if(f)for(var l=f.length;l--;){var h=f[l],o=h?h.end:a.appendedPTS;if(h.start<=m&&o!==void 0&&m<=o)return l>9&&(this.activeParts=f.slice(l-9)),h}else if(a.start<=m&&a.appendedPTS!==void 0&&m<=a.appendedPTS)return a}return this.getBufferedFrag(m,u)},g.getBufferedFrag=function(m,u){for(var a=this.fragments,f=Object.keys(a),l=f.length;l--;){var h=a[f[l]];if((h==null?void 0:h.body.type)===u&&h.buffered){var o=h.body;if(o.start<=m&&m<=o.end)return o}}return null},g.detectEvictedFragments=function(m,u,a){var f=this;Object.keys(this.fragments).forEach(function(l){var h=f.fragments[l];if(!h)return;if(!h.buffered){h.body.type===a&&f.removeFragment(h.body);return}var o=h.range[m];if(!o)return;o.time.some(function(s){var A=!f.isTimeBuffered(s.startPTS,s.endPTS,u);return A&&f.removeFragment(h.body),A})})},g.detectPartialFragments=function(m){var u=this,a=this.timeRanges,f=m.frag,l=m.part;if(!a||f.sn==="initSegment")return;var h=i(f),o=this.fragments[h];if(!o)return;Object.keys(a).forEach(function(s){var A=f.elementaryStreams[s];if(!A)return;var _=a[s],S=l!==null||A.partial===!0;o.range[s]=u.getBufferedTimes(f,l,S,_)}),o.backtrack=o.loaded=null,Object.keys(o.range).length?o.buffered=!0:this.removeFragment(o.body)},g.fragBuffered=function(m){var u=i(m),a=this.fragments[u];a&&(a.backtrack=a.loaded=null,a.buffered=!0)},g.getBufferedTimes=function(m,u,a,f){for(var l={time:[],partial:a},h=u?u.start:m.start,o=u?u.end:m.end,s=m.minEndPTS||o,A=m.maxStartPTS||h,_=0;_<f.length;_++){var S=f.start(_)-this.bufferPadding,L=f.end(_)+this.bufferPadding;if(A>=S&&s<=L){l.time.push({startPTS:Math.max(h,f.start(_)),endPTS:Math.min(o,f.end(_))});break}else if(h<L&&o>S)l.partial=!0,l.time.push({startPTS:Math.max(h,f.start(_)),endPTS:Math.min(o,f.end(_))});else if(o<=S)break}return l},g.getPartialFragment=function(m){var u=null,a,f,l,h=0,o=this.bufferPadding,s=this.fragments;return Object.keys(s).forEach(function(A){var _=s[A];if(!_)return;W(_)&&(f=_.body.start-o,l=_.body.end+o,m>=f&&m<=l&&(a=Math.min(m-f,l-m),h<=a&&(u=_.body,h=a)))}),u},g.getState=function(m){var u=i(m),a=this.fragments[u];return a?a.buffered?W(a)?U.PARTIAL:U.OK:a.backtrack?U.BACKTRACKED:U.APPENDING:U.NOT_LOADED},g.backtrack=function(m,u){var a=i(m),f=this.fragments[a];if(!f||f.backtrack)return null;var l=f.backtrack=u||f.loaded;return f.loaded=null,l},g.getBacktrackData=function(m){var u=i(m),a=this.fragments[u];if(a){var f,l=a.backtrack;if(l!=null&&(f=l.payload)!==null&&f!==void 0&&f.byteLength)return l;this.removeFragment(m)}return null},g.isTimeBuffered=function(m,u,a){for(var f,l,h=0;h<a.length;h++){if(f=a.start(h)-this.bufferPadding,l=a.end(h)+this.bufferPadding,m>=f&&u<=l)return!0;if(u<=f)return!1}return!1},g.onFragLoaded=function(m,u){var a=u.frag,f=u.part;if(a.sn==="initSegment"||a.bitrateTest||f)return;var l=i(a);this.fragments[l]={body:a,loaded:u,backtrack:null,buffered:!1,range:Object.create(null)}},g.onBufferAppended=function(m,u){var a=this,f=u.frag,l=u.part,h=u.timeRanges;if(f.type===F.PlaylistLevelType.MAIN)if(this.activeFragment=f,l){var o=this.activeParts;o||(this.activeParts=o=[]),o.push(l)}else this.activeParts=null;this.timeRanges=h,Object.keys(h).forEach(function(s){var A=h[s];if(a.detectEvictedFragments(s,A),!l)for(var _=0;_<A.length;_++)f.appendedPTS=Math.max(A.end(_),f.appendedPTS||0)})},g.onFragBuffered=function(m,u){this.detectPartialFragments(u)},g.hasFragment=function(m){var u=i(m);return!!this.fragments[u]},g.removeFragmentsInRange=function(m,u,a){var f=this;Object.keys(this.fragments).forEach(function(l){var h=f.fragments[l];if(!h)return;if(h.buffered){var o=h.body;o.type===a&&o.start<u&&o.end>m&&f.removeFragment(o)}})},g.removeFragment=function(m){var u=i(m);m.stats.loaded=0,m.clearElementaryStreamInfo(),delete this.fragments[u]},g.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},D}();function W(D){var g,d;return D.buffered&&(((g=D.range.video)===null||g===void 0?void 0:g.partial)||((d=D.range.audio)===null||d===void 0?void 0:d.partial))}function i(D){return D.type+"_"+D.level+"_"+D.urlId+"_"+D.sn}},"./src/controller/gap-controller.ts":function(ie,$,M){"use strict";M.r($),M.d($,"STALL_MINIMUM_DURATION_MS",function(){return W}),M.d($,"MAX_START_GAP_JUMP",function(){return i}),M.d($,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return D}),M.d($,"SKIP_BUFFER_RANGE_START",function(){return g}),M.d($,"default",function(){return d});var Y=M("./src/utils/buffer-helper.ts"),F=M("./src/errors.ts"),U=M("./src/events.ts"),G=M("./src/utils/logger.ts"),W=250,i=2,D=.1,g=.05,d=function(){function m(a,f,l,h){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=a,this.media=f,this.fragmentTracker=l,this.hls=h}var u=m.prototype;return u.destroy=function(){this.hls=this.fragmentTracker=this.media=null},u.poll=function(f){var l=this.config,h=this.media,o=this.stalled,s=h.currentTime,A=h.seeking,_=this.seeking&&!A,S=!this.seeking&&A;if(this.seeking=A,s!==f){if(this.moved=!0,o!==null){if(this.stallReported){var L=self.performance.now()-o;G.logger.warn("playback not stuck anymore @"+s+", after "+Math.round(L)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((S||_)&&(this.stalled=null),h.paused||h.ended||h.playbackRate===0||!Y.BufferHelper.getBuffered(h).length)return;var O=Y.BufferHelper.bufferInfo(h,s,0),C=O.len>0,w=O.nextStart||0;if(!C&&!w)return;if(A){var x=O.len>i,p=!w||w-s>i&&!this.fragmentTracker.getPartialFragment(s);if(x||p)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var T,v=Math.max(w,O.start||0)-s,y=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,N=y==null||((T=y.details)===null||T===void 0)?void 0:T.live,B=N?y.details.targetduration*2:i;if(v>0&&v<=B){this._trySkipBufferHole(null);return}}var R=self.performance.now();if(o===null){this.stalled=R;return}var j=R-o;!A&&j>=W&&this._reportStall(O.len);var P=Y.BufferHelper.bufferInfo(h,s,l.maxBufferHole);this._tryFixBufferStall(P,j)},u._tryFixBufferStall=function(f,l){var h=this.config,o=this.fragmentTracker,s=this.media,A=s.currentTime,_=o.getPartialFragment(A);if(_){var S=this._trySkipBufferHole(_);if(S)return}f.len>h.maxBufferHole&&l>h.highBufferWatchdogPeriod*1e3&&(G.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},u._reportStall=function(f){var l=this.hls,h=this.media,o=this.stallReported;o||(this.stallReported=!0,G.logger.warn("Playback stalling at @"+h.currentTime+" due to low buffer (buffer="+f+")"),l.trigger(U.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:f}))},u._trySkipBufferHole=function(f){for(var l=this.config,h=this.hls,o=this.media,s=o.currentTime,A=0,_=Y.BufferHelper.getBuffered(o),S=0;S<_.length;S++){var L=_.start(S);if(s+l.maxBufferHole>=A&&s<L){var O=Math.max(L+g,o.currentTime+D);return G.logger.warn("skipping hole, adjusting currentTime from "+s+" to "+O),this.moved=!0,this.stalled=null,o.currentTime=O,f&&h.trigger(U.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+s+" to "+O,frag:f}),O}A=_.end(S)}return 0},u._tryNudgeBuffer=function(){var f=this.config,l=this.hls,h=this.media,o=h.currentTime,s=(this.nudgeRetry||0)+1;if(this.nudgeRetry=s,s<f.nudgeMaxRetry){var A=o+s*f.nudgeOffset;G.logger.warn("Nudging 'currentTime' from "+o+" to "+A),h.currentTime=A,l.trigger(U.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else G.logger.error("Playhead still not moving while enough data buffered @"+o+" after "+f.nudgeMaxRetry+" nudges"),l.trigger(U.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},m}()},"./src/controller/id3-track-controller.ts":function(ie,$,M){"use strict";M.r($);var Y=M("./src/events.ts"),F=M("./src/utils/texttrack-utils.ts"),U=M("./src/demux/id3.ts"),G=.25,W=function(){function i(g){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=g,this._registerListeners()}var D=i.prototype;return D.destroy=function(){this._unregisterListeners()},D._registerListeners=function(){var d=this.hls;d.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(Y.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),d.on(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D._unregisterListeners=function(){var d=this.hls;d.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(Y.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),d.off(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D.onMediaAttached=function(d,m){this.media=m.media},D.onMediaDetaching=function(){if(!this.id3Track)return;Object(F.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},D.getID3Track=function(d){if(!this.media)return;for(var m=0;m<d.length;m++){var u=d[m];if(u.kind==="metadata"&&u.label==="id3")return Object(F.sendAddTrackEvent)(u,this.media),u}return this.media.addTextTrack("metadata","id3")},D.onFragParsingMetadata=function(d,m){if(!this.media)return;var u=m.frag,a=m.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var f=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,l=0;l<a.length;l++){var h=U.getID3Frames(a[l].data);if(h){var o=a[l].pts,s=l<a.length-1?a[l+1].pts:u.end,A=s-o;A<=0&&(s=o+G);for(var _=0;_<h.length;_++){var S=h[_];if(!U.isTimeStampFrame(S)){var L=new f(o,s,"");L.value=S,this.id3Track.addCue(L)}}}}},D.onBufferFlushing=function(d,m){var u=m.startOffset,a=m.endOffset,f=m.type;if(!f||f==="audio"){var l=this.id3Track;l&&Object(F.removeCuesInRange)(l,u,a)}},i}();$.default=W},"./src/controller/latency-controller.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return i});var Y=M("./src/errors.ts"),F=M("./src/events.ts"),U=M("./src/utils/logger.ts");function G(D,g){for(var d=0;d<g.length;d++){var m=g[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(D,m.key,m)}}function W(D,g,d){return g&&G(D.prototype,g),d&&G(D,d),D}var i=function(){function D(d){var m=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return m.timeupdate()},this.hls=d,this.config=d.config,this.registerListeners()}var g=D.prototype;return g.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},g.registerListeners=function(){this.hls.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(F.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(F.Events.ERROR,this.onError,this)},g.unregisterListeners=function(){this.hls.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(F.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(F.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(F.Events.ERROR,this.onError)},g.onMediaAttached=function(m,u){this.media=u.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},g.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},g.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},g.onLevelUpdated=function(m,u){var a=u.details;this.levelDetails=a,a.advanced&&this.timeupdate(),!a.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},g.onError=function(m,u){if(u.details!==Y.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,U.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},g.timeupdate=function(){var m=this.media,u=this.levelDetails;if(!m||!u)return;this.currentTime=m.currentTime;var a=this.computeLatency();if(a===null)return;this._latency=a;var f=this.config,l=f.lowLatencyMode,h=f.maxLiveSyncPlaybackRate;if(!l||h===1)return;var o=this.targetLatency;if(o===null)return;var s=a-o,A=Math.min(this.maxLatency,o+u.targetduration),_=s<A;if(u.live&&_&&s>.05&&this.forwardBufferLength>1){var S=Math.min(2,Math.max(1,h)),L=Math.round(2/(1+Math.exp(-.75*s-this.edgeStalled))*20)/20;m.playbackRate=Math.min(S,Math.max(1,L))}else m.playbackRate!==1&&m.playbackRate!==0&&(m.playbackRate=1)},g.estimateLiveEdge=function(){var m=this.levelDetails;return m===null?null:m.edge+m.age},g.computeLatency=function(){var m=this.estimateLiveEdge();return m===null?null:m-this.currentTime},W(D,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var m=this.config,u=this.levelDetails;return m.liveMaxLatencyDuration!==void 0?m.liveMaxLatencyDuration:u?m.liveMaxLatencyDurationCount*u.targetduration:0}},{key:"targetLatency",get:function(){var m=this.levelDetails;if(m===null)return null;var u=m.holdBack,a=m.partHoldBack,f=m.targetduration,l=this.config,h=l.liveSyncDuration,o=l.liveSyncDurationCount,s=l.lowLatencyMode,A=this.hls.userConfig,_=s&&a||u;(A.liveSyncDuration||A.liveSyncDurationCount||_===0)&&(_=h!==void 0?h:o*f);var S=f,L=1;return _+Math.min(this.stallCount*L,S)}},{key:"liveSyncPosition",get:function(){var m=this.estimateLiveEdge(),u=this.targetLatency,a=this.levelDetails;if(m===null||u===null||a===null)return null;var f=a.edge,l=m-u-this.edgeStalled,h=f-a.totalduration,o=f-(this.config.lowLatencyMode&&a.partTarget||a.targetduration);return Math.min(Math.max(h,l),o)}},{key:"drift",get:function(){var m=this.levelDetails;return m===null?1:m.drift}},{key:"edgeStalled",get:function(){var m=this.levelDetails;if(m===null)return 0;var u=(this.config.lowLatencyMode&&m.partTarget||m.targetduration)*3;return Math.max(m.age-u,0)}},{key:"forwardBufferLength",get:function(){var m=this.media,u=this.levelDetails;if(!m||!u)return 0;var a=m.buffered.length;return a?m.buffered.end(a-1):u.edge-this.currentTime}}]),D}()},"./src/controller/level-controller.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return l});var Y=M("./src/types/level.ts"),F=M("./src/events.ts"),U=M("./src/errors.ts"),G=M("./src/utils/codecs.ts"),W=M("./src/controller/level-helper.ts"),i=M("./src/controller/base-playlist-controller.ts"),D=M("./src/types/loader.ts");function g(){return g=Object.assign||function(h){for(var o=1;o<arguments.length;o++){var s=arguments[o];for(var A in s)Object.prototype.hasOwnProperty.call(s,A)&&(h[A]=s[A])}return h},g.apply(this,arguments)}function d(h,o){for(var s=0;s<o.length;s++){var A=o[s];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(h,A.key,A)}}function m(h,o,s){return o&&d(h.prototype,o),s&&d(h,s),h}function u(h,o){h.prototype=Object.create(o.prototype),h.prototype.constructor=h,a(h,o)}function a(h,o){return a=Object.setPrototypeOf||function(A,_){return A.__proto__=_,A},a(h,o)}var f=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),l=function(h){u(o,h);function o(A){var _;return _=h.call(this,A,"[level-controller]")||this,_._levels=[],_._firstLevel=-1,_._startLevel=void 0,_.currentLevelIndex=-1,_.manualLevelIndex=-1,_.onParsedComplete=void 0,_._registerListeners(),_}var s=o.prototype;return s._registerListeners=function(){var _=this.hls;_.on(F.Events.MANIFEST_LOADED,this.onManifestLoaded,this),_.on(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.on(F.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.on(F.Events.FRAG_LOADED,this.onFragLoaded,this),_.on(F.Events.ERROR,this.onError,this)},s._unregisterListeners=function(){var _=this.hls;_.off(F.Events.MANIFEST_LOADED,this.onManifestLoaded,this),_.off(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.off(F.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.off(F.Events.FRAG_LOADED,this.onFragLoaded,this),_.off(F.Events.ERROR,this.onError,this)},s.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,h.prototype.destroy.call(this)},s.startLoad=function(){var _=this._levels;_.forEach(function(S){S.loadError=0}),h.prototype.startLoad.call(this)},s.onManifestLoaded=function(_,S){var L=[],O=[],C=[],w,x={},p,T=!1,v=!1,y=!1;if(S.levels.forEach(function(j){var P=j.attrs;T=T||!!(j.width&&j.height),v=v||!!j.videoCodec,y=y||!!j.audioCodec,f&&j.audioCodec&&j.audioCodec.indexOf("mp4a.40.34")!==-1&&(j.audioCodec=void 0);var b=j.bitrate+"-"+j.attrs.RESOLUTION+"-"+j.attrs.CODECS;p=x[b],p?p.url.push(j.url):(p=new Y.Level(j),x[b]=p,L.push(p)),P&&(P.AUDIO&&Object(W.addGroupId)(p,"audio",P.AUDIO),P.SUBTITLES&&Object(W.addGroupId)(p,"text",P.SUBTITLES))}),(T||v)&&y&&(L=L.filter(function(j){var P=j.videoCodec,b=j.width,X=j.height;return!!P||!!(b&&X)})),L=L.filter(function(j){var P=j.audioCodec,b=j.videoCodec;return(!P||Object(G.isCodecSupportedInMp4)(P,"audio"))&&(!b||Object(G.isCodecSupportedInMp4)(b,"video"))}),S.audioTracks&&(O=S.audioTracks.filter(function(j){return!j.audioCodec||Object(G.isCodecSupportedInMp4)(j.audioCodec,"audio")}),Object(W.assignTrackIdsByGroup)(O)),S.subtitles&&(C=S.subtitles,Object(W.assignTrackIdsByGroup)(C)),L.length>0){w=L[0].bitrate,L.sort(function(j,P){return j.bitrate-P.bitrate}),this._levels=L;for(var N=0;N<L.length;N++)if(L[N].bitrate===w){this._firstLevel=N,this.log("manifest loaded, "+L.length+" level(s) found, first bitrate: "+w);break}var B=y&&!v,R={levels:L,audioTracks:O,subtitleTracks:C,firstLevel:this._firstLevel,stats:S.stats,audio:y,video:v,altAudio:!B&&O.some(function(j){return!!j.url})};this.hls.trigger(F.Events.MANIFEST_PARSED,R),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(F.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:S.url,reason:"no level with compatible codecs found in manifest"})},s.onError=function(_,S){if(h.prototype.onError.call(this,_,S),S.fatal)return;var L=S.context,O=this._levels[this.currentLevelIndex];if(L&&(L.type===D.PlaylistContextType.AUDIO_TRACK&&O.audioGroupIds&&L.groupId===O.audioGroupIds[O.urlId]||L.type===D.PlaylistContextType.SUBTITLE_TRACK&&O.textGroupIds&&L.groupId===O.textGroupIds[O.urlId])){this.redundantFailover(this.currentLevelIndex);return}var C=!1,w=!0,x;switch(S.details){case U.ErrorDetails.FRAG_LOAD_ERROR:case U.ErrorDetails.FRAG_LOAD_TIMEOUT:case U.ErrorDetails.KEY_LOAD_ERROR:case U.ErrorDetails.KEY_LOAD_TIMEOUT:if(S.frag){var p=this._levels[S.frag.level];p?(p.fragmentError++,p.fragmentError>this.hls.config.fragLoadingMaxRetry&&(x=S.frag.level)):x=S.frag.level}break;case U.ErrorDetails.LEVEL_LOAD_ERROR:case U.ErrorDetails.LEVEL_LOAD_TIMEOUT:L&&(L.deliveryDirectives&&(w=!1),x=L.level),C=!0;break;case U.ErrorDetails.REMUX_ALLOC_ERROR:x=S.level,C=!0;break}x!==void 0&&this.recoverLevel(S,x,C,w)},s.recoverLevel=function(_,S,L,O){var C=_.details,w=this._levels[S];if(w.loadError++,L){var x=this.retryLoadingOrFail(_);if(x)_.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(O){var p=w.url.length;if(p>1&&w.loadError<p)_.levelRetry=!0,this.redundantFailover(S);else if(this.manualLevelIndex===-1){var T=S===0?this._levels.length-1:S-1;this.currentLevelIndex!==T&&this._levels[T].loadError===0&&(this.warn(C+": switch to "+T),_.levelRetry=!0,this.hls.nextAutoLevel=T)}}},s.redundantFailover=function(_){var S=this._levels[_],L=S.url.length;if(L>1){var O=(S.urlId+1)%L;this.warn("Switching to redundant URL-id "+O),this._levels.forEach(function(C){C.urlId=O}),this.level=_}},s.onFragLoaded=function(_,S){var L=S.frag;if(L!==void 0&&L.type===D.PlaylistLevelType.MAIN){var O=this._levels[L.level];O!==void 0&&(O.fragmentError=0,O.loadError=0)}},s.onLevelLoaded=function(_,S){var L,O=S.level,C=S.details,w=this._levels[O];if(!w){var x;this.warn("Invalid level index "+O),(x=S.deliveryDirectives)!==null&&x!==void 0&&x.skip&&(C.deltaUpdateFailed=!0);return}O===this.currentLevelIndex?(w.fragmentError===0&&(w.loadError=0,this.retryCount=0),this.playlistLoaded(O,S,w.details)):(L=S.deliveryDirectives)!==null&&L!==void 0&&L.skip&&(C.deltaUpdateFailed=!0)},s.onAudioTrackSwitched=function(_,S){var L=this.hls.levels[this.currentLevelIndex];if(!L)return;if(L.audioGroupIds){for(var O=-1,C=this.hls.audioTracks[S.id].groupId,w=0;w<L.audioGroupIds.length;w++)if(L.audioGroupIds[w]===C){O=w;break}O!==L.urlId&&(L.urlId=O,this.startLoad())}},s.loadPlaylist=function(_){var S=this.currentLevelIndex,L=this._levels[S];if(this.canLoad&&L&&L.url.length>0){var O=L.urlId,C=L.url[O];if(_)try{C=_.addDirectives(C)}catch(w){this.warn("Could not construct new URL with HLS Delivery Directives: "+w)}this.log("Attempt loading level index "+S+(_?" at sn "+_.msn+" part "+_.part:"")+" with URL-id "+O+" "+C),this.clearTimer(),this.hls.trigger(F.Events.LEVEL_LOADING,{url:C,level:S,id:O,deliveryDirectives:_||null})}},s.removeLevel=function(_,S){var L=function(w,x){return x!==S},O=this._levels.filter(function(C,w){return w!==_?!0:C.url.length>1&&S!==void 0?(C.url=C.url.filter(L),C.audioGroupIds&&(C.audioGroupIds=C.audioGroupIds.filter(L)),C.textGroupIds&&(C.textGroupIds=C.textGroupIds.filter(L)),C.urlId=0,!0):!1}).map(function(C,w){var x=C.details;return x!=null&&x.fragments&&x.fragments.forEach(function(p){p.level=w}),C});this._levels=O,this.hls.trigger(F.Events.LEVELS_UPDATED,{levels:O})},m(o,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(_){var S,L=this._levels;if(L.length===0)return;if(this.currentLevelIndex===_&&(S=L[_])!==null&&S!==void 0&&S.details)return;if(_<0||_>=L.length){var O=_<0;if(this.hls.trigger(F.Events.ERROR,{type:U.ErrorTypes.OTHER_ERROR,details:U.ErrorDetails.LEVEL_SWITCH_ERROR,level:_,fatal:O,reason:"invalid level idx"}),O)return;_=Math.min(_,L.length-1)}this.clearTimer();var C=this.currentLevelIndex,w=L[C],x=L[_];this.log("switching to level "+_+" from "+C),this.currentLevelIndex=_;var p=g({},x,{level:_,maxBitrate:x.maxBitrate,uri:x.uri,urlId:x.urlId});delete p._urlId,this.hls.trigger(F.Events.LEVEL_SWITCHING,p);var T=x.details;if(!T||T.live){var v=this.switchParams(x.uri,w==null?void 0:w.details);this.loadPlaylist(v)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(_){this.manualLevelIndex=_,this._startLevel===void 0&&(this._startLevel=_),_!==-1&&(this.level=_)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(_){this._firstLevel=_}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var _=this.hls.config.startLevel;return _!==void 0?_:this._firstLevel}else return this._startLevel},set:function(_){this._startLevel=_}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(_){this.level=_,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=_)}}]),o}(i.default)},"./src/controller/level-helper.ts":function(ie,$,M){"use strict";M.r($),M.d($,"addGroupId",function(){return U}),M.d($,"assignTrackIdsByGroup",function(){return G}),M.d($,"updatePTS",function(){return W}),M.d($,"updateFragPTSDTS",function(){return D}),M.d($,"mergeDetails",function(){return g}),M.d($,"mapPartIntersection",function(){return d}),M.d($,"mapFragmentIntersection",function(){return m}),M.d($,"adjustSliding",function(){return u}),M.d($,"addSliding",function(){return a}),M.d($,"computeReloadInterval",function(){return f}),M.d($,"getFragmentWithSN",function(){return l}),M.d($,"getPartWith",function(){return h});var Y=M("./src/polyfills/number.ts"),F=M("./src/utils/logger.ts");function U(o,s,A){switch(s){case"audio":o.audioGroupIds||(o.audioGroupIds=[]),o.audioGroupIds.push(A);break;case"text":o.textGroupIds||(o.textGroupIds=[]),o.textGroupIds.push(A);break}}function G(o){var s={};o.forEach(function(A){var _=A.groupId||"";A.id=s[_]=s[_]||0,s[_]++})}function W(o,s,A){var _=o[s],S=o[A];i(_,S)}function i(o,s){var A=s.startPTS;if(Object(Y.isFiniteNumber)(A)){var _=0,S;s.sn>o.sn?(_=A-o.start,S=o):(_=o.start-A,S=s),S.duration!==_&&(S.duration=_)}else if(s.sn>o.sn){var L=o.cc===s.cc;L&&o.minEndPTS?s.start=o.start+(o.minEndPTS-o.start):s.start=o.start+o.duration}else s.start=Math.max(o.start-s.duration,0)}function D(o,s,A,_,S,L){var O=_-A;O<=0&&(F.logger.warn("Fragment should have a positive duration",s),_=A+s.duration,L=S+s.duration);var C=A,w=_,x=s.startPTS,p=s.endPTS;if(Object(Y.isFiniteNumber)(x)){var T=Math.abs(x-A);Object(Y.isFiniteNumber)(s.deltaPTS)?s.deltaPTS=Math.max(T,s.deltaPTS):s.deltaPTS=T,C=Math.max(A,x),A=Math.min(A,x),S=Math.min(S,s.startDTS),w=Math.min(_,p),_=Math.max(_,p),L=Math.max(L,s.endDTS)}s.duration=_-A;var v=A-s.start;s.appendedPTS=_,s.start=s.startPTS=A,s.maxStartPTS=C,s.startDTS=S,s.endPTS=_,s.minEndPTS=w,s.endDTS=L;var y=s.sn;if(!o||y<o.startSN||y>o.endSN)return 0;var N,B=y-o.startSN,R=o.fragments;for(R[B]=s,N=B;N>0;N--)i(R[N],R[N-1]);for(N=B;N<R.length-1;N++)i(R[N],R[N+1]);return o.fragmentHint&&i(R[R.length-1],o.fragmentHint),o.PTSKnown=o.alignedSliding=!0,v}function g(o,s){for(var A=null,_=o.fragments,S=_.length-1;S>=0;S--){var L=_[S].initSegment;if(L){A=L;break}}o.fragmentHint&&delete o.fragmentHint.endPTS;var O=0,C;if(m(o,s,function(N,B){N.relurl&&(O=N.cc-B.cc),Object(Y.isFiniteNumber)(N.startPTS)&&Object(Y.isFiniteNumber)(N.endPTS)&&(B.start=B.startPTS=N.startPTS,B.startDTS=N.startDTS,B.appendedPTS=N.appendedPTS,B.maxStartPTS=N.maxStartPTS,B.endPTS=N.endPTS,B.endDTS=N.endDTS,B.minEndPTS=N.minEndPTS,B.duration=N.endPTS-N.startPTS,B.duration&&(C=B),s.PTSKnown=s.alignedSliding=!0),B.elementaryStreams=N.elementaryStreams,B.loader=N.loader,B.stats=N.stats,B.urlId=N.urlId,N.initSegment&&(B.initSegment=N.initSegment,A=N.initSegment)}),A){var w=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments;w.forEach(function(N){var B;(!N.initSegment||N.initSegment.relurl===((B=A)===null||B===void 0?void 0:B.relurl))&&(N.initSegment=A)})}if(s.skippedSegments&&(s.deltaUpdateFailed=s.fragments.some(function(N){return!N}),s.deltaUpdateFailed)){F.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var x=s.skippedSegments;x--;)s.fragments.shift();s.startSN=s.fragments[0].sn,s.startCC=s.fragments[0].cc}var p=s.fragments;if(O){F.logger.warn("discontinuity sliding from playlist, take drift into account");for(var T=0;T<p.length;T++)p[T].cc+=O}s.skippedSegments&&(s.startCC=s.fragments[0].cc),d(o.partList,s.partList,function(N,B){B.elementaryStreams=N.elementaryStreams,B.stats=N.stats}),C?D(s,C,C.startPTS,C.endPTS,C.startDTS,C.endDTS):u(o,s),p.length&&(s.totalduration=s.edge-p[0].start),s.driftStartTime=o.driftStartTime,s.driftStart=o.driftStart;var v=s.advancedDateTime;if(s.advanced&&v){var y=s.edge;s.driftStart||(s.driftStartTime=v,s.driftStart=y),s.driftEndTime=v,s.driftEnd=y}else s.driftEndTime=o.driftEndTime,s.driftEnd=o.driftEnd,s.advancedDateTime=o.advancedDateTime}function d(o,s,A){if(o&&s)for(var _=0,S=0,L=o.length;S<=L;S++){var O=o[S],C=s[S+_];O&&C&&O.index===C.index&&O.fragment.sn===C.fragment.sn?A(O,C):_--}}function m(o,s,A){for(var _=s.skippedSegments,S=Math.max(o.startSN,s.startSN)-s.startSN,L=(o.fragmentHint?1:0)+(_?s.endSN:Math.min(o.endSN,s.endSN))-s.startSN,O=s.startSN-o.startSN,C=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,w=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments,x=S;x<=L;x++){var p=w[O+x],T=C[x];_&&!T&&x<_&&(T=s.fragments[x]=p),p&&T&&A(p,T)}}function u(o,s){var A=s.startSN+s.skippedSegments-o.startSN,_=o.fragments;if(A<0||A>=_.length)return;a(s,_[A].start)}function a(o,s){if(s){for(var A=o.fragments,_=o.skippedSegments;_<A.length;_++)A[_].start+=s;o.fragmentHint&&(o.fragmentHint.start+=s)}}function f(o,s){var A=1e3*o.levelTargetDuration,_=A/2,S=o.age,L=S>0&&S<A*3,O=s.loading.end-s.loading.start,C,w=o.availabilityDelay;if(o.updated===!1)if(L){var x=333*o.misses;C=Math.max(Math.min(_,O*2),x),o.availabilityDelay=(o.availabilityDelay||0)+C}else C=_;else L?(w=Math.min(w||A/2,S),o.availabilityDelay=w,C=w+A-S):C=A-O;return Math.round(C)}function l(o,s,A){if(!o||!o.details)return null;var _=o.details,S=_.fragments[s-_.startSN];return S||(S=_.fragmentHint,S&&S.sn===s?S:s<_.startSN&&A&&A.sn===s?A:null)}function h(o,s,A){if(!o||!o.details)return null;var _=o.details.partList;if(_)for(var S=_.length;S--;){var L=_[S];if(L.index===A&&L.fragment.sn===s)return L}return null}},"./src/controller/stream-controller.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return _});var Y=M("./src/polyfills/number.ts"),F=M("./src/controller/base-stream-controller.ts"),U=M("./src/is-supported.ts"),G=M("./src/events.ts"),W=M("./src/utils/buffer-helper.ts"),i=M("./src/controller/fragment-tracker.ts"),D=M("./src/types/loader.ts"),g=M("./src/loader/fragment.ts"),d=M("./src/demux/transmuxer-interface.ts"),m=M("./src/types/transmuxer.ts"),u=M("./src/controller/gap-controller.ts"),a=M("./src/errors.ts"),f=M("./src/utils/logger.ts");function l(S,L){for(var O=0;O<L.length;O++){var C=L[O];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(S,C.key,C)}}function h(S,L,O){return L&&l(S.prototype,L),O&&l(S,O),S}function o(S,L){S.prototype=Object.create(L.prototype),S.prototype.constructor=S,s(S,L)}function s(S,L){return s=Object.setPrototypeOf||function(C,w){return C.__proto__=w,C},s(S,L)}var A=100,_=function(S){o(L,S);function L(C,w){var x;return x=S.call(this,C,w,"[stream-controller]")||this,x.audioCodecSwap=!1,x.gapController=null,x.level=-1,x._forceStartLoad=!1,x.altAudio=!1,x.audioOnly=!1,x.fragPlaying=null,x.onvplaying=null,x.onvseeked=null,x.fragLastKbps=0,x.stalled=!1,x.couldBacktrack=!1,x.audioCodecSwitch=!1,x.videoBuffer=null,x._registerListeners(),x}var O=L.prototype;return O._registerListeners=function(){var w=this.hls;w.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),w.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),w.on(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),w.on(G.Events.ERROR,this.onError,this),w.on(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),w.on(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.on(G.Events.BUFFER_CREATED,this.onBufferCreated,this),w.on(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),w.on(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),w.on(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O._unregisterListeners=function(){var w=this.hls;w.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),w.off(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),w.off(G.Events.ERROR,this.onError,this),w.off(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),w.off(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.off(G.Events.BUFFER_CREATED,this.onBufferCreated,this),w.off(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),w.off(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),w.off(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},O.startLoad=function(w){if(this.levels){var x=this.lastCurrentTime,p=this.hls;if(this.stopLoad(),this.setInterval(A),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var T=p.startLevel;T===-1&&(p.config.testBandwidth?(T=0,this.bitrateTest=!0):T=p.nextAutoLevel),this.level=p.nextLoadLevel=T,this.loadedmetadata=!1}x>0&&w===-1&&(this.log("Override startPosition with lastCurrentTime @"+x.toFixed(3)),w=x),this.state=F.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=w,this.tick()}else this._forceStartLoad=!0,this.state=F.State.STOPPED},O.stopLoad=function(){this._forceStartLoad=!1,S.prototype.stopLoad.call(this)},O.doTick=function(){switch(this.state){case F.State.IDLE:this.doTickIdle();break;case F.State.WAITING_LEVEL:{var w,x=this.levels,p=this.level,T=x==null||((w=x[p])===null||w===void 0)?void 0:w.details;if(T&&(!T.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(T))break;this.state=F.State.IDLE;break}break}case F.State.FRAG_LOADING_WAITING_RETRY:{var v,y=self.performance.now(),N=this.retryDate;(!N||y>=N||(v=this.media)!==null&&v!==void 0&&v.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=F.State.IDLE)}break;default:break}this.onTickEnd()},O.onTickEnd=function(){S.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},O.doTickIdle=function(){var w,x,p=this.hls,T=this.levelLastLoaded,v=this.levels,y=this.media,N=p.config,B=p.nextLoadLevel;if(T===null||!y&&(this.startFragRequested||!N.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!v||!v[B])return;var R=v[B];this.level=p.nextLoadLevel=B;var j=R.details;if(!j||this.state===F.State.WAITING_LEVEL||j.live&&this.levelLastLoaded!==B){this.state=F.State.WAITING_LEVEL;return}var P=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:y,D.PlaylistLevelType.MAIN);if(P===null)return;var b=P.len,X=this.getMaxBufferLength(R.maxBitrate);if(b>=X)return;if(this._streamEnded(P,j)){var ee={};this.altAudio&&(ee.type="video"),this.hls.trigger(G.Events.BUFFER_EOS,ee),this.state=F.State.ENDED;return}var ae=P.end,le=this.getNextFragment(ae,j);if(this.couldBacktrack&&!this.fragPrevious&&le&&le.sn!=="initSegment"){var Re=le.sn-j.startSN;Re>1&&(le=j.fragments[Re-1],this.fragmentTracker.removeFragment(le))}if(le&&this.fragmentTracker.getState(le)===i.FragmentState.OK&&this.nextLoadPosition>ae){var Ee=this.audioOnly&&!this.altAudio?g.ElementaryStreamTypes.AUDIO:g.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(y,Ee,D.PlaylistLevelType.MAIN),le=this.getNextFragment(this.nextLoadPosition,j)}if(!le)return;le.initSegment&&!le.initSegment.data&&!this.bitrateTest&&(le=le.initSegment),((w=le.decryptdata)===null||w===void 0?void 0:w.keyFormat)==="identity"&&!((x=le.decryptdata)!==null&&x!==void 0&&x.key)?this.loadKey(le,j):this.loadFragment(le,j,ae)},O.loadFragment=function(w,x,p){var T,v=this.fragmentTracker.getState(w);if(this.fragCurrent=w,v===i.FragmentState.BACKTRACKED){var y=this.fragmentTracker.getBacktrackData(w);if(y){this._handleFragmentLoadProgress(y),this._handleFragmentLoadComplete(y);return}else v=i.FragmentState.NOT_LOADED}v===i.FragmentState.NOT_LOADED||v===i.FragmentState.PARTIAL?w.sn==="initSegment"?this._loadInitSegment(w):this.bitrateTest?(w.bitrateTest=!0,this.log("Fragment "+w.sn+" of level "+w.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(w)):(this.startFragRequested=!0,S.prototype.loadFragment.call(this,w,x,p)):v===i.FragmentState.APPENDING?this.reduceMaxBufferLength(w.duration)&&this.fragmentTracker.removeFragment(w):((T=this.media)===null||T===void 0?void 0:T.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},O.getAppendedFrag=function(w){var x=this.fragmentTracker.getAppendedFrag(w,D.PlaylistLevelType.MAIN);return x&&"fragment"in x?x.fragment:x},O.getBufferedFrag=function(w){return this.fragmentTracker.getBufferedFrag(w,D.PlaylistLevelType.MAIN)},O.followingBufferedFrag=function(w){return w?this.getBufferedFrag(w.end+.5):null},O.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},O.nextLevelSwitch=function(){var w=this.levels,x=this.media;if(x!=null&&x.readyState){var p,T=this.getAppendedFrag(x.currentTime);if(T&&T.start>1&&this.flushMainBuffer(0,T.start-1),!x.paused&&w){var v=this.hls.nextLoadLevel,y=w[v],N=this.fragLastKbps;N&&this.fragCurrent?p=this.fragCurrent.duration*y.maxBitrate/(1e3*N)+1:p=0}else p=0;var B=this.getBufferedFrag(x.currentTime+p);if(B){var R=this.followingBufferedFrag(B);if(R){this.abortCurrentFrag();var j=R.maxStartPTS?R.maxStartPTS:R.start,P=R.duration,b=Math.max(B.end,j+Math.min(Math.max(P-this.config.maxFragLookUpTolerance,P*.5),P*.75));this.flushMainBuffer(b,Number.POSITIVE_INFINITY)}}}},O.abortCurrentFrag=function(){var w=this.fragCurrent;this.fragCurrent=null,w!=null&&w.loader&&w.loader.abort(),this.state===F.State.KEY_LOADING&&(this.state=F.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},O.flushMainBuffer=function(w,x){S.prototype.flushMainBuffer.call(this,w,x,this.altAudio?"video":null)},O.onMediaAttached=function(w,x){S.prototype.onMediaAttached.call(this,w,x);var p=x.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),p.addEventListener("playing",this.onvplaying),p.addEventListener("seeked",this.onvseeked),this.gapController=new u.default(this.config,p,this.fragmentTracker,this.hls)},O.onMediaDetaching=function(){var w=this.media;w&&(w.removeEventListener("playing",this.onvplaying),w.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),S.prototype.onMediaDetaching.call(this)},O.onMediaPlaying=function(){this.tick()},O.onMediaSeeked=function(){var w=this.media,x=w?w.currentTime:null;Object(Y.isFiniteNumber)(x)&&this.log("Media seeked to "+x.toFixed(3)),this.tick()},O.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(G.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},O.onManifestParsed=function(w,x){var p=!1,T=!1,v;x.levels.forEach(function(y){v=y.audioCodec,v&&(v.indexOf("mp4a.40.2")!==-1&&(p=!0),v.indexOf("mp4a.40.5")!==-1&&(T=!0))}),this.audioCodecSwitch=p&&T&&!Object(U.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=x.levels,this.startFragRequested=!1},O.onLevelLoading=function(w,x){var p=this.levels;if(!p||this.state!==F.State.IDLE)return;var T=p[x.level];(!T.details||T.details.live&&this.levelLastLoaded!==x.level||this.waitForCdnTuneIn(T.details))&&(this.state=F.State.WAITING_LEVEL)},O.onLevelLoaded=function(w,x){var p,T=this.levels,v=x.level,y=x.details,N=y.totalduration;if(!T){this.warn("Levels were reset while loading level "+v);return}this.log("Level "+v+" loaded ["+y.startSN+","+y.endSN+"], cc ["+y.startCC+", "+y.endCC+"] duration:"+N);var B=this.fragCurrent;B&&(this.state===F.State.FRAG_LOADING||this.state===F.State.FRAG_LOADING_WAITING_RETRY)&&(B.level!==x.level&&B.loader&&(this.state=F.State.IDLE,B.loader.abort()));var R=T[v],j=0;if(y.live||(p=R.details)!==null&&p!==void 0&&p.live){if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed)return;j=this.alignPlaylists(y,R.details)}if(R.details=y,this.levelLastLoaded=v,this.hls.trigger(G.Events.LEVEL_UPDATED,{details:y,level:v}),this.state===F.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(y))return;this.state=F.State.IDLE}this.startFragRequested?y.live&&this.synchronizeToLiveEdge(y):this.setStartPosition(y,j),this.tick()},O._handleFragmentLoadProgress=function(w){var x,p=w.frag,T=w.part,v=w.payload,y=this.levels;if(!y){this.warn("Levels were reset while fragment load was in progress. Fragment "+p.sn+" of level "+p.level+" will not be buffered");return}var N=y[p.level],B=N.details;if(!B){this.warn("Dropping fragment "+p.sn+" of level "+p.level+" after level details were reset");return}var R=N.videoCodec,j=B.PTSKnown||!B.live,P=(x=p.initSegment)===null||x===void 0?void 0:x.data,b=this._getAudioCodec(N),X=this.transmuxer=this.transmuxer||new d.default(this.hls,D.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ee=T?T.index:-1,ae=ee!==-1,le=new m.ChunkMetadata(p.level,p.sn,p.stats.chunkCount,v.byteLength,ee,ae),Re=this.initPTS[p.cc];X.push(v,P,b,R,p,T,B.totalduration,j,le,Re)},O.onAudioTrackSwitching=function(w,x){var p=this.altAudio,T=!!x.url,v=x.id;if(!T){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var y=this.fragCurrent;y!=null&&y.loader&&(this.log("Switching to main audio track, cancel main fragment load"),y.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var N=this.hls;p&&N.trigger(G.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),N.trigger(G.Events.AUDIO_TRACK_SWITCHED,{id:v})}},O.onAudioTrackSwitched=function(w,x){var p=x.id,T=!!this.hls.audioTracks[p].url;if(T){var v=this.videoBuffer;v&&this.mediaBuffer!==v&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=v)}this.altAudio=T,this.tick()},O.onBufferCreated=function(w,x){var p=x.tracks,T,v,y=!1;for(var N in p){var B=p[N];if(B.id==="main"){if(v=N,T=B,N==="video"){var R=p[N];R&&(this.videoBuffer=R.buffer)}}else y=!0}y&&T?(this.log("Alternate track found, use "+v+".buffered to schedule main fragment loading"),this.mediaBuffer=T.buffer):this.mediaBuffer=this.media},O.onFragBuffered=function(w,x){var p=x.frag,T=x.part;if(p&&p.type!==D.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(p)){this.warn("Fragment "+p.sn+(T?" p: "+T.index:"")+" of level "+p.level+" finished buffering, but was aborted. state: "+this.state),this.state===F.State.PARSED&&(this.state=F.State.IDLE);return}var v=T?T.stats:p.stats;this.fragLastKbps=Math.round(8*v.total/(v.buffering.end-v.loading.first)),p.sn!=="initSegment"&&(this.fragPrevious=p),this.fragBufferedComplete(p,T)},O.onError=function(w,x){switch(x.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:case a.ErrorDetails.KEY_LOAD_ERROR:case a.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.MAIN,x);break;case a.ErrorDetails.LEVEL_LOAD_ERROR:case a.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==F.State.ERROR&&(x.fatal?(this.warn(""+x.details),this.state=F.State.ERROR):!x.levelRetry&&this.state===F.State.WAITING_LEVEL&&(this.state=F.State.IDLE));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(x.parent==="main"&&(this.state===F.State.PARSING||this.state===F.State.PARSED)){var p=!0,T=this.getFwdBufferInfo(this.media,D.PlaylistLevelType.MAIN);T&&T.len>.5&&(p=!this.reduceMaxBufferLength(T.len)),p&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},O.checkBuffer=function(){var w=this.media,x=this.gapController;if(!w||!x||!w.readyState)return;var p=W.BufferHelper.getBuffered(w);!this.loadedmetadata&&p.length?(this.loadedmetadata=!0,this.seekToStartPos()):x.poll(this.lastCurrentTime),this.lastCurrentTime=w.currentTime},O.onFragLoadEmergencyAborted=function(){this.state=F.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},O.onBufferFlushed=function(w,x){var p=x.type;if(p!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var T=(p===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(T,p,D.PlaylistLevelType.MAIN)}},O.onLevelsUpdated=function(w,x){this.levels=x.levels},O.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},O.seekToStartPos=function(){var w=this.media,x=w.currentTime,p=this.startPosition;if(p>=0&&x<p){if(w.seeking){f.logger.log("could not seek to "+p+", already seeking at "+x);return}var T=W.BufferHelper.getBuffered(w),v=T.length?T.start(0):0,y=v-p;y>0&&(y<this.config.maxBufferHole||y<this.config.maxFragLookUpTolerance)&&(f.logger.log("adjusting start position by "+y+" to match buffer start"),p+=y,this.startPosition=p),this.log("seek to target start position "+p+" from current time "+x),w.currentTime=p}},O._getAudioCodec=function(w){var x=this.config.defaultAudioCodec||w.audioCodec;return this.audioCodecSwap&&x&&(this.log("Swapping audio codec"),x.indexOf("mp4a.40.5")!==-1?x="mp4a.40.2":x="mp4a.40.5"),x},O._loadBitrateTestFrag=function(w){var x=this;this._doFragLoad(w).then(function(p){var T=x.hls;if(!p||T.nextLoadLevel||x.fragContextChanged(w))return;x.fragLoadError=0,x.state=F.State.IDLE,x.startFragRequested=!1,x.bitrateTest=!1;var v=w.stats;v.parsing.start=v.parsing.end=v.buffering.start=v.buffering.end=self.performance.now(),T.trigger(G.Events.FRAG_LOADED,p)})},O._handleTransmuxComplete=function(w){var x,p="main",T=this.hls,v=w.remuxResult,y=w.chunkMeta,N=this.getCurrentContext(y);if(!N){this.warn("The loading context changed while buffering fragment "+y.sn+" of level "+y.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(y.level);return}var B=N.frag,R=N.part,j=N.level,P=v.video,b=v.text,X=v.id3,ee=v.initSegment,ae=this.altAudio?void 0:v.audio;if(this.fragContextChanged(B))return;if(this.state=F.State.PARSING,ee){ee.tracks&&(this._bufferInitSegment(j,ee.tracks,B,y),T.trigger(G.Events.FRAG_PARSING_INIT_SEGMENT,{frag:B,id:p,tracks:ee.tracks}));var le=ee.initPTS,Re=ee.timescale;Object(Y.isFiniteNumber)(le)&&(this.initPTS[B.cc]=le,T.trigger(G.Events.INIT_PTS_FOUND,{frag:B,id:p,initPTS:le,timescale:Re}))}if(P&&v.independent!==!1){if(j.details){var Ee=P.startPTS,Te=P.endPTS,Ae=P.startDTS,Oe=P.endDTS;if(R)R.elementaryStreams[P.type]={startPTS:Ee,endPTS:Te,startDTS:Ae,endDTS:Oe};else if(P.firstKeyFrame&&P.independent&&(this.couldBacktrack=!0),P.dropped&&P.independent){var ce=this.getLoadPosition()+this.config.maxBufferHole;if(ce<Ee){this.backtrack(B);return}B.setElementaryStreamInfo(P.type,B.start,Te,B.start,Oe,!0)}B.setElementaryStreamInfo(P.type,Ee,Te,Ae,Oe),this.bufferFragmentData(P,B,R,y)}}else if(v.independent===!1){this.backtrack(B);return}if(ae){var ue=ae.startPTS,Pe=ae.endPTS,qe=ae.startDTS,ze=ae.endDTS;R&&(R.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:ue,endPTS:Pe,startDTS:qe,endDTS:ze}),B.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,ue,Pe,qe,ze),this.bufferFragmentData(ae,B,R,y)}if(X!=null&&(x=X.samples)!==null&&x!==void 0&&x.length){var et={frag:B,id:p,samples:X.samples};T.trigger(G.Events.FRAG_PARSING_METADATA,et)}if(b){var nt={frag:B,id:p,samples:b.samples};T.trigger(G.Events.FRAG_PARSING_USERDATA,nt)}},O._bufferInitSegment=function(w,x,p,T){var v=this;if(this.state!==F.State.PARSING)return;this.audioOnly=!!x.audio&&!x.video,this.altAudio&&!this.audioOnly&&delete x.audio;var y=x.audio,N=x.video,B=x.audiovideo;if(y){var R=w.audioCodec,j=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(R&&(R.indexOf("mp4a.40.5")!==-1?R="mp4a.40.2":R="mp4a.40.5"),y.metadata.channelCount!==1&&j.indexOf("firefox")===-1&&(R="mp4a.40.5")),j.indexOf("android")!==-1&&y.container!=="audio/mpeg"&&(R="mp4a.40.2",this.log("Android: force audio codec to "+R)),w.audioCodec&&w.audioCodec!==R&&this.log('Swapping manifest audio codec "'+w.audioCodec+'" for "'+R+'"'),y.levelCodec=R,y.id="main",this.log("Init audio buffer, container:"+y.container+", codecs[selected/level/parsed]=["+(R||"")+"/"+(w.audioCodec||"")+"/"+y.codec+"]")}N&&(N.levelCodec=w.videoCodec,N.id="main",this.log("Init video buffer, container:"+N.container+", codecs[level/parsed]=["+(w.videoCodec||"")+"/"+N.codec+"]")),B&&this.log("Init audiovideo buffer, container:"+B.container+", codecs[level/parsed]=["+(w.attrs.CODECS||"")+"/"+B.codec+"]"),this.hls.trigger(G.Events.BUFFER_CODECS,x),Object.keys(x).forEach(function(P){var b=x[P],X=b.initSegment;X!=null&&X.byteLength&&v.hls.trigger(G.Events.BUFFER_APPENDING,{type:P,data:X,frag:p,part:null,chunkMeta:T,parent:p.type})}),this.tick()},O.backtrack=function(w){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(w);var x=this.fragmentTracker.backtrack(w);this.fragPrevious=null,this.nextLoadPosition=w.start,x?this.resetFragmentLoading(w):this.state=F.State.BACKTRACKING},O.checkFragmentChanged=function(){var w=this.media,x=null;if(w&&w.readyState>1&&w.seeking===!1){var p=w.currentTime;if(W.BufferHelper.isBuffered(w,p)?x=this.getAppendedFrag(p):W.BufferHelper.isBuffered(w,p+.1)&&(x=this.getAppendedFrag(p+.1)),x){var T=this.fragPlaying,v=x.level;(!T||x.sn!==T.sn||T.level!==v||x.urlId!==T.urlId)&&(this.hls.trigger(G.Events.FRAG_CHANGED,{frag:x}),(!T||T.level!==v)&&this.hls.trigger(G.Events.LEVEL_SWITCHED,{level:v}),this.fragPlaying=x)}}},h(L,[{key:"nextLevel",get:function(){var w=this.nextBufferedFrag;return w?w.level:-1}},{key:"currentLevel",get:function(){var w=this.media;if(w){var x=this.getAppendedFrag(w.currentTime);if(x)return x.level}return-1}},{key:"nextBufferedFrag",get:function(){var w=this.media;if(w){var x=this.getAppendedFrag(w.currentTime);return this.followingBufferedFrag(x)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),L}(F.default)},"./src/controller/subtitle-stream-controller.ts":function(ie,$,M){"use strict";M.r($),M.d($,"SubtitleStreamController",function(){return o});var Y=M("./src/events.ts"),F=M("./src/utils/logger.ts"),U=M("./src/utils/buffer-helper.ts"),G=M("./src/controller/fragment-finders.ts"),W=M("./src/utils/discontinuities.ts"),i=M("./src/controller/level-helper.ts"),D=M("./src/controller/fragment-tracker.ts"),g=M("./src/controller/base-stream-controller.ts"),d=M("./src/types/loader.ts"),m=M("./src/types/level.ts");function u(s,A){for(var _=0;_<A.length;_++){var S=A[_];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(s,S.key,S)}}function a(s,A,_){return A&&u(s.prototype,A),_&&u(s,_),s}function f(s,A){s.prototype=Object.create(A.prototype),s.prototype.constructor=s,l(s,A)}function l(s,A){return l=Object.setPrototypeOf||function(S,L){return S.__proto__=L,S},l(s,A)}var h=500,o=function(s){f(A,s);function A(S,L){var O;return O=s.call(this,S,L,"[subtitle-stream-controller]")||this,O.levels=[],O.currentTrackId=-1,O.tracksBuffered=[],O.mainDetails=null,O._registerListeners(),O}var _=A.prototype;return _.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},_._registerListeners=function(){var L=this.hls;L.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),L.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),L.on(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),L.on(Y.Events.LEVEL_LOADED,this.onLevelLoaded,this),L.on(Y.Events.ERROR,this.onError,this),L.on(Y.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),L.on(Y.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),L.on(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),L.on(Y.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),L.on(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},_._unregisterListeners=function(){var L=this.hls;L.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),L.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),L.off(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),L.off(Y.Events.LEVEL_LOADED,this.onLevelLoaded,this),L.off(Y.Events.ERROR,this.onError,this),L.off(Y.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),L.off(Y.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),L.off(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),L.off(Y.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),L.off(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},_.startLoad=function(){this.stopLoad(),this.state=g.State.IDLE,this.setInterval(h),this.tick()},_.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},_.onLevelLoaded=function(L,O){this.mainDetails=O.details},_.onSubtitleFragProcessed=function(L,O){var C=O.frag,w=O.success;if(this.fragPrevious=C,this.state=g.State.IDLE,!w)return;var x=this.tracksBuffered[this.currentTrackId];if(!x)return;for(var p,T=C.start,v=0;v<x.length;v++)if(T>=x[v].start&&T<=x[v].end){p=x[v];break}var y=C.start+C.duration;p?p.end=y:(p={start:T,end:y},x.push(p)),this.fragmentTracker.fragBuffered(C)},_.onBufferFlushing=function(L,O){var C=O.startOffset,w=O.endOffset;if(C===0&&w!==Number.POSITIVE_INFINITY){var x=this.currentTrackId,p=this.levels;if(!p.length||!p[x]||!p[x].details)return;var T=p[x].details,v=T.targetduration,y=w-v;if(y<=0)return;O.endOffsetSubtitles=Math.max(0,y),this.tracksBuffered.forEach(function(N){for(var B=0;B<N.length;){if(N[B].end<=y){N.shift();continue}else if(N[B].start<y)N[B].start=y;else break;B++}}),this.fragmentTracker.removeFragmentsInRange(C,y,d.PlaylistLevelType.SUBTITLE)}},_.onError=function(L,O){var C,w=O.frag;if(!w||w.type!==d.PlaylistLevelType.SUBTITLE)return;(C=this.fragCurrent)!==null&&C!==void 0&&C.loader&&this.fragCurrent.loader.abort(),this.state=g.State.IDLE},_.onSubtitleTracksUpdated=function(L,O){var C=this,w=O.subtitleTracks;this.tracksBuffered=[],this.levels=w.map(function(x){return new m.Level(x)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(x){C.tracksBuffered[x.id]=[]}),this.mediaBuffer=null},_.onSubtitleTrackSwitch=function(L,O){if(this.currentTrackId=O.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var C=this.levels[this.currentTrackId];C!=null&&C.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,C&&this.setInterval(h)},_.onSubtitleTrackLoaded=function(L,O){var C,w=O.details,x=O.id,p=this.currentTrackId,T=this.levels;if(!T.length)return;var v=T[p];if(x>=T.length||x!==p||!v)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,w.live||(C=v.details)!==null&&C!==void 0&&C.live){var y=this.mainDetails;if(w.deltaUpdateFailed||!y)return;var N=y.fragments[0];if(!v.details)w.hasProgramDateTime&&y.hasProgramDateTime?Object(W.alignMediaPlaylistByPDT)(w,y):N&&Object(i.addSliding)(w,N.start);else{var B=this.alignPlaylists(w,v.details);B===0&&N&&Object(i.addSliding)(w,N.start)}}if(v.details=w,this.levelLastLoaded=x,this.tick(),w.live&&!this.fragCurrent&&this.media&&this.state===g.State.IDLE){var R=Object(G.findFragmentByPTS)(null,w.fragments,this.media.currentTime,0);R||(this.warn("Subtitle playlist not aligned with playback"),v.details=void 0)}},_._handleFragmentLoadComplete=function(L){var O=L.frag,C=L.payload,w=O.decryptdata,x=this.hls;if(this.fragContextChanged(O))return;if(C&&C.byteLength>0&&w&&w.key&&w.iv&&w.method==="AES-128"){var p=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(C),w.key.buffer,w.iv.buffer).then(function(T){var v=performance.now();x.trigger(Y.Events.FRAG_DECRYPTED,{frag:O,payload:T,stats:{tstart:p,tdecrypt:v}})})}},_.doTick=function(){if(!this.media){this.state=g.State.IDLE;return}if(this.state===g.State.IDLE){var L,O=this.currentTrackId,C=this.levels;if(!C.length||!C[O]||!C[O].details)return;var w=C[O].details,x=w.targetduration,p=this.config,T=this.media,v=U.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,T.currentTime-x,p.maxBufferHole),y=v.end,N=v.len,B=this.getMaxBufferLength()+x;if(N>B)return;console.assert(w,"Subtitle track details are defined on idle subtitle stream controller tick");var R=w.fragments,j=R.length,P=w.edge,b,X=this.fragPrevious;if(y<P){var ee=p.maxFragLookUpTolerance;X&&w.hasProgramDateTime&&(b=Object(G.findFragmentByPDT)(R,X.endProgramDateTime,ee)),b||(b=Object(G.findFragmentByPTS)(X,R,y,ee),!b&&X&&X.start<R[0].start&&(b=R[0]))}else b=R[j-1];(L=b)!==null&&L!==void 0&&L.encrypted?(F.logger.log("Loading key for "+b.sn),this.state=g.State.KEY_LOADING,this.hls.trigger(Y.Events.KEY_LOADING,{frag:b})):b&&this.fragmentTracker.getState(b)===D.FragmentState.NOT_LOADED&&this.loadFragment(b,w,y)}},_.loadFragment=function(L,O,C){this.fragCurrent=L,s.prototype.loadFragment.call(this,L,O,C)},a(A,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),A}(g.default)},"./src/controller/subtitle-track-controller.ts":function(ie,$,M){"use strict";M.r($);var Y=M("./src/events.ts"),F=M("./src/utils/texttrack-utils.ts"),U=M("./src/controller/base-playlist-controller.ts"),G=M("./src/types/loader.ts");function W(u,a){for(var f=0;f<a.length;f++){var l=a[f];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(u,l.key,l)}}function i(u,a,f){return a&&W(u.prototype,a),f&&W(u,f),u}function D(u,a){u.prototype=Object.create(a.prototype),u.prototype.constructor=u,g(u,a)}function g(u,a){return g=Object.setPrototypeOf||function(l,h){return l.__proto__=h,l},g(u,a)}var d=function(u){D(a,u);function a(l){var h;return h=u.call(this,l,"[subtitle-track-controller]")||this,h.media=null,h.tracks=[],h.groupId=null,h.tracksInGroup=[],h.trackId=-1,h.selectDefaultTrack=!0,h.queuedDefaultTrack=-1,h.trackChangeListener=function(){return h.onTextTracksChanged()},h.asyncPollTrackChange=function(){return h.pollTrackChange(0)},h.useTextTrackPolling=!1,h.subtitlePollingInterval=-1,h.subtitleDisplay=!0,h.registerListeners(),h}var f=a.prototype;return f.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,u.prototype.destroy.call(this)},f.registerListeners=function(){var h=this.hls;h.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),h.on(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),h.on(Y.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var h=this.hls;h.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),h.off(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),h.off(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),h.off(Y.Events.ERROR,this.onError,this)},f.onMediaAttached=function(h,o){if(this.media=o.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(h){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,h)},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 h=m(this.media.textTracks);h.forEach(function(o){Object(F.clearCurrentCues)(o)}),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(h,o){this.tracks=o.subtitleTracks},f.onSubtitleTrackLoaded=function(h,o){var s=o.id,A=o.details,_=this.trackId,S=this.tracksInGroup[_];if(!S){this.warn("Invalid subtitle track id "+s);return}var L=S.details;S.details=o.details,this.log("subtitle track "+s+" loaded ["+A.startSN+"-"+A.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,o,L))},f.onLevelLoading=function(h,o){this.switchLevel(o.level)},f.onLevelSwitching=function(h,o){this.switchLevel(o.level)},f.switchLevel=function(h){var o=this.hls.levels[h];if(!(o!=null&&o.textGroupIds))return;var s=o.textGroupIds[o.urlId];if(this.groupId!==s){var A=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,_=this.tracks.filter(function(O){return!s||O.groupId===s});this.tracksInGroup=_;var S=this.findTrackId(A==null?void 0:A.name)||this.findTrackId();this.groupId=s;var L={subtitleTracks:_};this.log("Updating subtitle tracks, "+_.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(Y.Events.SUBTITLE_TRACKS_UPDATED,L),S!==-1&&this.setSubtitleTrack(S,A)}},f.findTrackId=function(h){for(var o=this.tracksInGroup,s=0;s<o.length;s++){var A=o[s];if((!this.selectDefaultTrack||A.default)&&(!h||h===A.name))return A.id}return-1},f.onError=function(h,o){if(u.prototype.onError.call(this,h,o),o.fatal||!o.context)return;o.context.type===G.PlaylistContextType.SUBTITLE_TRACK&&o.context.id===this.trackId&&o.context.groupId===this.groupId&&this.retryLoadingOrFail(o)},f.loadPlaylist=function(h){var o=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(o)){var s=o.id,A=o.groupId,_=o.url;if(h)try{_=h.addDirectives(_)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("Loading subtitle playlist for id "+s),this.hls.trigger(Y.Events.SUBTITLE_TRACK_LOADING,{url:_,id:s,groupId:A,deliveryDirectives:h||null})}},f.toggleTrackModes=function(h){var o=this,s=this.media,A=this.subtitleDisplay,_=this.trackId;if(!s)return;var S=m(s.textTracks),L=S.filter(function(w){return w.groupId===o.groupId});if(h===-1)[].slice.call(S).forEach(function(w){w.mode="disabled"});else{var O=L[_];O&&(O.mode="disabled")}var C=L[h];C&&(C.mode=A?"showing":"hidden")},f.setSubtitleTrack=function(h,o){var s,A=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=h;return}if(this.trackId!==h&&this.toggleTrackModes(h),this.trackId===h&&(h===-1||(s=A[h])!==null&&s!==void 0&&s.details)||h<-1||h>=A.length)return;this.clearTimer();var _=A[h];if(this.log("Switching to subtitle track "+h),this.trackId=h,_){var S=_.id,L=_.groupId,O=L===void 0?"":L,C=_.name,w=_.type,x=_.url;this.hls.trigger(Y.Events.SUBTITLE_TRACK_SWITCH,{id:S,groupId:O,name:C,type:w,url:x});var p=this.switchParams(_.url,o==null?void 0:o.details);this.loadPlaylist(p)}else this.hls.trigger(Y.Events.SUBTITLE_TRACK_SWITCH,{id:h})},f.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var h=-1,o=m(this.media.textTracks),s=0;s<o.length;s++)if(o[s].mode==="hidden")h=s;else if(o[s].mode==="showing"){h=s;break}this.subtitleTrack!==h&&(this.subtitleTrack=h)},i(a,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(h){this.selectDefaultTrack=!1;var o=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(h,o)}}]),a}(U.default);function m(u){for(var a=[],f=0;f<u.length;f++){var l=u[f];l.kind==="subtitles"&&l.label&&a.push(u[f])}return a}$.default=d},"./src/controller/timeline-controller.ts":function(ie,$,M){"use strict";M.r($),M.d($,"TimelineController",function(){return m});var Y=M("./src/polyfills/number.ts"),F=M("./src/events.ts"),U=M("./src/utils/cea-608-parser.ts"),G=M("./src/utils/output-filter.ts"),W=M("./src/utils/webvtt-parser.ts"),i=M("./src/utils/texttrack-utils.ts"),D=M("./src/utils/imsc1-ttml-parser.ts"),g=M("./src/types/loader.ts"),d=M("./src/utils/logger.ts"),m=function(){function l(o){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=o,this.config=o.config,this.Cues=o.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 G.default(this,"textTrack1"),A=new G.default(this,"textTrack2"),_=new G.default(this,"textTrack3"),S=new G.default(this,"textTrack4");this.cea608Parser1=new U.default(1,s,A),this.cea608Parser2=new U.default(3,_,S)}o.on(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(F.Events.MANIFEST_LOADED,this.onManifestLoaded,this),o.on(F.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),o.on(F.Events.FRAG_LOADING,this.onFragLoading,this),o.on(F.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(F.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),o.on(F.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),o.on(F.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.on(F.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),o.on(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var h=l.prototype;return h.destroy=function(){var s=this.hls;s.off(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(F.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.off(F.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.off(F.Events.FRAG_LOADING,this.onFragLoading,this),s.off(F.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(F.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.off(F.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.off(F.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.off(F.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.off(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},h.addCues=function(s,A,_,S,L){for(var O=!1,C=L.length;C--;){var w=L[C],x=a(w[0],w[1],A,_);if(x>=0&&(w[0]=Math.min(w[0],A),w[1]=Math.max(w[1],_),O=!0,x/(_-A)>.5))return}if(O||L.push([A,_]),this.config.renderTextTracksNatively){var p=this.captionsTracks[s];this.Cues.newCue(p,A,_,S)}else{var T=this.Cues.newCue(null,A,_,S);this.hls.trigger(F.Events.CUES_PARSED,{type:"captions",cues:T,track:s})}},h.onInitPtsFound=function(s,A){var _=this,S=A.frag,L=A.id,O=A.initPTS,C=A.timescale,w=this.unparsedVttFrags;L==="main"&&(this.initPTS[S.cc]=O,this.timescale[S.cc]=C),w.length&&(this.unparsedVttFrags=[],w.forEach(function(x){_.onFragLoaded(F.Events.FRAG_LOADED,x)}))},h.getExistingTrack=function(s){var A=this.media;if(A)for(var _=0;_<A.textTracks.length;_++){var S=A.textTracks[_];if(S[s])return S}return null},h.createCaptionsTrack=function(s){this.config.renderTextTracksNatively?this.createNativeTrack(s):this.createNonNativeTrack(s)},h.createNativeTrack=function(s){if(this.captionsTracks[s])return;var A=this.captionsProperties,_=this.captionsTracks,S=this.media,L=A[s],O=L.label,C=L.languageCode,w=this.getExistingTrack(s);if(w)_[s]=w,Object(i.clearCurrentCues)(_[s]),Object(i.sendAddTrackEvent)(_[s],S);else{var x=this.createTextTrack("captions",O,C);x&&(x[s]=!0,_[s]=x)}},h.createNonNativeTrack=function(s){if(this.nonNativeCaptionsTracks[s])return;var A=this.captionsProperties[s];if(!A)return;var _=A.label,S={_id:s,label:_,kind:"captions",default:A.media?!!A.media.default:!1,closedCaptions:A.media};this.nonNativeCaptionsTracks[s]=S,this.hls.trigger(F.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[S]})},h.createTextTrack=function(s,A,_){var S=this.media;return S?S.addTextTrack(s,A,_):void 0},h.onMediaAttaching=function(s,A){this.media=A.media,this._cleanTracks()},h.onMediaDetaching=function(){var s=this.captionsTracks;Object.keys(s).forEach(function(A){Object(i.clearCurrentCues)(s[A]),delete s[A]}),this.nonNativeCaptionsTracks={}},h.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())},h._cleanTracks=function(){var s=this.media;if(!s)return;var A=s.textTracks;if(A)for(var _=0;_<A.length;_++)Object(i.clearCurrentCues)(A[_])},h.onSubtitleTracksUpdated=function(s,A){var _=this;this.textTracks=[];var S=A.subtitleTracks||[],L=S.some(function(x){return x.textCodec===D.IMSC1_CODEC});if(this.config.enableWebVTT||L&&this.config.enableIMSC1){var O=this.tracks&&S&&this.tracks.length===S.length;if(this.tracks=S||[],this.config.renderTextTracksNatively){var C=this.media?this.media.textTracks:[];this.tracks.forEach(function(x,p){var T;if(p<C.length){for(var v=null,y=0;y<C.length;y++)if(u(C[y],x)){v=C[y];break}v&&(T=v)}T?Object(i.clearCurrentCues)(T):(T=_.createTextTrack("subtitles",x.name,x.lang),T&&(T.mode="disabled")),T&&(T.groupId=x.groupId,_.textTracks.push(T))})}else if(!O&&this.tracks&&this.tracks.length){var w=this.tracks.map(function(x){return{label:x.name,kind:x.type.toLowerCase(),default:x.default,subtitleTrack:x}});this.hls.trigger(F.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:w})}}},h.onManifestLoaded=function(s,A){var _=this;this.config.enableCEA708Captions&&A.captions&&A.captions.forEach(function(S){var L=/(?:CC|SERVICE)([1-4])/.exec(S.instreamId);if(!L)return;var O="textTrack"+L[1],C=_.captionsProperties[O];if(!C)return;C.label=S.name,S.lang&&(C.languageCode=S.lang),C.media=S})},h.onFragLoading=function(s,A){var _=this.cea608Parser1,S=this.cea608Parser2,L=this.lastSn,O=this.lastPartIndex;if(!this.enabled||!(_&&S))return;if(A.frag.type===g.PlaylistLevelType.MAIN){var C,w,x=A.frag.sn,p=(C=A==null||((w=A.part)===null||w===void 0)?void 0:w.index)!=null?C:-1;x===L+1||x===L&&p===O+1||(_.reset(),S.reset()),this.lastSn=x,this.lastPartIndex=p}},h.onFragLoaded=function(s,A){var _=A.frag,S=A.payload,L=this.initPTS,O=this.unparsedVttFrags;if(_.type===g.PlaylistLevelType.SUBTITLE)if(S.byteLength){if(!Object(Y.isFiniteNumber)(L[_.cc])){O.push(A),L.length&&this.hls.trigger(F.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:_,error:new Error("Missing initial subtitle PTS")});return}var C=_.decryptdata;if(C==null||C.key==null||C.method!=="AES-128"){var w=this.tracks[_.level],x=this.vttCCs;x[_.cc]||(x[_.cc]={start:_.start,prevCC:this.prevCC,new:!0},this.prevCC=_.cc),w&&w.textCodec===D.IMSC1_CODEC?this._parseIMSC1(_,S):this._parseVTTs(_,S,x)}}else this.hls.trigger(F.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:_,error:new Error("Empty subtitle payload")})},h._parseIMSC1=function(s,A){var _=this,S=this.hls;Object(D.parseIMSC1)(A,this.initPTS[s.cc],this.timescale[s.cc],function(L){_._appendCues(L,s.level),S.trigger(F.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(L){d.logger.log("Failed to parse IMSC1: "+L),S.trigger(F.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:L})})},h._parseVTTs=function(s,A,_){var S=this,L=this.hls;Object(W.parseWebVTT)(A,this.initPTS[s.cc],this.timescale[s.cc],_,s.cc,s.start,function(O){S._appendCues(O,s.level),L.trigger(F.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(O){S._fallbackToIMSC1(s,A),d.logger.log("Failed to parse VTT cue: "+O),L.trigger(F.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:O})})},h._fallbackToIMSC1=function(s,A){var _=this,S=this.tracks[s.level];S.textCodec||Object(D.parseIMSC1)(A,this.initPTS[s.cc],this.timescale[s.cc],function(){S.textCodec=D.IMSC1_CODEC,_._parseIMSC1(s,A)},function(){S.textCodec="wvtt"})},h._appendCues=function(s,A){var _=this.hls;if(this.config.renderTextTracksNatively){var S=this.textTracks[A];if(S.mode==="disabled")return;s.forEach(function(C){return Object(i.addCueToTrack)(S,C)})}else{var L=this.tracks[A],O=L.default?"default":"subtitles"+A;_.trigger(F.Events.CUES_PARSED,{type:"subtitles",cues:s,track:O})}},h.onFragDecrypted=function(s,A){var _=A.frag;if(_.type===g.PlaylistLevelType.SUBTITLE){if(!Object(Y.isFiniteNumber)(this.initPTS[_.cc])){this.unparsedVttFrags.push(A);return}this.onFragLoaded(F.Events.FRAG_LOADED,A)}},h.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},h.onFragParsingUserdata=function(s,A){var _=this.cea608Parser1,S=this.cea608Parser2;if(!this.enabled||!(_&&S))return;for(var L=0;L<A.samples.length;L++){var O=A.samples[L].bytes;if(O){var C=this.extractCea608Data(O);_.addData(A.samples[L].pts,C[0]),S.addData(A.samples[L].pts,C[1])}}},h.onBufferFlushing=function(s,A){var _=A.startOffset,S=A.endOffset,L=A.endOffsetSubtitles,O=A.type,C=this.media;if(!C||C.currentTime<S)return;if(!O||O==="video"){var w=this.captionsTracks;Object.keys(w).forEach(function(p){return Object(i.removeCuesInRange)(w[p],_,S)})}if(this.config.renderTextTracksNatively&&(_===0&&L!==void 0)){var x=this.textTracks;Object.keys(x).forEach(function(p){return Object(i.removeCuesInRange)(x[p],_,L)})}},h.extractCea608Data=function(s){for(var A=s[0]&31,_=2,S=[[],[]],L=0;L<A;L++){var O=s[_++],C=127&s[_++],w=127&s[_++],x=(4&O)!==0,p=3&O;if(C===0&&w===0)continue;x&&((p===0||p===1)&&(S[p].push(C),S[p].push(w)))}return S},l}();function u(l,h){return l&&l.label===h.name&&!(l.textTrack1||l.textTrack2)}function a(l,h,o,s){return Math.min(h,s)-Math.max(l,o)}function f(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return Y});var Y=function(){function F(G,W){this.subtle=void 0,this.aesIV=void 0,this.subtle=G,this.aesIV=W}var U=F.prototype;return U.decrypt=function(W,i){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},i,W)},F}()},"./src/crypt/aes-decryptor.ts":function(ie,$,M){"use strict";M.r($),M.d($,"removePadding",function(){return F}),M.d($,"default",function(){return U});var Y=M("./src/utils/typed-array.ts");function F(G){var W=G.byteLength,i=W&&new DataView(G.buffer).getUint8(W-1);return i?Object(Y.sliceUint8)(G,0,W-i):G}var U=function(){function G(){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 W=G.prototype;return W.uint8ArrayToUint32Array_=function(D){for(var g=new DataView(D),d=new Uint32Array(4),m=0;m<4;m++)d[m]=g.getUint32(m*4);return d},W.initTable=function(){var D=this.sBox,g=this.invSBox,d=this.subMix,m=d[0],u=d[1],a=d[2],f=d[3],l=this.invSubMix,h=l[0],o=l[1],s=l[2],A=l[3],_=new Uint32Array(256),S=0,L=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 C=L^L<<1^L<<2^L<<3^L<<4;C=C>>>8^C&255^99,D[S]=C,g[C]=S;var w=_[S],x=_[w],p=_[x],T=_[C]*257^C*16843008;m[S]=T<<24|T>>>8,u[S]=T<<16|T>>>16,a[S]=T<<8|T>>>24,f[S]=T,T=p*16843009^x*65537^w*257^S*16843008,h[C]=T<<24|T>>>8,o[C]=T<<16|T>>>16,s[C]=T<<8|T>>>24,A[C]=T,S?(S=w^_[_[_[p^w]]],L^=_[_[L]]):S=L=1}},W.expandKey=function(D){for(var g=this.uint8ArrayToUint32Array_(D),d=!0,m=0;m<g.length&&d;)d=g[m]===this.key[m],m++;if(d)return;this.key=g;var u=this.keySize=g.length;if(u!==4&&u!==6&&u!==8)throw new Error("Invalid aes key size="+u);var a=this.ksRows=(u+6+1)*4,f,l,h=this.keySchedule=new Uint32Array(a),o=this.invKeySchedule=new Uint32Array(a),s=this.sBox,A=this.rcon,_=this.invSubMix,S=_[0],L=_[1],O=_[2],C=_[3],w,x;for(f=0;f<a;f++){if(f<u){w=h[f]=g[f];continue}x=w,f%u===0?(x=x<<8|x>>>24,x=s[x>>>24]<<24|s[x>>>16&255]<<16|s[x>>>8&255]<<8|s[x&255],x^=A[f/u|0]<<24):u>6&&f%u===4&&(x=s[x>>>24]<<24|s[x>>>16&255]<<16|s[x>>>8&255]<<8|s[x&255]),h[f]=w=(h[f-u]^x)>>>0}for(l=0;l<a;l++)f=a-l,l&3?x=h[f]:x=h[f-4],l<4||f<=4?o[l]=x:o[l]=S[s[x>>>24]]^L[s[x>>>16&255]]^O[s[x>>>8&255]]^C[s[x&255]],o[l]=o[l]>>>0},W.networkToHostOrderSwap=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},W.decrypt=function(D,g,d){for(var m=this.keySize+6,u=this.invKeySchedule,a=this.invSBox,f=this.invSubMix,l=f[0],h=f[1],o=f[2],s=f[3],A=this.uint8ArrayToUint32Array_(d),_=A[0],S=A[1],L=A[2],O=A[3],C=new Int32Array(D),w=new Int32Array(C.length),x,p,T,v,y,N,B,R,j,P,b,X,ee,ae,le=this.networkToHostOrderSwap;g<C.length;){for(j=le(C[g]),P=le(C[g+1]),b=le(C[g+2]),X=le(C[g+3]),y=j^u[0],N=X^u[1],B=b^u[2],R=P^u[3],ee=4,ae=1;ae<m;ae++)x=l[y>>>24]^h[N>>16&255]^o[B>>8&255]^s[R&255]^u[ee],p=l[N>>>24]^h[B>>16&255]^o[R>>8&255]^s[y&255]^u[ee+1],T=l[B>>>24]^h[R>>16&255]^o[y>>8&255]^s[N&255]^u[ee+2],v=l[R>>>24]^h[y>>16&255]^o[N>>8&255]^s[B&255]^u[ee+3],y=x,N=p,B=T,R=v,ee=ee+4;x=a[y>>>24]<<24^a[N>>16&255]<<16^a[B>>8&255]<<8^a[R&255]^u[ee],p=a[N>>>24]<<24^a[B>>16&255]<<16^a[R>>8&255]<<8^a[y&255]^u[ee+1],T=a[B>>>24]<<24^a[R>>16&255]<<16^a[y>>8&255]<<8^a[N&255]^u[ee+2],v=a[R>>>24]<<24^a[y>>16&255]<<16^a[N>>8&255]<<8^a[B&255]^u[ee+3],w[g]=le(x^_),w[g+1]=le(v^S),w[g+2]=le(T^L),w[g+3]=le(p^O),_=j,S=P,L=b,O=X,g=g+4}return w.buffer},G}()},"./src/crypt/decrypter.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return g});var Y=M("./src/crypt/aes-crypto.ts"),F=M("./src/crypt/fast-aes-key.ts"),U=M("./src/crypt/aes-decryptor.ts"),G=M("./src/utils/logger.ts"),W=M("./src/utils/mp4-tools.ts"),i=M("./src/utils/typed-array.ts"),D=16,g=function(){function d(u,a,f){var l=f===void 0?{}:f,h=l.removePKCS7Padding,o=h===void 0?!0:h;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=u,this.config=a,this.removePKCS7Padding=o,o)try{var s=self.crypto;s&&(this.subtle=s.subtle||s.webkitSubtle)}catch(A){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var m=d.prototype;return m.destroy=function(){this.observer=null},m.isSync=function(){return this.config.enableSoftwareAES},m.flush=function(){var a=this.currentResult;if(!a){this.reset();return}var f=new Uint8Array(a);return this.reset(),this.removePKCS7Padding?Object(U.removePadding)(f):f},m.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},m.decrypt=function(a,f,l,h){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(a),f,l);var o=this.flush();o&&h(o.buffer)}else this.webCryptoDecrypt(new Uint8Array(a),f,l).then(h)},m.softwareDecrypt=function(a,f,l){var h=this.currentIV,o=this.currentResult,s=this.remainderData;this.logOnce("JS AES decrypt"),s&&(a=Object(W.appendUint8Array)(s,a),this.remainderData=null);var A=this.getValidChunk(a);if(!A.length)return null;h&&(l=h);var _=this.softwareDecrypter;_||(_=this.softwareDecrypter=new U.default),_.expandKey(f);var S=o;return this.currentResult=_.decrypt(A.buffer,0,l),this.currentIV=Object(i.sliceUint8)(A,-16).buffer,S||null},m.webCryptoDecrypt=function(a,f,l){var h=this,o=this.subtle;return(this.key!==f||!this.fastAesKey)&&(this.key=f,this.fastAesKey=new F.default(o,f)),this.fastAesKey.expandKey().then(function(s){if(!o)return Promise.reject(new Error("web crypto not initialized"));var A=new Y.default(o,l);return A.decrypt(a.buffer,s)}).catch(function(s){return h.onWebCryptoError(s,a,f,l)})},m.onWebCryptoError=function(a,f,l,h){return G.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",a),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(f,l,h)},m.getValidChunk=function(a){var f=a,l=a.length-a.length%D;return l!==a.length&&(f=Object(i.sliceUint8)(a,0,l),this.remainderData=Object(i.sliceUint8)(a,l)),f},m.logOnce=function(a){if(!this.logEnabled)return;G.logger.log("[decrypter.ts]: "+a),this.logEnabled=!1},d}()},"./src/crypt/fast-aes-key.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return Y});var Y=function(){function F(G,W){this.subtle=void 0,this.key=void 0,this.subtle=G,this.key=W}var U=F.prototype;return U.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},F}()},"./src/demux/aacdemuxer.ts":function(ie,$,M){"use strict";M.r($);var Y=M("./src/demux/base-audio-demuxer.ts"),F=M("./src/demux/adts.ts"),U=M("./src/utils/logger.ts"),G=M("./src/demux/id3.ts");function W(g,d){g.prototype=Object.create(d.prototype),g.prototype.constructor=g,i(g,d)}function i(g,d){return i=Object.setPrototypeOf||function(u,a){return u.__proto__=a,u},i(g,d)}var D=function(g){W(d,g);function d(u,a){var f;return f=g.call(this)||this,f.observer=void 0,f.config=void 0,f.observer=u,f.config=a,f}var m=d.prototype;return m.resetInitSegment=function(a,f,l){g.prototype.resetInitSegment.call(this,a,f,l),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:a,duration:l,inputTimeScale:9e4,dropped:0}},d.probe=function(a){if(!a)return!1;for(var f=G.getID3Data(a,0)||[],l=f.length,h=a.length;l<h;l++)if(F.probe(a,l))return U.logger.log("ADTS sync word found !"),!0;return!1},m.canParse=function(a,f){return F.canParse(a,f)},m.appendFrame=function(a,f,l){F.initTrackConfig(a,this.observer,f,l,a.manifestCodec);var h=F.appendFrame(a,f,l,this.initPTS,this.frameIndex);if(h&&h.missing===0)return h},d}(Y.default);D.minProbeByteLength=9,$.default=D},"./src/demux/adts.ts":function(ie,$,M){"use strict";M.r($),M.d($,"getAudioConfig",function(){return G}),M.d($,"isHeaderPattern",function(){return W}),M.d($,"getHeaderLength",function(){return i}),M.d($,"getFullFrameLength",function(){return D}),M.d($,"canGetFrameLength",function(){return g}),M.d($,"isHeader",function(){return d}),M.d($,"canParse",function(){return m}),M.d($,"probe",function(){return u}),M.d($,"initTrackConfig",function(){return a}),M.d($,"getFrameDuration",function(){return f}),M.d($,"parseFrameHeader",function(){return l}),M.d($,"appendFrame",function(){return h});var Y=M("./src/utils/logger.ts"),F=M("./src/errors.ts"),U=M("./src/events.ts");function G(o,s,A,_){var S,L,O,C,w=navigator.userAgent.toLowerCase(),x=_,p=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];S=((s[A+2]&192)>>>6)+1;var T=(s[A+2]&60)>>>2;if(T>p.length-1){o.trigger(U.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+T});return}return O=(s[A+2]&1)<<2,O|=(s[A+3]&192)>>>6,Y.logger.log("manifest codec:"+_+", ADTS type:"+S+", samplingIndex:"+T),/firefox/i.test(w)?T>=6?(S=5,C=new Array(4),L=T-3):(S=2,C=new Array(2),L=T):w.indexOf("android")!==-1?(S=2,C=new Array(2),L=T):(S=5,C=new Array(4),_&&(_.indexOf("mp4a.40.29")!==-1||_.indexOf("mp4a.40.5")!==-1)||!_&&T>=6?L=T-3:((_&&_.indexOf("mp4a.40.2")!==-1&&(T>=6&&O===1||/vivaldi/i.test(w))||!_&&O===1)&&(S=2,C=new Array(2)),L=T)),C[0]=S<<3,C[0]|=(T&14)>>1,C[1]|=(T&1)<<7,C[1]|=O<<3,S===5&&(C[1]|=(L&14)>>1,C[2]=(L&1)<<7,C[2]|=2<<2,C[3]=0),{config:C,samplerate:p[T],channelCount:O,codec:"mp4a.40."+S,manifestCodec:x}}function W(o,s){return o[s]===255&&(o[s+1]&246)===240}function i(o,s){return o[s+1]&1?7:9}function D(o,s){return(o[s+3]&3)<<11|o[s+4]<<3|(o[s+5]&224)>>>5}function g(o,s){return s+5<o.length}function d(o,s){return s+1<o.length&&W(o,s)}function m(o,s){return g(o,s)&&W(o,s)&&D(o,s)<=o.length-s}function u(o,s){if(d(o,s)){var A=i(o,s);if(s+A>=o.length)return!1;var _=D(o,s);if(_<=A)return!1;var S=s+_;return S===o.length||d(o,S)}return!1}function a(o,s,A,_,S){if(!o.samplerate){var L=G(s,A,_,S);if(!L)return;o.config=L.config,o.samplerate=L.samplerate,o.channelCount=L.channelCount,o.codec=L.codec,o.manifestCodec=L.manifestCodec,Y.logger.log("parsed codec:"+o.codec+", rate:"+L.samplerate+", channels:"+L.channelCount)}}function f(o){return 1024*9e4/o}function l(o,s,A,_,S){var L=i(o,s),O=D(o,s);if(O-=L,O>0){var C=A+_*S;return{headerLength:L,frameLength:O,stamp:C}}}function h(o,s,A,_,S){var L=f(o.samplerate),O=l(s,A,_,S,L);if(O){var C=O.frameLength,w=O.headerLength,x=O.stamp,p=w+C,T=Math.max(0,A+p-s.length),v;T?(v=new Uint8Array(p-w),v.set(s.subarray(A+w,s.length),0)):v=s.subarray(A+w,A+p);var y={unit:v,pts:x};return T||o.samples.push(y),{sample:y,length:p,missing:T}}}},"./src/demux/base-audio-demuxer.ts":function(ie,$,M){"use strict";M.r($),M.d($,"initPTSFn",function(){return D});var Y=M("./src/polyfills/number.ts"),F=M("./src/demux/id3.ts"),U=M("./src/demux/dummy-demuxed-track.ts"),G=M("./src/utils/mp4-tools.ts"),W=M("./src/utils/typed-array.ts"),i=function(){function g(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var d=g.prototype;return d.resetInitSegment=function(u,a,f){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},d.resetTimeStamp=function(){},d.resetContiguity=function(){},d.canParse=function(u,a){return!1},d.appendFrame=function(u,a,f){},d.demux=function(u,a){this.cachedData&&(u=Object(G.appendUint8Array)(this.cachedData,u),this.cachedData=null);var f=F.getID3Data(u,0),l=f?f.length:0,h,o,s=this._audioTrack,A=this._id3Track,_=f?F.getTimeStamp(f):void 0,S=u.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(_,a)),f&&f.length>0&&A.samples.push({pts:this.initPTS,dts:this.initPTS,data:f}),o=this.initPTS;l<S;){if(this.canParse(u,l)){var L=this.appendFrame(s,u,l);L?(this.frameIndex++,o=L.sample.pts,l+=L.length,h=l):l=S}else F.canParse(u,l)?(f=F.getID3Data(u,l),A.samples.push({pts:o,dts:o,data:f}),l+=f.length,h=l):l++;if(l===S&&h!==S){var O=Object(W.sliceUint8)(u,h);this.cachedData?this.cachedData=Object(G.appendUint8Array)(this.cachedData,O):this.cachedData=O}}return{audioTrack:s,avcTrack:Object(U.dummyTrack)(),id3Track:A,textTrack:Object(U.dummyTrack)()}},d.demuxSampleAes=function(u,a,f){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},d.flush=function(u){var a=this.cachedData;return a&&(this.cachedData=null,this.demux(a,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(U.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(U.dummyTrack)()}},d.destroy=function(){},g}(),D=function(d,m){return Object(Y.isFiniteNumber)(d)?d*90:m*9e4};$.default=i},"./src/demux/chunk-cache.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return Y});var Y=function(){function U(){this.chunks=[],this.dataLength=0}var G=U.prototype;return G.push=function(i){this.chunks.push(i),this.dataLength+=i.length},G.flush=function(){var i=this.chunks,D=this.dataLength,g;if(i.length)i.length===1?g=i[0]:g=F(i,D);else return new Uint8Array(0);return this.reset(),g},G.reset=function(){this.chunks.length=0,this.dataLength=0},U}();function F(U,G){for(var W=new Uint8Array(G),i=0,D=0;D<U.length;D++){var g=U[D];W.set(g,i),i+=g.length}return W}},"./src/demux/dummy-demuxed-track.ts":function(ie,$,M){"use strict";M.r($),M.d($,"dummyTrack",function(){return Y});function Y(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ie,$,M){"use strict";M.r($);var Y=M("./src/utils/logger.ts"),F=function(){function U(W){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=W,this.bytesAvailable=W.byteLength,this.word=0,this.bitsAvailable=0}var G=U.prototype;return G.loadWord=function(){var i=this.data,D=this.bytesAvailable,g=i.byteLength-D,d=new Uint8Array(4),m=Math.min(4,D);if(m===0)throw new Error("no bytes available");d.set(i.subarray(g,g+m)),this.word=new DataView(d.buffer).getUint32(0),this.bitsAvailable=m*8,this.bytesAvailable-=m},G.skipBits=function(i){var D;this.bitsAvailable>i?(this.word<<=i,this.bitsAvailable-=i):(i-=this.bitsAvailable,D=i>>3,i-=D>>3,this.bytesAvailable-=D,this.loadWord(),this.word<<=i,this.bitsAvailable-=i)},G.readBits=function(i){var D=Math.min(this.bitsAvailable,i),g=this.word>>>32-D;return i>32&&Y.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=D,this.bitsAvailable>0?this.word<<=D:this.bytesAvailable>0&&this.loadWord(),D=i-D,D>0&&this.bitsAvailable?g<<D|this.readBits(D):g},G.skipLZ=function(){var i;for(i=0;i<this.bitsAvailable;++i)if((this.word&2147483648>>>i)!==0)return this.word<<=i,this.bitsAvailable-=i,i;return this.loadWord(),i+this.skipLZ()},G.skipUEG=function(){this.skipBits(1+this.skipLZ())},G.skipEG=function(){this.skipBits(1+this.skipLZ())},G.readUEG=function(){var i=this.skipLZ();return this.readBits(i+1)-1},G.readEG=function(){var i=this.readUEG();return 1&i?1+i>>>1:-1*(i>>>1)},G.readBoolean=function(){return this.readBits(1)===1},G.readUByte=function(){return this.readBits(8)},G.readUShort=function(){return this.readBits(16)},G.readUInt=function(){return this.readBits(32)},G.skipScalingList=function(i){for(var D=8,g=8,d,m=0;m<i;m++)g!==0&&(d=this.readEG(),g=(D+d+256)%256),D=g===0?D:g},G.readSPS=function(){var i=0,D=0,g=0,d=0,m,u,a,f=this.readUByte.bind(this),l=this.readBits.bind(this),h=this.readUEG.bind(this),o=this.readBoolean.bind(this),s=this.skipBits.bind(this),A=this.skipEG.bind(this),_=this.skipUEG.bind(this),S=this.skipScalingList.bind(this);f();var L=f();if(l(5),s(3),f(),_(),L===100||L===110||L===122||L===244||L===44||L===83||L===86||L===118||L===128){var O=h();if(O===3&&s(1),_(),_(),s(1),o())for(u=O!==3?8:12,a=0;a<u;a++)o()&&(a<6?S(16):S(64))}_();var C=h();if(C===0)h();else if(C===1)for(s(1),A(),A(),m=h(),a=0;a<m;a++)A();_(),s(1);var w=h(),x=h(),p=l(1);p===0&&s(1),s(1),o()&&(i=h(),D=h(),g=h(),d=h());var T=[1,1];if(o()&&o()){var v=f();switch(v){case 1:T=[1,1];break;case 2:T=[12,11];break;case 3:T=[10,11];break;case 4:T=[16,11];break;case 5:T=[40,33];break;case 6:T=[24,11];break;case 7:T=[20,11];break;case 8:T=[32,11];break;case 9:T=[80,33];break;case 10:T=[18,11];break;case 11:T=[15,11];break;case 12:T=[64,33];break;case 13:T=[160,99];break;case 14:T=[4,3];break;case 15:T=[3,2];break;case 16:T=[2,1];break;case 255:{T=[f()<<8|f(),f()<<8|f()];break}}}return{width:Math.ceil((w+1)*16-i*2-D*2),height:(2-p)*(x+1)*16-(p?2:4)*(g+d),pixelRatio:T}},G.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},U}();$.default=F},"./src/demux/id3.ts":function(ie,$,M){"use strict";M.r($),M.d($,"isHeader",function(){return Y}),M.d($,"isFooter",function(){return F}),M.d($,"getID3Data",function(){return U}),M.d($,"canParse",function(){return W}),M.d($,"getTimeStamp",function(){return i}),M.d($,"isTimeStampFrame",function(){return D}),M.d($,"getID3Frames",function(){return d}),M.d($,"decodeFrame",function(){return m}),M.d($,"utf8ArrayToStr",function(){return h}),M.d($,"testables",function(){return o});var Y=function(S,L){return L+10<=S.length&&(S[L]===73&&S[L+1]===68&&S[L+2]===51&&(S[L+3]<255&&S[L+4]<255&&(S[L+6]<128&&S[L+7]<128&&S[L+8]<128&&S[L+9]<128)))},F=function(S,L){return L+10<=S.length&&(S[L]===51&&S[L+1]===68&&S[L+2]===73&&(S[L+3]<255&&S[L+4]<255&&(S[L+6]<128&&S[L+7]<128&&S[L+8]<128&&S[L+9]<128)))},U=function(S,L){for(var O=L,C=0;Y(S,L);){C+=10;var w=G(S,L+6);C+=w,F(S,L+10)&&(C+=10),L+=C}return C>0?S.subarray(O,O+C):void 0},G=function(S,L){var O=0;return O=(S[L]&127)<<21,O|=(S[L+1]&127)<<14,O|=(S[L+2]&127)<<7,O|=S[L+3]&127,O},W=function(S,L){return Y(S,L)&&G(S,L+6)+10<=S.length-L},i=function(S){for(var L=d(S),O=0;O<L.length;O++){var C=L[O];if(D(C))return l(C)}return},D=function(S){return S&&S.key==="PRIV"&&S.info==="com.apple.streaming.transportStreamTimestamp"},g=function(S){var L=String.fromCharCode(S[0],S[1],S[2],S[3]),O=G(S,4),C=10;return{type:L,size:O,data:S.subarray(C,C+O)}},d=function(S){for(var L=0,O=[];Y(S,L);){var C=G(S,L+6);L+=10;for(var w=L+C;L+8<w;){var x=g(S.subarray(L)),p=m(x);p&&O.push(p),L+=x.size+10}F(S,L)&&(L+=10)}return O},m=function(S){return S.type==="PRIV"?u(S):S.type[0]==="W"?f(S):a(S)},u=function(S){if(S.size<2)return;var L=h(S.data,!0),O=new Uint8Array(S.data.subarray(L.length+1));return{key:S.type,info:L,data:O.buffer}},a=function(S){if(S.size<2)return;if(S.type==="TXXX"){var L=1,O=h(S.data.subarray(L),!0);L+=O.length+1;var C=h(S.data.subarray(L));return{key:S.type,info:O,data:C}}var w=h(S.data.subarray(1));return{key:S.type,data:w}},f=function(S){if(S.type==="WXXX"){if(S.size<2)return;var L=1,O=h(S.data.subarray(L),!0);L+=O.length+1;var C=h(S.data.subarray(L));return{key:S.type,info:O,data:C}}var w=h(S.data);return{key:S.type,data:w}},l=function(S){if(S.data.byteLength===8){var L=new Uint8Array(S.data),O=L[3]&1,C=(L[4]<<23)+(L[5]<<15)+(L[6]<<7)+L[7];return C/=45,O&&(C+=4772185884e-2),Math.round(C)}return},h=function(S,L){L===void 0&&(L=!1);var O=A();if(O){var C=O.decode(S);if(L){var w=C.indexOf("\0");return w!==-1?C.substring(0,w):C}return C.replace(/\0/g,"")}for(var x=S.length,p,T,v,y="",N=0;N<x;){if(p=S[N++],p===0&&L)return y;if(p===0||p===3)continue;switch(p>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:y+=String.fromCharCode(p);break;case 12:case 13:T=S[N++],y+=String.fromCharCode((p&31)<<6|T&63);break;case 14:T=S[N++],v=S[N++],y+=String.fromCharCode((p&15)<<12|(T&63)<<6|(v&63)<<0);break;default:}}return y},o={decodeTextFrame:a},s;function A(){return!s&&typeof self.TextDecoder!="undefined"&&(s=new self.TextDecoder("utf-8")),s}},"./src/demux/mp3demuxer.ts":function(ie,$,M){"use strict";M.r($);var Y=M("./src/demux/base-audio-demuxer.ts"),F=M("./src/demux/id3.ts"),U=M("./src/utils/logger.ts"),G=M("./src/demux/mpegaudio.ts");function W(g,d){g.prototype=Object.create(d.prototype),g.prototype.constructor=g,i(g,d)}function i(g,d){return i=Object.setPrototypeOf||function(u,a){return u.__proto__=a,u},i(g,d)}var D=function(g){W(d,g);function d(){return g.apply(this,arguments)||this}var m=d.prototype;return m.resetInitSegment=function(a,f,l){g.prototype.resetInitSegment.call(this,a,f,l),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:a,duration:l,inputTimeScale:9e4,dropped:0}},d.probe=function(a){if(!a)return!1;for(var f=F.getID3Data(a,0)||[],l=f.length,h=a.length;l<h;l++)if(G.probe(a,l))return U.logger.log("MPEG Audio sync word found !"),!0;return!1},m.canParse=function(a,f){return G.canParse(a,f)},m.appendFrame=function(a,f,l){return this.initPTS===null?void 0:G.appendFrame(a,f,l,this.initPTS,this.frameIndex)},d}(Y.default);D.minProbeByteLength=4,$.default=D},"./src/demux/mp4demuxer.ts":function(ie,$,M){"use strict";M.r($);var Y=M("./src/utils/mp4-tools.ts"),F=M("./src/demux/dummy-demuxed-track.ts"),U=function(){function G(i,D){this.remainderData=null,this.config=void 0,this.config=D}var W=G.prototype;return W.resetTimeStamp=function(){},W.resetInitSegment=function(){},W.resetContiguity=function(){},G.probe=function(D){return Object(Y.findBox)({data:D,start:0,end:Math.min(D.length,16384)},["moof"]).length>0},W.demux=function(D){var g=D,d=Object(F.dummyTrack)();if(this.config.progressive){this.remainderData&&(g=Object(Y.appendUint8Array)(this.remainderData,D));var m=Object(Y.segmentValidRange)(g);this.remainderData=m.remainder,d.samples=m.valid||new Uint8Array}else d.samples=g;return{audioTrack:Object(F.dummyTrack)(),avcTrack:d,id3Track:Object(F.dummyTrack)(),textTrack:Object(F.dummyTrack)()}},W.flush=function(){var D=Object(F.dummyTrack)();return D.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(F.dummyTrack)(),avcTrack:D,id3Track:Object(F.dummyTrack)(),textTrack:Object(F.dummyTrack)()}},W.demuxSampleAes=function(D,g,d){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},W.destroy=function(){},G}();U.minProbeByteLength=1024,$.default=U},"./src/demux/mpegaudio.ts":function(ie,$,M){"use strict";M.r($),M.d($,"appendFrame",function(){return i}),M.d($,"parseHeader",function(){return D}),M.d($,"isHeaderPattern",function(){return g}),M.d($,"isHeader",function(){return d}),M.d($,"canParse",function(){return m}),M.d($,"probe",function(){return u});var Y=null,F=[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],U=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],G=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],W=[0,1,1,4];function i(a,f,l,h,o){if(l+24>f.length)return;var s=D(f,l);if(s&&l+s.frameLength<=f.length){var A=s.samplesPerFrame*9e4/s.sampleRate,_=h+o*A,S={unit:f.subarray(l,l+s.frameLength),pts:_,dts:_};return a.config=[],a.channelCount=s.channelCount,a.samplerate=s.sampleRate,a.samples.push(S),{sample:S,length:s.frameLength,missing:0}}}function D(a,f){var l=a[f+1]>>3&3,h=a[f+1]>>1&3,o=a[f+2]>>4&15,s=a[f+2]>>2&3;if(l!==1&&o!==0&&o!==15&&s!==3){var A=a[f+2]>>1&1,_=a[f+3]>>6,S=l===3?3-h:h===3?3:4,L=F[S*14+o-1]*1e3,O=l===3?0:l===2?1:2,C=U[O*3+s],w=_===3?1:2,x=G[l][h],p=W[h],T=x*8*p,v=Math.floor(x*L/C+A)*p;if(Y===null){var y=navigator.userAgent||"",N=y.match(/Chrome\/(\d+)/i);Y=N?parseInt(N[1]):0}var B=!!Y&&Y<=87;return B&&h===2&&L>=224e3&&_===0&&(a[f+3]=a[f+3]|128),{sampleRate:C,channelCount:w,frameLength:v,samplesPerFrame:T}}}function g(a,f){return a[f]===255&&(a[f+1]&224)===224&&(a[f+1]&6)!==0}function d(a,f){return f+1<a.length&&g(a,f)}function m(a,f){var l=4;return g(a,f)&&l<=a.length-f}function u(a,f){if(f+1<a.length&&g(a,f)){var l=4,h=D(a,f),o=l;h!=null&&h.frameLength&&(o=h.frameLength);var s=f+o;return s===a.length||d(a,s)}return!1}},"./src/demux/sample-aes.ts":function(ie,$,M){"use strict";M.r($);var Y=M("./src/crypt/decrypter.ts"),F=M("./src/demux/tsdemuxer.ts"),U=function(){function G(i,D,g){this.keyData=void 0,this.decrypter=void 0,this.keyData=g,this.decrypter=new Y.default(i,D,{removePKCS7Padding:!1})}var W=G.prototype;return W.decryptBuffer=function(D,g){this.decrypter.decrypt(D,this.keyData.key.buffer,this.keyData.iv.buffer,g)},W.decryptAacSample=function(D,g,d,m){var u=D[g].unit,a=u.subarray(16,u.length-u.length%16),f=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),l=this;this.decryptBuffer(f,function(h){var o=new Uint8Array(h);u.set(o,16),m||l.decryptAacSamples(D,g+1,d)})},W.decryptAacSamples=function(D,g,d){for(;;g++){if(g>=D.length){d();return}if(D[g].unit.length<32)continue;var m=this.decrypter.isSync();if(this.decryptAacSample(D,g,d,m),!m)return}},W.getAvcEncryptedData=function(D){for(var g=Math.floor((D.length-48)/160)*16+16,d=new Int8Array(g),m=0,u=32;u<=D.length-16;u+=160,m+=16)d.set(D.subarray(u,u+16),m);return d},W.getAvcDecryptedUnit=function(D,g){for(var d=new Uint8Array(g),m=0,u=32;u<=D.length-16;u+=160,m+=16)D.set(d.subarray(m,m+16),u);return D},W.decryptAvcSample=function(D,g,d,m,u,a){var f=Object(F.discardEPB)(u.data),l=this.getAvcEncryptedData(f),h=this;this.decryptBuffer(l.buffer,function(o){u.data=h.getAvcDecryptedUnit(f,o),a||h.decryptAvcSamples(D,g,d+1,m)})},W.decryptAvcSamples=function(D,g,d,m){if(D instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,d=0){if(g>=D.length){m();return}for(var u=D[g].units;!(d>=u.length);d++){var a=u[d];if(a.data.length<=48||a.type!==1&&a.type!==5)continue;var f=this.decrypter.isSync();if(this.decryptAvcSample(D,g,d,m,a,f),!f)return}}},G}();$.default=U},"./src/demux/transmuxer-interface.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return u});var Y=M("./node_modules/webworkify-webpack/index.js"),F=M.n(Y),U=M("./src/events.ts"),G=M("./src/demux/transmuxer.ts"),W=M("./src/utils/logger.ts"),i=M("./src/errors.ts"),D=M("./src/utils/mediasource-helper.ts"),g=M("./node_modules/eventemitter3/index.js"),d=M.n(g),m=Object(D.getMediaSource)()||{isTypeSupported:function(){return!1}},u=function(){function a(l,h,o,s){var A=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=l,this.id=h,this.onTransmuxComplete=o,this.onFlush=s;var _=l.config,S=function(x,p){p=p||{},p.frag=A.frag,p.id=A.id,l.trigger(x,p)};this.observer=new g.EventEmitter,this.observer.on(U.Events.FRAG_DECRYPTED,S),this.observer.on(U.Events.ERROR,S);var L={mp4:m.isTypeSupported("video/mp4"),mpeg:m.isTypeSupported("audio/mpeg"),mp3:m.isTypeSupported('audio/mp4; codecs="mp3"')},O=navigator.vendor;if(_.enableWorker&&typeof Worker!="undefined"){W.logger.log("demuxing in webworker");var C;try{C=this.worker=Y("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),C.addEventListener("message",this.onwmsg),C.onerror=function(w){l.trigger(U.Events.ERROR,{type:i.ErrorTypes.OTHER_ERROR,details:i.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(w.message+" ("+w.filename+":"+w.lineno+")")})},C.postMessage({cmd:"init",typeSupported:L,vendor:O,id:h,config:JSON.stringify(_)})}catch(w){W.logger.warn("Error in worker:",w),W.logger.error("Error while initializing DemuxerWorker, fallback to inline"),C&&self.URL.revokeObjectURL(C.objectURL),this.transmuxer=new G.default(this.observer,L,_,O,h),this.worker=null}}else this.transmuxer=new G.default(this.observer,L,_,O,h)}var f=a.prototype;return f.destroy=function(){var h=this.worker;if(h)h.removeEventListener("message",this.onwmsg),h.terminate(),this.worker=null;else{var o=this.transmuxer;o&&(o.destroy(),this.transmuxer=null)}var s=this.observer;s&&s.removeAllListeners(),this.observer=null},f.push=function(h,o,s,A,_,S,L,O,C,w){var x=this;C.transmuxing.start=self.performance.now();var p=this.transmuxer,T=this.worker,v=S?S.start:_.start,y=_.decryptdata,N=this.frag,B=!(N&&_.cc===N.cc),R=!(N&&C.level===N.level),j=N?C.sn-N.sn:-1,P=this.part?C.part-this.part.index:1,b=!R&&(j===1||j===0&&P===1),X=self.performance.now();(R||j||_.stats.parsing.start===0)&&(_.stats.parsing.start=X),S&&(P||!b)&&(S.stats.parsing.start=X);var ee=new G.TransmuxState(B,b,O,R,v);if(!b||B){W.logger.log("[transmuxer-interface, "+_.type+"]: Starting new transmux session for sn: "+C.sn+" p: "+C.part+" level: "+C.level+" id: "+C.id+`
|
|
discontinuity: `+B+`
|
|
trackSwitch: `+R+`
|
|
contiguous: `+b+`
|
|
accurateTimeOffset: `+O+`
|
|
timeOffset: `+v);var ae=new G.TransmuxConfig(s,A,o,L,w);this.configureTransmuxer(ae)}if(this.frag=_,this.part=S,T)T.postMessage({cmd:"demux",data:h,decryptdata:y,chunkMeta:C,state:ee},h instanceof ArrayBuffer?[h]:[]);else if(p){var le=p.push(h,y,C,ee);Object(G.isPromise)(le)?le.then(function(Re){x.handleTransmuxComplete(Re)}):this.handleTransmuxComplete(le)}},f.flush=function(h){var o=this;h.transmuxing.start=self.performance.now();var s=this.transmuxer,A=this.worker;if(A)A.postMessage({cmd:"flush",chunkMeta:h});else if(s){var _=s.flush(h);Object(G.isPromise)(_)?_.then(function(S){o.handleFlushResult(S,h)}):this.handleFlushResult(_,h)}},f.handleFlushResult=function(h,o){var s=this;h.forEach(function(A){s.handleTransmuxComplete(A)}),this.onFlush(o)},f.onWorkerMessage=function(h){var o=h.data,s=this.hls;switch(o.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(o.data);break}case"flush":{this.onFlush(o.data);break}default:{o.data=o.data||{},o.data.frag=this.frag,o.data.id=this.id,s.trigger(o.event,o.data);break}}},f.configureTransmuxer=function(h){var o=this.worker,s=this.transmuxer;o?o.postMessage({cmd:"configure",config:h}):s&&s.configure(h)},f.handleTransmuxComplete=function(h){h.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(h)},a}()},"./src/demux/transmuxer-worker.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return i});var Y=M("./src/demux/transmuxer.ts"),F=M("./src/events.ts"),U=M("./src/utils/logger.ts"),G=M("./node_modules/eventemitter3/index.js"),W=M.n(G);function i(u){var a=new G.EventEmitter,f=function(h,o){u.postMessage({event:h,data:o})};a.on(F.Events.FRAG_DECRYPTED,f),a.on(F.Events.ERROR,f),u.addEventListener("message",function(l){var h=l.data;switch(h.cmd){case"init":{var o=JSON.parse(h.config);u.transmuxer=new Y.default(a,h.typeSupported,o,h.vendor,h.id),Object(U.enableLogs)(o.debug),f("init",null);break}case"configure":{u.transmuxer.configure(h.config);break}case"demux":{var s=u.transmuxer.push(h.data,h.decryptdata,h.chunkMeta,h.state);Object(Y.isPromise)(s)?s.then(function(S){D(u,S)}):D(u,s);break}case"flush":{var A=h.chunkMeta,_=u.transmuxer.flush(A);Object(Y.isPromise)(_)?_.then(function(S){d(u,S,A)}):d(u,_,A);break}default:break}})}function D(u,a){if(m(a.remuxResult))return;var f=[],l=a.remuxResult,h=l.audio,o=l.video;h&&g(f,h),o&&g(f,o),u.postMessage({event:"transmuxComplete",data:a},f)}function g(u,a){a.data1&&u.push(a.data1.buffer),a.data2&&u.push(a.data2.buffer)}function d(u,a,f){a.forEach(function(l){D(u,l)}),u.postMessage({event:"flush",data:f})}function m(u){return!u.audio&&!u.video&&!u.text&&!u.id3&&!u.initSegment}},"./src/demux/transmuxer.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return o}),M.d($,"isPromise",function(){return _}),M.d($,"TransmuxConfig",function(){return S}),M.d($,"TransmuxState",function(){return L});var Y=M("./src/events.ts"),F=M("./src/errors.ts"),U=M("./src/crypt/decrypter.ts"),G=M("./src/demux/aacdemuxer.ts"),W=M("./src/demux/mp4demuxer.ts"),i=M("./src/demux/tsdemuxer.ts"),D=M("./src/demux/mp3demuxer.ts"),g=M("./src/remux/mp4-remuxer.ts"),d=M("./src/remux/passthrough-remuxer.ts"),m=M("./src/demux/chunk-cache.ts"),u=M("./src/utils/mp4-tools.ts"),a=M("./src/utils/logger.ts"),f;try{f=self.performance.now.bind(self.performance)}catch(O){a.logger.debug("Unable to use Performance API on this environment"),f=self.Date.now}var l=[{demux:i.default,remux:g.default},{demux:W.default,remux:d.default},{demux:G.default,remux:g.default},{demux:D.default,remux:g.default}],h=1024;l.forEach(function(O){var C=O.demux;h=Math.max(h,C.minProbeByteLength)});var o=function(){function O(w,x,p,T,v){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new m.default,this.observer=w,this.typeSupported=x,this.config=p,this.vendor=T,this.id=v}var C=O.prototype;return C.configure=function(x){this.transmuxConfig=x,this.decrypter&&this.decrypter.reset()},C.push=function(x,p,T,v){var y=this,N=T.transmuxing;N.executeStart=f();var B=new Uint8Array(x),R=this.cache,j=this.config,P=this.currentTransmuxState,b=this.transmuxConfig;v&&(this.currentTransmuxState=v);var X=s(B,p);if(X&&X.method==="AES-128"){var ee=this.getDecrypter();if(j.enableSoftwareAES){var ae=ee.softwareDecrypt(B,X.key.buffer,X.iv.buffer);if(!ae)return N.executeEnd=f(),A(T);B=new Uint8Array(ae)}else return this.decryptionPromise=ee.webCryptoDecrypt(B,X.key.buffer,X.iv.buffer).then(function(Me){var Ge=y.push(Me,null,T);return y.decryptionPromise=null,Ge}),this.decryptionPromise}var le=v||P,Re=le.contiguous,Ee=le.discontinuity,Te=le.trackSwitch,Ae=le.accurateTimeOffset,Oe=le.timeOffset,ce=b.audioCodec,ue=b.videoCodec,Pe=b.defaultInitPts,qe=b.duration,ze=b.initSegmentData;if((Ee||Te)&&this.resetInitSegment(ze,ce,ue,qe),Ee&&this.resetInitialTimestamp(Pe),Re||this.resetContiguity(),this.needsProbing(B,Ee,Te)){if(R.dataLength){var et=R.flush();B=Object(u.appendUint8Array)(et,B)}this.configureTransmuxer(B,b)}var nt=this.transmux(B,X,Oe,Ae,T),Ie=this.currentTransmuxState;return Ie.contiguous=!0,Ie.discontinuity=!1,Ie.trackSwitch=!1,N.executeEnd=f(),nt},C.flush=function(x){var p=this,T=x.transmuxing;T.executeStart=f();var v=this.decrypter,y=this.cache,N=this.currentTransmuxState,B=this.decryptionPromise;if(B)return B.then(function(){return p.flush(x)});var R=[],j=N.timeOffset;if(v){var P=v.flush();P&&R.push(this.push(P,null,x))}var b=y.dataLength;y.reset();var X=this.demuxer,ee=this.remuxer;if(!X||!ee)return b>=h&&this.observer.emit(Y.Events.ERROR,Y.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),T.executeEnd=f(),[A(x)];var ae=X.flush(j);return _(ae)?ae.then(function(le){return p.flushRemux(R,le,x),R}):(this.flushRemux(R,ae,x),R)},C.flushRemux=function(x,p,T){var v=p.audioTrack,y=p.avcTrack,N=p.id3Track,B=p.textTrack,R=this.currentTransmuxState,j=R.accurateTimeOffset,P=R.timeOffset;a.logger.log("[transmuxer.ts]: Flushed fragment "+T.sn+(T.part>-1?" p: "+T.part:"")+" of level "+T.level);var b=this.remuxer.remux(v,y,N,B,P,j,!0,this.id);x.push({remuxResult:b,chunkMeta:T}),T.transmuxing.executeEnd=f()},C.resetInitialTimestamp=function(x){var p=this.demuxer,T=this.remuxer;if(!p||!T)return;p.resetTimeStamp(x),T.resetTimeStamp(x)},C.resetContiguity=function(){var x=this.demuxer,p=this.remuxer;if(!x||!p)return;x.resetContiguity(),p.resetNextTimestamp()},C.resetInitSegment=function(x,p,T,v){var y=this.demuxer,N=this.remuxer;if(!y||!N)return;y.resetInitSegment(p,T,v),N.resetInitSegment(x,p,T)},C.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},C.transmux=function(x,p,T,v,y){var N;return p&&p.method==="SAMPLE-AES"?N=this.transmuxSampleAes(x,p,T,v,y):N=this.transmuxUnencrypted(x,T,v,y),N},C.transmuxUnencrypted=function(x,p,T,v){var y=this.demuxer.demux(x,p,!1,!this.config.progressive),N=y.audioTrack,B=y.avcTrack,R=y.id3Track,j=y.textTrack,P=this.remuxer.remux(N,B,R,j,p,T,!1,this.id);return{remuxResult:P,chunkMeta:v}},C.transmuxSampleAes=function(x,p,T,v,y){var N=this;return this.demuxer.demuxSampleAes(x,p,T).then(function(B){var R=N.remuxer.remux(B.audioTrack,B.avcTrack,B.id3Track,B.textTrack,T,v,!1,N.id);return{remuxResult:R,chunkMeta:y}})},C.configureTransmuxer=function(x,p){for(var T=this.config,v=this.observer,y=this.typeSupported,N=this.vendor,B=p.audioCodec,R=p.defaultInitPts,j=p.duration,P=p.initSegmentData,b=p.videoCodec,X,ee=0,ae=l.length;ee<ae;ee++)if(l[ee].demux.probe(x)){X=l[ee];break}X||(a.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),X={demux:W.default,remux:d.default});var le=this.demuxer,Re=this.remuxer,Ee=X.remux,Te=X.demux;(!Re||!(Re instanceof Ee))&&(this.remuxer=new Ee(v,T,y,N)),(!le||!(le instanceof Te))&&(this.demuxer=new Te(v,T,y),this.probe=Te.probe),this.resetInitSegment(P,B,b,j),this.resetInitialTimestamp(R)},C.needsProbing=function(x,p,T){return!this.demuxer||!this.remuxer||p||T},C.getDecrypter=function(){var x=this.decrypter;return x||(x=this.decrypter=new U.default(this.observer,this.config)),x},O}();function s(O,C){var w=null;return O.byteLength>0&&C!=null&&C.key!=null&&C.iv!==null&&C.method!=null&&(w=C),w}var A=function(C){return{remuxResult:{},chunkMeta:C}};function _(O){return"then"in O&&O.then instanceof Function}var S=function(C,w,x,p,T){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=C,this.videoCodec=w,this.initSegmentData=x,this.duration=p,this.defaultInitPts=T},L=function(C,w,x,p,T){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=C,this.contiguous=w,this.accurateTimeOffset=x,this.trackSwitch=p,this.timeOffset=T}},"./src/demux/tsdemuxer.ts":function(ie,$,M){"use strict";M.r($),M.d($,"discardEPB",function(){return A});var Y=M("./src/demux/adts.ts"),F=M("./src/demux/mpegaudio.ts"),U=M("./src/demux/exp-golomb.ts"),G=M("./src/demux/id3.ts"),W=M("./src/demux/sample-aes.ts"),i=M("./src/events.ts"),D=M("./src/utils/mp4-tools.ts"),g=M("./src/utils/logger.ts"),d=M("./src/errors.ts"),m={video:1,audio:2,id3:3,text:4},u=function(){function _(L,O,C){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=L,this.config=O,this.typeSupported=C}_.probe=function(O){var C=_.syncOffset(O);return C<0?!1:(C&&g.logger.warn("MPEG2-TS detected but first sync word found @ offset "+C+", junk ahead ?"),!0)},_.syncOffset=function(O){for(var C=Math.min(1e3,O.length-3*188),w=0;w<C;){if(O[w]===71&&O[w+188]===71&&O[w+2*188]===71)return w;w++}return-1},_.createTrack=function(O,C){return{container:O==="video"||O==="audio"?"video/mp2t":void 0,type:O,id:m[O],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:O==="audio"?C:void 0}};var S=_.prototype;return S.resetInitSegment=function(O,C,w){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=_.createTrack("video",w),this._audioTrack=_.createTrack("audio",w),this._id3Track=_.createTrack("id3",w),this._txtTrack=_.createTrack("text",w),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=O,this.videoCodec=C,this._duration=w},S.resetTimeStamp=function(){},S.resetContiguity=function(){var O=this._audioTrack,C=this._avcTrack,w=this._id3Track;O&&(O.pesData=null),C&&(C.pesData=null),w&&(w.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},S.demux=function(O,C,w,x){w===void 0&&(w=!1),x===void 0&&(x=!1),w||(this.sampleAes=null);var p,T=this._avcTrack,v=this._audioTrack,y=this._id3Track,N=T.pid,B=T.pesData,R=v.pid,j=y.pid,P=v.pesData,b=y.pesData,X=!1,ee=this.pmtParsed,ae=this._pmtId,le=O.length;if(this.remainderData&&(O=Object(D.appendUint8Array)(this.remainderData,O),le=O.length,this.remainderData=null),le<188&&!x)return this.remainderData=O,{audioTrack:v,avcTrack:T,id3Track:y,textTrack:this._txtTrack};var Re=Math.max(0,_.syncOffset(O));le-=(le+Re)%188,le<O.byteLength&&!x&&(this.remainderData=new Uint8Array(O.buffer,le,O.buffer.byteLength-le));for(var Ee=Re;Ee<le;Ee+=188)if(O[Ee]===71){var Te=!!(O[Ee+1]&64),Ae=((O[Ee+1]&31)<<8)+O[Ee+2],Oe=(O[Ee+3]&48)>>4,ce=void 0;if(Oe>1){if(ce=Ee+5+O[Ee+4],ce===Ee+188)continue}else ce=Ee+4;switch(Ae){case N:Te&&(B&&(p=h(B))&&this.parseAVCPES(p,!1),B={data:[],size:0}),B&&(B.data.push(O.subarray(ce,Ee+188)),B.size+=Ee+188-ce);break;case R:Te&&(P&&(p=h(P))&&(v.isAAC?this.parseAACPES(p):this.parseMPEGPES(p)),P={data:[],size:0}),P&&(P.data.push(O.subarray(ce,Ee+188)),P.size+=Ee+188-ce);break;case j:Te&&(b&&(p=h(b))&&this.parseID3PES(p),b={data:[],size:0}),b&&(b.data.push(O.subarray(ce,Ee+188)),b.size+=Ee+188-ce);break;case 0:Te&&(ce+=O[ce]+1),ae=this._pmtId=f(O,ce);break;case ae:{Te&&(ce+=O[ce]+1);var ue=l(O,ce,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,w);N=ue.avc,N>0&&(T.pid=N),R=ue.audio,R>0&&(v.pid=R,v.isAAC=ue.isAAC),j=ue.id3,j>0&&(y.pid=j),X&&!ee&&(g.logger.log("reparse from beginning"),X=!1,Ee=Re-188),ee=this.pmtParsed=!0;break}case 17:case 8191:break;default:X=!0;break}}else this.observer.emit(i.Events.ERROR,i.Events.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});T.pesData=B,v.pesData=P,y.pesData=b;var Pe={audioTrack:v,avcTrack:T,id3Track:y,textTrack:this._txtTrack};return x&&this.extractRemainingSamples(Pe),Pe},S.flush=function(){var O=this.remainderData;this.remainderData=null;var C;return O?C=this.demux(O,-1,!1,!0):C={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(C),this.sampleAes?this.decrypt(C,this.sampleAes):C},S.extractRemainingSamples=function(O){var C=O.audioTrack,w=O.avcTrack,x=O.id3Track,p=w.pesData,T=C.pesData,v=x.pesData,y;p&&(y=h(p))?(this.parseAVCPES(y,!0),w.pesData=null):w.pesData=p,T&&(y=h(T))?(C.isAAC?this.parseAACPES(y):this.parseMPEGPES(y),C.pesData=null):(T!=null&&T.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),C.pesData=T),v&&(y=h(v))?(this.parseID3PES(y),x.pesData=null):x.pesData=v},S.demuxSampleAes=function(O,C,w){var x=this.demux(O,w,!0,!this.config.progressive),p=this.sampleAes=new W.default(this.observer,this.config,C);return this.decrypt(x,p)},S.decrypt=function(O,C){return new Promise(function(w){var x=O.audioTrack,p=O.avcTrack;x.samples&&x.isAAC?C.decryptAacSamples(x.samples,0,function(){p.samples?C.decryptAvcSamples(p.samples,0,0,function(){w(O)}):w(O)}):p.samples&&C.decryptAvcSamples(p.samples,0,0,function(){w(O)})})},S.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},S.parseAVCPES=function(O,C){var w=this,x=this._avcTrack,p=this.parseAVCNALu(O.data),T=!1,v=this.avcSample,y,N=!1;O.data=null,v&&p.length&&!x.audFound&&(o(v,x),v=this.avcSample=a(!1,O.pts,O.dts,"")),p.forEach(function(B){switch(B.type){case 1:{y=!0,v||(v=w.avcSample=a(!0,O.pts,O.dts,"")),T&&(v.debug+="NDR "),v.frame=!0;var R=B.data;if(N&&R.length>4){var j=new U.default(R).readSliceType();(j===2||j===4||j===7||j===9)&&(v.key=!0)}break}case 5:y=!0,v||(v=w.avcSample=a(!0,O.pts,O.dts,"")),T&&(v.debug+="IDR "),v.key=!0,v.frame=!0;break;case 6:{y=!0,T&&v&&(v.debug+="SEI ");var P=new U.default(A(B.data));P.readUByte();for(var b=0,X=0,ee=!1,ae=0;!ee&&P.bytesAvailable>1;){b=0;do ae=P.readUByte(),b+=ae;while(ae===255);X=0;do ae=P.readUByte(),X+=ae;while(ae===255);if(b===4&&P.bytesAvailable!==0){ee=!0;var le=P.readUByte();if(le===181){var Re=P.readUShort();if(Re===49){var Ee=P.readUInt();if(Ee===1195456820){var Te=P.readUByte();if(Te===3){for(var Ae=P.readUByte(),Oe=P.readUByte(),ce=31&Ae,ue=[Ae,Oe],Pe=0;Pe<ce;Pe++)ue.push(P.readUByte()),ue.push(P.readUByte()),ue.push(P.readUByte());s(w._txtTrack.samples,{type:3,pts:O.pts,bytes:ue})}}}}}else if(b===5&&P.bytesAvailable!==0){if(ee=!0,X>16){for(var qe=[],ze=0;ze<16;ze++)qe.push(P.readUByte().toString(16)),(ze===3||ze===5||ze===7||ze===9)&&qe.push("-");for(var et=X-16,nt=new Uint8Array(et),Ie=0;Ie<et;Ie++)nt[Ie]=P.readUByte();s(w._txtTrack.samples,{pts:O.pts,payloadType:b,uuid:qe.join(""),userData:Object(G.utf8ArrayToStr)(nt),userDataBytes:nt})}}else if(X<P.bytesAvailable)for(var Me=0;Me<X;Me++)P.readUByte()}break}case 7:if(y=!0,N=!0,T&&v&&(v.debug+="SPS "),!x.sps){var Ge=new U.default(B.data),se=Ge.readSPS();x.width=se.width,x.height=se.height,x.pixelRatio=se.pixelRatio,x.sps=[B.data],x.duration=w._duration;for(var be=B.data.subarray(1,4),xe="avc1.",Se=0;Se<3;Se++){var Be=be[Se].toString(16);Be.length<2&&(Be="0"+Be),xe+=Be}x.codec=xe}break;case 8:y=!0,T&&v&&(v.debug+="PPS "),x.pps||(x.pps=[B.data]);break;case 9:y=!1,x.audFound=!0,v&&o(v,x),v=w.avcSample=a(!1,O.pts,O.dts,T?"AUD ":"");break;case 12:y=!1;break;default:y=!1,v&&(v.debug+="unknown NAL "+B.type+" ");break}if(v&&y){var He=v.units;He.push(B)}}),C&&v&&(o(v,x),this.avcSample=null)},S.getLastNalUnit=function(){var O,C=this.avcSample,w;if(!C||C.units.length===0){var x=this._avcTrack.samples;C=x[x.length-1]}if((O=C)!==null&&O!==void 0&&O.units){var p=C.units;w=p[p.length-1]}return w},S.parseAVCNALu=function(O){var C=O.byteLength,w=this._avcTrack,x=w.naluState||0,p=x,T=[],v=0,y,N,B,R=-1,j=0;for(x===-1&&(R=0,j=O[0]&31,x=0,v=1);v<C;){if(y=O[v++],!x){x=y?0:1;continue}if(x===1){x=y?0:2;continue}if(!y)x=3;else if(y===1){if(R>=0){var P={data:O.subarray(R,v-x-1),type:j};T.push(P)}else{var b=this.getLastNalUnit();if(b&&(p&&v<=4-p&&(b.state&&(b.data=b.data.subarray(0,b.data.byteLength-p))),N=v-x-1,N>0)){var X=new Uint8Array(b.data.byteLength+N);X.set(b.data,0),X.set(O.subarray(0,N),b.data.byteLength),b.data=X,b.state=0}}v<C?(B=O[v]&31,R=v,j=B,x=0):x=-1}else x=0}if(R>=0&&x>=0){var ee={data:O.subarray(R,C),type:j,state:x};T.push(ee)}if(T.length===0){var ae=this.getLastNalUnit();if(ae){var le=new Uint8Array(ae.data.byteLength+O.byteLength);le.set(ae.data,0),le.set(O,ae.data.byteLength),ae.data=le}}return w.naluState=x,T},S.parseAACPES=function(O){var C=0,w=this._audioTrack,x=this.aacOverFlow,p=O.data;if(x){this.aacOverFlow=null;var T=x.sample.unit.byteLength,v=Math.min(x.missing,T),y=T-v;x.sample.unit.set(p.subarray(0,v),y),w.samples.push(x.sample),C=x.missing}var N,B;for(N=C,B=p.length;N<B-1&&!Y.isHeader(p,N);N++);if(N!==C){var R,j;if(N<B-1?(R="AAC PES did not start with ADTS header,offset:"+N,j=!1):(R="no ADTS header found in AAC PES",j=!0),g.logger.warn("parsing error:"+R),this.observer.emit(i.Events.ERROR,i.Events.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.FRAG_PARSING_ERROR,fatal:j,reason:R}),j)return}Y.initTrackConfig(w,this.observer,p,N,this.audioCodec);var P;if(O.pts!==void 0)P=O.pts;else if(x){var b=Y.getFrameDuration(w.samplerate);P=x.sample.pts+b}else{g.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var X=0;N<B;)if(Y.isHeader(p,N)){if(N+5<B){var ee=Y.appendFrame(w,p,N,P,X);if(ee)if(ee.missing)this.aacOverFlow=ee;else{N+=ee.length,X++;continue}}break}else N++},S.parseMPEGPES=function(O){var C=O.data,w=C.length,x=0,p=0,T=O.pts;if(T===void 0){g.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;p<w;)if(F.isHeader(C,p)){var v=F.appendFrame(this._audioTrack,C,p,T,x);if(v)p+=v.length,x++;else break}else p++},S.parseID3PES=function(O){if(O.pts===void 0){g.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(O)},_}();u.minProbeByteLength=188;function a(_,S,L,O){return{key:_,frame:!1,pts:S,dts:L,units:[],debug:O,length:0}}function f(_,S){return(_[S+10]&31)<<8|_[S+11]}function l(_,S,L,O){var C={audio:-1,avc:-1,id3:-1,isAAC:!0},w=(_[S+1]&15)<<8|_[S+2],x=S+3+w-4,p=(_[S+10]&15)<<8|_[S+11];for(S+=12+p;S<x;){var T=(_[S+1]&31)<<8|_[S+2];switch(_[S]){case 207:if(!O){g.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:C.audio===-1&&(C.audio=T);break;case 21:C.id3===-1&&(C.id3=T);break;case 219:if(!O){g.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:C.avc===-1&&(C.avc=T);break;case 3:case 4:L?C.audio===-1&&(C.audio=T,C.isAAC=!1):g.logger.log("MPEG audio found, not supported in this browser");break;case 36:g.logger.warn("Unsupported HEVC stream type found");break;default:break}S+=((_[S+3]&15)<<8|_[S+4])+5}return C}function h(_){var S=0,L,O,C,w,x,p=_.data;if(!_||_.size===0)return null;for(;p[0].length<19&&p.length>1;){var T=new Uint8Array(p[0].length+p[1].length);T.set(p[0]),T.set(p[1],p[0].length),p[0]=T,p.splice(1,1)}L=p[0];var v=(L[0]<<16)+(L[1]<<8)+L[2];if(v===1){if(O=(L[4]<<8)+L[5],O&&O>_.size-6)return null;var y=L[7];y&192&&(w=(L[9]&14)*536870912+(L[10]&255)*4194304+(L[11]&254)*16384+(L[12]&255)*128+(L[13]&254)/2,y&64?(x=(L[14]&14)*536870912+(L[15]&255)*4194304+(L[16]&254)*16384+(L[17]&255)*128+(L[18]&254)/2,w-x>60*9e4&&(g.logger.warn(Math.round((w-x)/9e4)+"s delta between PTS and DTS, align them"),w=x)):x=w),C=L[8];var N=C+9;if(_.size<=N)return null;_.size-=N;for(var B=new Uint8Array(_.size),R=0,j=p.length;R<j;R++){L=p[R];var P=L.byteLength;if(N)if(N>P){N-=P;continue}else L=L.subarray(N),P-=N,N=0;B.set(L,S),S+=P}return O&&(O-=C+3),{data:B,pts:w,dts:x,len:O}}return null}function o(_,S){if(_.units.length&&_.frame){if(_.pts===void 0){var L=S.samples,O=L.length;if(O){var C=L[O-1];_.pts=C.pts,_.dts=C.dts}else{S.dropped++;return}}S.samples.push(_)}_.debug.length&&g.logger.log(_.pts+"/"+_.dts+":"+_.debug)}function s(_,S){var L=_.length;if(L>0){if(S.pts>=_[L-1].pts)_.push(S);else for(var O=L-1;O>=0;O--)if(S.pts<_[O].pts){_.splice(O,0,S);break}}else _.push(S)}function A(_){for(var S=_.byteLength,L=[],O=1;O<S-2;)_[O]===0&&_[O+1]===0&&_[O+2]===3?(L.push(O+2),O+=2):O++;if(L.length===0)return _;var C=S-L.length,w=new Uint8Array(C),x=0;for(O=0;O<C;x++,O++)x===L[0]&&(x++,L.shift()),w[O]=_[x];return w}$.default=u},"./src/errors.ts":function(ie,$,M){"use strict";M.r($),M.d($,"ErrorTypes",function(){return Y}),M.d($,"ErrorDetails",function(){return F});var Y;(function(U){U.NETWORK_ERROR="networkError",U.MEDIA_ERROR="mediaError",U.KEY_SYSTEM_ERROR="keySystemError",U.MUX_ERROR="muxError",U.OTHER_ERROR="otherError"})(Y||(Y={}));var F;(function(U){U.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",U.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",U.KEY_SYSTEM_NO_SESSION="keySystemNoSession",U.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",U.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",U.MANIFEST_LOAD_ERROR="manifestLoadError",U.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",U.MANIFEST_PARSING_ERROR="manifestParsingError",U.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",U.LEVEL_EMPTY_ERROR="levelEmptyError",U.LEVEL_LOAD_ERROR="levelLoadError",U.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",U.LEVEL_SWITCH_ERROR="levelSwitchError",U.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",U.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",U.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",U.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",U.FRAG_LOAD_ERROR="fragLoadError",U.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",U.FRAG_DECRYPT_ERROR="fragDecryptError",U.FRAG_PARSING_ERROR="fragParsingError",U.REMUX_ALLOC_ERROR="remuxAllocError",U.KEY_LOAD_ERROR="keyLoadError",U.KEY_LOAD_TIMEOUT="keyLoadTimeOut",U.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",U.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",U.BUFFER_APPEND_ERROR="bufferAppendError",U.BUFFER_APPENDING_ERROR="bufferAppendingError",U.BUFFER_STALLED_ERROR="bufferStalledError",U.BUFFER_FULL_ERROR="bufferFullError",U.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",U.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",U.INTERNAL_EXCEPTION="internalException",U.INTERNAL_ABORTED="aborted",U.UNKNOWN="unknown"})(F||(F={}))},"./src/events.ts":function(ie,$,M){"use strict";M.r($),M.d($,"Events",function(){return Y});var Y;(function(F){F.MEDIA_ATTACHING="hlsMediaAttaching",F.MEDIA_ATTACHED="hlsMediaAttached",F.MEDIA_DETACHING="hlsMediaDetaching",F.MEDIA_DETACHED="hlsMediaDetached",F.BUFFER_RESET="hlsBufferReset",F.BUFFER_CODECS="hlsBufferCodecs",F.BUFFER_CREATED="hlsBufferCreated",F.BUFFER_APPENDING="hlsBufferAppending",F.BUFFER_APPENDED="hlsBufferAppended",F.BUFFER_EOS="hlsBufferEos",F.BUFFER_FLUSHING="hlsBufferFlushing",F.BUFFER_FLUSHED="hlsBufferFlushed",F.MANIFEST_LOADING="hlsManifestLoading",F.MANIFEST_LOADED="hlsManifestLoaded",F.MANIFEST_PARSED="hlsManifestParsed",F.LEVEL_SWITCHING="hlsLevelSwitching",F.LEVEL_SWITCHED="hlsLevelSwitched",F.LEVEL_LOADING="hlsLevelLoading",F.LEVEL_LOADED="hlsLevelLoaded",F.LEVEL_UPDATED="hlsLevelUpdated",F.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",F.LEVELS_UPDATED="hlsLevelsUpdated",F.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",F.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",F.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",F.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",F.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",F.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",F.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",F.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",F.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",F.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",F.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",F.CUES_PARSED="hlsCuesParsed",F.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",F.INIT_PTS_FOUND="hlsInitPtsFound",F.FRAG_LOADING="hlsFragLoading",F.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",F.FRAG_LOADED="hlsFragLoaded",F.FRAG_DECRYPTED="hlsFragDecrypted",F.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",F.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",F.FRAG_PARSING_METADATA="hlsFragParsingMetadata",F.FRAG_PARSED="hlsFragParsed",F.FRAG_BUFFERED="hlsFragBuffered",F.FRAG_CHANGED="hlsFragChanged",F.FPS_DROP="hlsFpsDrop",F.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",F.ERROR="hlsError",F.DESTROYING="hlsDestroying",F.KEY_LOADING="hlsKeyLoading",F.KEY_LOADED="hlsKeyLoaded",F.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",F.BACK_BUFFER_REACHED="hlsBackBufferReached"})(Y||(Y={}))},"./src/hls.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return _});var Y=M("./node_modules/url-toolkit/src/url-toolkit.js"),F=M.n(Y),U=M("./src/loader/playlist-loader.ts"),G=M("./src/loader/key-loader.ts"),W=M("./src/controller/id3-track-controller.ts"),i=M("./src/controller/latency-controller.ts"),D=M("./src/controller/level-controller.ts"),g=M("./src/controller/fragment-tracker.ts"),d=M("./src/controller/stream-controller.ts"),m=M("./src/is-supported.ts"),u=M("./src/utils/logger.ts"),a=M("./src/config.ts"),f=M("./node_modules/eventemitter3/index.js"),l=M.n(f),h=M("./src/events.ts"),o=M("./src/errors.ts");function s(S,L){for(var O=0;O<L.length;O++){var C=L[O];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(S,C.key,C)}}function A(S,L,O){return L&&s(S.prototype,L),O&&s(S,O),S}var _=function(){S.isSupported=function(){return Object(m.isSupported)()};function S(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 C=this.config=Object(a.mergeConfig)(S.DefaultConfig,O);this.userConfig=O,Object(u.enableLogs)(C.debug),this._autoLevelCapping=-1,C.progressive&&Object(a.enableStreamingMode)(C);var w=C.abrController,x=C.bufferController,p=C.capLevelController,T=C.fpsController,v=this.abrController=new w(this),y=this.bufferController=new x(this),N=this.capLevelController=new p(this),B=new T(this),R=new U.default(this),j=new G.default(this),P=new W.default(this),b=this.levelController=new D.default(this),X=new g.FragmentTracker(this),ee=this.streamController=new d.default(this,X);N.setStreamController(ee),B.setStreamController(ee);var ae=[b,ee];this.networkControllers=ae;var le=[R,j,v,y,N,B,P,X];this.audioTrackController=this.createController(C.audioTrackController,null,ae),this.createController(C.audioStreamController,X,ae),this.subtitleTrackController=this.createController(C.subtitleTrackController,null,ae),this.createController(C.subtitleStreamController,X,ae),this.createController(C.timelineController,null,le),this.emeController=this.createController(C.emeController,null,le),this.cmcdController=this.createController(C.cmcdController,null,le),this.latencyController=this.createController(i.default,null,le),this.coreComponents=le}var L=S.prototype;return L.createController=function(C,w,x){if(C){var p=w?new C(this,w):new C(this);return x&&x.push(p),p}return null},L.on=function(C,w,x){x===void 0&&(x=this),this._emitter.on(C,w,x)},L.once=function(C,w,x){x===void 0&&(x=this),this._emitter.once(C,w,x)},L.removeAllListeners=function(C){this._emitter.removeAllListeners(C)},L.off=function(C,w,x,p){x===void 0&&(x=this),this._emitter.off(C,w,x,p)},L.listeners=function(C){return this._emitter.listeners(C)},L.emit=function(C,w,x){return this._emitter.emit(C,w,x)},L.trigger=function(C,w){if(this.config.debug)return this.emit(C,C,w);try{return this.emit(C,C,w)}catch(x){u.logger.error("An internal error happened while handling event "+C+'. Error message: "'+x.message+'". Here is a stacktrace:',x),this.trigger(h.Events.ERROR,{type:o.ErrorTypes.OTHER_ERROR,details:o.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:C,error:x})}return!1},L.listenerCount=function(C){return this._emitter.listenerCount(C)},L.destroy=function(){u.logger.log("destroy"),this.trigger(h.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(C){return C.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(C){return C.destroy()}),this.coreComponents.length=0},L.attachMedia=function(C){u.logger.log("attachMedia"),this._media=C,this.trigger(h.Events.MEDIA_ATTACHING,{media:C})},L.detachMedia=function(){u.logger.log("detachMedia"),this.trigger(h.Events.MEDIA_DETACHING,void 0),this._media=null},L.loadSource=function(C){this.stopLoad();var w=this.media,x=this.url,p=this.url=Y.buildAbsoluteURL(self.location.href,C,{alwaysNormalize:!0});u.logger.log("loadSource:"+p),w&&x&&x!==p&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(w)),this.trigger(h.Events.MANIFEST_LOADING,{url:C})},L.startLoad=function(C){C===void 0&&(C=-1),u.logger.log("startLoad("+C+")"),this.networkControllers.forEach(function(w){w.startLoad(C)})},L.stopLoad=function(){u.logger.log("stopLoad"),this.networkControllers.forEach(function(C){C.stopLoad()})},L.swapAudioCodec=function(){u.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},L.recoverMediaError=function(){u.logger.log("recoverMediaError");var C=this._media;this.detachMedia(),C&&this.attachMedia(C)},L.removeLevel=function(C,w){w===void 0&&(w=0),this.levelController.removeLevel(C,w)},A(S,[{key:"levels",get:function(){var C=this.levelController.levels;return C||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(C){u.logger.log("set currentLevel:"+C),this.loadLevel=C,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(C){u.logger.log("set nextLevel:"+C),this.levelController.manualLevel=C,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(C){u.logger.log("set loadLevel:"+C),this.levelController.manualLevel=C}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(C){this.levelController.nextLoadLevel=C}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(C){u.logger.log("set firstLevel:"+C),this.levelController.firstLevel=C}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(C){u.logger.log("set startLevel:"+C),C!==-1&&(C=Math.max(C,this.minAutoLevel)),this.levelController.startLevel=C}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(C){var w=!!C;w!==this.config.capLevelToPlayerSize&&(w?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=w)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(C){this._autoLevelCapping!==C&&(u.logger.log("set autoLevelCapping:"+C),this._autoLevelCapping=C)}},{key:"bandwidthEstimate",get:function(){var C=this.abrController.bwEstimator;return C?C.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var C=this.levels,w=this.config.minAutoBitrate;if(!C)return 0;for(var x=C.length,p=0;p<x;p++)if(C[p].maxBitrate>w)return p;return 0}},{key:"maxAutoLevel",get:function(){var C=this.levels,w=this.autoLevelCapping,x;return w===-1&&C&&C.length?x=C.length-1:x=w,x}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(C){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,C)}},{key:"audioTracks",get:function(){var C=this.audioTrackController;return C?C.audioTracks:[]}},{key:"audioTrack",get:function(){var C=this.audioTrackController;return C?C.audioTrack:-1},set:function(C){var w=this.audioTrackController;w&&(w.audioTrack=C)}},{key:"subtitleTracks",get:function(){var C=this.subtitleTrackController;return C?C.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var C=this.subtitleTrackController;return C?C.subtitleTrack:-1},set:function(C){var w=this.subtitleTrackController;w&&(w.subtitleTrack=C)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var C=this.subtitleTrackController;return C?C.subtitleDisplay:!1},set:function(C){var w=this.subtitleTrackController;w&&(w.subtitleDisplay=C)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(C){this.config.lowLatencyMode=C}},{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 h.Events}},{key:"ErrorTypes",get:function(){return o.ErrorTypes}},{key:"ErrorDetails",get:function(){return o.ErrorDetails}},{key:"DefaultConfig",get:function(){return S.defaultConfig?S.defaultConfig:a.hlsDefaultConfig},set:function(C){S.defaultConfig=C}}]),S}();_.defaultConfig=void 0},"./src/is-supported.ts":function(ie,$,M){"use strict";M.r($),M.d($,"isSupported",function(){return U}),M.d($,"changeTypeSupported",function(){return G});var Y=M("./src/utils/mediasource-helper.ts");function F(){return self.SourceBuffer||self.WebKitSourceBuffer}function U(){var W=Object(Y.getMediaSource)();if(!W)return!1;var i=F(),D=W&&typeof W.isTypeSupported=="function"&&W.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),g=!i||i.prototype&&typeof i.prototype.appendBuffer=="function"&&typeof i.prototype.remove=="function";return!!D&&!!g}function G(){var W,i=F();return typeof(i==null||((W=i.prototype)===null||W===void 0)?void 0:W.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return u}),M.d($,"LoadError",function(){return f});var Y=M("./src/polyfills/number.ts"),F=M("./src/errors.ts");function U(l,h){l.prototype=Object.create(h.prototype),l.prototype.constructor=l,g(l,h)}function G(l){var h=typeof Map=="function"?new Map:void 0;return G=function(s){if(s===null||!D(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof h!="undefined"){if(h.has(s))return h.get(s);h.set(s,A)}function A(){return W(s,arguments,d(this).constructor)}return A.prototype=Object.create(s.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),g(A,s)},G(l)}function W(l,h,o){return i()?W=Reflect.construct:W=function(A,_,S){var L=[null];L.push.apply(L,_);var O=Function.bind.apply(A,L),C=new O;return S&&g(C,S.prototype),C},W.apply(null,arguments)}function i(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(l){return!1}}function D(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function g(l,h){return g=Object.setPrototypeOf||function(s,A){return s.__proto__=A,s},g(l,h)}function d(l){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},d(l)}var m=Math.pow(2,17),u=function(){function l(o){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=o}var h=l.prototype;return h.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},h.abort=function(){this.loader&&this.loader.abort()},h.load=function(s,A){var _=this,S=s.url;if(!S)return Promise.reject(new f({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,networkDetails:null},"Fragment does not have a "+(S?"part list":"url")));this.abort();var L=this.config,O=L.fLoader,C=L.loader;return new Promise(function(w,x){_.loader&&_.loader.destroy();var p=_.loader=s.loader=O?new O(L):new C(L),T=a(s),v={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:m};s.stats=p.stats,p.load(T,v,{onSuccess:function(N,B,R,j){_.resetLoader(s,p),w({frag:s,part:null,payload:N.data,networkDetails:j})},onError:function(N,B,R){_.resetLoader(s,p),x(new f({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,response:N,networkDetails:R}))},onAbort:function(N,B,R){_.resetLoader(s,p),x(new f({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,networkDetails:R}))},onTimeout:function(N,B,R){_.resetLoader(s,p),x(new f({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,networkDetails:R}))},onProgress:function(N,B,R,j){A&&A({frag:s,part:null,payload:R,networkDetails:j})}})})},h.loadPart=function(s,A,_){var S=this;this.abort();var L=this.config,O=L.fLoader,C=L.loader;return new Promise(function(w,x){S.loader&&S.loader.destroy();var p=S.loader=s.loader=O?new O(L):new C(L),T=a(s,A),v={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:m};A.stats=p.stats,p.load(T,v,{onSuccess:function(N,B,R,j){S.resetLoader(s,p),S.updateStatsFromPart(s,A);var P={frag:s,part:A,payload:N.data,networkDetails:j};_(P),w(P)},onError:function(N,B,R){S.resetLoader(s,p),x(new f({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,part:A,response:N,networkDetails:R}))},onAbort:function(N,B,R){s.stats.aborted=A.stats.aborted,S.resetLoader(s,p),x(new f({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,part:A,networkDetails:R}))},onTimeout:function(N,B,R){S.resetLoader(s,p),x(new f({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,part:A,networkDetails:R}))}})})},h.updateStatsFromPart=function(s,A){var _=s.stats,S=A.stats,L=S.total;if(_.loaded+=S.loaded,L){var O=Math.round(s.duration/A.duration),C=Math.min(Math.round(_.loaded/L),O),w=O-C,x=w*Math.round(_.loaded/C);_.total=_.loaded+x}else _.total=Math.max(_.loaded,_.total);var p=_.loading,T=S.loading;p.start?p.first+=T.first-T.start:(p.start=T.start,p.first=T.first),p.end=T.end},h.resetLoader=function(s,A){s.loader=null,this.loader===A&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),A.destroy()},l}();function a(l,h){h===void 0&&(h=null);var o=h||l,s={frag:l,part:h,responseType:"arraybuffer",url:o.url,headers:{},rangeStart:0,rangeEnd:0},A=o.byteRangeStartOffset,_=o.byteRangeEndOffset;return Object(Y.isFiniteNumber)(A)&&Object(Y.isFiniteNumber)(_)&&(s.rangeStart=A,s.rangeEnd=_),s}var f=function(l){U(h,l);function h(o){for(var s,A=arguments.length,_=new Array(A>1?A-1:0),S=1;S<A;S++)_[S-1]=arguments[S];return s=l.call.apply(l,[this].concat(_))||this,s.data=void 0,s.data=o,s}return h}(G(Error))},"./src/loader/fragment.ts":function(ie,$,M){"use strict";M.r($),M.d($,"ElementaryStreamTypes",function(){return u}),M.d($,"BaseSegment",function(){return a}),M.d($,"Fragment",function(){return f}),M.d($,"Part",function(){return l});var Y=M("./src/polyfills/number.ts"),F=M("./node_modules/url-toolkit/src/url-toolkit.js"),U=M.n(F),G=M("./src/utils/logger.ts"),W=M("./src/loader/level-key.ts"),i=M("./src/loader/load-stats.ts");function D(h,o){h.prototype=Object.create(o.prototype),h.prototype.constructor=h,g(h,o)}function g(h,o){return g=Object.setPrototypeOf||function(A,_){return A.__proto__=_,A},g(h,o)}function d(h,o){for(var s=0;s<o.length;s++){var A=o[s];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(h,A.key,A)}}function m(h,o,s){return o&&d(h.prototype,o),s&&d(h,s),h}var u;(function(h){h.AUDIO="audio",h.VIDEO="video",h.AUDIOVIDEO="audiovideo"})(u||(u={}));var a=function(){function h(s){var A;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(A={},A[u.AUDIO]=null,A[u.VIDEO]=null,A[u.AUDIOVIDEO]=null,A),this.baseurl=s}var o=h.prototype;return o.setByteRange=function(A,_){var S=A.split("@",2),L=[];S.length===1?L[0]=_?_.byteRangeEndOffset:0:L[0]=parseInt(S[1]),L[1]=parseInt(S[0])+L[0],this._byteRange=L},m(h,[{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(F.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(A){this._url=A}}]),h}(),f=function(h){D(o,h);function o(A,_){var S;return S=h.call(this,_)||this,S._decryptdata=null,S.rawProgramDateTime=null,S.programDateTime=null,S.tagList=[],S.duration=0,S.sn=0,S.levelkey=void 0,S.type=void 0,S.loader=null,S.level=-1,S.cc=0,S.startPTS=void 0,S.endPTS=void 0,S.appendedPTS=void 0,S.startDTS=void 0,S.endDTS=void 0,S.start=0,S.deltaPTS=void 0,S.maxStartPTS=void 0,S.minEndPTS=void 0,S.stats=new i.LoadStats,S.urlId=0,S.data=void 0,S.bitrateTest=!1,S.title=null,S.initSegment=null,S.type=A,S}var s=o.prototype;return s.createInitializationVector=function(_){for(var S=new Uint8Array(16),L=12;L<16;L++)S[L]=_>>8*(15-L)&255;return S},s.setDecryptDataFromLevelKey=function(_,S){var L=_;return(_==null?void 0:_.method)==="AES-128"&&_.uri&&!_.iv&&(L=W.LevelKey.fromURI(_.uri),L.method=_.method,L.iv=this.createInitializationVector(S),L.keyFormat="identity"),L},s.setElementaryStreamInfo=function(_,S,L,O,C,w){w===void 0&&(w=!1);var x=this.elementaryStreams,p=x[_];if(!p){x[_]={startPTS:S,endPTS:L,startDTS:O,endDTS:C,partial:w};return}p.startPTS=Math.min(p.startPTS,S),p.endPTS=Math.max(p.endPTS,L),p.startDTS=Math.min(p.startDTS,O),p.endDTS=Math.max(p.endDTS,C)},s.clearElementaryStreamInfo=function(){var _=this.elementaryStreams;_[u.AUDIO]=null,_[u.VIDEO]=null,_[u.AUDIOVIDEO]=null},m(o,[{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&&G.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(Y.isFiniteNumber)(this.programDateTime))return null;var _=Object(Y.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)}}]),o}(a),l=function(h){D(o,h);function o(s,A,_,S,L){var O;O=h.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 i.LoadStats,O.duration=s.decimalFloatingPoint("DURATION"),O.gap=s.bool("GAP"),O.independent=s.bool("INDEPENDENT"),O.relurl=s.enumeratedString("URI"),O.fragment=A,O.index=S;var C=s.enumeratedString("BYTERANGE");return C&&O.setByteRange(C,L),L&&(O.fragOffset=L.fragOffset+L.duration),O}return m(o,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var A=this.elementaryStreams;return!!(A.audio||A.video||A.audiovideo)}}]),o}(a)},"./src/loader/key-loader.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return G});var Y=M("./src/events.ts"),F=M("./src/errors.ts"),U=M("./src/utils/logger.ts"),G=function(){function W(D){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=D,this._registerListeners()}var i=W.prototype;return i._registerListeners=function(){this.hls.on(Y.Events.KEY_LOADING,this.onKeyLoading,this)},i._unregisterListeners=function(){this.hls.off(Y.Events.KEY_LOADING,this.onKeyLoading)},i.destroy=function(){this._unregisterListeners();for(var g in this.loaders){var d=this.loaders[g];d&&d.destroy()}this.loaders={}},i.onKeyLoading=function(g,d){var m=d.frag,u=m.type,a=this.loaders[u];if(!m.decryptdata){U.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var f=m.decryptdata.uri;if(f!==this.decrypturl||this.decryptkey===null){var l=this.hls.config;if(a&&(U.logger.warn("abort previous key loader for type:"+u),a.abort()),!f){U.logger.warn("key uri is falsy");return}var h=l.loader,o=m.loader=this.loaders[u]=new h(l);this.decrypturl=f,this.decryptkey=null;var s={url:f,frag:m,responseType:"arraybuffer"},A={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},_={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};o.load(s,A,_)}else this.decryptkey&&(m.decryptdata.key=this.decryptkey,this.hls.trigger(Y.Events.KEY_LOADED,{frag:m}))},i.loadsuccess=function(g,d,m){var u=m.frag;if(!u.decryptdata){U.logger.error("after key load, decryptdata unset");return}this.decryptkey=u.decryptdata.key=new Uint8Array(g.data),u.loader=null,delete this.loaders[u.type],this.hls.trigger(Y.Events.KEY_LOADED,{frag:u})},i.loaderror=function(g,d){var m=d.frag,u=m.loader;u&&u.abort(),delete this.loaders[m.type],this.hls.trigger(Y.Events.ERROR,{type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:m,response:g})},i.loadtimeout=function(g,d){var m=d.frag,u=m.loader;u&&u.abort(),delete this.loaders[m.type],this.hls.trigger(Y.Events.ERROR,{type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:m})},W}()},"./src/loader/level-details.ts":function(ie,$,M){"use strict";M.r($),M.d($,"LevelDetails",function(){return W});var Y=M("./src/polyfills/number.ts");function F(i,D){for(var g=0;g<D.length;g++){var d=D[g];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(i,d.key,d)}}function U(i,D,g){return D&&F(i.prototype,D),g&&F(i,g),i}var G=10,W=function(){function i(g){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=g}var D=i.prototype;return D.reloaded=function(d){if(!d){this.advanced=!0,this.updated=!0;return}var m=this.lastPartSn-d.lastPartSn,u=this.lastPartIndex-d.lastPartIndex;this.updated=this.endSN!==d.endSN||!!u||!!m,this.advanced=this.endSN>d.endSN||m>0||m===0&&u>0,this.updated||this.advanced?this.misses=Math.floor(d.misses*.6):this.misses=d.misses+1,this.availabilityDelay=d.availabilityDelay},U(i,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(Y.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||G}},{key:"drift",get:function(){var d=this.driftEndTime-this.driftStartTime;if(d>0){var m=this.driftEnd-this.driftStart;return m*1e3/d}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var d;return(d=this.partList)!==null&&d!==void 0&&d.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var d;return(d=this.fragments)!==null&&d!==void 0&&d.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 d;return(d=this.partList)!==null&&d!==void 0&&d.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var d;return(d=this.partList)!==null&&d!==void 0&&d.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),i}()},"./src/loader/level-key.ts":function(ie,$,M){"use strict";M.r($),M.d($,"LevelKey",function(){return W});var Y=M("./node_modules/url-toolkit/src/url-toolkit.js"),F=M.n(Y);function U(i,D){for(var g=0;g<D.length;g++){var d=D[g];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(i,d.key,d)}}function G(i,D,g){return D&&U(i.prototype,D),g&&U(i,g),i}var W=function(){i.fromURL=function(g,d){return new i(g,d)},i.fromURI=function(g){return new i(g)};function i(D,g){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,g?this._uri=Object(Y.buildAbsoluteURL)(D,g,{alwaysNormalize:!0}):this._uri=D}return G(i,[{key:"uri",get:function(){return this._uri}}]),i}()},"./src/loader/load-stats.ts":function(ie,$,M){"use strict";M.r($),M.d($,"LoadStats",function(){return Y});var Y=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(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return o});var Y=M("./src/polyfills/number.ts"),F=M("./node_modules/url-toolkit/src/url-toolkit.js"),U=M.n(F),G=M("./src/loader/fragment.ts"),W=M("./src/loader/level-details.ts"),i=M("./src/loader/level-key.ts"),D=M("./src/utils/attr-list.ts"),g=M("./src/utils/logger.ts"),d=M("./src/utils/codecs.ts"),m=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,u=/#EXT-X-MEDIA:(.*)/g,a=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("|")),l=/\.(mp4|m4s|m4v|m4a)$/i;function h(L){var O,C;return l.test((O=(C=F.parseURL(L))===null||C===void 0?void 0:C.path)!=null?O:"")}var o=function(){function L(){}return L.findGroup=function(C,w){for(var x=0;x<C.length;x++){var p=C[x];if(p.id===w)return p}},L.convertAVC1ToAVCOTI=function(C){var w=C.split(".");if(w.length>2){var x=w.shift()+".";return x+=parseInt(w.shift()).toString(16),x+=("000"+parseInt(w.shift()).toString(16)).substr(-4),x}return C},L.resolve=function(C,w){return F.buildAbsoluteURL(w,C,{alwaysNormalize:!0})},L.parseMasterPlaylist=function(C,w){var x=[],p={},T=!1;m.lastIndex=0;for(var v;(v=m.exec(C))!=null;)if(v[1]){var y=new D.AttrList(v[1]),N={attrs:y,bitrate:y.decimalInteger("AVERAGE-BANDWIDTH")||y.decimalInteger("BANDWIDTH"),name:y.NAME,url:L.resolve(v[2],w)},B=y.decimalResolution("RESOLUTION");B&&(N.width=B.width,N.height=B.height),s((y.CODECS||"").split(/[ ,]+/).filter(function(j){return j}),N),N.videoCodec&&N.videoCodec.indexOf("avc1")!==-1&&(N.videoCodec=L.convertAVC1ToAVCOTI(N.videoCodec)),x.push(N)}else if(v[3]){var R=new D.AttrList(v[3]);R["DATA-ID"]&&(T=!0,p[R["DATA-ID"]]=R)}return{levels:x,sessionData:T?p:null}},L.parseMasterPlaylistMedia=function(C,w,x,p){p===void 0&&(p=[]);var T,v=[],y=0;for(u.lastIndex=0;(T=u.exec(C))!==null;){var N=new D.AttrList(T[1]);if(N.TYPE===x){var B={attrs:N,bitrate:0,id:y++,groupId:N["GROUP-ID"],instreamId:N["INSTREAM-ID"],name:N.NAME||N.LANGUAGE||"",type:x,default:N.bool("DEFAULT"),autoselect:N.bool("AUTOSELECT"),forced:N.bool("FORCED"),lang:N.LANGUAGE,url:N.URI?L.resolve(N.URI,w):""};if(p.length){var R=L.findGroup(p,B.groupId)||p[0];A(B,R,"audioCodec"),A(B,R,"textCodec")}v.push(B)}}return v},L.parseLevelPlaylist=function(C,w,x,p,T){var v=new W.LevelDetails(w),y=v.fragments,N=null,B=0,R=0,j=0,P=0,b=null,X=new G.Fragment(p,w),ee,ae,le,Re=-1,Ee=!1;for(a.lastIndex=0,v.m3u8=C;(ee=a.exec(C))!==null;){Ee&&(Ee=!1,X=new G.Fragment(p,w),X.start=j,X.sn=B,X.cc=P,X.level=x,N&&(X.initSegment=N,X.rawProgramDateTime=N.rawProgramDateTime));var Te=ee[1];if(Te){X.duration=parseFloat(Te);var Ae=(" "+ee[2]).slice(1);X.title=Ae||null,X.tagList.push(Ae?["INF",Te,Ae]:["INF",Te])}else if(ee[3])Object(Y.isFiniteNumber)(X.duration)&&(X.start=j,le&&(X.levelkey=le),X.sn=B,X.level=x,X.cc=P,X.urlId=T,y.push(X),X.relurl=(" "+ee[3]).slice(1),S(X,b),b=X,j+=X.duration,B++,R=0,Ee=!0);else if(ee[4]){var Oe=(" "+ee[4]).slice(1);b?X.setByteRange(Oe,b):X.setByteRange(Oe)}else if(ee[5])X.rawProgramDateTime=(" "+ee[5]).slice(1),X.tagList.push(["PROGRAM-DATE-TIME",X.rawProgramDateTime]),Re===-1&&(Re=y.length);else{if(ee=ee[0].match(f),!ee){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(ae=1;ae<ee.length&&!(typeof ee[ae]!="undefined");ae++);var ce=(" "+ee[ae]).slice(1),ue=(" "+ee[ae+1]).slice(1),Pe=ee[ae+2]?(" "+ee[ae+2]).slice(1):"";switch(ce){case"PLAYLIST-TYPE":v.type=ue.toUpperCase();break;case"MEDIA-SEQUENCE":B=v.startSN=parseInt(ue);break;case"SKIP":{var qe=new D.AttrList(ue),ze=qe.decimalInteger("SKIPPED-SEGMENTS");if(Object(Y.isFiniteNumber)(ze)){v.skippedSegments=ze;for(var et=ze;et--;)y.unshift(null);B+=ze}var nt=qe.enumeratedString("RECENTLY-REMOVED-DATERANGES");nt&&(v.recentlyRemovedDateranges=nt.split(" "));break}case"TARGETDURATION":v.targetduration=parseFloat(ue);break;case"VERSION":v.version=parseInt(ue);break;case"EXTM3U":break;case"ENDLIST":v.live=!1;break;case"#":(ue||Pe)&&X.tagList.push(Pe?[ue,Pe]:[ue]);break;case"DIS":P++;case"GAP":X.tagList.push([ce]);break;case"BITRATE":X.tagList.push([ce,ue]);break;case"DISCONTINUITY-SEQ":P=parseInt(ue);break;case"KEY":{var Ie,Me=new D.AttrList(ue),Ge=Me.enumeratedString("METHOD"),se=Me.URI,be=Me.hexadecimalInteger("IV"),xe=Me.enumeratedString("KEYFORMATVERSIONS"),Se=Me.enumeratedString("KEYID"),Be=(Ie=Me.enumeratedString("KEYFORMAT"))!=null?Ie:"identity",He=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(He.indexOf(Be)>-1){g.logger.warn("Keyformat "+Be+" is not supported from the manifest");continue}else if(Be!=="identity")continue;Ge&&(le=i.LevelKey.fromURL(w,se),se&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ge)>=0&&(le.method=Ge,le.keyFormat=Be,Se&&(le.keyID=Se),xe&&(le.keyFormatVersions=xe),le.iv=be));break}case"START":{var Xe=new D.AttrList(ue),Ve=Xe.decimalFloatingPoint("TIME-OFFSET");Object(Y.isFiniteNumber)(Ve)&&(v.startTimeOffset=Ve);break}case"MAP":{var lt=new D.AttrList(ue);X.relurl=lt.URI,lt.BYTERANGE&&X.setByteRange(lt.BYTERANGE),X.level=x,X.sn="initSegment",le&&(X.levelkey=le),X.initSegment=null,N=X,Ee=!0;break}case"SERVER-CONTROL":{var $e=new D.AttrList(ue);v.canBlockReload=$e.bool("CAN-BLOCK-RELOAD"),v.canSkipUntil=$e.optionalFloat("CAN-SKIP-UNTIL",0),v.canSkipDateRanges=v.canSkipUntil>0&&$e.bool("CAN-SKIP-DATERANGES"),v.partHoldBack=$e.optionalFloat("PART-HOLD-BACK",0),v.holdBack=$e.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Qe=new D.AttrList(ue);v.partTarget=Qe.decimalFloatingPoint("PART-TARGET");break}case"PART":{var De=v.partList;De||(De=v.partList=[]);var ct=R>0?De[De.length-1]:void 0,ut=R++,ke=new G.Part(new D.AttrList(ue),X,w,ut,ct);De.push(ke),X.duration+=ke.duration;break}case"PRELOAD-HINT":{var Ne=new D.AttrList(ue);v.preloadHint=Ne;break}case"RENDITION-REPORT":{var _e=new D.AttrList(ue);v.renditionReports=v.renditionReports||[],v.renditionReports.push(_e);break}default:g.logger.warn("line parsed but not handled: "+ee);break}}}b&&!b.relurl?(y.pop(),j-=b.duration,v.partList&&(v.fragmentHint=b)):v.partList&&(S(X,b),X.cc=P,v.fragmentHint=X);var fe=y.length,ve=y[0],ne=y[fe-1];if(j+=v.skippedSegments*v.targetduration,j>0&&fe&&ne){v.averagetargetduration=j/fe;var re=ne.sn;v.endSN=re!=="initSegment"?re:0,ve&&(v.startCC=ve.cc,ve.initSegment||v.fragments.every(function(oe){return oe.relurl&&h(oe.relurl)})&&(g.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),X=new G.Fragment(p,w),X.relurl=ne.relurl,X.level=x,X.sn="initSegment",ve.initSegment=X,v.needSidxRanges=!0))}else v.endSN=0,v.startCC=0;return v.fragmentHint&&(j+=v.fragmentHint.duration),v.totalduration=j,v.endCC=P,Re>0&&_(y,Re),v},L}();function s(L,O){["video","audio","text"].forEach(function(C){var w=L.filter(function(p){return Object(d.isCodecType)(p,C)});if(w.length){var x=w.filter(function(p){return p.lastIndexOf("avc1",0)===0||p.lastIndexOf("mp4a",0)===0});O[C+"Codec"]=x.length>0?x[0]:w[0],L=L.filter(function(p){return w.indexOf(p)===-1})}}),O.unknownCodecs=L}function A(L,O,C){var w=O[C];w&&(L[C]=w)}function _(L,O){for(var C=L[O],w=O;w--;){var x=L[w];if(!x)return;x.programDateTime=C.programDateTime-x.duration*1e3,C=x}}function S(L,O){L.rawProgramDateTime?L.programDateTime=Date.parse(L.rawProgramDateTime):O!=null&&O.programDateTime&&(L.programDateTime=O.endProgramDateTime),Object(Y.isFiniteNumber)(L.programDateTime)||(L.programDateTime=null,L.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ie,$,M){"use strict";M.r($);var Y=M("./src/polyfills/number.ts"),F=M("./src/events.ts"),U=M("./src/errors.ts"),G=M("./src/utils/logger.ts"),W=M("./src/utils/mp4-tools.ts"),i=M("./src/loader/m3u8-parser.ts"),D=M("./src/types/loader.ts"),g=M("./src/utils/attr-list.ts");function d(a){var f=a.type;switch(f){case D.PlaylistContextType.AUDIO_TRACK:return D.PlaylistLevelType.AUDIO;case D.PlaylistContextType.SUBTITLE_TRACK:return D.PlaylistLevelType.SUBTITLE;default:return D.PlaylistLevelType.MAIN}}function m(a,f){var l=a.url;return(l===void 0||l.indexOf("data:")===0)&&(l=f.url),l}var u=function(){function a(l){this.hls=void 0,this.loaders=Object.create(null),this.hls=l,this.registerListeners()}var f=a.prototype;return f.registerListeners=function(){var h=this.hls;h.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(F.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on(F.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),h.on(F.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.unregisterListeners=function(){var h=this.hls;h.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(F.Events.LEVEL_LOADING,this.onLevelLoading,this),h.off(F.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),h.off(F.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.createInternalLoader=function(h){var o=this.hls.config,s=o.pLoader,A=o.loader,_=s||A,S=new _(o);return h.loader=S,this.loaders[h.type]=S,S},f.getInternalLoader=function(h){return this.loaders[h.type]},f.resetInternalLoader=function(h){this.loaders[h]&&delete this.loaders[h]},f.destroyInternalLoaders=function(){for(var h in this.loaders){var o=this.loaders[h];o&&o.destroy(),this.resetInternalLoader(h)}},f.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},f.onManifestLoading=function(h,o){var s=o.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.PlaylistContextType.MANIFEST,url:s,deliveryDirectives:null})},f.onLevelLoading=function(h,o){var s=o.id,A=o.level,_=o.url,S=o.deliveryDirectives;this.load({id:s,groupId:null,level:A,responseType:"text",type:D.PlaylistContextType.LEVEL,url:_,deliveryDirectives:S})},f.onAudioTrackLoading=function(h,o){var s=o.id,A=o.groupId,_=o.url,S=o.deliveryDirectives;this.load({id:s,groupId:A,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:_,deliveryDirectives:S})},f.onSubtitleTrackLoading=function(h,o){var s=o.id,A=o.groupId,_=o.url,S=o.deliveryDirectives;this.load({id:s,groupId:A,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:_,deliveryDirectives:S})},f.load=function(h){var o,s=this.hls.config,A=this.getInternalLoader(h);if(A){var _=A.context;if(_&&_.url===h.url){G.logger.trace("[playlist-loader]: playlist request ongoing");return}G.logger.log("[playlist-loader]: aborting previous loader for type: "+h.type),A.abort()}var S,L,O,C;switch(h.type){case D.PlaylistContextType.MANIFEST:S=s.manifestLoadingMaxRetry,L=s.manifestLoadingTimeOut,O=s.manifestLoadingRetryDelay,C=s.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:S=0,L=s.levelLoadingTimeOut;break;default:S=s.levelLoadingMaxRetry,L=s.levelLoadingTimeOut,O=s.levelLoadingRetryDelay,C=s.levelLoadingMaxRetryTimeout;break}if(A=this.createInternalLoader(h),(o=h.deliveryDirectives)!==null&&o!==void 0&&o.part){var w;if(h.type===D.PlaylistContextType.LEVEL&&h.level!==null?w=this.hls.levels[h.level].details:h.type===D.PlaylistContextType.AUDIO_TRACK&&h.id!==null?w=this.hls.audioTracks[h.id].details:h.type===D.PlaylistContextType.SUBTITLE_TRACK&&h.id!==null&&(w=this.hls.subtitleTracks[h.id].details),w){var x=w.partTarget,p=w.targetduration;x&&p&&(L=Math.min(Math.max(x*3,p*.8)*1e3,L))}}var T={timeout:L,maxRetry:S,retryDelay:O,maxRetryDelay:C,highWaterMark:0},v={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};A.load(h,T,v)},f.loadsuccess=function(h,o,s,A){if(A===void 0&&(A=null),s.isSidxRequest){this.handleSidxRequest(h,s),this.handlePlaylistLoaded(h,o,s,A);return}this.resetInternalLoader(s.type);var _=h.data;if(_.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(h,s,"no EXTM3U delimiter",A);return}o.parsing.start=performance.now(),_.indexOf("#EXTINF:")>0||_.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(h,o,s,A):this.handleMasterPlaylist(h,o,s,A)},f.loaderror=function(h,o,s){s===void 0&&(s=null),this.handleNetworkError(o,s,!1,h)},f.loadtimeout=function(h,o,s){s===void 0&&(s=null),this.handleNetworkError(o,s,!0)},f.handleMasterPlaylist=function(h,o,s,A){var _=this.hls,S=h.data,L=m(h,s),O=i.default.parseMasterPlaylist(S,L),C=O.levels,w=O.sessionData;if(!C.length){this.handleManifestParsingError(h,s,"no level found in manifest",A);return}var x=C.map(function(B){return{id:B.attrs.AUDIO,audioCodec:B.audioCodec}}),p=C.map(function(B){return{id:B.attrs.SUBTITLES,textCodec:B.textCodec}}),T=i.default.parseMasterPlaylistMedia(S,L,"AUDIO",x),v=i.default.parseMasterPlaylistMedia(S,L,"SUBTITLES",p),y=i.default.parseMasterPlaylistMedia(S,L,"CLOSED-CAPTIONS");if(T.length){var N=T.some(function(B){return!B.url});!N&&C[0].audioCodec&&!C[0].attrs.AUDIO&&(G.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),T.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new g.AttrList({}),bitrate:0,url:""}))}_.trigger(F.Events.MANIFEST_LOADED,{levels:C,audioTracks:T,subtitles:v,captions:y,url:L,stats:o,networkDetails:A,sessionData:w})},f.handleTrackOrLevelPlaylist=function(h,o,s,A){var _=this.hls,S=s.id,L=s.level,O=s.type,C=m(h,s),w=Object(Y.isFiniteNumber)(S)?S:0,x=Object(Y.isFiniteNumber)(L)?L:w,p=d(s),T=i.default.parseLevelPlaylist(h.data,C,x,p,w);if(!T.fragments.length){_.trigger(F.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:C,reason:"no fragments found in level",level:typeof s.level=="number"?s.level:void 0});return}if(O===D.PlaylistContextType.MANIFEST){var v={attrs:new g.AttrList({}),bitrate:0,details:T,name:"",url:C};_.trigger(F.Events.MANIFEST_LOADED,{levels:[v],audioTracks:[],url:C,stats:o,networkDetails:A,sessionData:null})}if(o.parsing.end=performance.now(),T.needSidxRanges){var y,N=(y=T.fragments[0].initSegment)===null||y===void 0?void 0:y.url;this.load({url:N,isSidxRequest:!0,type:O,level:L,levelDetails:T,id:S,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}s.levelDetails=T,this.handlePlaylistLoaded(h,o,s,A)},f.handleSidxRequest=function(h,o){var s=Object(W.parseSegmentIndex)(new Uint8Array(h.data));if(!s)return;var A=s.references,_=o.levelDetails;A.forEach(function(S,L){var O=S.info,C=_.fragments[L];C.byteRange.length===0&&C.setByteRange(String(1+O.end-O.start)+"@"+String(O.start)),C.initSegment&&C.initSegment.setByteRange(String(s.moovEndOffset)+"@0")})},f.handleManifestParsingError=function(h,o,s,A){this.hls.trigger(F.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:o.type===D.PlaylistContextType.MANIFEST,url:h.url,reason:s,response:h,context:o,networkDetails:A})},f.handleNetworkError=function(h,o,s,A){s===void 0&&(s=!1),G.logger.warn("[playlist-loader]: A network "+(s?"timeout":"error")+" occurred while loading "+h.type+" level: "+h.level+" id: "+h.id+' group-id: "'+h.groupId+'"');var _=U.ErrorDetails.UNKNOWN,S=!1,L=this.getInternalLoader(h);switch(h.type){case D.PlaylistContextType.MANIFEST:_=s?U.ErrorDetails.MANIFEST_LOAD_TIMEOUT:U.ErrorDetails.MANIFEST_LOAD_ERROR,S=!0;break;case D.PlaylistContextType.LEVEL:_=s?U.ErrorDetails.LEVEL_LOAD_TIMEOUT:U.ErrorDetails.LEVEL_LOAD_ERROR,S=!1;break;case D.PlaylistContextType.AUDIO_TRACK:_=s?U.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:U.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,S=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:_=s?U.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:U.ErrorDetails.SUBTITLE_LOAD_ERROR,S=!1;break}L&&this.resetInternalLoader(h.type);var O={type:U.ErrorTypes.NETWORK_ERROR,details:_,fatal:S,url:h.url,loader:L,context:h,networkDetails:o};A&&(O.response=A),this.hls.trigger(F.Events.ERROR,O)},f.handlePlaylistLoaded=function(h,o,s,A){var _=s.type,S=s.level,L=s.id,O=s.groupId,C=s.loader,w=s.levelDetails,x=s.deliveryDirectives;if(!(w!=null&&w.targetduration)){this.handleManifestParsingError(h,s,"invalid target duration",A);return}if(!C)return;w.live&&(C.getCacheAge&&(w.ageHeader=C.getCacheAge()||0),(!C.getCacheAge||isNaN(w.ageHeader))&&(w.ageHeader=0));switch(_){case D.PlaylistContextType.MANIFEST:case D.PlaylistContextType.LEVEL:this.hls.trigger(F.Events.LEVEL_LOADED,{details:w,level:S||0,id:L||0,stats:o,networkDetails:A,deliveryDirectives:x});break;case D.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(F.Events.AUDIO_TRACK_LOADED,{details:w,id:L||0,groupId:O||"",stats:o,networkDetails:A,deliveryDirectives:x});break;case D.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(F.Events.SUBTITLE_TRACK_LOADED,{details:w,id:L||0,groupId:O||"",stats:o,networkDetails:A,deliveryDirectives:x});break}},a}();$.default=u},"./src/polyfills/number.ts":function(ie,$,M){"use strict";M.r($),M.d($,"isFiniteNumber",function(){return Y}),M.d($,"MAX_SAFE_INTEGER",function(){return F});var Y=Number.isFinite||function(U){return typeof U=="number"&&isFinite(U)},F=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ie,$,M){"use strict";M.r($);var Y=function(){function F(){}return F.getSilentFrame=function(G,W){switch(G){case"mp4a.40.2":if(W===1)return new Uint8Array([0,200,0,128,35,128]);if(W===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(W===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(W===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(W===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(W===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(W===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(W===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(W===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},F}();$.default=Y},"./src/remux/mp4-generator.ts":function(ie,$,M){"use strict";M.r($);var Y=Math.pow(2,32)-1,F=function(){function U(){}return U.init=function(){U.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 W;for(W in U.types)U.types.hasOwnProperty(W)&&(U.types[W]=[W.charCodeAt(0),W.charCodeAt(1),W.charCodeAt(2),W.charCodeAt(3)]);var i=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),D=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]);U.HDLR_TYPES={video:i,audio:D};var g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),d=new Uint8Array([0,0,0,0,0,0,0,0]);U.STTS=U.STSC=U.STCO=d,U.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),U.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),U.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),U.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var m=new Uint8Array([105,115,111,109]),u=new Uint8Array([97,118,99,49]),a=new Uint8Array([0,0,0,1]);U.FTYP=U.box(U.types.ftyp,m,a,m,u),U.DINF=U.box(U.types.dinf,U.box(U.types.dref,g))},U.box=function(W){for(var i=8,D=arguments.length,g=new Array(D>1?D-1:0),d=1;d<D;d++)g[d-1]=arguments[d];for(var m=g.length,u=m;m--;)i+=g[m].byteLength;var a=new Uint8Array(i);for(a[0]=i>>24&255,a[1]=i>>16&255,a[2]=i>>8&255,a[3]=i&255,a.set(W,4),m=0,i=8;m<u;m++)a.set(g[m],i),i+=g[m].byteLength;return a},U.hdlr=function(W){return U.box(U.types.hdlr,U.HDLR_TYPES[W])},U.mdat=function(W){return U.box(U.types.mdat,W)},U.mdhd=function(W,i){i*=W;var D=Math.floor(i/(Y+1)),g=Math.floor(i%(Y+1));return U.box(U.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,W>>24&255,W>>16&255,W>>8&255,W&255,D>>24,D>>16&255,D>>8&255,D&255,g>>24,g>>16&255,g>>8&255,g&255,85,196,0,0]))},U.mdia=function(W){return U.box(U.types.mdia,U.mdhd(W.timescale,W.duration),U.hdlr(W.type),U.minf(W))},U.mfhd=function(W){return U.box(U.types.mfhd,new Uint8Array([0,0,0,0,W>>24,W>>16&255,W>>8&255,W&255]))},U.minf=function(W){return W.type==="audio"?U.box(U.types.minf,U.box(U.types.smhd,U.SMHD),U.DINF,U.stbl(W)):U.box(U.types.minf,U.box(U.types.vmhd,U.VMHD),U.DINF,U.stbl(W))},U.moof=function(W,i,D){return U.box(U.types.moof,U.mfhd(W),U.traf(D,i))},U.moov=function(W){for(var i=W.length,D=[];i--;)D[i]=U.trak(W[i]);return U.box.apply(null,[U.types.moov,U.mvhd(W[0].timescale,W[0].duration)].concat(D).concat(U.mvex(W)))},U.mvex=function(W){for(var i=W.length,D=[];i--;)D[i]=U.trex(W[i]);return U.box.apply(null,[U.types.mvex].concat(D))},U.mvhd=function(W,i){i*=W;var D=Math.floor(i/(Y+1)),g=Math.floor(i%(Y+1)),d=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,W>>24&255,W>>16&255,W>>8&255,W&255,D>>24,D>>16&255,D>>8&255,D&255,g>>24,g>>16&255,g>>8&255,g&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return U.box(U.types.mvhd,d)},U.sdtp=function(W){var i=W.samples||[],D=new Uint8Array(4+i.length),g,d;for(g=0;g<i.length;g++)d=i[g].flags,D[g+4]=d.dependsOn<<4|d.isDependedOn<<2|d.hasRedundancy;return U.box(U.types.sdtp,D)},U.stbl=function(W){return U.box(U.types.stbl,U.stsd(W),U.box(U.types.stts,U.STTS),U.box(U.types.stsc,U.STSC),U.box(U.types.stsz,U.STSZ),U.box(U.types.stco,U.STCO))},U.avc1=function(W){var i=[],D=[],g,d,m;for(g=0;g<W.sps.length;g++)d=W.sps[g],m=d.byteLength,i.push(m>>>8&255),i.push(m&255),i=i.concat(Array.prototype.slice.call(d));for(g=0;g<W.pps.length;g++)d=W.pps[g],m=d.byteLength,D.push(m>>>8&255),D.push(m&255),D=D.concat(Array.prototype.slice.call(d));var u=U.box(U.types.avcC,new Uint8Array([1,i[3],i[4],i[5],252|3,224|W.sps.length].concat(i).concat([W.pps.length]).concat(D))),a=W.width,f=W.height,l=W.pixelRatio[0],h=W.pixelRatio[1];return U.box(U.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,a>>8&255,a&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]),u,U.box(U.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),U.box(U.types.pasp,new Uint8Array([l>>24,l>>16&255,l>>8&255,l&255,h>>24,h>>16&255,h>>8&255,h&255])))},U.esds=function(W){var i=W.config.length;return new Uint8Array([0,0,0,0,3,23+i,0,1,0,4,15+i,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([i]).concat(W.config).concat([6,1,2]))},U.mp4a=function(W){var i=W.samplerate;return U.box(U.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W.channelCount,0,16,0,0,0,0,i>>8&255,i&255,0,0]),U.box(U.types.esds,U.esds(W)))},U.mp3=function(W){var i=W.samplerate;return U.box(U.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W.channelCount,0,16,0,0,0,0,i>>8&255,i&255,0,0]))},U.stsd=function(W){return W.type==="audio"?!W.isAAC&&W.codec==="mp3"?U.box(U.types.stsd,U.STSD,U.mp3(W)):U.box(U.types.stsd,U.STSD,U.mp4a(W)):U.box(U.types.stsd,U.STSD,U.avc1(W))},U.tkhd=function(W){var i=W.id,D=W.duration*W.timescale,g=W.width,d=W.height,m=Math.floor(D/(Y+1)),u=Math.floor(D%(Y+1));return U.box(U.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,i>>24&255,i>>16&255,i>>8&255,i&255,0,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,u>>24,u>>16&255,u>>8&255,u&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,g>>8&255,g&255,0,0,d>>8&255,d&255,0,0]))},U.traf=function(W,i){var D=U.sdtp(W),g=W.id,d=Math.floor(i/(Y+1)),m=Math.floor(i%(Y+1));return U.box(U.types.traf,U.box(U.types.tfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255])),U.box(U.types.tfdt,new Uint8Array([1,0,0,0,d>>24,d>>16&255,d>>8&255,d&255,m>>24,m>>16&255,m>>8&255,m&255])),U.trun(W,D.length+16+20+8+16+8+8),D)},U.trak=function(W){return W.duration=W.duration||4294967295,U.box(U.types.trak,U.tkhd(W),U.mdia(W))},U.trex=function(W){var i=W.id;return U.box(U.types.trex,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},U.trun=function(W,i){var D=W.samples||[],g=D.length,d=12+16*g,m=new Uint8Array(d),u,a,f,l,h,o;for(i+=8+d,m.set([0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255],0),u=0;u<g;u++)a=D[u],f=a.duration,l=a.size,h=a.flags,o=a.cts,m.set([f>>>24&255,f>>>16&255,f>>>8&255,f&255,l>>>24&255,l>>>16&255,l>>>8&255,l&255,h.isLeading<<2|h.dependsOn,h.isDependedOn<<6|h.hasRedundancy<<4|h.paddingValue<<1|h.isNonSync,h.degradPrio&240<<8,h.degradPrio&15,o>>>24&255,o>>>16&255,o>>>8&255,o&255],12+16*u);return U.box(U.types.trun,m)},U.initSegment=function(W){U.types||U.init();var i=U.moov(W),D=new Uint8Array(U.FTYP.byteLength+i.byteLength);return D.set(U.FTYP),D.set(i,U.FTYP.byteLength),D},U}();F.types=void 0,F.HDLR_TYPES=void 0,F.STTS=void 0,F.STSC=void 0,F.STCO=void 0,F.STSZ=void 0,F.VMHD=void 0,F.SMHD=void 0,F.STSD=void 0,F.FTYP=void 0,F.DINF=void 0,$.default=F},"./src/remux/mp4-remuxer.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return o}),M.d($,"normalizePts",function(){return s});var Y=M("./src/polyfills/number.ts"),F=M("./src/remux/aac-helper.ts"),U=M("./src/remux/mp4-generator.ts"),G=M("./src/events.ts"),W=M("./src/errors.ts"),i=M("./src/utils/logger.ts"),D=M("./src/types/loader.ts"),g=M("./src/utils/timescale-conversion.ts");function d(){return d=Object.assign||function(L){for(var O=1;O<arguments.length;O++){var C=arguments[O];for(var w in C)Object.prototype.hasOwnProperty.call(C,w)&&(L[w]=C[w])}return L},d.apply(this,arguments)}var m=10*1e3,u=1024,a=1152,f=null,l=null,h=!1,o=function(){function L(C,w,x,p){if(p===void 0&&(p=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=C,this.config=w,this.typeSupported=x,this.ISGenerated=!1,f===null){var T=navigator.userAgent||"",v=T.match(/Chrome\/(\d+)/i);f=v?parseInt(v[1]):0}if(l===null){var y=navigator.userAgent.match(/Safari\/(\d+)/i);l=y?parseInt(y[1]):0}h=!!f&&f<75||!!l&&l<600}var O=L.prototype;return O.destroy=function(){},O.resetTimeStamp=function(w){i.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=w},O.resetNextTimestamp=function(){i.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},O.resetInitSegment=function(){i.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},O.getVideoStartPts=function(w){var x=!1,p=w.reduce(function(T,v){var y=v.pts-T;return y<-4294967296?(x=!0,s(T,v.pts)):y>0?T:v.pts},w[0].pts);return x&&i.logger.debug("PTS rollover detected"),p},O.remux=function(w,x,p,T,v,y,N,B){var R,j,P,b,X,ee,ae=v,le=v,Re=w.pid>-1,Ee=x.pid>-1,Te=x.samples.length,Ae=w.samples.length>0,Oe=Te>1,ce=(!Re||Ae)&&(!Ee||Oe)||this.ISGenerated||N;if(ce){this.ISGenerated||(P=this.generateIS(w,x,v));var ue=this.isVideoContiguous,Pe=-1;if(Oe&&(Pe=A(x.samples),!ue&&this.config.forceKeyFrameOnDiscontinuity))if(ee=!0,Pe>0){i.logger.warn("[mp4-remuxer]: Dropped "+Pe+" out of "+Te+" video samples due to a missing keyframe");var qe=this.getVideoStartPts(x.samples);x.samples=x.samples.slice(Pe),x.dropped+=Pe,le+=(x.samples[0].pts-qe)/(x.timescale||9e4)}else Pe===-1&&(i.logger.warn("[mp4-remuxer]: No keyframe found out of "+Te+" video samples"),ee=!1);if(this.ISGenerated){if(Ae&&Oe){var ze=this.getVideoStartPts(x.samples),et=s(w.samples[0].pts,ze)-ze,nt=et/x.inputTimeScale;ae+=Math.max(0,nt),le+=Math.max(0,-nt)}if(Ae){if(w.samplerate||(i.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),P=this.generateIS(w,x,v)),j=this.remuxAudio(w,ae,this.isAudioContiguous,y,Ee||Oe||B===D.PlaylistLevelType.AUDIO?le:void 0),Oe){var Ie=j?j.endPTS-j.startPTS:0;x.inputTimeScale||(i.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),P=this.generateIS(w,x,v)),R=this.remuxVideo(x,le,ue,Ie)}}else Oe&&(R=this.remuxVideo(x,le,ue,0));R&&(R.firstKeyFrame=Pe,R.independent=Pe!==-1)}}return this.ISGenerated&&(p.samples.length&&(X=this.remuxID3(p,v)),T.samples.length&&(b=this.remuxText(T,v))),{audio:j,video:R,initSegment:P,independent:ee,text:b,id3:X}},O.generateIS=function(w,x,p){var T=w.samples,v=x.samples,y=this.typeSupported,N={},B=!Object(Y.isFiniteNumber)(this._initPTS),R="audio/mp4",j,P,b;if(B&&(j=P=Infinity),w.config&&T.length&&(w.timescale=w.samplerate,w.isAAC||(y.mpeg?(R="audio/mpeg",w.codec=""):y.mp3&&(w.codec="mp3")),N.audio={id:"audio",container:R,codec:w.codec,initSegment:!w.isAAC&&y.mpeg?new Uint8Array(0):U.default.initSegment([w]),metadata:{channelCount:w.channelCount}},B&&(b=w.inputTimeScale,j=P=T[0].pts-Math.round(b*p))),x.sps&&x.pps&&v.length&&(x.timescale=x.inputTimeScale,N.video={id:"main",container:"video/mp4",codec:x.codec,initSegment:U.default.initSegment([x]),metadata:{width:x.width,height:x.height}},B)){b=x.inputTimeScale;var X=this.getVideoStartPts(v),ee=Math.round(b*p);P=Math.min(P,s(v[0].dts,X)-ee),j=Math.min(j,X-ee)}if(Object.keys(N).length)return this.ISGenerated=!0,B&&(this._initPTS=j,this._initDTS=P),{tracks:N,initPTS:j,timescale:b}},O.remuxVideo=function(w,x,p,T){var v=w.inputTimeScale,y=w.samples,N=[],B=y.length,R=this._initPTS,j=this.nextAvcDts,P=8,b,X,ee,ae=Number.POSITIVE_INFINITY,le=Number.NEGATIVE_INFINITY,Re=0,Ee=!1;if(!p||j===null){var Te=x*v,Ae=y[0].pts-s(y[0].dts,y[0].pts);j=Te-Ae}for(var Oe=0;Oe<B;Oe++){var ce=y[Oe];if(ce.pts=s(ce.pts-R,j),ce.dts=s(ce.dts-R,j),ce.dts>ce.pts){var ue=9e4*.2;Re=Math.max(Math.min(Re,ce.pts-ce.dts),-1*ue)}ce.dts<y[Oe>0?Oe-1:Oe].dts&&(Ee=!0)}Ee&&y.sort(function(mt,yt){var tt=mt.dts-yt.dts,Ut=mt.pts-yt.pts;return tt||Ut}),X=y[0].dts,ee=y[y.length-1].dts;var Pe=Math.round((ee-X)/(B-1));if(Re<0){if(Re<Pe*-2){i.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(g.toMsFromMpegTsClock)(-Pe,!0)+" ms");for(var qe=Re,ze=0;ze<B;ze++)y[ze].dts=qe=Math.max(qe,y[ze].pts-Pe),y[ze].pts=Math.max(qe,y[ze].pts)}else{i.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(g.toMsFromMpegTsClock)(Re,!0)+" ms to overcome this issue");for(var et=0;et<B;et++)y[et].dts=y[et].dts+Re}X=y[0].dts}if(p){var nt=X-j,Ie=nt>Pe,Me=nt<-1;if(Ie||Me){Ie?i.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(nt,!0)+" ms ("+nt+"dts) hole between fragments detected, filling it"):i.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(-nt,!0)+" ms ("+nt+"dts) overlapping between fragments detected"),X=j;var Ge=y[0].pts-nt;y[0].dts=X,y[0].pts=Ge,i.logger.log("Video: First PTS/DTS adjusted: "+Object(g.toMsFromMpegTsClock)(Ge,!0)+"/"+Object(g.toMsFromMpegTsClock)(X,!0)+", delta: "+Object(g.toMsFromMpegTsClock)(nt,!0)+" ms")}}h&&(X=Math.max(0,X));for(var se=0,be=0,xe=0;xe<B;xe++){for(var Se=y[xe],Be=Se.units,He=Be.length,Xe=0,Ve=0;Ve<He;Ve++)Xe+=Be[Ve].data.length;be+=Xe,se+=He,Se.length=Xe,Se.dts=Math.max(Se.dts,X),Se.pts=Math.max(Se.pts,Se.dts,0),ae=Math.min(Se.pts,ae),le=Math.max(Se.pts,le)}ee=y[B-1].dts;var lt=be+4*se+8,$e;try{$e=new Uint8Array(lt)}catch(mt){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:lt,reason:"fail allocating video mdat "+lt});return}var Qe=new DataView($e.buffer);Qe.setUint32(0,lt),$e.set(U.default.types.mdat,4);for(var De=0;De<B;De++){for(var ct=y[De],ut=ct.units,ke=0,Ne=0,_e=ut.length;Ne<_e;Ne++){var fe=ut[Ne],ve=fe.data,ne=fe.data.byteLength;Qe.setUint32(P,ne),P+=4,$e.set(ve,P),P+=ne,ke+=4+ne}if(De<B-1)b=y[De+1].dts-ct.dts;else{var re=this.config,oe=ct.dts-y[De>0?De-1:De].dts;if(re.stretchShortVideoTrack&&this.nextAudioPts!==null){var de=Math.floor(re.maxBufferHole*v),ye=(T?ae+T*v:this.nextAudioPts)-ct.pts;ye>de?(b=ye-oe,b<0&&(b=oe),i.logger.log("[mp4-remuxer]: It is approximately "+ye/90+" ms to the next segment; using duration "+b/90+" ms for the last video frame.")):b=oe}else b=oe}var Le=Math.round(ct.pts-ct.dts);N.push(new _(ct.key,b,ke,Le))}if(N.length&&f&&f<70){var Ue=N[0].flags;Ue.dependsOn=2,Ue.isNonSync=0}console.assert(b!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=j=ee+b,this.isVideoContiguous=!0;var Je=U.default.moof(w.sequenceNumber++,X,d({},w,{samples:N})),dt="video",rt={data1:Je,data2:$e,startPTS:ae/v,endPTS:(le+b)/v,startDTS:X/v,endDTS:j/v,type:dt,hasAudio:!1,hasVideo:!0,nb:N.length,dropped:w.dropped};return w.samples=[],w.dropped=0,console.assert($e.length,"MDAT length must not be zero"),rt},O.remuxAudio=function(w,x,p,T,v){var y=w.inputTimeScale,N=w.samplerate?w.samplerate:y,B=y/N,R=w.isAAC?u:a,j=R*B,P=this._initPTS,b=!w.isAAC&&this.typeSupported.mpeg,X=[],ee=w.samples,ae=b?0:8,le=this.nextAudioPts||-1,Re=x*y;if(this.isAudioContiguous=p=p||ee.length&&le>0&&(T&&Math.abs(Re-le)<9e3||Math.abs(s(ee[0].pts-P,Re)-le)<20*j),ee.forEach(function(ve){ve.pts=s(ve.pts-P,Re)}),!p||le<0){if(ee=ee.filter(function(ve){return ve.pts>=0}),!ee.length)return;v===0?le=0:T?le=Math.max(0,Re):le=ee[0].pts}if(w.isAAC)for(var Ee=v!==void 0,Te=this.config.maxAudioFramesDrift,Ae=0,Oe=le;Ae<ee.length;Ae++){var ce=ee[Ae],ue=ce.pts,Pe=ue-Oe,qe=Math.abs(1e3*Pe/y);if(Pe<=-Te*j&&Ee)Ae===0&&(i.logger.warn("Audio frame @ "+(ue/y).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Pe/y)+" ms."),this.nextAudioPts=le=Oe=ue);else if(Pe>=Te*j&&qe<m&&Ee){var ze=Math.round(Pe/j);Oe=ue-ze*j,Oe<0&&(ze--,Oe+=j),Ae===0&&(this.nextAudioPts=le=Oe),i.logger.warn("[mp4-remuxer]: Injecting "+ze+" audio frame @ "+(Oe/y).toFixed(3)+"s due to "+Math.round(1e3*Pe/y)+" ms gap.");for(var et=0;et<ze;et++){var nt=Math.max(Oe,0),Ie=F.default.getSilentFrame(w.manifestCodec||w.codec,w.channelCount);Ie||(i.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Ie=ce.unit.subarray()),ee.splice(Ae,0,{unit:Ie,pts:nt}),Oe+=j,Ae++}}ce.pts=Oe,Oe+=j}for(var Me=null,Ge=null,se,be=0,xe=ee.length;xe--;)be+=ee[xe].unit.byteLength;for(var Se=0,Be=ee.length;Se<Be;Se++){var He=ee[Se],Xe=He.unit,Ve=He.pts;if(Ge!==null){var lt=X[Se-1];lt.duration=Math.round((Ve-Ge)/B)}else if(p&&w.isAAC&&(Ve=le),Me=Ve,be>0){be+=ae;try{se=new Uint8Array(be)}catch(ve){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:be,reason:"fail allocating audio mdat "+be});return}if(!b){var $e=new DataView(se.buffer);$e.setUint32(0,be),se.set(U.default.types.mdat,4)}}else return;se.set(Xe,ae);var Qe=Xe.byteLength;ae+=Qe,X.push(new _(!0,R,Qe,0)),Ge=Ve}var De=X.length;if(!De)return;var ct=X[X.length-1];this.nextAudioPts=le=Ge+B*ct.duration;var ut=b?new Uint8Array(0):U.default.moof(w.sequenceNumber++,Me/B,d({},w,{samples:X}));w.samples=[];var ke=Me/y,Ne=le/y,_e="audio",fe={data1:ut,data2:se,startPTS:ke,endPTS:Ne,startDTS:ke,endDTS:Ne,type:_e,hasAudio:!0,hasVideo:!1,nb:De};return this.isAudioContiguous=!0,console.assert(se.length,"MDAT length must not be zero"),fe},O.remuxEmptyAudio=function(w,x,p,T){var v=w.inputTimeScale,y=w.samplerate?w.samplerate:v,N=v/y,B=this.nextAudioPts,R=(B!==null?B:T.startDTS*v)+this._initDTS,j=T.endDTS*v+this._initDTS,P=N*u,b=Math.ceil((j-R)/P),X=F.default.getSilentFrame(w.manifestCodec||w.codec,w.channelCount);if(i.logger.warn("[mp4-remuxer]: remux empty Audio"),!X){i.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ee=[],ae=0;ae<b;ae++){var le=R+ae*P;ee.push({unit:X,pts:le,dts:le})}return w.samples=ee,this.remuxAudio(w,x,p,!1)},O.remuxID3=function(w,x){var p=w.samples.length;if(!p)return;for(var T=w.inputTimeScale,v=this._initPTS,y=this._initDTS,N=0;N<p;N++){var B=w.samples[N];B.pts=s(B.pts-v,x*T)/T,B.dts=s(B.dts-y,x*T)/T}var R=w.samples;return w.samples=[],{samples:R}},O.remuxText=function(w,x){var p=w.samples.length;if(!p)return;for(var T=w.inputTimeScale,v=this._initPTS,y=0;y<p;y++){var N=w.samples[y];N.pts=s(N.pts-v,x*T)/T}w.samples.sort(function(R,j){return R.pts-j.pts});var B=w.samples;return w.samples=[],{samples:B}},L}();function s(L,O){var C;if(O===null)return L;for(O<L?C=-8589934592:C=8589934592;Math.abs(L-O)>4294967296;)L+=C;return L}function A(L){for(var O=0;O<L.length;O++)if(L[O].key)return O;return-1}var _=function(O,C,w,x){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=C,this.size=w,this.cts=x,this.flags=new S(O)},S=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(ie,$,M){"use strict";M.r($);var Y=M("./src/polyfills/number.ts"),F=M("./src/utils/mp4-tools.ts"),U=M("./src/loader/fragment.ts"),G=M("./src/utils/logger.ts"),W=function(){function g(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var d=g.prototype;return d.destroy=function(){},d.resetTimeStamp=function(u){this.initPTS=u,this.lastEndDTS=null},d.resetNextTimestamp=function(){this.lastEndDTS=null},d.resetInitSegment=function(u,a,f){this.audioCodec=a,this.videoCodec=f,this.generateInitSegment(u),this.emitInitSegment=!0},d.generateInitSegment=function(u){var a=this.audioCodec,f=this.videoCodec;if(!u||!u.byteLength){this.initTracks=void 0,this.initData=void 0;return}var l=this.initData=Object(F.parseInitSegment)(u);a||(a=D(l.audio,U.ElementaryStreamTypes.AUDIO)),f||(f=D(l.video,U.ElementaryStreamTypes.VIDEO));var h={};l.audio&&l.video?h.audiovideo={container:"video/mp4",codec:a+","+f,initSegment:u,id:"main"}:l.audio?h.audio={container:"audio/mp4",codec:a,initSegment:u,id:"audio"}:l.video?h.video={container:"video/mp4",codec:f,initSegment:u,id:"main"}:G.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=h},d.remux=function(u,a,f,l,h){var o=this.initPTS,s=this.lastEndDTS,A={audio:void 0,video:void 0,text:l,id3:f,initSegment:void 0};Object(Y.isFiniteNumber)(s)||(s=this.lastEndDTS=h||0);var _=a.samples;if(!_||!_.length)return A;var S={initPTS:void 0,timescale:1},L=this.initData;if((!L||!L.length)&&(this.generateInitSegment(_),L=this.initData),!L||!L.length)return G.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),A;this.emitInitSegment&&(S.tracks=this.initTracks,this.emitInitSegment=!1),Object(Y.isFiniteNumber)(o)||(this.initPTS=S.initPTS=o=i(L,_,s));var O=Object(F.getDuration)(_,L),C=s,w=O+C;Object(F.offsetStartDTS)(L,_,o),O>0?this.lastEndDTS=w:(G.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var x=!!L.audio,p=!!L.video,T="";x&&(T+="audio"),p&&(T+="video");var v={data1:_,startPTS:C,startDTS:C,endPTS:w,endDTS:w,type:T,hasAudio:x,hasVideo:p,nb:1,dropped:0};return A.audio=v.type==="audio"?v:void 0,A.video=v.type!=="audio"?v:void 0,A.text=l,A.id3=f,A.initSegment=S,A},g}(),i=function(d,m,u){return Object(F.getStartDTS)(d,m)-u};function D(g,d){var m=g==null?void 0:g.codec;return m&&m.length>4?m:m==="hvc1"?"hvc1.1.c.L120.90":m==="av01"?"av01.0.04M.08":m==="avc1"||d===U.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}$.default=W},"./src/task-loop.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return Y});var Y=function(){function F(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var U=F.prototype;return U.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},U.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},U.onHandlerDestroyed=function(){},U.hasInterval=function(){return!!this._tickInterval},U.hasNextTick=function(){return!!this._tickTimer},U.setInterval=function(W){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,W),!0)},U.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},U.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},U.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},U.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},U.doTick=function(){},F}()},"./src/types/cmcd.ts":function(ie,$,M){"use strict";M.r($),M.d($,"CMCDVersion",function(){return Y}),M.d($,"CMCDObjectType",function(){return F}),M.d($,"CMCDStreamingFormat",function(){return U}),M.d($,"CMCDStreamType",function(){return G});var Y=1,F;(function(W){W.MANIFEST="m",W.AUDIO="a",W.VIDEO="v",W.MUXED="av",W.INIT="i",W.CAPTION="c",W.TIMED_TEXT="tt",W.KEY="k",W.OTHER="o"})(F||(F={}));var U;(function(W){W.DASH="d",W.HLS="h",W.SMOOTH="s",W.OTHER="o"})(U||(U={}));var G;(function(W){W.VOD="v",W.LIVE="l"})(G||(G={}))},"./src/types/level.ts":function(ie,$,M){"use strict";M.r($),M.d($,"HlsSkip",function(){return U}),M.d($,"getSkipValue",function(){return G}),M.d($,"HlsUrlParameters",function(){return W}),M.d($,"Level",function(){return i});function Y(D,g){for(var d=0;d<g.length;d++){var m=g[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(D,m.key,m)}}function F(D,g,d){return g&&Y(D.prototype,g),d&&Y(D,d),D}var U;(function(D){D.No="",D.Yes="YES",D.v2="v2"})(U||(U={}));function G(D,g){var d=D.canSkipUntil,m=D.canSkipDateRanges,u=D.endSN,a=g!==void 0?g-u:0;return d&&a<d?m?U.v2:U.Yes:U.No}var W=function(){function D(d,m,u){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=d,this.part=m,this.skip=u}var g=D.prototype;return g.addDirectives=function(m){var u=new self.URL(m);return this.msn!==void 0&&u.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&u.searchParams.set("_HLS_part",this.part.toString()),this.skip&&u.searchParams.set("_HLS_skip",this.skip),u.toString()},D}(),i=function(){function D(g){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[g.url],this.attrs=g.attrs,this.bitrate=g.bitrate,g.details&&(this.details=g.details),this.id=g.id||0,this.name=g.name,this.width=g.width||0,this.height=g.height||0,this.audioCodec=g.audioCodec,this.videoCodec=g.videoCodec,this.unknownCodecs=g.unknownCodecs,this.codecSet=[g.videoCodec,g.audioCodec].filter(function(d){return d}).join(",").replace(/\.[^.,]+/g,"")}return F(D,[{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(d){var m=d%this.url.length;this._urlId!==m&&(this.details=void 0,this._urlId=m)}}]),D}()},"./src/types/loader.ts":function(ie,$,M){"use strict";M.r($),M.d($,"PlaylistContextType",function(){return Y}),M.d($,"PlaylistLevelType",function(){return F});var Y;(function(U){U.MANIFEST="manifest",U.LEVEL="level",U.AUDIO_TRACK="audioTrack",U.SUBTITLE_TRACK="subtitleTrack"})(Y||(Y={}));var F;(function(U){U.MAIN="main",U.AUDIO="audio",U.SUBTITLE="subtitle"})(F||(F={}))},"./src/types/transmuxer.ts":function(ie,$,M){"use strict";M.r($),M.d($,"ChunkMetadata",function(){return Y});var Y=function(G,W,i,D,g,d){D===void 0&&(D=0),g===void 0&&(g=-1),d===void 0&&(d=!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=F(),this.buffering={audio:F(),video:F(),audiovideo:F()},this.level=G,this.sn=W,this.id=i,this.size=D,this.part=g,this.partial=d};function F(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ie,$,M){"use strict";M.r($),M.d($,"AttrList",function(){return U});var Y=/^(\d+)x(\d+)$/,F=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,U=function(){function G(i){typeof i=="string"&&(i=G.parseAttrList(i));for(var D in i)i.hasOwnProperty(D)&&(this[D]=i[D])}var W=G.prototype;return W.decimalInteger=function(D){var g=parseInt(this[D],10);return g>Number.MAX_SAFE_INTEGER?Infinity:g},W.hexadecimalInteger=function(D){if(this[D]){var g=(this[D]||"0x").slice(2);g=(g.length&1?"0":"")+g;for(var d=new Uint8Array(g.length/2),m=0;m<g.length/2;m++)d[m]=parseInt(g.slice(m*2,m*2+2),16);return d}else return null},W.hexadecimalIntegerAsNumber=function(D){var g=parseInt(this[D],16);return g>Number.MAX_SAFE_INTEGER?Infinity:g},W.decimalFloatingPoint=function(D){return parseFloat(this[D])},W.optionalFloat=function(D,g){var d=this[D];return d?parseFloat(d):g},W.enumeratedString=function(D){return this[D]},W.bool=function(D){return this[D]==="YES"},W.decimalResolution=function(D){var g=Y.exec(this[D]);return g===null?void 0:{width:parseInt(g[1],10),height:parseInt(g[2],10)}},G.parseAttrList=function(D){var g,d={},m='"';for(F.lastIndex=0;(g=F.exec(D))!==null;){var u=g[2];u.indexOf(m)===0&&u.lastIndexOf(m)===u.length-1&&(u=u.slice(1,-1)),d[g[1]]=u}return d},G}()},"./src/utils/binary-search.ts":function(ie,$,M){"use strict";M.r($);var Y={search:function(U,G){for(var W=0,i=U.length-1,D=null,g=null;W<=i;){D=(W+i)/2|0,g=U[D];var d=G(g);if(d>0)W=D+1;else if(d<0)i=D-1;else return g}return null}};$.default=Y},"./src/utils/buffer-helper.ts":function(ie,$,M){"use strict";M.r($),M.d($,"BufferHelper",function(){return U});var Y=M("./src/utils/logger.ts"),F={length:0,start:function(){return 0},end:function(){return 0}},U=function(){function G(){}return G.isBuffered=function(i,D){try{if(i){for(var g=G.getBuffered(i),d=0;d<g.length;d++)if(D>=g.start(d)&&D<=g.end(d))return!0}}catch(m){}return!1},G.bufferInfo=function(i,D,g){try{if(i){var d=G.getBuffered(i),m=[],u;for(u=0;u<d.length;u++)m.push({start:d.start(u),end:d.end(u)});return this.bufferedInfo(m,D,g)}}catch(a){}return{len:0,start:D,end:D,nextStart:void 0}},G.bufferedInfo=function(i,D,g){D=Math.max(0,D),i.sort(function(S,L){var O=S.start-L.start;return O||L.end-S.end});var d=[];if(g)for(var m=0;m<i.length;m++){var u=d.length;if(u){var a=d[u-1].end;i[m].start-a<g?i[m].end>a&&(d[u-1].end=i[m].end):d.push(i[m])}else d.push(i[m])}else d=i;for(var f=0,l,h=D,o=D,s=0;s<d.length;s++){var A=d[s].start,_=d[s].end;if(D+g>=A&&D<_)h=A,o=_,f=o-D;else if(D+g<A){l=A;break}}return{len:f,start:h||0,end:o||0,nextStart:l}},G.getBuffered=function(i){try{return i.buffered}catch(D){return Y.logger.log("failed to get media.buffered",D),F}},G}()},"./src/utils/cea-608-parser.ts":function(ie,$,M){"use strict";M.r($),M.d($,"Row",function(){return o}),M.d($,"CaptionScreen",function(){return s});var Y=M("./src/utils/logger.ts"),F={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},U=function(w){var x=w;return F.hasOwnProperty(w)&&(x=F[w]),String.fromCharCode(x)},G=15,W=100,i={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},D={17:2,18:4,21:6,22:8,23:10,19:13,20:15},g={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},d={25:2,26:4,29:6,30:8,31:10,27:13,28:15},m=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],u;(function(C){C[C.ERROR=0]="ERROR",C[C.TEXT=1]="TEXT",C[C.WARNING=2]="WARNING",C[C.INFO=2]="INFO",C[C.DEBUG=3]="DEBUG",C[C.DATA=3]="DATA"})(u||(u={}));var a=function(){function C(){this.time=null,this.verboseLevel=u.ERROR}var w=C.prototype;return w.log=function(p,T){this.verboseLevel>=p&&Y.logger.log(this.time+" ["+p+"] "+T)},C}(),f=function(w){for(var x=[],p=0;p<w.length;p++)x.push(w[p].toString(16));return x},l=function(){function C(x,p,T,v,y){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=x||"white",this.underline=p||!1,this.italics=T||!1,this.background=v||"black",this.flash=y||!1}var w=C.prototype;return w.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},w.setStyles=function(p){for(var T=["foreground","underline","italics","background","flash"],v=0;v<T.length;v++){var y=T[v];p.hasOwnProperty(y)&&(this[y]=p[y])}},w.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},w.equals=function(p){return this.foreground===p.foreground&&this.underline===p.underline&&this.italics===p.italics&&this.background===p.background&&this.flash===p.flash},w.copy=function(p){this.foreground=p.foreground,this.underline=p.underline,this.italics=p.italics,this.background=p.background,this.flash=p.flash},w.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},C}(),h=function(){function C(x,p,T,v,y,N){this.uchar=void 0,this.penState=void 0,this.uchar=x||" ",this.penState=new l(p,T,v,y,N)}var w=C.prototype;return w.reset=function(){this.uchar=" ",this.penState.reset()},w.setChar=function(p,T){this.uchar=p,this.penState.copy(T)},w.setPenState=function(p){this.penState.copy(p)},w.equals=function(p){return this.uchar===p.uchar&&this.penState.equals(p.penState)},w.copy=function(p){this.uchar=p.uchar,this.penState.copy(p.penState)},w.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},C}(),o=function(){function C(x){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var p=0;p<W;p++)this.chars.push(new h);this.logger=x,this.pos=0,this.currPenState=new l}var w=C.prototype;return w.equals=function(p){for(var T=!0,v=0;v<W;v++)if(!this.chars[v].equals(p.chars[v])){T=!1;break}return T},w.copy=function(p){for(var T=0;T<W;T++)this.chars[T].copy(p.chars[T])},w.isEmpty=function(){for(var p=!0,T=0;T<W;T++)if(!this.chars[T].isEmpty()){p=!1;break}return p},w.setCursor=function(p){this.pos!==p&&(this.pos=p),this.pos<0?(this.logger.log(u.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>W&&(this.logger.log(u.DEBUG,"Too large cursor position "+this.pos),this.pos=W)},w.moveCursor=function(p){var T=this.pos+p;if(p>1)for(var v=this.pos+1;v<T+1;v++)this.chars[v].setPenState(this.currPenState);this.setCursor(T)},w.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},w.insertChar=function(p){p>=144&&this.backSpace();var T=U(p);if(this.pos>=W){this.logger.log(u.ERROR,"Cannot insert "+p.toString(16)+" ("+T+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(T,this.currPenState),this.moveCursor(1)},w.clearFromPos=function(p){var T;for(T=p;T<W;T++)this.chars[T].reset()},w.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},w.clearToEndOfRow=function(){this.clearFromPos(this.pos)},w.getTextString=function(){for(var p=[],T=!0,v=0;v<W;v++){var y=this.chars[v].uchar;y!==" "&&(T=!1),p.push(y)}return T?"":p.join("")},w.setPenStyles=function(p){this.currPenState.setStyles(p);var T=this.chars[this.pos];T.setPenState(this.currPenState)},C}(),s=function(){function C(x){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var p=0;p<G;p++)this.rows.push(new o(x));this.logger=x,this.currRow=G-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var w=C.prototype;return w.reset=function(){for(var p=0;p<G;p++)this.rows[p].clear();this.currRow=G-1},w.equals=function(p){for(var T=!0,v=0;v<G;v++)if(!this.rows[v].equals(p.rows[v])){T=!1;break}return T},w.copy=function(p){for(var T=0;T<G;T++)this.rows[T].copy(p.rows[T])},w.isEmpty=function(){for(var p=!0,T=0;T<G;T++)if(!this.rows[T].isEmpty()){p=!1;break}return p},w.backSpace=function(){var p=this.rows[this.currRow];p.backSpace()},w.clearToEndOfRow=function(){var p=this.rows[this.currRow];p.clearToEndOfRow()},w.insertChar=function(p){var T=this.rows[this.currRow];T.insertChar(p)},w.setPen=function(p){var T=this.rows[this.currRow];T.setPenStyles(p)},w.moveCursor=function(p){var T=this.rows[this.currRow];T.moveCursor(p)},w.setCursor=function(p){this.logger.log(u.INFO,"setCursor: "+p);var T=this.rows[this.currRow];T.setCursor(p)},w.setPAC=function(p){this.logger.log(u.INFO,"pacData = "+JSON.stringify(p));var T=p.row-1;if(this.nrRollUpRows&&T<this.nrRollUpRows-1&&(T=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==T){for(var v=0;v<G;v++)this.rows[v].clear();var y=this.currRow+1-this.nrRollUpRows,N=this.lastOutputScreen;if(N){var B=N.rows[y].cueStartTime,R=this.logger.time;if(B&&R!==null&&B<R)for(var j=0;j<this.nrRollUpRows;j++)this.rows[T-this.nrRollUpRows+j+1].copy(N.rows[y+j])}}this.currRow=T;var P=this.rows[this.currRow];if(p.indent!==null){var b=p.indent,X=Math.max(b-1,0);P.setCursor(p.indent),p.color=P.chars[X].penState.foreground}var ee={foreground:p.color,underline:p.underline,italics:p.italics,background:"black",flash:!1};this.setPen(ee)},w.setBkgData=function(p){this.logger.log(u.INFO,"bkgData = "+JSON.stringify(p)),this.backSpace(),this.setPen(p),this.insertChar(32)},w.setRollUpRows=function(p){this.nrRollUpRows=p},w.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(u.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(u.TEXT,this.getDisplayText());var p=this.currRow+1-this.nrRollUpRows,T=this.rows.splice(p,1)[0];T.clear(),this.rows.splice(this.currRow,0,T),this.logger.log(u.INFO,"Rolling up")},w.getDisplayText=function(p){p=p||!1;for(var T=[],v="",y=-1,N=0;N<G;N++){var B=this.rows[N].getTextString();B&&(y=N+1,p?T.push("Row "+y+": '"+B+"'"):T.push(B.trim()))}return T.length>0&&(p?v="["+T.join(" | ")+"]":v=T.join(`
|
|
`)),v},w.getTextAndFormat=function(){return this.rows},C}(),A=function(){function C(x,p,T){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=x,this.outputFilter=p,this.mode=null,this.verbose=0,this.displayedMemory=new s(T),this.nonDisplayedMemory=new s(T),this.lastOutputScreen=new s(T),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=T}var w=C.prototype;return w.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},w.getHandler=function(){return this.outputFilter},w.setHandler=function(p){this.outputFilter=p},w.setPAC=function(p){this.writeScreen.setPAC(p)},w.setBkgData=function(p){this.writeScreen.setBkgData(p)},w.setMode=function(p){if(p===this.mode)return;this.mode=p,this.logger.log(u.INFO,"MODE="+p),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=p},w.insertChars=function(p){for(var T=0;T<p.length;T++)this.writeScreen.insertChar(p[T]);var v=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(u.INFO,v+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(u.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},w.ccRCL=function(){this.logger.log(u.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},w.ccBS=function(){if(this.logger.log(u.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},w.ccAOF=function(){},w.ccAON=function(){},w.ccDER=function(){this.logger.log(u.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},w.ccRU=function(p){this.logger.log(u.INFO,"RU("+p+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(p)},w.ccFON=function(){this.logger.log(u.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},w.ccRDC=function(){this.logger.log(u.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},w.ccTR=function(){this.logger.log(u.INFO,"TR"),this.setMode("MODE_TEXT")},w.ccRTD=function(){this.logger.log(u.INFO,"RTD"),this.setMode("MODE_TEXT")},w.ccEDM=function(){this.logger.log(u.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},w.ccCR=function(){this.logger.log(u.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},w.ccENM=function(){this.logger.log(u.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},w.ccEOC=function(){if(this.logger.log(u.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var p=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=p,this.writeScreen=this.nonDisplayedMemory,this.logger.log(u.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},w.ccTO=function(p){this.logger.log(u.INFO,"TO("+p+") - Tab Offset"),this.writeScreen.moveCursor(p)},w.ccMIDROW=function(p){var T={flash:!1};if(T.underline=p%2===1,T.italics=p>=46,T.italics)T.foreground="white";else{var v=Math.floor(p/2)-16,y=["white","green","blue","cyan","red","yellow","magenta"];T.foreground=y[v]}this.logger.log(u.INFO,"MIDROW: "+JSON.stringify(T)),this.writeScreen.setPen(T)},w.outputDataUpdate=function(p){p===void 0&&(p=!1);var T=this.logger.time;if(T===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=T:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,T,this.lastOutputScreen),p&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:T),this.lastOutputScreen.copy(this.displayedMemory))},w.cueSplitAtTime=function(p){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,p,this.displayedMemory),this.cueStartTime=p))},C}(),_=function(){function C(x,p,T){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var v=new a;this.channels=[null,new A(x,p,v),new A(x+1,T,v)],this.cmdHistory=O(),this.logger=v}var w=C.prototype;return w.getHandler=function(p){return this.channels[p].getHandler()},w.setHandler=function(p,T){this.channels[p].setHandler(T)},w.addData=function(p,T){var v,y,N,B=!1;this.logger.time=p;for(var R=0;R<T.length;R+=2){if(y=T[R]&127,N=T[R+1]&127,y===0&&N===0)continue;if(this.logger.log(u.DATA,"["+f([T[R],T[R+1]])+"] -> ("+f([y,N])+")"),v=this.parseCmd(y,N),v||(v=this.parseMidrow(y,N)),v||(v=this.parsePAC(y,N)),v||(v=this.parseBackgroundAttributes(y,N)),!v&&(B=this.parseChars(y,N),B)){var j=this.currentChannel;if(j&&j>0){var P=this.channels[j];P.insertChars(B)}else this.logger.log(u.WARNING,"No channel found yet. TEXT-MODE?")}!v&&!B&&this.logger.log(u.WARNING,"Couldn't parse cleaned data "+f([y,N])+" orig: "+f([T[R],T[R+1]]))}},w.parseCmd=function(p,T){var v=this.cmdHistory,y=(p===20||p===28||p===21||p===29)&&T>=32&&T<=47,N=(p===23||p===31)&&T>=33&&T<=35;if(!(y||N))return!1;if(L(p,T,v))return S(null,null,v),this.logger.log(u.DEBUG,"Repeated command ("+f([p,T])+") is dropped"),!0;var B=p===20||p===21||p===23?1:2,R=this.channels[B];return p===20||p===21||p===28||p===29?T===32?R.ccRCL():T===33?R.ccBS():T===34?R.ccAOF():T===35?R.ccAON():T===36?R.ccDER():T===37?R.ccRU(2):T===38?R.ccRU(3):T===39?R.ccRU(4):T===40?R.ccFON():T===41?R.ccRDC():T===42?R.ccTR():T===43?R.ccRTD():T===44?R.ccEDM():T===45?R.ccCR():T===46?R.ccENM():T===47&&R.ccEOC():R.ccTO(T-32),S(p,T,v),this.currentChannel=B,!0},w.parseMidrow=function(p,T){var v=0;if((p===17||p===25)&&T>=32&&T<=47){if(p===17?v=1:v=2,v!==this.currentChannel)return this.logger.log(u.ERROR,"Mismatch channel in midrow parsing"),!1;var y=this.channels[v];return y?(y.ccMIDROW(T),this.logger.log(u.DEBUG,"MIDROW ("+f([p,T])+")"),!0):!1}return!1},w.parsePAC=function(p,T){var v,y=this.cmdHistory,N=(p>=17&&p<=23||p>=25&&p<=31)&&T>=64&&T<=127,B=(p===16||p===24)&&T>=64&&T<=95;if(!(N||B))return!1;if(L(p,T,y))return S(null,null,y),!0;var R=p<=23?1:2;T>=64&&T<=95?v=R===1?i[p]:g[p]:v=R===1?D[p]:d[p];var j=this.channels[R];return j?(j.setPAC(this.interpretPAC(v,T)),S(p,T,y),this.currentChannel=R,!0):!1},w.interpretPAC=function(p,T){var v,y={color:null,italics:!1,indent:null,underline:!1,row:p};return T>95?v=T-96:v=T-64,y.underline=(v&1)===1,v<=13?y.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(v/2)]:v<=15?(y.italics=!0,y.color="white"):y.indent=Math.floor((v-16)/2)*4,y},w.parseChars=function(p,T){var v,y=null,N=null;if(p>=25?(v=2,N=p-8):(v=1,N=p),N>=17&&N<=19){var B;N===17?B=T+80:N===18?B=T+112:B=T+144,this.logger.log(u.INFO,"Special char '"+U(B)+"' in channel "+v),y=[B]}else p>=32&&p<=127&&(y=T===0?[p]:[p,T]);if(y){var R=f(y);this.logger.log(u.DEBUG,"Char codes = "+R.join(",")),S(p,T,this.cmdHistory)}return y},w.parseBackgroundAttributes=function(p,T){var v=(p===16||p===24)&&T>=32&&T<=47,y=(p===23||p===31)&&T>=45&&T<=47;if(!(v||y))return!1;var N,B={};p===16||p===24?(N=Math.floor((T-32)/2),B.background=m[N],T%2===1&&(B.background=B.background+"_semi")):T===45?B.background="transparent":(B.foreground="black",T===47&&(B.underline=!0));var R=p<=23?1:2,j=this.channels[R];return j.setBkgData(B),S(p,T,this.cmdHistory),!0},w.reset=function(){for(var p=0;p<Object.keys(this.channels).length;p++){var T=this.channels[p];T&&T.reset()}this.cmdHistory=O()},w.cueSplitAtTime=function(p){for(var T=0;T<this.channels.length;T++){var v=this.channels[T];v&&v.cueSplitAtTime(p)}},C}();function S(C,w,x){x.a=C,x.b=w}function L(C,w,x){return x.a===C&&x.b===w}function O(){return{a:null,b:null}}$.default=_},"./src/utils/codecs.ts":function(ie,$,M){"use strict";M.r($),M.d($,"isCodecType",function(){return F}),M.d($,"isCodecSupportedInMp4",function(){return U});var Y={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 F(G,W){var i=Y[W];return!!i&&i[G.slice(0,4)]===!0}function U(G,W){return MediaSource.isTypeSupported((W||"video")+'/mp4;codecs="'+G+'"')}},"./src/utils/cues.ts":function(ie,$,M){"use strict";M.r($);var Y=M("./src/utils/vttparser.ts"),F=M("./src/utils/webvtt-parser.ts"),U=M("./src/utils/texttrack-utils.ts"),G=/\s/,W={newCue:function(D,g,d,m){for(var u=[],a,f,l,h,o,s=self.VTTCue||self.TextTrackCue,A=0;A<m.rows.length;A++)if(a=m.rows[A],l=!0,h=0,o="",!a.isEmpty()){for(var _=0;_<a.chars.length;_++)G.test(a.chars[_].uchar)&&l?h++:(o+=a.chars[_].uchar,l=!1);a.cueStartTime=g,g===d&&(d+=1e-4),h>=16?h--:h++;var S=Object(Y.fixLineBreaks)(o.trim()),L=Object(F.generateCueId)(g,d,S);(!D||!D.cues||!D.cues.getCueById(L))&&(f=new s(g,d,S),f.id=L,f.line=A+1,f.align="left",f.position=10+Math.min(80,Math.floor(h*8/32)*10),u.push(f))}return D&&u.length&&(u.sort(function(O,C){return O.line==="auto"||C.line==="auto"?0:O.line>8&&C.line>8?C.line-O.line:O.line-C.line}),u.forEach(function(O){return Object(U.addCueToTrack)(D,O)})),u}};$.default=W},"./src/utils/discontinuities.ts":function(ie,$,M){"use strict";M.r($),M.d($,"findFirstFragWithCC",function(){return G}),M.d($,"shouldAlignOnDiscontinuities",function(){return W}),M.d($,"findDiscontinuousReferenceFrag",function(){return i}),M.d($,"adjustSlidingStart",function(){return g}),M.d($,"alignStream",function(){return d}),M.d($,"alignPDT",function(){return u}),M.d($,"alignFragmentByPDTDelta",function(){return a}),M.d($,"alignMediaPlaylistByPDT",function(){return f});var Y=M("./src/polyfills/number.ts"),F=M("./src/utils/logger.ts"),U=M("./src/controller/level-helper.ts");function G(l,h){for(var o=null,s=0,A=l.length;s<A;s++){var _=l[s];if(_&&_.cc===h){o=_;break}}return o}function W(l,h,o){return!!(h.details&&(o.endCC>o.startCC||l&&l.cc<o.startCC))}function i(l,h){var o=l.fragments,s=h.fragments;if(!s.length||!o.length){F.logger.log("No fragments to align");return}var A=G(o,s[0].cc);if(!A||A&&!A.startPTS){F.logger.log("No frag in previous level to align on");return}return A}function D(l,h){if(l){var o=l.start+h;l.start=l.startPTS=o,l.endPTS=o+l.duration}}function g(l,h){for(var o=h.fragments,s=0,A=o.length;s<A;s++)D(o[s],l);h.fragmentHint&&D(h.fragmentHint,l),h.alignedSliding=!0}function d(l,h,o){if(!h)return;m(l,o,h),!o.alignedSliding&&h.details&&u(o,h.details),!o.alignedSliding&&h.details&&!o.skippedSegments&&Object(U.adjustSliding)(h.details,o)}function m(l,h,o){if(W(l,o,h)){var s=i(o.details,h);s&&Object(Y.isFiniteNumber)(s.start)&&(F.logger.log("Adjusting PTS using last level due to CC increase within current level "+h.url),g(s.start,h))}}function u(l,h){if(!h.fragments.length||!l.hasProgramDateTime||!h.hasProgramDateTime)return;var o=h.fragments[0].programDateTime,s=l.fragments[0].programDateTime,A=(s-o)/1e3+h.fragments[0].start;A&&Object(Y.isFiniteNumber)(A)&&(F.logger.log("Adjusting PTS using programDateTime delta "+(s-o)+"ms, sliding:"+A.toFixed(3)+" "+l.url+" "),g(A,l))}function a(l,h){var o=l.programDateTime;if(!o)return;var s=(o-h)/1e3;l.start=l.startPTS=s,l.endPTS=s+l.duration}function f(l,h){if(!h.fragments.length||!l.hasProgramDateTime||!h.hasProgramDateTime)return;var o=h.fragments[0].programDateTime,s=h.fragments[0].start,A=o-s*1e3;l.fragments.forEach(function(_){a(_,A)}),l.fragmentHint&&a(l.fragmentHint,A),l.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ie,$,M){"use strict";M.r($);var Y=M("./src/utils/ewma.ts"),F=function(){function U(W,i,D){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=D,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Y.default(W),this.fast_=new Y.default(i)}var G=U.prototype;return G.update=function(i,D){var g=this.slow_,d=this.fast_;this.slow_.halfLife!==i&&(this.slow_=new Y.default(i,g.getEstimate(),g.getTotalWeight())),this.fast_.halfLife!==D&&(this.fast_=new Y.default(D,d.getEstimate(),d.getTotalWeight()))},G.sample=function(i,D){i=Math.max(i,this.minDelayMs_);var g=8*D,d=i/1e3,m=g/d;this.fast_.sample(d,m),this.slow_.sample(d,m)},G.canEstimate=function(){var i=this.fast_;return i&&i.getTotalWeight()>=this.minWeight_},G.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},G.destroy=function(){},U}();$.default=F},"./src/utils/ewma.ts":function(ie,$,M){"use strict";M.r($);var Y=function(){function F(G,W,i){W===void 0&&(W=0),i===void 0&&(i=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=G,this.alpha_=G?Math.exp(Math.log(.5)/G):0,this.estimate_=W,this.totalWeight_=i}var U=F.prototype;return U.sample=function(W,i){var D=Math.pow(this.alpha_,W);this.estimate_=i*(1-D)+D*this.estimate_,this.totalWeight_+=W},U.getTotalWeight=function(){return this.totalWeight_},U.getEstimate=function(){if(this.alpha_){var W=1-Math.pow(this.alpha_,this.totalWeight_);if(W)return this.estimate_/W}return this.estimate_},F}();$.default=Y},"./src/utils/fetch-loader.ts":function(ie,$,M){"use strict";M.r($),M.d($,"fetchSupported",function(){return a});var Y=M("./src/polyfills/number.ts"),F=M("./src/loader/load-stats.ts"),U=M("./src/demux/chunk-cache.ts");function G(s,A){s.prototype=Object.create(A.prototype),s.prototype.constructor=s,d(s,A)}function W(s){var A=typeof Map=="function"?new Map:void 0;return W=function(S){if(S===null||!g(S))return S;if(typeof S!="function")throw new TypeError("Super expression must either be null or a function");if(typeof A!="undefined"){if(A.has(S))return A.get(S);A.set(S,L)}function L(){return i(S,arguments,m(this).constructor)}return L.prototype=Object.create(S.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),d(L,S)},W(s)}function i(s,A,_){return D()?i=Reflect.construct:i=function(L,O,C){var w=[null];w.push.apply(w,O);var x=Function.bind.apply(L,w),p=new x;return C&&d(p,C.prototype),p},i.apply(null,arguments)}function D(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function g(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function d(s,A){return d=Object.setPrototypeOf||function(S,L){return S.__proto__=L,S},d(s,A)}function m(s){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(_){return _.__proto__||Object.getPrototypeOf(_)},m(s)}function u(){return u=Object.assign||function(s){for(var A=1;A<arguments.length;A++){var _=arguments[A];for(var S in _)Object.prototype.hasOwnProperty.call(_,S)&&(s[S]=_[S])}return s},u.apply(this,arguments)}function a(){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||h,this.controller=new self.AbortController,this.stats=new F.LoadStats}var A=s.prototype;return A.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},A.abortInternal=function(){var S=this.response;(!S||!S.ok)&&(this.stats.aborted=!0,this.controller.abort())},A.abort=function(){var S;this.abortInternal(),(S=this.callbacks)!==null&&S!==void 0&&S.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},A.load=function(S,L,O){var C=this,w=this.stats;if(w.loading.start)throw new Error("Loader can only be used once.");w.loading.start=self.performance.now();var x=l(S,this.controller.signal),p=O.onProgress,T=S.responseType==="arraybuffer",v=T?"byteLength":"length";this.context=S,this.config=L,this.callbacks=O,this.request=this.fetchSetup(S,x),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){C.abortInternal(),O.onTimeout(w,S,C.response)},L.timeout),self.fetch(this.request).then(function(y){if(C.response=C.loader=y,!y.ok){var N=y.status,B=y.statusText;throw new o(B||"fetch, bad network response",N,y)}return w.loading.first=Math.max(self.performance.now(),w.loading.start),w.total=parseInt(y.headers.get("Content-Length")||"0"),p&&Object(Y.isFiniteNumber)(L.highWaterMark)?C.loadProgressively(y,w,S,L.highWaterMark,p):T?y.arrayBuffer():y.text()}).then(function(y){var N=C.response;self.clearTimeout(C.requestTimeout),w.loading.end=Math.max(self.performance.now(),w.loading.first),w.loaded=w.total=y[v];var B={url:N.url,data:y};p&&!Object(Y.isFiniteNumber)(L.highWaterMark)&&p(w,S,y,N),O.onSuccess(B,w,S,N)}).catch(function(y){if(self.clearTimeout(C.requestTimeout),w.aborted)return;var N=y.code||0;O.onError({code:N,text:y.message},S,y.details)})},A.getCacheAge=function(){var S=null;if(this.response){var L=this.response.headers.get("age");S=L?parseFloat(L):null}return S},A.loadProgressively=function(S,L,O,C,w){C===void 0&&(C=0);var x=new U.default,p=S.body.getReader(),T=function v(){return p.read().then(function(y){if(y.done)return x.dataLength&&w(L,O,x.flush(),S),Promise.resolve(new ArrayBuffer(0));var N=y.value,B=N.length;return L.loaded+=B,B<C||x.dataLength?(x.push(N),x.dataLength>=C&&w(L,O,x.flush(),S)):w(L,O,N,S),v()}).catch(function(){return Promise.reject()})};return T()},s}();function l(s,A){var _={method:"GET",mode:"cors",credentials:"same-origin",signal:A,headers:new self.Headers(u({},s.headers))};return s.rangeEnd&&_.headers.set("Range","bytes="+s.rangeStart+"-"+String(s.rangeEnd-1)),_}function h(s,A){return new self.Request(s.url,A)}var o=function(s){G(A,s);function A(_,S,L){var O;return O=s.call(this,_)||this,O.code=void 0,O.details=void 0,O.code=S,O.details=L,O}return A}(W(Error));$.default=f},"./src/utils/imsc1-ttml-parser.ts":function(ie,$,M){"use strict";M.r($),M.d($,"IMSC1_CODEC",function(){return g}),M.d($,"parseIMSC1",function(){return a});var Y=M("./src/utils/mp4-tools.ts"),F=M("./src/utils/vttparser.ts"),U=M("./src/utils/vttcue.ts"),G=M("./src/demux/id3.ts"),W=M("./src/utils/timescale-conversion.ts"),i=M("./src/utils/webvtt-parser.ts");function D(){return D=Object.assign||function(C){for(var w=1;w<arguments.length;w++){var x=arguments[w];for(var p in x)Object.prototype.hasOwnProperty.call(x,p)&&(C[p]=x[p])}return C},D.apply(this,arguments)}var g="stpp.ttml.im1t",d=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,m=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,u={left:"start",center:"center",right:"end",start:"start",end:"end"};function a(C,w,x,p,T){var v=Object(Y.findBox)(new Uint8Array(C),["mdat"]);if(v.length===0){T(new Error("Could not parse IMSC1 mdat"));return}var y=v[0],N=Object(G.utf8ArrayToStr)(new Uint8Array(C,y.start,y.end-y.start)),B=Object(W.toTimescaleFromScale)(w,1,x);try{p(f(N,B))}catch(R){T(R)}}function f(C,w){var x=new DOMParser,p=x.parseFromString(C,"text/xml"),T=p.getElementsByTagName("tt")[0];if(!T)throw new Error("Invalid ttml");var v={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},y=Object.keys(v).reduce(function(P,b){return P[b]=T.getAttribute("ttp:"+b)||v[b],P},{}),N=T.getAttribute("xml:space")!=="preserve",B=h(l(T,"styling","style")),R=h(l(T,"layout","region")),j=l(T,"body","[begin]");return[].map.call(j,function(P){var b=o(P,N);if(!b||!P.hasAttribute("begin"))return null;var X=S(P.getAttribute("begin"),y),ee=S(P.getAttribute("dur"),y),ae=S(P.getAttribute("end"),y);if(X===null)throw _(P);if(ae===null){if(ee===null)throw _(P);ae=X+ee}var le=new U.default(X-w,ae-w,b);le.id=Object(i.generateCueId)(le.startTime,le.endTime,le.text);var Re=R[P.getAttribute("region")],Ee=B[P.getAttribute("style")];le.position=10,le.size=80;var Te=s(Re,Ee),Ae=Te.textAlign;if(Ae){var Oe=u[Ae];Oe&&(le.lineAlign=Oe),le.align=Ae}return D(le,Te),le}).filter(function(P){return P!==null})}function l(C,w,x){var p=C.getElementsByTagName(w)[0];return p?[].slice.call(p.querySelectorAll(x)):[]}function h(C){return C.reduce(function(w,x){var p=x.getAttribute("xml:id");return p&&(w[p]=x),w},{})}function o(C,w){return[].slice.call(C.childNodes).reduce(function(x,p,T){var v;return p.nodeName==="br"&&T?x+`
|
|
`:(v=p.childNodes)!==null&&v!==void 0&&v.length?o(p,w):w?x+p.textContent.trim().replace(/\s+/g," "):x+p.textContent},"")}function s(C,w){var x="http://www.w3.org/ns/ttml#styling",p=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return p.reduce(function(T,v){var y=A(w,x,v)||A(C,x,v);return y&&(T[v]=y),T},{})}function A(C,w,x){return C.hasAttributeNS(w,x)?C.getAttributeNS(w,x):null}function _(C){return new Error("Could not parse ttml timestamp "+C)}function S(C,w){if(!C)return null;var x=Object(F.parseTimeStamp)(C);return x===null&&(d.test(C)?x=L(C,w):m.test(C)&&(x=O(C,w))),x}function L(C,w){var x=d.exec(C),p=(x[4]|0)+(x[5]|0)/w.subFrameRate;return(x[1]|0)*3600+(x[2]|0)*60+(x[3]|0)+p/w.frameRate}function O(C,w){var x=m.exec(C),p=Number(x[1]),T=x[2];switch(T){case"h":return p*3600;case"m":return p*60;case"ms":return p*1e3;case"f":return p/w.frameRate;case"t":return p/w.tickRate}return p}},"./src/utils/logger.ts":function(ie,$,M){"use strict";M.r($),M.d($,"enableLogs",function(){return i}),M.d($,"logger",function(){return D});var Y=function(){},F={trace:Y,debug:Y,log:Y,warn:Y,info:Y,error:Y},U=F;function G(g){var d=self.console[g];return d?d.bind(self.console,"["+g+"] >"):Y}function W(g){for(var d=arguments.length,m=new Array(d>1?d-1:0),u=1;u<d;u++)m[u-1]=arguments[u];m.forEach(function(a){U[a]=g[a]?g[a].bind(g):G(a)})}function i(g){if(self.console&&g===!0||typeof g=="object"){W(g,"debug","log","info","warn","error");try{U.log()}catch(d){U=F}}else U=F}var D=U},"./src/utils/mediakeys-helper.ts":function(ie,$,M){"use strict";M.r($),M.d($,"KeySystems",function(){return Y}),M.d($,"requestMediaKeySystemAccess",function(){return F});var Y;(function(U){U.WIDEVINE="com.widevine.alpha",U.PLAYREADY="com.microsoft.playready"})(Y||(Y={}));var F=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ie,$,M){"use strict";M.r($),M.d($,"getMediaSource",function(){return Y});function Y(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ie,$,M){"use strict";M.r($),M.d($,"bin2str",function(){return W}),M.d($,"readUint16",function(){return i}),M.d($,"readUint32",function(){return D}),M.d($,"writeUint32",function(){return g}),M.d($,"findBox",function(){return d}),M.d($,"parseSegmentIndex",function(){return m}),M.d($,"parseInitSegment",function(){return u}),M.d($,"getStartDTS",function(){return a}),M.d($,"getDuration",function(){return f}),M.d($,"computeRawDurationFromSamples",function(){return l}),M.d($,"offsetStartDTS",function(){return h}),M.d($,"segmentValidRange",function(){return o}),M.d($,"appendUint8Array",function(){return s});var Y=M("./src/utils/typed-array.ts"),F=M("./src/loader/fragment.ts"),U=Math.pow(2,32)-1,G=[].push;function W(A){return String.fromCharCode.apply(null,A)}function i(A,_){"data"in A&&(_+=A.start,A=A.data);var S=A[_]<<8|A[_+1];return S<0?65536+S:S}function D(A,_){"data"in A&&(_+=A.start,A=A.data);var S=A[_]<<24|A[_+1]<<16|A[_+2]<<8|A[_+3];return S<0?4294967296+S:S}function g(A,_,S){"data"in A&&(_+=A.start,A=A.data),A[_]=S>>24,A[_+1]=S>>16&255,A[_+2]=S>>8&255,A[_+3]=S&255}function d(A,_){var S=[];if(!_.length)return S;var L,O,C;"data"in A?(L=A.data,O=A.start,C=A.end):(L=A,O=0,C=L.byteLength);for(var w=O;w<C;){var x=D(L,w),p=W(L.subarray(w+4,w+8)),T=x>1?w+x:C;if(p===_[0])if(_.length===1)S.push({data:L,start:w+8,end:T});else{var v=d({data:L,start:w+8,end:T},_.slice(1));v.length&&G.apply(S,v)}w=T}return S}function m(A){var _=d(A,["moov"]),S=_[0],L=S?S.end:null,O=d(A,["sidx"]);if(!O||!O[0])return null;var C=[],w=O[0],x=w.data[0],p=x===0?8:16,T=D(w,p);p+=4;var v=0,y=0;x===0?p+=8:p+=16,p+=2;var N=w.end+y,B=i(w,p);p+=2;for(var R=0;R<B;R++){var j=p,P=D(w,j);j+=4;var b=P&2147483647,X=(P&2147483648)>>>31;if(X===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ee=D(w,j);j+=4,C.push({referenceSize:b,subsegmentDuration:ee,info:{duration:ee/T,start:N,end:N+b-1}}),N+=b,j+=4,p=j}return{earliestPresentationTime:v,timescale:T,version:x,referencesCount:B,references:C,moovEndOffset:L}}function u(A){for(var _=[],S=d(A,["moov","trak"]),L=0;L<S.length;L++){var O=S[L],C=d(O,["tkhd"])[0];if(C){var w=C.data[C.start],x=w===0?12:20,p=D(C,x),T=d(O,["mdia","mdhd"])[0];if(T){w=T.data[T.start],x=w===0?12:20;var v=D(T,x),y=d(O,["mdia","hdlr"])[0];if(y){var N=W(y.data.subarray(y.start+8,y.start+12)),B={soun:F.ElementaryStreamTypes.AUDIO,vide:F.ElementaryStreamTypes.VIDEO}[N];if(B){var R=d(O,["mdia","minf","stbl","stsd"])[0],j=void 0;R&&(j=W(R.data.subarray(R.start+12,R.start+16))),_[p]={timescale:v,type:B},_[B]={timescale:v,id:p,codec:j}}}}}}var P=d(A,["moov","mvex","trex"]);return P.forEach(function(b){var X=D(b,4),ee=_[X];ee&&(ee.default={duration:D(b,12),flags:D(b,20)})}),_}function a(A,_){return d(_,["moof","traf"]).reduce(function(S,L){var O=d(L,["tfdt"])[0],C=O.data[O.start],w=d(L,["tfhd"]).reduce(function(x,p){var T=D(p,4),v=A[T];if(v){var y=D(O,4);C===1&&(y*=Math.pow(2,32),y+=D(O,8));var N=v.timescale||9e4,B=y/N;if(isFinite(B)&&(x===null||B<x))return B}return x},null);return w!==null&&isFinite(w)&&(S===null||w<S)?w:S},null)||0}function f(A,_){for(var S=0,L=0,O=0,C=d(A,["moof","traf"]),w=0;w<C.length;w++){var x=C[w],p=d(x,["tfhd"])[0],T=D(p,4),v=_[T];if(!v)continue;var y=v.default,N=D(p,0)|(y==null?void 0:y.flags),B=y==null?void 0:y.duration;N&8&&(N&2?B=D(p,12):B=D(p,8));for(var R=v.timescale||9e4,j=d(x,["trun"]),P=0;P<j.length;P++){if(B){var b=D(j[P],4);S=B*b}else S=l(j[P]);v.type===F.ElementaryStreamTypes.VIDEO?L+=S/R:v.type===F.ElementaryStreamTypes.AUDIO&&(O+=S/R)}}if(L===0&&O===0){var X=m(A);if(X!=null&&X.references)return X.references.reduce(function(ee,ae){return ee+ae.info.duration||0},0)}return L||O}function l(A){var _=D(A,0),S=8;_&1&&(S+=4),_&4&&(S+=4);for(var L=0,O=D(A,4),C=0;C<O;C++){if(_&256){var w=D(A,S);L+=w,S+=4}_&512&&(S+=4),_&1024&&(S+=4),_&2048&&(S+=4)}return L}function h(A,_,S){d(_,["moof","traf"]).forEach(function(L){d(L,["tfhd"]).forEach(function(O){var C=D(O,4),w=A[C];if(!w)return;var x=w.timescale||9e4;d(L,["tfdt"]).forEach(function(p){var T=p.data[p.start],v=D(p,4);if(T===0)g(p,4,v-S*x);else{v*=Math.pow(2,32),v+=D(p,8),v-=S*x,v=Math.max(v,0);var y=Math.floor(v/(U+1)),N=Math.floor(v%(U+1));g(p,4,y),g(p,8,N)}})})})}function o(A){var _={valid:null,remainder:null},S=d(A,["moof"]);if(S){if(S.length<2)return _.remainder=A,_}else return _;var L=S[S.length-1];return _.valid=Object(Y.sliceUint8)(A,0,L.start-8),_.remainder=Object(Y.sliceUint8)(A,L.start-8),_}function s(A,_){var S=new Uint8Array(A.length+_.length);return S.set(A),S.set(_,A.length),S}},"./src/utils/output-filter.ts":function(ie,$,M){"use strict";M.r($),M.d($,"default",function(){return Y});var Y=function(){function F(G,W){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=G,this.trackName=W}var U=F.prototype;return U.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},U.newCue=function(W,i,D){(this.startTime===null||this.startTime>W)&&(this.startTime=W),this.endTime=i,this.screen=D,this.timelineController.createCaptionsTrack(this.trackName)},U.reset=function(){this.cueRanges=[]},F}()},"./src/utils/texttrack-utils.ts":function(ie,$,M){"use strict";M.r($),M.d($,"sendAddTrackEvent",function(){return F}),M.d($,"addCueToTrack",function(){return U}),M.d($,"clearCurrentCues",function(){return G}),M.d($,"removeCuesInRange",function(){return W}),M.d($,"getCuesInRange",function(){return D});var Y=M("./src/utils/logger.ts");function F(g,d){var m;try{m=new Event("addtrack")}catch(u){m=document.createEvent("Event"),m.initEvent("addtrack",!1,!1)}m.track=g,d.dispatchEvent(m)}function U(g,d){var m=g.mode;if(m==="disabled"&&(g.mode="hidden"),g.cues&&!g.cues.getCueById(d.id))try{if(g.addCue(d),!g.cues.getCueById(d.id))throw new Error("addCue is failed for: "+d)}catch(a){Y.logger.debug("[texttrack-utils]: "+a);var u=new self.TextTrackCue(d.startTime,d.endTime,d.text);u.id=d.id,g.addCue(u)}m==="disabled"&&(g.mode=m)}function G(g){var d=g.mode;if(d==="disabled"&&(g.mode="hidden"),g.cues)for(var m=g.cues.length;m--;)g.removeCue(g.cues[m]);d==="disabled"&&(g.mode=d)}function W(g,d,m){var u=g.mode;if(u==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var a=D(g.cues,d,m),f=0;f<a.length;f++)g.removeCue(a[f]);u==="disabled"&&(g.mode=u)}function i(g,d){if(d<g[0].startTime)return 0;var m=g.length-1;if(d>g[m].endTime)return-1;for(var u=0,a=m;u<=a;){var f=Math.floor((a+u)/2);if(d<g[f].startTime)a=f-1;else if(d>g[f].startTime&&u<m)u=f+1;else return f}return g[u].startTime-d<d-g[a].startTime?u:a}function D(g,d,m){var u=[],a=i(g,d);if(a>-1)for(var f=a,l=g.length;f<l;f++){var h=g[f];if(h.startTime>=d&&h.endTime<=m)u.push(h);else if(h.startTime>m)return u}return u}},"./src/utils/time-ranges.ts":function(ie,$,M){"use strict";M.r($);var Y={toString:function(U){for(var G="",W=U.length,i=0;i<W;i++)G+="["+U.start(i).toFixed(3)+","+U.end(i).toFixed(3)+"]";return G}};$.default=Y},"./src/utils/timescale-conversion.ts":function(ie,$,M){"use strict";M.r($),M.d($,"toTimescaleFromBase",function(){return F}),M.d($,"toTimescaleFromScale",function(){return U}),M.d($,"toMsFromMpegTsClock",function(){return G}),M.d($,"toMpegTsClockFromTimescale",function(){return W});var Y=9e4;function F(i,D,g,d){g===void 0&&(g=1),d===void 0&&(d=!1);var m=i*D*g;return d?Math.round(m):m}function U(i,D,g,d){return g===void 0&&(g=1),d===void 0&&(d=!1),F(i,D,1/g,d)}function G(i,D){return D===void 0&&(D=!1),F(i,1e3,1/Y,D)}function W(i,D){return D===void 0&&(D=1),F(i,Y,1/D)}},"./src/utils/typed-array.ts":function(ie,$,M){"use strict";M.r($),M.d($,"sliceUint8",function(){return Y});function Y(F,U,G){return Uint8Array.prototype.slice?F.slice(U,G):new Uint8Array(Array.prototype.slice.call(F,U,G))}},"./src/utils/vttcue.ts":function(ie,$,M){"use strict";M.r($),$.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var Y=["","lr","rl"],F=["start","middle","end","left","right"];function U(g,d){if(typeof d!="string")return!1;if(!Array.isArray(g))return!1;var m=d.toLowerCase();return~g.indexOf(m)?m:!1}function G(g){return U(Y,g)}function W(g){return U(F,g)}function i(g){for(var d=arguments.length,m=new Array(d>1?d-1:0),u=1;u<d;u++)m[u-1]=arguments[u];for(var a=1;a<arguments.length;a++){var f=arguments[a];for(var l in f)g[l]=f[l]}return g}function D(g,d,m){var u=this,a={enumerable:!0};u.hasBeenReset=!1;var f="",l=!1,h=g,o=d,s=m,A=null,_="",S=!0,L="auto",O="start",C=50,w="middle",x=50,p="middle";Object.defineProperty(u,"id",i({},a,{get:function(){return f},set:function(v){f=""+v}})),Object.defineProperty(u,"pauseOnExit",i({},a,{get:function(){return l},set:function(v){l=!!v}})),Object.defineProperty(u,"startTime",i({},a,{get:function(){return h},set:function(v){if(typeof v!="number")throw new TypeError("Start time must be set to a number.");h=v,this.hasBeenReset=!0}})),Object.defineProperty(u,"endTime",i({},a,{get:function(){return o},set:function(v){if(typeof v!="number")throw new TypeError("End time must be set to a number.");o=v,this.hasBeenReset=!0}})),Object.defineProperty(u,"text",i({},a,{get:function(){return s},set:function(v){s=""+v,this.hasBeenReset=!0}})),Object.defineProperty(u,"region",i({},a,{get:function(){return A},set:function(v){A=v,this.hasBeenReset=!0}})),Object.defineProperty(u,"vertical",i({},a,{get:function(){return _},set:function(v){var y=G(v);if(y===!1)throw new SyntaxError("An invalid or illegal string was specified.");_=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"snapToLines",i({},a,{get:function(){return S},set:function(v){S=!!v,this.hasBeenReset=!0}})),Object.defineProperty(u,"line",i({},a,{get:function(){return L},set:function(v){if(typeof v!="number"&&v!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");L=v,this.hasBeenReset=!0}})),Object.defineProperty(u,"lineAlign",i({},a,{get:function(){return O},set:function(v){var y=W(v);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");O=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"position",i({},a,{get:function(){return C},set:function(v){if(v<0||v>100)throw new Error("Position must be between 0 and 100.");C=v,this.hasBeenReset=!0}})),Object.defineProperty(u,"positionAlign",i({},a,{get:function(){return w},set:function(v){var y=W(v);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");w=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"size",i({},a,{get:function(){return x},set:function(v){if(v<0||v>100)throw new Error("Size must be between 0 and 100.");x=v,this.hasBeenReset=!0}})),Object.defineProperty(u,"align",i({},a,{get:function(){return p},set:function(v){var y=W(v);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");p=y,this.hasBeenReset=!0}})),u.displayState=void 0}return D.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},D}()},"./src/utils/vttparser.ts":function(ie,$,M){"use strict";M.r($),M.d($,"parseTimeStamp",function(){return U}),M.d($,"fixLineBreaks",function(){return d}),M.d($,"VTTParser",function(){return m});var Y=M("./src/utils/vttcue.ts"),F=function(){function u(){}var a=u.prototype;return a.decode=function(l,h){if(!l)return"";if(typeof l!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(l))},u}();function U(u){function a(l,h,o,s){return(l|0)*3600+(h|0)*60+(o|0)+parseFloat(s||0)}var f=u.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return f?parseFloat(f[2])>59?a(f[2],f[3],0,f[4]):a(f[1],f[2],f[3],f[4]):null}var G=function(){function u(){this.values=Object.create(null)}var a=u.prototype;return a.set=function(l,h){!this.get(l)&&h!==""&&(this.values[l]=h)},a.get=function(l,h,o){return o?this.has(l)?this.values[l]:h[o]:this.has(l)?this.values[l]:h},a.has=function(l){return l in this.values},a.alt=function(l,h,o){for(var s=0;s<o.length;++s)if(h===o[s]){this.set(l,h);break}},a.integer=function(l,h){/^-?\d+$/.test(h)&&this.set(l,parseInt(h,10))},a.percent=function(l,h){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(h)){var o=parseFloat(h);if(o>=0&&o<=100)return this.set(l,o),!0}return!1},u}();function W(u,a,f,l){var h=l?u.split(l):[u];for(var o in h){if(typeof h[o]!="string")continue;var s=h[o].split(f);if(s.length!==2)continue;var A=s[0],_=s[1];a(A,_)}}var i=new Y.default(0,0,""),D=i.align==="middle"?"middle":"center";function g(u,a,f){var l=u;function h(){var A=U(u);if(A===null)throw new Error("Malformed timestamp: "+l);return u=u.replace(/^[^\sa-zA-Z-]+/,""),A}function o(A,_){var S=new G;W(A,function(C,w){var x;switch(C){case"region":for(var p=f.length-1;p>=0;p--)if(f[p].id===w){S.set(C,f[p].region);break}break;case"vertical":S.alt(C,w,["rl","lr"]);break;case"line":x=w.split(","),S.integer(C,x[0]),S.percent(C,x[0])&&S.set("snapToLines",!1),S.alt(C,x[0],["auto"]),x.length===2&&S.alt("lineAlign",x[1],["start",D,"end"]);break;case"position":x=w.split(","),S.percent(C,x[0]),x.length===2&&S.alt("positionAlign",x[1],["start",D,"end","line-left","line-right","auto"]);break;case"size":S.percent(C,w);break;case"align":S.alt(C,w,["start",D,"end","left","right"]);break}},/:/,/\s/),_.region=S.get("region",null),_.vertical=S.get("vertical","");var L=S.get("line","auto");L==="auto"&&i.line===-1&&(L=-1),_.line=L,_.lineAlign=S.get("lineAlign","start"),_.snapToLines=S.get("snapToLines",!0),_.size=S.get("size",100),_.align=S.get("align",D);var O=S.get("position","auto");O==="auto"&&i.position===50&&(O=_.align==="start"||_.align==="left"?0:_.align==="end"||_.align==="right"?100:50),_.position=O}function s(){u=u.replace(/^\s+/,"")}if(s(),a.startTime=h(),s(),u.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);u=u.substr(3),s(),a.endTime=h(),s(),o(u,a)}function d(u){return u.replace(/<br(?: \/)?>/gi,`
|
|
`)}var m=function(){function u(){this.state="INITIAL",this.buffer="",this.decoder=new F,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var a=u.prototype;return a.parse=function(l){var h=this;l&&(h.buffer+=h.decoder.decode(l,{stream:!0}));function o(){var O=h.buffer,C=0;for(O=d(O);C<O.length&&O[C]!=="\r"&&O[C]!==`
|
|
`;)++C;var w=O.substr(0,C);return O[C]==="\r"&&++C,O[C]===`
|
|
`&&++C,h.buffer=O.substr(C),w}function s(O){W(O,function(C,w){},/:/)}try{var A="";if(h.state==="INITIAL"){if(!/\r\n|\n/.test(h.buffer))return this;A=o();var _=A.match(/^()?WEBVTT([ \t].*)?$/);if(!_||!_[0])throw new Error("Malformed WebVTT signature.");h.state="HEADER"}for(var S=!1;h.buffer;){if(!/\r\n|\n/.test(h.buffer))return this;S?S=!1:A=o();switch(h.state){case"HEADER":/:/.test(A)?s(A):A||(h.state="ID");continue;case"NOTE":A||(h.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(A)){h.state="NOTE";break}if(!A)continue;if(h.cue=new Y.default(0,0,""),h.state="CUE",A.indexOf("-->")===-1){h.cue.id=A;continue}case"CUE":if(!h.cue){h.state="BADCUE";continue}try{g(A,h.cue,h.regionList)}catch(O){h.cue=null,h.state="BADCUE";continue}h.state="CUETEXT";continue;case"CUETEXT":{var L=A.indexOf("-->")!==-1;if(!A||L&&(S=!0)){h.oncue&&h.cue&&h.oncue(h.cue),h.cue=null,h.state="ID";continue}if(h.cue===null)continue;h.cue.text&&(h.cue.text+=`
|
|
`),h.cue.text+=A}continue;case"BADCUE":A||(h.state="ID")}}}catch(O){h.state==="CUETEXT"&&h.cue&&h.oncue&&h.oncue(h.cue),h.cue=null,h.state=h.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},a.flush=function(){var l=this;try{if((l.cue||l.state==="HEADER")&&(l.buffer+=`
|
|
|
|
`,l.parse()),l.state==="INITIAL"||l.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(h){l.onparsingerror&&l.onparsingerror(h)}return l.onflush&&l.onflush(),this},u}()},"./src/utils/webvtt-parser.ts":function(ie,$,M){"use strict";M.r($),M.d($,"generateCueId",function(){return m}),M.d($,"parseWebVTT",function(){return a});var Y=M("./src/polyfills/number.ts"),F=M("./src/utils/vttparser.ts"),U=M("./src/demux/id3.ts"),G=M("./src/utils/timescale-conversion.ts"),W=M("./src/remux/mp4-remuxer.ts"),i=/\r\n|\n\r|\n|\r/g,D=function(l,h,o){return o===void 0&&(o=0),l.substr(o,h.length)===h},g=function(l){var h=parseInt(l.substr(-3)),o=parseInt(l.substr(-6,2)),s=parseInt(l.substr(-9,2)),A=l.length>9?parseInt(l.substr(0,l.indexOf(":"))):0;if(!Object(Y.isFiniteNumber)(h)||!Object(Y.isFiniteNumber)(o)||!Object(Y.isFiniteNumber)(s)||!Object(Y.isFiniteNumber)(A))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+l);return h+=1e3*o,h+=60*1e3*s,h+=60*60*1e3*A,h},d=function(l){for(var h=5381,o=l.length;o;)h=h*33^l.charCodeAt(--o);return(h>>>0).toString()};function m(f,l,h){return d(f.toString())+d(l.toString())+d(h)}var u=function(l,h,o){var s=l[h],A=l[s.prevCC];if(!A||!A.new&&s.new){l.ccOffset=l.presentationOffset=s.start,s.new=!1;return}for(;(_=A)!==null&&_!==void 0&&_.new;){var _;l.ccOffset+=s.start-A.start,s.new=!1,s=A,A=l[s.prevCC]}l.presentationOffset=o};function a(f,l,h,o,s,A,_,S){var L=new F.VTTParser,O=Object(U.utf8ArrayToStr)(new Uint8Array(f)).trim().replace(i,`
|
|
`).split(`
|
|
`),C=[],w=Object(G.toMpegTsClockFromTimescale)(l,h),x="00:00.000",p=0,T=0,v,y=!0,N=!1;L.oncue=function(B){var R=o[s],j=o.ccOffset,P=(p-w)/9e4;if(R!=null&&R.new&&(T!==void 0?j=o.ccOffset=R.start:u(o,s,P)),P&&(j=P-o.presentationOffset),N){var b=B.endTime-B.startTime,X=Object(W.normalizePts)((B.startTime+j-T)*9e4,A*9e4)/9e4;B.startTime=X,B.endTime=X+b}var ee=B.text.trim();B.text=decodeURIComponent(encodeURIComponent(ee)),B.id||(B.id=m(B.startTime,B.endTime,ee)),B.endTime>0&&C.push(B)},L.onparsingerror=function(B){v=B},L.onflush=function(){if(v){S(v);return}_(C)},O.forEach(function(B){if(y)if(D(B,"X-TIMESTAMP-MAP=")){y=!1,N=!0,B.substr(16).split(",").forEach(function(R){D(R,"LOCAL:")?x=R.substr(6):D(R,"MPEGTS:")&&(p=parseInt(R.substr(7)))});try{T=g(x)/1e3}catch(R){N=!1,v=R}return}else B===""&&(y=!1);L.parse(B+`
|
|
`)}),L.flush()}},"./src/utils/xhr-loader.ts":function(ie,$,M){"use strict";M.r($);var Y=M("./src/utils/logger.ts"),F=M("./src/loader/load-stats.ts"),U=/^age:\s*[\d.]+\s*$/m,G=function(){function W(D){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=D?D.xhrSetup:null,this.stats=new F.LoadStats,this.retryDelay=0}var i=W.prototype;return i.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},i.abortInternal=function(){var g=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),g&&(g.onreadystatechange=null,g.onprogress=null,g.readyState!==4&&(this.stats.aborted=!0,g.abort()))},i.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},i.load=function(g,d,m){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=g,this.config=d,this.callbacks=m,this.retryDelay=d.retryDelay,this.loadInternal()},i.loadInternal=function(){var g=this.config,d=this.context;if(!g)return;var m=this.loader=new self.XMLHttpRequest,u=this.stats;u.loading.first=0,u.loaded=0;var a=this.xhrSetup;try{if(a)try{a(m,d.url)}catch(h){m.open("GET",d.url,!0),a(m,d.url)}m.readyState||m.open("GET",d.url,!0);var f=this.context.headers;if(f)for(var l in f)m.setRequestHeader(l,f[l])}catch(h){this.callbacks.onError({code:m.status,text:h.message},d,m);return}d.rangeEnd&&m.setRequestHeader("Range","bytes="+d.rangeStart+"-"+(d.rangeEnd-1)),m.onreadystatechange=this.readystatechange.bind(this),m.onprogress=this.loadprogress.bind(this),m.responseType=d.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.timeout),m.send()},i.readystatechange=function(){var g=this.context,d=this.loader,m=this.stats;if(!g||!d)return;var u=d.readyState,a=this.config;if(m.aborted)return;if(u>=2)if(self.clearTimeout(this.requestTimeout),m.loading.first===0&&(m.loading.first=Math.max(self.performance.now(),m.loading.start)),u===4){d.onreadystatechange=null,d.onprogress=null;var f=d.status;if(f>=200&&f<300){m.loading.end=Math.max(self.performance.now(),m.loading.first);var l,h;if(g.responseType==="arraybuffer"?(l=d.response,h=l.byteLength):(l=d.responseText,h=l.length),m.loaded=m.total=h,!this.callbacks)return;var o=this.callbacks.onProgress;if(o&&o(m,g,l,d),!this.callbacks)return;var s={url:d.responseURL,data:l};this.callbacks.onSuccess(s,m,g,d)}else m.retry>=a.maxRetry||f>=400&&f<499?(Y.logger.error(f+" while loading "+g.url),this.callbacks.onError({code:f,text:d.statusText},g,d)):(Y.logger.warn(f+" while loading "+g.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,a.maxRetryDelay),m.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.timeout)},i.loadtimeout=function(){Y.logger.warn("timeout while loading "+this.context.url);var g=this.callbacks;g&&(this.abortInternal(),g.onTimeout(this.stats,this.context,this.loader))},i.loadprogress=function(g){var d=this.stats;d.loaded=g.loaded,g.lengthComputable&&(d.total=g.total)},i.getCacheAge=function(){var g=null;if(this.loader&&U.test(this.loader.getAllResponseHeaders())){var d=this.loader.getResponseHeader("age");g=d?parseFloat(d):null}return g},W}();$.default=G}}).default})},vHTk:function(at,ge,J){at.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);
|