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([[80,5,7,9,21],{"+NIl":function(Ze,Te,Z){(function(oe){oe(Z("VrN/"))})(function(oe){"use strict";oe.defineMode("stex",function($,M){"use strict";function X(l,h){l.cmdState.push(h)}function B(l){return l.cmdState.length>0?l.cmdState[l.cmdState.length-1]:null}function P(l){var h=l.cmdState.pop();h&&h.closeBracket()}function W(l){for(var h=l.cmdState,f=h.length-1;f>=0;f--){var o=h[f];if(o.name=="DEFAULT")continue;return o}return{styleIdentifier:function(){return null}}}function H(l,h,f){return function(){this.name=l,this.bracketNo=0,this.style=h,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=H("importmodule","tag",["string","builtin"]),i.documentclass=H("documentclass","tag",["","atom"]),i.usepackage=H("usepackage","tag",["atom"]),i.begin=H("begin","tag",["atom"]),i.end=H("end","tag",["atom"]),i.label=H("label","tag",["atom"]),i.ref=H("ref","tag",["atom"]),i.eqref=H("eqref","tag",["atom"]),i.cite=H("cite","tag",["atom"]),i.bibitem=H("bibitem","tag",["atom"]),i.Bibitem=H("Bibitem","tag",["atom"]),i.RBibitem=H("RBibitem","tag",["atom"]),i.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function L(l,h){l.f=h}function v(l,h){var f;if(l.match(/^\\[a-zA-Z@]+/)){var o=l.current().slice(1);return f=i.hasOwnProperty(o)?i[o]:i.DEFAULT,f=new f,X(h,f),L(h,p),f.style}if(l.match(/^\\[$&%#{}_]/))return"tag";if(l.match(/^\\[,;!\/\\]/))return"tag";if(l.match("\\["))return L(h,function(s,a){return m(s,a,"\\]")}),"keyword";if(l.match("\\("))return L(h,function(s,a){return m(s,a,"\\)")}),"keyword";if(l.match("$$"))return L(h,function(s,a){return m(s,a,"$$")}),"keyword";if(l.match("$"))return L(h,function(s,a){return m(s,a,"$")}),"keyword";var u=l.next();if(u=="%")return l.skipToEnd(),"comment";if(u=="}"||u=="]"){if(f=B(h),f)f.closeBracket(u),L(h,p);else return"error";return"bracket"}else return u=="{"||u=="["?(f=i.DEFAULT,f=new f,X(h,f),"bracket"):/\d/.test(u)?(l.eatWhile(/[\w.%]/),"atom"):(l.eatWhile(/[\w\-_]/),f=W(h),f.name=="begin"&&(f.argument=l.current()),f.styleIdentifier())}function m(l,h,f){if(l.eatSpace())return null;if(f&&l.match(f))return L(h,v),"keyword";if(l.match(/^\\[a-zA-Z@]+/))return"tag";if(l.match(/^[a-zA-Z]+/))return"variable-2";if(l.match(/^\\[$&%#{}_]/))return"tag";if(l.match(/^\\[,;!\/]/))return"tag";if(l.match(/^[\^_&]/))return"tag";if(l.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(l.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var o=l.next();return o=="{"||o=="}"||o=="["||o=="]"||o=="("||o==")"?"bracket":o=="%"?(l.skipToEnd(),"comment"):"error"}function p(l,h){var f=l.peek(),o;return f=="{"||f=="["?(o=B(h),o.openBracket(f),l.eat(f),L(h,v),"bracket"):/[ \t\r]/.test(f)?(l.eat(f),null):(L(h,v),P(h),v(l,h))}return{startState:function(){var l=M.inMathMode?function(h,f){return m(h,f)}:v;return{cmdState:[],f:l}},copyState:function(l){return{cmdState:l.cmdState.slice(),f:l.f}},token:function(l,h){return h.f(l,h)},blankLine:function(l){l.f=v,l.cmdState.length=0},lineComment:"%"}}),oe.defineMIME("text/x-stex","stex"),oe.defineMIME("text/x-latex","stex")})},"+ua5":function(Ze,Te,Z){},"/cxE":function(Ze,Te,Z){"use strict";Z.d(Te,"f",function(){return M}),Z.d(Te,"g",function(){return X}),Z.d(Te,"h",function(){return B}),Z.d(Te,"e",function(){return W}),Z.d(Te,"b",function(){return H}),Z.d(Te,"c",function(){return i}),Z.d(Te,"d",function(){return L}),Z.d(Te,"a",function(){return v});class oe{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(m){setTimeout(()=>{throw m.stack?new Error(m.message+`
|
|
|
|
`+m.stack):m},0)}}emit(m){this.listeners.forEach(p=>{p(m)})}onUnexpectedError(m){this.unexpectedErrorHandler(m),this.emit(m)}onUnexpectedExternalError(m){this.unexpectedErrorHandler(m)}}const $=new oe;function M(m){W(m)||$.onUnexpectedError(m);return}function X(m){W(m)||$.onUnexpectedExternalError(m);return}function B(m){if(m instanceof Error){let{name:p,message:l}=m;const h=m.stacktrace||m.stack;return{$isError:!0,name:p,message:l,stack:h}}return m}const P="Canceled";function W(m){return m instanceof Error&&m.name===P&&m.message===P}function H(){const m=new Error(P);return m.name=m.message,m}function i(m){return m?new Error(`Illegal argument: ${m}`):new Error("Illegal argument")}function L(m){return m?new Error(`Illegal state: ${m}`):new Error("Illegal state")}class v extends Error{constructor(m){super("NotSupported");m&&(this.message=m)}}},"19Vz":function(Ze,Te,Z){(function(oe){oe(Z("VrN/"))})(function(oe){oe.defineOption("placeholder","",function(H,i,L){var v=L&&L!=oe.Init;if(i&&!v)H.on("blur",B),H.on("change",P),H.on("swapDoc",P),oe.on(H.getInputField(),"compositionupdate",H.state.placeholderCompose=function(){X(H)}),P(H);else if(!i&&v){H.off("blur",B),H.off("change",P),H.off("swapDoc",P),oe.off(H.getInputField(),"compositionupdate",H.state.placeholderCompose),$(H);var m=H.getWrapperElement();m.className=m.className.replace(" CodeMirror-empty","")}i&&!H.hasFocus()&&B(H)});function $(H){H.state.placeholder&&(H.state.placeholder.parentNode.removeChild(H.state.placeholder),H.state.placeholder=null)}function M(H){$(H);var i=H.state.placeholder=document.createElement("pre");i.style.cssText="height: 0; overflow: visible",i.style.direction=H.getOption("direction"),i.className="CodeMirror-placeholder CodeMirror-line-like";var L=H.getOption("placeholder");typeof L=="string"&&(L=document.createTextNode(L)),i.appendChild(L),H.display.lineSpace.insertBefore(i,H.display.lineSpace.firstChild)}function X(H){setTimeout(function(){var i=!1,L=H.getInputField();L.nodeName=="TEXTAREA"?i=!L.value:H.lineCount()==1&&(i=!/[^\u200b]/.test(L.querySelector(".CodeMirror-line").textContent)),i?M(H):$(H)},20)}function B(H){W(H)&&M(H)}function P(H){var i=H.getWrapperElement(),L=W(H);i.className=i.className.replace(" CodeMirror-empty","")+(L?" CodeMirror-empty":""),L?M(H):$(H)}function W(H){return H.lineCount()===1&&H.getLine(0)===""}})},"1eCo":function(Ze,Te,Z){(function(oe){oe(Z("VrN/"))})(function(oe){"use strict";var $={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},M={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};oe.defineMode("xml",function(X,B){var P=X.indentUnit,W={},H=B.htmlMode?$:M;for(var i in H)W[i]=H[i];for(var i in B)W[i]=B[i];var L,v;function m(c,x){function y(U){return x.tokenize=U,U(c,x)}var g=c.next();if(g=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?y(h("atom","]]>")):null:c.match("--")?y(h("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),y(f(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),x.tokenize=h("meta","?>"),"meta"):(L=c.eat("/")?"closeTag":"openTag",x.tokenize=p,"tag bracket");if(g=="&"){var F;return c.eat("#")?c.eat("x")?F=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):F=c.eatWhile(/[\d]/)&&c.eat(";"):F=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),F?"atom":"error"}else return c.eatWhile(/[^&<]/),null}m.isInText=!0;function p(c,x){var y=c.next();if(y==">"||y=="/"&&c.eat(">"))return x.tokenize=m,L=y==">"?"endTag":"selfcloseTag","tag bracket";if(y=="=")return L="equals",null;if(y=="<"){x.tokenize=m,x.state=a,x.tagName=x.tagStart=null;var g=x.tokenize(c,x);return g?g+" tag error":"tag error"}else return/[\'\"]/.test(y)?(x.tokenize=l(y),x.stringStartCol=c.column(),x.tokenize(c,x)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(c){var x=function(y,g){for(;!y.eol();)if(y.next()==c){g.tokenize=p;break}return"string"};return x.isInAttribute=!0,x}function h(c,x){return function(y,g){for(;!y.eol();){if(y.match(x)){g.tokenize=m;break}y.next()}return c}}function f(c){return function(x,y){for(var g;(g=x.next())!=null;){if(g=="<")return y.tokenize=f(c+1),y.tokenize(x,y);if(g==">")if(c==1){y.tokenize=m;break}else return y.tokenize=f(c-1),y.tokenize(x,y)}return"meta"}}function o(c,x,y){this.prev=c.context,this.tagName=x,this.indent=c.indented,this.startOfLine=y,(W.doNotIndent.hasOwnProperty(x)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function u(c){c.context&&(c.context=c.context.prev)}function s(c,x){for(var y;;){if(!c.context)return;if(y=c.context.tagName,!W.contextGrabbers.hasOwnProperty(y)||!W.contextGrabbers[y].hasOwnProperty(x))return;u(c)}}function a(c,x,y){return c=="openTag"?(y.tagStart=x.column(),C):c=="closeTag"?_:a}function C(c,x,y){return c=="word"?(y.tagName=x.current(),v="tag",O):W.allowMissingTagName&&c=="endTag"?(v="tag bracket",O(c,x,y)):(v="error",C)}function _(c,x,y){if(c=="word"){var g=x.current();return y.context&&y.context.tagName!=g&&W.implicitlyClosed.hasOwnProperty(y.context.tagName)&&u(y),y.context&&y.context.tagName==g||W.matchClosing===!1?(v="tag",T):(v="tag error",R)}else return W.allowMissingTagName&&c=="endTag"?(v="tag bracket",T(c,x,y)):(v="error",R)}function T(c,x,y){return c!="endTag"?(v="error",T):(u(y),a)}function R(c,x,y){return v="error",T(c,x,y)}function O(c,x,y){if(c=="word")return v="attribute",S;if(c=="endTag"||c=="selfcloseTag"){var g=y.tagName,F=y.tagStart;return y.tagName=y.tagStart=null,c=="selfcloseTag"||W.autoSelfClosers.hasOwnProperty(g)?s(y,g):(s(y,g),y.context=new o(y,g,F==y.indented)),a}return v="error",O}function S(c,x,y){return c=="equals"?w:(W.allowMissing||(v="error"),O(c,x,y))}function w(c,x,y){return c=="string"?E:c=="word"&&W.allowUnquoted?(v="string",O):(v="error",O(c,x,y))}function E(c,x,y){return c=="string"?E:O(c,x,y)}return{startState:function(c){var x={tokenize:m,state:a,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(x.baseIndent=c),x},token:function(c,x){if(!x.tagName&&c.sol()&&(x.indented=c.indentation()),c.eatSpace())return null;L=null;var y=x.tokenize(c,x);return(y||L)&&y!="comment"&&(v=null,x.state=x.state(L||y,c,x),v&&(y=v=="error"?y+" error":v)),y},indent:function(c,x,y){var g=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+P;if(g&&g.noIndent)return oe.Pass;if(c.tokenize!=p&&c.tokenize!=m)return y?y.match(/^(\s*)/)[0].length:0;if(c.tagName)return W.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+P*(W.multilineTagIndentFactor||1);if(W.alignCDATA&&/<!\[CDATA\[/.test(x))return 0;var F=x&&/^<(\/)?([\w_:\.-]*)/.exec(x);if(F&&F[1])for(;g;)if(g.tagName==F[2]){g=g.prev;break}else if(W.implicitlyClosed.hasOwnProperty(g.tagName))g=g.prev;else break;else if(F)for(;g;){var U=W.contextGrabbers[g.tagName];if(U&&U.hasOwnProperty(F[2]))g=g.prev;else break}for(;g&&g.prev&&!g.startOfLine;)g=g.prev;return g?g.indent+P:c.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:W.htmlMode?"html":"xml",helperType:W.htmlMode?"html":"xml",skipAttribute:function(c){c.state==w&&(c.state=O)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var x=[],y=c.context;y;y=y.prev)y.tagName&&x.push(y.tagName);return x.reverse()}}}),oe.defineMIME("text/xml","xml"),oe.defineMIME("application/xml","xml"),oe.mimeModes.hasOwnProperty("text/html")||oe.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(Ze,Te,Z){"use strict";Z.d(Te,"a",function(){return $});class oe{constructor(M){this.element=M,this.next=oe.Undefined,this.prev=oe.Undefined}}oe.Undefined=new oe(void 0);class ${constructor(){this._first=oe.Undefined,this._last=oe.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===oe.Undefined}clear(){let M=this._first;for(;M!==oe.Undefined;){const X=M.next;M.prev=oe.Undefined,M.next=oe.Undefined,M=X}this._first=oe.Undefined,this._last=oe.Undefined,this._size=0}unshift(M){return this._insert(M,!1)}push(M){return this._insert(M,!0)}_insert(M,X){const B=new oe(M);if(this._first===oe.Undefined)this._first=B,this._last=B;else if(X){const W=this._last;this._last=B,B.prev=W,W.next=B}else{const W=this._first;this._first=B,B.next=W,W.prev=B}this._size+=1;let P=!1;return()=>{P||(P=!0,this._remove(B))}}shift(){if(this._first===oe.Undefined)return;{const M=this._first.element;return this._remove(this._first),M}}pop(){if(this._last===oe.Undefined)return;{const M=this._last.element;return this._remove(this._last),M}}_remove(M){if(M.prev!==oe.Undefined&&M.next!==oe.Undefined){const X=M.prev;X.next=M.next,M.next.prev=X}else M.prev===oe.Undefined&&M.next===oe.Undefined?(this._first=oe.Undefined,this._last=oe.Undefined):M.next===oe.Undefined?(this._last=this._last.prev,this._last.next=oe.Undefined):M.prev===oe.Undefined&&(this._first=this._first.next,this._first.prev=oe.Undefined);this._size-=1}*[Symbol.iterator](){let M=this._first;for(;M!==oe.Undefined;)yield M.element,M=M.next}}},"3/fG":function(Ze,Te,Z){"use strict";Z.d(Te,"a",function(){return $});function oe(M,X){let B;return X.length===0?B=M:B=M.replace(/\{(\d+)\}/g,function(P,W){const H=W[0];return typeof X[H]!="undefined"?X[H]:P}),B}function $(M,X,...B){return oe(X,B)}},"3Rgl":function(Ze,Te,Z){"use strict";Z.r(Te);var oe=Z("+L6B"),$=Z("2/Rp"),M=Z("6UJt"),X=Z("DFOY"),B=Z("/zsF"),P=Z("PArb"),W=Z("5NDa"),H=Z("5rEg"),i=Z("OaEy"),L=Z("2fM7"),v=Z("14J3"),m=Z("BMrR"),p=Z("jCWc"),l=Z("kPKH"),h=Z("sPJy"),f=Z("bE4q"),o=Z("miYZ"),u=Z("tsqr"),s=Z("k1fw"),a=Z("9og8"),C=Z("y8nQ"),_=Z("Vl3Y"),T=Z("tJVT"),R=Z("PpiC"),O=Z("B9cy"),S=Z("Ol7k"),w=Z("lUTK"),E=Z("BvKs"),c=Z("WmNS"),x=Z.n(c),y=Z("q1tI"),g=Z.n(y),F=Z("Ot1p"),U=Z("Ty5D"),A=Z("9kvl"),j=Z("55Ip"),N=Z("gJ3r"),b=Z("m7e3"),Y=Z.n(b),re=E.a.SubMenu,fe=S.a.Content,ve=S.a.Sider,ke=function(Le){var ye,_e,de,z,D,I,V,Q=Le.graduation,G=Le.globalSetting,ce=Le.loading,Ce=Le.user,De=Le.dispatch,ue=Object(R.a)(Le,["graduation","globalSetting","loading","user","dispatch"]),ge=Object(U.i)(),we=Object(U.h)(),Ae=Ce.userInfo,Ne=_.a.useForm(),Be=Object(T.a)(Ne,1),Ge=Be[0],He=Q.addTopicData,qe=function(){var je=Object(a.a)(x.a.mark(function Ke(){var Me,et,Je;return x.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return Me=Ge.getFieldsValue(),et=Object(s.a)({},Me),et.city&&(et.province=et.city[0],et.city=et.city[1]),q.next=5,De({type:"graduation/addTopic",payload:{coursesId:ge.coursesId,attachment_ids:[],graduation_topic:et}});case 5:Je=q.sent,Je.status?u.b.error(Je.message):A.d.push("/classrooms/".concat(ge.coursesId,"/graduation_topics/").concat(ge.categoryId));case 7:case"end":return q.stop()}},Ke)}));return function(){return je.apply(this,arguments)}}();return Object(y.useEffect)(function(){De({type:"graduation/addTopicDefaultData",payload:Object(s.a)({},ge)})},[ge.coursesId]),g.a.createElement("section",{className:"edu-container"},g.a.createElement("section",{className:"animated fadeIn"},g.a.createElement("aside",{className:"mt10"},Ae&&g.a.createElement(f.a,{separator:">"},g.a.createElement(f.a.Item,null,g.a.createElement(j.a,{to:"".concat(Ae.first_category_url)},Ae==null||((ye=Ae.course)===null||ye===void 0)?void 0:ye.course_name)),g.a.createElement(f.a.Item,null,g.a.createElement(j.a,{to:"/classrooms/".concat(ge.coursesId,"/graduation_topics/").concat(ge.categoryId)},"\u6BD5\u8BBE\u9009\u9898")),g.a.createElement(f.a.Item,null,"\u65B0\u5EFA"))),g.a.createElement("aside",{className:[Y.a.title,"mt20"].join(" ")},g.a.createElement(m.a,{style:{width:"100%"}},g.a.createElement(l.a,{flex:"1"},g.a.createElement("strong",{className:"font20 ml5"},"\u65B0\u5EFA\u6BD5\u8BBE\u9009\u9898")),g.a.createElement(l.a,null,g.a.createElement(j.a,{className:"font16 c-light-black",to:"/classrooms/".concat(ge.coursesId,"/exercise")},"\u8FD4\u56DE"))))),g.a.createElement("section",{className:[Y.a.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},g.a.createElement(_.a,{layout:"vertical",form:Ge,scrollToFirstError:!0,onFinish:function(){var je=Object(a.a)(x.a.mark(function Ke(Me){return x.a.wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:qe();case 1:case"end":return Je.stop()}},Ke)}));return function(Ke){return je.apply(this,arguments)}}()},g.a.createElement(_.a.Item,{name:"tea_id",label:"\u6307\u5BFC\u8001\u5E08\uFF1A",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u6307\u5BFC\u8001\u5E08"}]},g.a.createElement(L.a,{size:"large",placeholder:"\u8BF7\u9009\u62E9\u6307\u5BFC\u8001\u5E08",style:{width:200}},(_e=He.teacher_list)===null||_e===void 0?void 0:_e.map(function(je,Ke){return g.a.createElement(L.a.Option,{value:je.id,key:Ke},je.name)}))),g.a.createElement(_.a.Item,{name:"name",label:"\u9009\u9898\u540D\u79F0\uFF1A",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BD5\u5377\u6807\u9898"}]},g.a.createElement(H.a,{maxLength:60,size:"large",placeholder:"\u8BD5\u5377\u6807\u9898\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"})),g.a.createElement(P.a,null),g.a.createElement(_.a.Item,{label:"\u9009\u9898\u7B80\u4ECB",name:"description",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5185\u5BB9"}]},g.a.createElement(F.a,{watch:!0,placeholder:"\u8BF7\u7B80\u8981\u8BF4\u660E\u9009\u9898\u5185\u5BB9\uFF0C\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"})),g.a.createElement(m.a,{gutter:[20,0]},g.a.createElement(l.a,{flex:"1"},g.a.createElement(_.a.Item,{name:"topic_type"},g.a.createElement(L.a,{size:"large",placeholder:"\u8BF7\u9009\u62E9\u9009\u9898\u7C7B\u578B"},(de=He.topic_type)===null||de===void 0?void 0:de.map(function(je,Ke){return g.a.createElement(L.a.Option,{value:je.id,key:Ke},je.name)})))),g.a.createElement(l.a,{flex:"1"},g.a.createElement(_.a.Item,{name:"topic_source"},g.a.createElement(L.a,{size:"large",placeholder:"\u8BF7\u9009\u62E9\u9009\u9898\u6765\u6E90"},(z=He.topic_source)===null||z===void 0?void 0:z.map(function(je,Ke){return g.a.createElement(L.a.Option,{value:je.id,key:Ke},je.name)})))),g.a.createElement(l.a,{flex:"1"},g.a.createElement(_.a.Item,{name:"topic_property_first"},g.a.createElement(L.a,{size:"large",placeholder:"\u8BF7\u9009\u62E9\u9009\u9898\u6027\u8D281"},(D=He.topic_property_first)===null||D===void 0?void 0:D.map(function(je,Ke){return g.a.createElement(L.a.Option,{value:je.id,key:Ke},je.name)})))),g.a.createElement(l.a,{flex:"1"},g.a.createElement(_.a.Item,{name:"topic_property_second"},g.a.createElement(L.a,{size:"large",placeholder:"\u8BF7\u9009\u62E9\u9009\u9898\u6027\u8D282"},(I=He.topic_property_second)===null||I===void 0?void 0:I.map(function(je,Ke){return g.a.createElement(L.a.Option,{value:je.id,key:Ke},je.name)})))),g.a.createElement(l.a,{flex:"150px"})),g.a.createElement(P.a,null),g.a.createElement(_.a.Item,{name:"source_unit",label:"\u9009\u9898\u6765\u6E90\u5355\u4F4D\uFF1A"},g.a.createElement(H.a,{width:"200",size:"large",style:{width:200},placeholder:"\u8BF7\u586B\u5199\u6765\u6E90\u5355\u4F4D"})),g.a.createElement(_.a.Item,{name:"topic_repeat",label:"\u9009\u9898\u91CD\u590D\u60C5\u51B5\uFF1A"},g.a.createElement(L.a,{size:"large",placeholder:"\u8BF7\u9009\u62E9\u91CD\u590D\u60C5\u51B5",style:{width:200}},(V=He.topic_repeat)===null||V===void 0?void 0:V.map(function(je,Ke){return g.a.createElement(L.a.Option,{value:je.id,key:Ke},je.name)}))),g.a.createElement(_.a.Item,{name:"city",label:"\u8C03\u7814\u6216\u5B9E\u4E60\u5730\u70B9\uFF1A"},g.a.createElement(X.a,{size:"large",style:{width:200},options:N.a,placeholder:"\u8BF7\u9009\u62E9\u6240\u5728\u5730"})))),g.a.createElement("aside",{className:Y.a.btns},g.a.createElement($.a,{type:"primary",onClick:function(){Ge.submit()}},"\u4FDD\u5B58"),g.a.createElement(j.a,{to:"/classrooms/".concat(ge.coursesId,"/graduation_topics/").concat(ge.categoryId)},"\u53D6\u6D88")))};Te.default=Object(A.a)(function(Se){var Le=Se.graduation,ye=Se.loading,_e=Se.user,de=Se.globalSetting;return{graduation:Le,globalSetting:de,user:_e,loading:ye.effects}})(ke)},"55Ip":function(Ze,Te,Z){"use strict";Z.d(Te,"a",function(){return s});var oe=Z("Ty5D"),$=Z("dI71"),M=Z("q1tI"),X=Z.n(M),B=Z("YS25"),P=Z("17x9"),W=Z.n(P),H=Z("wx14"),i=Z("zLVn"),L=Z("9R94"),v=function(w){Object($.a)(E,w);function E(){for(var x,y=arguments.length,g=new Array(y),F=0;F<y;F++)g[F]=arguments[F];return x=w.call.apply(w,[this].concat(g))||this,x.history=Object(B.a)(x.props),x}var c=E.prototype;return c.render=function(){return X.a.createElement(oe.c,{history:this.history,children:this.props.children})},E}(X.a.Component),m=function(w){Object($.a)(E,w);function E(){for(var x,y=arguments.length,g=new Array(y),F=0;F<y;F++)g[F]=arguments[F];return x=w.call.apply(w,[this].concat(g))||this,x.history=Object(B.b)(x.props),x}var c=E.prototype;return c.render=function(){return X.a.createElement(oe.c,{history:this.history,children:this.props.children})},E}(X.a.Component),p=function(E,c){return typeof E=="function"?E(c):E},l=function(E,c){return typeof E=="string"?Object(B.c)(E,null,null,c):E},h=function(E){return E},f=X.a.forwardRef;typeof f=="undefined"&&(f=h);function o(w){return!!(w.metaKey||w.altKey||w.ctrlKey||w.shiftKey)}var u=f(function(w,E){var c=w.innerRef,x=w.navigate,y=w.onClick,g=Object(i.a)(w,["innerRef","navigate","onClick"]),F=g.target,U=Object(H.a)({},g,{onClick:function(j){try{y&&y(j)}catch(N){throw j.preventDefault(),N}!j.defaultPrevented&&j.button===0&&(!F||F==="_self")&&!o(j)&&(j.preventDefault(),x())}});return h!==f?U.ref=E||c:U.ref=c,X.a.createElement("a",U)}),s=f(function(w,E){var c=w.component,x=c===void 0?u:c,y=w.replace,g=w.to,F=w.innerRef,U=Object(i.a)(w,["component","replace","to","innerRef"]);return X.a.createElement(oe.e.Consumer,null,function(A){A||Object(L.a)(!1);var j=A.history,N=l(p(g,A.location),A.location),b=N?j.createHref(N):"",Y=Object(H.a)({},U,{href:b,navigate:function(){var fe=p(g,A.location),ve=y?j.replace:j.push;ve(fe)}});return h!==f?Y.ref=E||F:Y.innerRef=F,X.a.createElement(x,Y)})});if(!1)var a,C;var _=function(E){return E},T=X.a.forwardRef;typeof T=="undefined"&&(T=_);function R(){for(var w=arguments.length,E=new Array(w),c=0;c<w;c++)E[c]=arguments[c];return E.filter(function(x){return x}).join(" ")}var O=T(function(w,E){var c=w["aria-current"],x=c===void 0?"page":c,y=w.activeClassName,g=y===void 0?"active":y,F=w.activeStyle,U=w.className,A=w.exact,j=w.isActive,N=w.location,b=w.sensitive,Y=w.strict,re=w.style,fe=w.to,ve=w.innerRef,ke=Object(i.a)(w,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return X.a.createElement(oe.e.Consumer,null,function(Se){Se||Object(L.a)(!1);var Le=N||Se.location,ye=l(p(fe,Le),Le),_e=ye.pathname,de=_e&&_e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),z=de?Object(oe.f)(Le.pathname,{path:de,exact:A,sensitive:b,strict:Y}):null,D=!!(j?j(z,Le):z),I=D?R(U,g):U,V=D?Object(H.a)({},re,{},F):re,Q=Object(H.a)({"aria-current":D&&x||null,className:I,style:V,to:ye},ke);return _!==T?Q.ref=E||ve:Q.innerRef=ve,X.a.createElement(s,Q)})});if(!1)var S},"5VLF":function(Ze,Te,Z){"use strict";var oe,$;function M(X,B,P){var W=function(H,i){return X.js_beautify(H,i)};return W.js=X.js_beautify,W.css=B.css_beautify,W.html=P.html_beautify,W.js_beautify=X.js_beautify,W.css_beautify=B.css_beautify,W.html_beautify=P.html_beautify,W}!(oe=[Z("6UM0"),Z("TXwP"),Z("psGv")],$=function(X,B,P){return M(X,B,P)}.apply(Te,oe),$!==void 0&&(Ze.exports=$))},"5Y4S":function(Ze,Te,Z){"use strict";Z.d(Te,"a",function(){return M});var oe=Z("MNsG");const $=oe.b.performance&&typeof oe.b.performance.now=="function";class M{constructor(X){this._highResolution=$&&X,this._startTime=this._now(),this._stopTime=-1}static create(X=!0){return new M(X)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?oe.b.performance.now():Date.now()}}},"6UM0":function(Ze,Te,Z){var oe,$;(function(){var M;(function(){"use strict";var B=[function(i,L,v){var m=v(1).Beautifier,p=v(5).Options;function l(h,f){var o=new m(h,f);return o.beautify()}i.exports=l,i.exports.defaultOptions=function(){return new p}},function(i,L,v){var m=v(2).Output,p=v(3).Token,l=v(4),h=v(5).Options,f=v(7).Tokenizer,o=v(7).line_starters,u=v(7).positionable_operators,s=v(7).TOKEN;function a(b,Y){return Y.indexOf(b)!==-1}function C(b){return b.replace(/^\s+/g,"")}function _(b){for(var Y={},re=0;re<b.length;re++)Y[b[re].replace(/-/g,"_")]=b[re];return Y}function T(b,Y){return b&&b.type===s.RESERVED&&b.text===Y}function R(b,Y){return b&&b.type===s.RESERVED&&a(b.text,Y)}var O=["case","return","do","if","throw","else","await","break","continue","async"],S=["before-newline","after-newline","preserve-newline"],w=_(S),E=[w.before_newline,w.preserve_newline],c={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function x(b,Y){if(Y.multiline_frame||Y.mode===c.ForInitializer||Y.mode===c.Conditional)return;b.remove_indent(Y.start_line_index)}function y(b){b=b.replace(l.allLineBreaks,`
|
|
`);for(var Y=[],re=b.indexOf(`
|
|
`);re!==-1;)Y.push(b.substring(0,re)),b=b.substring(re+1),re=b.indexOf(`
|
|
`);return b.length&&Y.push(b),Y}function g(b){return b===c.ArrayLiteral}function F(b){return a(b,[c.Expression,c.ForInitializer,c.Conditional])}function U(b,Y){for(var re=0;re<b.length;re++){var fe=b[re].trim();if(fe.charAt(0)!==Y)return!1}return!0}function A(b,Y){for(var re=0,fe=b.length,ve;re<fe;re++)if(ve=b[re],ve&&ve.indexOf(Y)!==0)return!1;return!0}function j(b,Y){Y=Y||{},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 h(Y)}j.prototype.create_flags=function(b,Y){var re=0;b&&(re=b.indentation_level,!this._output.just_added_newline()&&b.line_indent_level>re&&(re=b.line_indent_level));var fe={mode:Y,parent:b,last_token:b?b.last_token:new p(s.START_BLOCK,""),last_word:b?b.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:re,alignment:0,line_indent_level:b?b.line_indent_level:re,start_line_index:this._output.get_line_number(),ternary_depth:0};return fe},j.prototype._reset=function(b){var Y=b.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,Y),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(c.BlockStatement);var re=new f(b,this._options);return this._tokens=re.tokenize(),b},j.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var b,Y=this._reset(this._source_text),re=this._options.eol;this._options.eol==="auto"&&(re=`
|
|
`,Y&&l.lineBreak.test(Y||"")&&(re=Y.match(l.lineBreak)[0]));for(var fe=this._tokens.next();fe;)this.handle_token(fe),this._last_last_text=this._flags.last_token.text,this._flags.last_token=fe,fe=this._tokens.next();return b=this._output.get_code(re),b},j.prototype.handle_token=function(b,Y){b.type===s.START_EXPR?this.handle_start_expr(b):b.type===s.END_EXPR?this.handle_end_expr(b):b.type===s.START_BLOCK?this.handle_start_block(b):b.type===s.END_BLOCK?this.handle_end_block(b):b.type===s.WORD?this.handle_word(b):b.type===s.RESERVED?this.handle_word(b):b.type===s.SEMICOLON?this.handle_semicolon(b):b.type===s.STRING?this.handle_string(b):b.type===s.EQUALS?this.handle_equals(b):b.type===s.OPERATOR?this.handle_operator(b):b.type===s.COMMA?this.handle_comma(b):b.type===s.BLOCK_COMMENT?this.handle_block_comment(b,Y):b.type===s.COMMENT?this.handle_comment(b,Y):b.type===s.DOT?this.handle_dot(b):b.type===s.EOF?this.handle_eof(b):b.type===s.UNKNOWN?this.handle_unknown(b,Y):this.handle_unknown(b,Y)},j.prototype.handle_whitespace_and_comments=function(b,Y){var re=b.newlines,fe=this._options.keep_array_indentation&&g(this._flags.mode);if(b.comments_before)for(var ve=b.comments_before.next();ve;)this.handle_whitespace_and_comments(ve,Y),this.handle_token(ve,Y),ve=b.comments_before.next();if(fe)for(var ke=0;ke<re;ke+=1)this.print_newline(ke>0,Y);else if(this._options.max_preserve_newlines&&re>this._options.max_preserve_newlines&&(re=this._options.max_preserve_newlines),this._options.preserve_newlines&&re>1){this.print_newline(!1,Y);for(var Se=1;Se<re;Se+=1)this.print_newline(!0,Y)}};var N=["async","break","continue","return","throw","yield"];j.prototype.allow_wrap_or_preserved_newline=function(b,Y){if(Y=Y===void 0?!1:Y,this._output.just_added_newline())return;var re=this._options.preserve_newlines&&b.newlines||Y,fe=a(this._flags.last_token.text,u)||a(b.text,u);if(fe){var ve=a(this._flags.last_token.text,u)&&a(this._options.operator_position,E)||a(b.text,u);re=re&&ve}if(re)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(R(this._flags.last_token,N))return;this._output.set_wrap_point()}},j.prototype.print_newline=function(b,Y){if(!Y&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var re=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&T(re,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(b)&&(this._flags.multiline_frame=!0)},j.prototype.print_token_line_indentation=function(b){this._output.just_added_newline()&&(this._options.keep_array_indentation&&b.newlines&&(b.text==="["||g(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===s.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var Y=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(Y),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(b),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(b),this._output.non_breaking_space=!0,this._output.add_token(b.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},j.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},j.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},j.prototype.set_mode=function(b){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,b),this._flags=this.create_flags(this._previous_flags,b),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},j.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===c.Statement&&x(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},j.prototype.start_of_object_property=function(){return this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"]))},j.prototype.start_of_statement=function(b){var Y=!1;return Y=Y||R(this._flags.last_token,["var","let","const"])&&b.type===s.WORD,Y=Y||T(this._flags.last_token,"do"),Y=Y||!(this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement)&&R(this._flags.last_token,N)&&!b.newlines,Y=Y||T(this._flags.last_token,"else")&&!(T(b,"if")&&!b.comments_before),Y=Y||this._flags.last_token.type===s.END_EXPR&&(this._previous_flags.mode===c.ForInitializer||this._previous_flags.mode===c.Conditional),Y=Y||this._flags.last_token.type===s.WORD&&this._flags.mode===c.BlockStatement&&!this._flags.in_case&&!(b.text==="--"||b.text==="++")&&this._last_last_text!=="function"&&b.type!==s.WORD&&b.type!==s.RESERVED,Y=Y||this._flags.mode===c.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"])),Y?(this.set_mode(c.Statement),this.indent(),this.handle_whitespace_and_comments(b,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b,R(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 Y=c.Expression;if(b.text==="["){if(this._flags.last_token.type===s.WORD||this._flags.last_token.text===")"){R(this._flags.last_token,o)&&(this._output.space_before_token=!0),this.print_token(b),this.set_mode(Y),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}Y=c.ArrayLiteral,g(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())),a(this._flags.last_token.type,[s.START_EXPR,s.END_EXPR,s.WORD,s.OPERATOR,s.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===s.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,Y=c.ForInitializer):a(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,Y=c.Conditional):a(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:(a(this._flags.last_token.text,o)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b);else if(this._flags.last_token.type===s.WORD){this._output.space_before_token=!1;var re=this._tokens.peek(-3);if(this._options.space_after_named_function&&re){var fe=this._tokens.peek(-4);R(re,["async","function"])||re.text==="*"&&R(fe,["async","function"])?this._output.space_before_token=!0:this._flags.mode===c.ObjectLiteral?(re.text==="{"||re.text===","||re.text==="*"&&(fe.text==="{"||fe.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===s.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(a(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&a(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===s.START_BLOCK?this.print_newline():(this._flags.last_token.type===s.END_EXPR||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===s.COMMA)&&this.allow_wrap_or_preserved_newline(b,b.newlines),this.print_token(b),this.set_mode(Y),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},j.prototype.handle_end_expr=function(b){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(b),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(b,b.text==="]"&&g(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===s.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(b),this.restore_mode(),x(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===c.Conditional&&(this._previous_flags.mode=c.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},j.prototype.handle_start_block=function(b){this.handle_whitespace_and_comments(b);var Y=this._tokens.peek(),re=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===s.END_EXPR?(this.set_mode(c.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(c.BlockStatement):re&&(a(re.text,[":",","])&&a(Y.type,[s.STRING,s.WORD,s.RESERVED])||a(Y.text,["get","set","..."])&&a(re.type,[s.WORD,s.RESERVED]))?a(this._last_last_text,["class","interface"])&&!a(re.text,[":",","])?this.set_mode(c.BlockStatement):this.set_mode(c.ObjectLiteral):this._flags.last_token.type===s.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(c.BlockStatement):a(this._flags.last_token.type,[s.EQUALS,s.START_EXPR,s.COMMA,s.OPERATOR])||R(this._flags.last_token,["return","throw","import","default"])?this.set_mode(c.ObjectLiteral):this.set_mode(c.BlockStatement),this._flags.last_token&&(R(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var fe=!Y.comments_before&&Y.text==="}",ve=fe&&this._flags.last_word==="function"&&this._flags.last_token.type===s.END_EXPR;if(this._options.brace_preserve_inline){var ke=0,Se=null;this._flags.inline_frame=!0;do if(ke+=1,Se=this._tokens.peek(ke-1),Se.newlines){this._flags.inline_frame=!1;break}while(Se.type!==s.EOF&&!(Se.type===s.END_BLOCK&&Se.opened===b))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&b.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==s.OPERATOR&&(ve||this._flags.last_token.type===s.EQUALS||R(this._flags.last_token,O)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(g(this._previous_flags.mode)&&(this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.COMMA)&&((this._flags.last_token.type===s.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.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!==s.OPERATOR&&this._flags.last_token.type!==s.START_EXPR&&(this._flags.last_token.type===s.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(b),this.indent(),!fe&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},j.prototype.handle_end_block=function(b){for(this.handle_whitespace_and_comments(b);this._flags.mode===c.Statement;)this.restore_mode();var Y=this._flags.last_token.type===s.START_BLOCK;this._flags.inline_frame&&!Y?this._output.space_before_token=!0:this._options.brace_style==="expand"?Y||this.print_newline():Y||(g(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===s.RESERVED){if(a(b.text,["set","get"])&&this._flags.mode!==c.ObjectLiteral)b.type=s.WORD;else if(b.text==="import"&&a(this._tokens.peek().text,["(","."]))b.type=s.WORD;else if(a(b.text,["as","from"])&&!this._flags.import_block)b.type=s.WORD;else if(this._flags.mode===c.ObjectLiteral){var Y=this._tokens.peek();Y.text===":"&&(b.type=s.WORD)}}if(this.start_of_statement(b)?R(this._flags.last_token,["var","let","const"])&&b.type===s.WORD&&(this._flags.declaration_statement=!0):b.newlines&&!F(this._flags.mode)&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==s.EQUALS&&(this._options.preserve_newlines||!R(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(T(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&&T(b,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===c.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&R(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===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b)),T(b,"function")){(a(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(a(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===s.OPERATOR))&&(!this._output.just_added_blankline()&&!b.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD?R(this._flags.last_token,["get","set","new","export"])||R(this._flags.last_token,N)?this._output.space_before_token=!0:T(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===s.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(F(this._flags.mode)||g(this._flags.mode))||this.print_newline(),this.print_token(b),this._flags.last_word=b.text;return}var re="NONE";if(this._flags.last_token.type===s.END_BLOCK?this._previous_flags.inline_frame?re="SPACE":R(b,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&b.newlines?re="NEWLINE":(re="SPACE",this._output.space_before_token=!0):re="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&this._flags.mode===c.BlockStatement?re="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&F(this._flags.mode)?re="SPACE":this._flags.last_token.type===s.STRING?re="NEWLINE":this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.last_token.text==="*"&&(a(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&a(this._last_last_text,["{",","]))?re="SPACE":this._flags.last_token.type===s.START_BLOCK?this._flags.inline_frame?re="SPACE":re="NEWLINE":this._flags.last_token.type===s.END_EXPR&&(this._output.space_before_token=!0,re="NEWLINE"),R(b,o)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?re="SPACE":re="NEWLINE"),R(b,["else","catch","finally"]))if((!(this._flags.last_token.type===s.END_BLOCK&&this._previous_flags.mode===c.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&b.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var fe=this._output.current_line;fe.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else re==="NEWLINE"?R(this._flags.last_token,O)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&R(b,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==s.END_EXPR?(this._flags.last_token.type!==s.START_EXPR||!R(b,["var","let","const"]))&&this._flags.last_token.text!==":"&&(T(b,"if")&&T(b.previous,"else")?this._output.space_before_token=!0:this.print_newline()):R(b,o)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&g(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():re==="SPACE"&&(this._output.space_before_token=!0);b.previous&&(b.previous.type===s.WORD||b.previous.type===s.RESERVED)&&(this._output.space_before_token=!0),this.print_token(b),this._flags.last_word=b.text,b.type===s.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&&T(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 Y=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&T(Y,"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===s.WORD)||(this.start_of_statement(b)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(b),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b):b.text.startsWith("`")&&this._flags.last_token.type===s.END_EXPR&&(b.previous.text==="]"||b.previous.text===")")&&b.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(b)},j.prototype.handle_equals=function(b){this.start_of_statement(b)||this.handle_whitespace_and_comments(b),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(b),this._output.space_before_token=!0},j.prototype.handle_comma=function(b){this.handle_whitespace_and_comments(b,!0),this.print_token(b),this._output.space_before_token=!0,this._flags.declaration_statement?(F(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(b)):this._flags.mode===c.ObjectLiteral||this._flags.mode===c.Statement&&this._flags.parent.mode===c.ObjectLiteral?(this._flags.mode===c.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(b)},j.prototype.handle_operator=function(b){var Y=b.text==="*"&&(R(this._flags.last_token,["function","yield"])||a(this._flags.last_token.type,[s.START_BLOCK,s.COMMA,s.END_BLOCK,s.SEMICOLON])),re=a(b.text,["-","+"])&&(a(this._flags.last_token.type,[s.START_BLOCK,s.START_EXPR,s.EQUALS,s.OPERATOR])||a(this._flags.last_token.text,o)||this._flags.last_token.text===",");if(!this.start_of_statement(b)){var fe=!Y;this.handle_whitespace_and_comments(b,fe)}if(b.text==="*"&&this._flags.last_token.type===s.DOT){this.print_token(b);return}if(b.text==="::"){this.print_token(b);return}if(this._flags.last_token.type===s.OPERATOR&&a(this._options.operator_position,E)&&this.allow_wrap_or_preserved_newline(b),b.text===":"&&this._flags.in_case){this.print_token(b),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==s.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 ve=!0,ke=!0,Se=!1;if(b.text===":"?this._flags.ternary_depth===0?ve=!1:(this._flags.ternary_depth-=1,Se=!0):b.text==="?"&&(this._flags.ternary_depth+=1),!re&&!Y&&this._options.preserve_newlines&&a(b.text,u)){var Le=b.text===":",ye=Le&&Se,_e=Le&&!Se;switch(this._options.operator_position){case w.before_newline:this._output.space_before_token=!_e,this.print_token(b),(!Le||ye)&&this.allow_wrap_or_preserved_newline(b),this._output.space_before_token=!0;return;case w.after_newline:this._output.space_before_token=!0,!Le||ye?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:_e||this.allow_wrap_or_preserved_newline(b),ve=!(this._output.just_added_newline()||_e),this._output.space_before_token=ve,this.print_token(b),this._output.space_before_token=!0;return}}if(Y){this.allow_wrap_or_preserved_newline(b),ve=!1;var de=this._tokens.peek();ke=de&&a(de.type,[s.WORD,s.RESERVED])}else if(b.text==="...")this.allow_wrap_or_preserved_newline(b),ve=this._flags.last_token.type===s.START_BLOCK,ke=!1;else if(a(b.text,["--","++","!","~"])||re){if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR)&&this.allow_wrap_or_preserved_newline(b),ve=!1,ke=!1,b.newlines&&(b.text==="--"||b.text==="++"||b.text==="~")){var z=R(this._flags.last_token,O)&&b.newlines;z&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(z,!0)}this._flags.last_token.text===";"&&F(this._flags.mode)&&(ve=!0),this._flags.last_token.type===s.RESERVED?ve=!0:this._flags.last_token.type===s.END_EXPR?ve=!(this._flags.last_token.text==="]"&&(b.text==="--"||b.text==="++")):this._flags.last_token.type===s.OPERATOR&&(ve=a(b.text,["--","-","++","+"])&&a(this._flags.last_token.text,["--","-","++","+"]),a(b.text,["+","-"])&&a(this._flags.last_token.text,["--","++"])&&(ke=!0)),(this._flags.mode===c.BlockStatement&&!this._flags.inline_frame||this._flags.mode===c.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ve,this.print_token(b),this._output.space_before_token=ke},j.prototype.handle_block_comment=function(b,Y){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,Y),this.print_token(b),b.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!l.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,Y)},j.prototype.print_block_commment=function(b,Y){var re=y(b.text),fe,ve=!1,ke=!1,Se=b.whitespace_before,Le=Se.length;if(this.print_newline(!1,Y),this.print_token_line_indentation(b),this._output.add_token(re[0]),this.print_newline(!1,Y),re.length>1){for(re=re.slice(1),ve=U(re,"*"),ke=A(re,Se),ve&&(this._flags.alignment=1),fe=0;fe<re.length;fe++)ve?(this.print_token_line_indentation(b),this._output.add_token(C(re[fe]))):ke&&re[fe]?(this.print_token_line_indentation(b),this._output.add_token(re[fe].substring(Le))):(this._output.current_line.set_indent(-1),this._output.add_token(re[fe])),this.print_newline(!1,Y);this._flags.alignment=0}},j.prototype.handle_comment=function(b,Y){b.newlines?this.print_newline(!1,Y):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(b),this.print_newline(!1,Y)},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),R(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,Y){this.print_token(b),b.text[b.text.length-1]===`
|
|
`&&this.print_newline(!1,Y)},j.prototype.handle_eof=function(b){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(b)},i.exports.Beautifier=j},function(i){function L(p){this.__parent=p,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}L.prototype.clone_empty=function(){var p=new L(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},L.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},L.prototype.has_match=function(p){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(p))return!0;return!1},L.prototype.set_indent=function(p,l){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},L.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},L.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},L.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},L.prototype.is_empty=function(){return this.__items.length===0},L.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},L.prototype.push=function(p){this.__items.push(p);var l=p.lastIndexOf(`
|
|
`);l!==-1?this.__character_count=p.length-l:this.__character_count+=p.length},L.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},L.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},L.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},L.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},L.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function v(p,l){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),l=l||"",p.indent_level>0&&(l=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}v.prototype.get_indent_size=function(p,l){var h=this.__base_string_length;return l=l||0,p<0&&(h=0),h+=p*this.__indent_size,h+=l,h},v.prototype.get_indent_string=function(p,l){var h=this.__base_string;return l=l||0,p<0&&(p=0,h=""),l+=p*this.__indent_size,this.__ensure_cache(l),h+=this.__cache[l],h},v.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var p=this.__cache.length,l=0,h="";this.__indent_size&&p>=this.__indent_size&&(l=Math.floor(p/this.__indent_size),p-=l*this.__indent_size,h=new Array(l+1).join(this.__indent_string)),p&&(h+=new Array(p+1).join(" ")),this.__cache.push(h)};function m(p,l){this.__indent_cache=new v(p,l),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new L(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(p,l){return this.__indent_cache.get_indent_string(p,l)},m.prototype.get_indent_size=function(p,l){return this.__indent_cache.get_indent_size(p,l)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(p){this.trim(!0);var l=this.current_line.pop();l&&(l[l.length-1]===`
|
|
`&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var h=this.__lines.join(`
|
|
`);return p!==`
|
|
`&&(h=h.replace(/[\n]/g,p)),h},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,l){return p=p||0,l=l||0,this.next_line.set_indent(p,l),this.__lines.length>1?(this.current_line.set_indent(p,l),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var l=0;l<p.newlines;l++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},m.prototype.remove_indent=function(p){for(var l=this.__lines.length;p<l;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(p,l){for(var h=this.__lines.length-2;h>=0;){var f=this.__lines[h];if(f.is_empty())break;if(f.item(0).indexOf(p)!==0&&f.item(-1)!==l){this.__lines.splice(h+1,0,new L(this)),this.previous_line=this.__lines[this.__lines.length-2];break}h--}},i.exports.Output=m},function(i){function L(v,m,p,l){this.type=v,this.text=m,this.comments_before=null,this.newlines=p||0,this.whitespace_before=l||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}i.exports.Token=L},function(i,L){var v="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",l="\\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",h="(?:\\\\u[0-9a-fA-F]{4}|["+v+p+"])",f="(?:\\\\u[0-9a-fA-F]{4}|["+m+p+l+"])*";L.identifier=new RegExp(h+f,"g"),L.identifierStart=new RegExp(h),L.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+p+l+"])+");var o=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;L.newline=/[\n\r\u2028\u2029]/,L.lineBreak=new RegExp(`\r
|
|
|`+L.newline.source),L.allLineBreaks=new RegExp(L.lineBreak.source,"g")},function(i,L,v){var m=v(6).Options,p=["before-newline","after-newline","preserve-newline"];function l(h){m.call(this,h,"js");var f=this.raw_options.brace_style||null;f==="expand-strict"?this.raw_options.brace_style="expand":f==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var o=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var u=0;u<o.length;u++)o[u]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=o[u];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",p),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}l.prototype=new m,i.exports.Options=l},function(i){function L(p,l){this.raw_options=v(p,l),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}L.prototype._get_array=function(p,l){var h=this.raw_options[p],f=l||[];return typeof h=="object"?h!==null&&typeof h.concat=="function"&&(f=h.concat()):typeof h=="string"&&(f=h.split(/[^a-zA-Z0-9_\/\-]+/)),f},L.prototype._get_boolean=function(p,l){var h=this.raw_options[p],f=h===void 0?!!l:!!h;return f},L.prototype._get_characters=function(p,l){var h=this.raw_options[p],f=l||"";return typeof h=="string"&&(f=h.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),f},L.prototype._get_number=function(p,l){var h=this.raw_options[p];l=parseInt(l,10),isNaN(l)&&(l=0);var f=parseInt(h,10);return isNaN(f)&&(f=l),f},L.prototype._get_selection=function(p,l,h){var f=this._get_selection_list(p,l,h);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
|
|
`+l+`
|
|
You passed in: '`+this.raw_options[p]+"'");return f[0]},L.prototype._get_selection_list=function(p,l,h){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(h=h||[l[0]],!this._is_valid_selection(h,l))throw new Error("Invalid Default Value!");var f=this._get_array(p,h);if(!this._is_valid_selection(f,l))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
|
|
`+l+`
|
|
You passed in: '`+this.raw_options[p]+"'");return f},L.prototype._is_valid_selection=function(p,l){return p.length&&l.length&&!p.some(function(h){return l.indexOf(h)===-1})};function v(p,l){var h={};p=m(p);var f;for(f in p)f!==l&&(h[f]=p[f]);if(l&&p[l])for(f in p[l])h[f]=p[l][f];return h}function m(p){var l={},h;for(h in p){var f=h.replace(/-/g,"_");l[f]=p[h]}return l}i.exports.Options=L,i.exports.normalizeOpts=m,i.exports.mergeOpts=v},function(i,L,v){var m=v(8).InputScanner,p=v(9).Tokenizer,l=v(9).TOKEN,h=v(13).Directives,f=v(4),o=v(12).Pattern,u=v(14).TemplatablePattern;function s(U,A){return A.indexOf(U)!==-1}var a={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:l.START,RAW:l.RAW,EOF:l.EOF},C=new h(/\/\*/,/\*\//),_=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,T=/[0-9]/,R=/[^\d\.]/,O=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),S=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";S=S.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),S="\\?\\.(?!\\d) "+S,S=S.replace(/ /g,"|");var w=new RegExp(S),E="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),c=E.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),x=new RegExp("^(?:"+c.join("|")+")$"),y,g=function(U,A){p.call(this,U,A),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var j=new o(this._input),N=new u(this._input).read_options(this._options);this.__patterns={template:N,identifier:N.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:N.until(/['\\\n\r\u2028\u2029]/),double_quote:N.until(/["\\\n\r\u2028\u2029]/),template_text:N.until(/[`\\$]/),template_expression:N.until(/[`}\\]/)}};g.prototype=new p,g.prototype._is_comment=function(U){return U.type===a.COMMENT||U.type===a.BLOCK_COMMENT||U.type===a.UNKNOWN},g.prototype._is_opening=function(U){return U.type===a.START_BLOCK||U.type===a.START_EXPR},g.prototype._is_closing=function(U,A){return(U.type===a.END_BLOCK||U.type===a.END_EXPR)&&A&&(U.text==="]"&&A.text==="["||U.text===")"&&A.text==="("||U.text==="}"&&A.text==="{")},g.prototype._reset=function(){y=!1},g.prototype._get_next_token=function(U,A){var j=null;this._readWhitespace();var N=this._input.peek();return N===null?this._create_token(a.EOF,""):(j=j||this._read_non_javascript(N),j=j||this._read_string(N),j=j||this._read_word(U),j=j||this._read_singles(N),j=j||this._read_comment(N),j=j||this._read_regexp(N,U),j=j||this._read_xml(N,U),j=j||this._read_punctuation(),j=j||this._create_token(a.UNKNOWN,this._input.next()),j)},g.prototype._read_word=function(U){var A;if(A=this.__patterns.identifier.read(),A!=="")return A=A.replace(f.allLineBreaks,`
|
|
`),!(U.type===a.DOT||U.type===a.RESERVED&&(U.text==="set"||U.text==="get"))&&x.test(A)?(A==="in"||A==="of")&&(U.type===a.WORD||U.type===a.STRING)?this._create_token(a.OPERATOR,A):this._create_token(a.RESERVED,A):this._create_token(a.WORD,A);if(A=this.__patterns.number.read(),A!=="")return this._create_token(a.WORD,A)},g.prototype._read_singles=function(U){var A=null;return U==="("||U==="["?A=this._create_token(a.START_EXPR,U):U===")"||U==="]"?A=this._create_token(a.END_EXPR,U):U==="{"?A=this._create_token(a.START_BLOCK,U):U==="}"?A=this._create_token(a.END_BLOCK,U):U===";"?A=this._create_token(a.SEMICOLON,U):U==="."&&R.test(this._input.peek(1))?A=this._create_token(a.DOT,U):U===","&&(A=this._create_token(a.COMMA,U)),A&&this._input.next(),A},g.prototype._read_punctuation=function(){var U=this.__patterns.punct.read();if(U!=="")return U==="="?this._create_token(a.EQUALS,U):U==="?."?this._create_token(a.DOT,U):this._create_token(a.OPERATOR,U)},g.prototype._read_non_javascript=function(U){var A="";if(U==="#"){if(this._is_first_token()&&(A=this.__patterns.shebang.read(),A))return this._create_token(a.UNKNOWN,A.trim()+`
|
|
`);if(A=this.__patterns.include.read(),A)return this._create_token(a.UNKNOWN,A.trim()+`
|
|
`);U=this._input.next();var j="#";if(this._input.hasNext()&&this._input.testChar(T)){do U=this._input.next(),j+=U;while(this._input.hasNext()&&U!=="#"&&U!=="=");return U==="#"||(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(a.WORD,j)}this._input.back()}else if(U==="<"&&this._is_first_token()){if(A=this.__patterns.html_comment_start.read(),A){for(;this._input.hasNext()&&!this._input.testChar(f.newline);)A+=this._input.next();return y=!0,this._create_token(a.COMMENT,A)}}else if(y&&U==="-"&&(A=this.__patterns.html_comment_end.read(),A))return y=!1,this._create_token(a.COMMENT,A);return null},g.prototype._read_comment=function(U){var A=null;if(U==="/"){var j="";if(this._input.peek(1)==="*"){j=this.__patterns.block_comment.read();var N=C.get_directives(j);N&&N.ignore==="start"&&(j+=C.readIgnored(this._input)),j=j.replace(f.allLineBreaks,`
|
|
`),A=this._create_token(a.BLOCK_COMMENT,j),A.directives=N}else this._input.peek(1)==="/"&&(j=this.__patterns.comment.read(),A=this._create_token(a.COMMENT,j))}return A},g.prototype._read_string=function(U){if(U==="`"||U==="'"||U==='"'){var A=this._input.next();return this.has_char_escapes=!1,U==="`"?A+=this._read_string_recursive("`",!0,"${"):A+=this._read_string_recursive(U),this.has_char_escapes&&this._options.unescape_strings&&(A=F(A)),this._input.peek()===U&&(A+=this._input.next()),A=A.replace(f.allLineBreaks,`
|
|
`),this._create_token(a.STRING,A)}return null},g.prototype._allow_regexp_or_xml=function(U){return U.type===a.RESERVED&&s(U.text,["return","case","throw","else","do","typeof","yield"])||U.type===a.END_EXPR&&U.text===")"&&U.opened.previous.type===a.RESERVED&&s(U.opened.previous.text,["if","while","for"])||s(U.type,[a.COMMENT,a.START_EXPR,a.START_BLOCK,a.START,a.END_BLOCK,a.OPERATOR,a.EQUALS,a.EOF,a.SEMICOLON,a.COMMA])},g.prototype._read_regexp=function(U,A){if(U==="/"&&this._allow_regexp_or_xml(A)){for(var j=this._input.next(),N=!1,b=!1;this._input.hasNext()&&(N||b||this._input.peek()!==U)&&!this._input.testChar(f.newline);)j+=this._input.peek(),N?N=!1:(N=this._input.peek()==="\\",this._input.peek()==="["?b=!0:this._input.peek()==="]"&&(b=!1)),this._input.next();return this._input.peek()===U&&(j+=this._input.next(),j+=this._input.read(f.identifier)),this._create_token(a.STRING,j)}return null},g.prototype._read_xml=function(U,A){if(this._options.e4x&&U==="<"&&this._allow_regexp_or_xml(A)){var j="",N=this.__patterns.xml.read_match();if(N){for(var b=N[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),Y=b.indexOf("{")===0,re=0;N;){var fe=!!N[1],ve=N[2],ke=!!N[N.length-1]||ve.slice(0,8)==="![CDATA[";if(!ke&&(ve===b||Y&&ve.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(fe?--re:++re),j+=N[0],re<=0)break;N=this.__patterns.xml.read_match()}return N||(j+=this._input.match(/[\s\S]*/g)[0]),j=j.replace(f.allLineBreaks,`
|
|
`),this._create_token(a.STRING,j)}}return null};function F(U){for(var A="",j=0,N=new m(U),b=null;N.hasNext();)if(b=N.match(/([\s]|[^\\]|\\\\)+/g),b&&(A+=b[0]),N.peek()==="\\"){if(N.next(),N.peek()==="x")b=N.match(/x([0-9A-Fa-f]{2})/g);else if(N.peek()==="u")b=N.match(/u([0-9A-Fa-f]{4})/g);else{A+="\\",N.hasNext()&&(A+=N.next());continue}if(!b)return U;if(j=parseInt(b[1],16),j>126&&j<=255&&b[0].indexOf("x")===0)return U;if(j>=0&&j<32){A+="\\"+b[0];continue}else j===34||j===39||j===92?A+="\\"+String.fromCharCode(j):A+=String.fromCharCode(j)}return A}g.prototype._read_string_recursive=function(U,A,j){var N,b;U==="'"?b=this.__patterns.single_quote:U==='"'?b=this.__patterns.double_quote:U==="`"?b=this.__patterns.template_text:U==="}"&&(b=this.__patterns.template_expression);for(var Y=b.read(),re="";this._input.hasNext();){if(re=this._input.next(),re===U||!A&&f.newline.test(re)){this._input.back();break}else re==="\\"&&this._input.hasNext()?(N=this._input.peek(),N==="x"||N==="u"?this.has_char_escapes=!0:N==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),re+=this._input.next()):j&&(j==="${"&&re==="$"&&this._input.peek()==="{"&&(re+=this._input.next()),j===re&&(U==="`"?re+=this._read_string_recursive("}",A,"`"):re+=this._read_string_recursive("`",A,"${"),this._input.hasNext()&&(re+=this._input.next())));re+=b.read(),Y+=re}return Y},i.exports.Tokenizer=g,i.exports.TOKEN=a,i.exports.positionable_operators=O.slice(),i.exports.line_starters=E.slice()},function(i){var L=RegExp.prototype.hasOwnProperty("sticky");function v(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position<this.__input_length},v.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},v.prototype.peek=function(m){var p=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(p=this.__input.charAt(m)),p},v.prototype.__match=function(m,p){m.lastIndex=p;var l=m.exec(this.__input);return l&&!(L&&m.sticky)&&(l.index!==p&&(l=null)),l},v.prototype.test=function(m,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(m,p):!1},v.prototype.testChar=function(m,p){var l=this.peek(p);return m.lastIndex=0,l!==null&&m.test(l)},v.prototype.match=function(m){var p=this.__match(m,this.__position);return p?this.__position+=p[0].length:p=null,p},v.prototype.read=function(m,p,l){var h="",f;return m&&(f=this.match(m),f&&(h+=f[0])),p&&(f||!m)&&(h+=this.readUntil(p,l)),h},v.prototype.readUntil=function(m,p){var l="",h=this.__position;m.lastIndex=this.__position;var f=m.exec(this.__input);return f?(h=f.index,p&&(h+=f[0].length)):h=this.__input_length,l=this.__input.substring(this.__position,h),this.__position=h,l},v.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},v.prototype.get_regexp=function(m,p){var l=null,h="g";return p&&L&&(h="y"),typeof m=="string"&&m!==""?l=new RegExp(m,h):m&&(l=new RegExp(m.source,h)),l},v.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(m){var p=this.__position,l=this.readUntilAfter(m);return this.__position=p,l},v.prototype.lookBack=function(m){var p=this.__position-1;return p>=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},i.exports.InputScanner=v},function(i,L,v){var m=v(8).InputScanner,p=v(3).Token,l=v(10).TokenStream,h=v(11).WhitespacePattern,f={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(u,s){this._input=new m(u),this._options=s||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new h(this._input)};o.prototype.tokenize=function(){this._input.restart(),this.__tokens=new l,this._reset();for(var u,s=new p(f.START,""),a=null,C=[],_=new l;s.type!==f.EOF;){for(u=this._get_next_token(s,a);this._is_comment(u);)_.add(u),u=this._get_next_token(s,a);_.isEmpty()||(u.comments_before=_,_=new l),u.parent=a,this._is_opening(u)?(C.push(a),a=u):a&&this._is_closing(u,a)&&(u.opened=a,a.closed=u,a=C.pop(),u.parent=a),u.previous=s,s.next=u,this.__tokens.add(u),s=u}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(u,s){this._readWhitespace();var a=this._input.read(/.+/g);return a?this._create_token(f.RAW,a):this._create_token(f.EOF,"")},o.prototype._is_comment=function(u){return!1},o.prototype._is_opening=function(u){return!1},o.prototype._is_closing=function(u,s){return!1},o.prototype._create_token=function(u,s){var a=new p(u,s,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return a},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},i.exports.Tokenizer=o,i.exports.TOKEN=f},function(i){function L(v){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=v}L.prototype.restart=function(){this.__position=0},L.prototype.isEmpty=function(){return this.__tokens_length===0},L.prototype.hasNext=function(){return this.__position<this.__tokens_length},L.prototype.next=function(){var v=null;return this.hasNext()&&(v=this.__tokens[this.__position],this.__position+=1),v},L.prototype.peek=function(v){var m=null;return v=v||0,v+=this.__position,v>=0&&v<this.__tokens_length&&(m=this.__tokens[v]),m},L.prototype.add=function(v){this.__parent_token&&(v.parent=this.__parent_token),this.__tokens.push(v),this.__tokens_length+=1},i.exports.TokenStream=L},function(i,L,v){var m=v(12).Pattern;function p(l,h){m.call(this,l,h),h?this._line_regexp=this._input.get_regexp(h._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}p.prototype=new m,p.prototype.__set_whitespace_patterns=function(l,h){l+="\\t ",h+="\\n\\r",this._match_pattern=this._input.get_regexp("["+l+h+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+h+"]")},p.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var l=this._input.read(this._match_pattern);if(l===" ")this.whitespace_before_token=" ";else if(l){var h=this.__split(this._newline_regexp,l);this.newline_count=h.length-1,this.whitespace_before_token=h[this.newline_count]}return l},p.prototype.matching=function(l,h){var f=this._create();return f.__set_whitespace_patterns(l,h),f._update(),f},p.prototype._create=function(){return new p(this._input,this)},p.prototype.__split=function(l,h){l.lastIndex=0;for(var f=0,o=[],u=l.exec(h);u;)o.push(h.substring(f,u.index)),f=u.index+u[0].length,u=l.exec(h);return f<h.length?o.push(h.substring(f,h.length)):o.push(""),o},i.exports.WhitespacePattern=p},function(i){function L(v,m){this._input=v,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,m&&(this._starting_pattern=this._input.get_regexp(m._starting_pattern,!0),this._match_pattern=this._input.get_regexp(m._match_pattern,!0),this._until_pattern=this._input.get_regexp(m._until_pattern),this._until_after=m._until_after)}L.prototype.read=function(){var v=this._input.read(this._starting_pattern);return(!this._starting_pattern||v)&&(v+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),v},L.prototype.read_match=function(){return this._input.match(this._match_pattern)},L.prototype.until_after=function(v){var m=this._create();return m._until_after=!0,m._until_pattern=this._input.get_regexp(v),m._update(),m},L.prototype.until=function(v){var m=this._create();return m._until_after=!1,m._until_pattern=this._input.get_regexp(v),m._update(),m},L.prototype.starting_with=function(v){var m=this._create();return m._starting_pattern=this._input.get_regexp(v,!0),m._update(),m},L.prototype.matching=function(v){var m=this._create();return m._match_pattern=this._input.get_regexp(v,!0),m._update(),m},L.prototype._create=function(){return new L(this._input,this)},L.prototype._update=function(){},i.exports.Pattern=L},function(i){function L(v,m){v=typeof v=="string"?v:v.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+m,"g")}L.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(v);p;)m[p[1]]=p[2],p=this.__directive_pattern.exec(v);return m},L.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},i.exports.Directives=L},function(i,L,v){var m=v(12).Pattern,p={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function l(h,f){m.call(this,h,f),this.__template_pattern=null,this._disabled=Object.assign({},p),this._excluded=Object.assign({},p),f&&(this.__template_pattern=this._input.get_regexp(f.__template_pattern),this._excluded=Object.assign(this._excluded,f._excluded),this._disabled=Object.assign(this._disabled,f._disabled));var o=new m(h);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}/)}}l.prototype=new m,l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){this.__set_templated_pattern()},l.prototype.disable=function(h){var f=this._create();return f._disabled[h]=!0,f._update(),f},l.prototype.read_options=function(h){var f=this._create();for(var o in p)f._disabled[o]=h.templating.indexOf(o)===-1;return f._update(),f},l.prototype.exclude=function(h){var f=this._create();return f._excluded[h]=!0,f._update(),f},l.prototype.read=function(){var h="";this._match_pattern?h=this._input.read(this._starting_pattern):h=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),h+=f,f=this._read_template();return this._until_after&&(h+=this._input.readUntilAfter(this._until_pattern)),h},l.prototype.__set_templated_pattern=function(){var h=[];this._disabled.php||h.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||h.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||h.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(h.push(this.__patterns.django._starting_pattern.source),h.push(this.__patterns.django_value._starting_pattern.source),h.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||h.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&h.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+h.join("|")+")")},l.prototype._read_template=function(){var h="",f=this._input.peek();if(f==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(h=h||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(h=h||this.__patterns.erb.read())}else f==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(h=h||this.__patterns.handlebars_comment.read(),h=h||this.__patterns.handlebars_unescaped.read(),h=h||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(h=h||this.__patterns.django_value.read()),this._excluded.django||(h=h||this.__patterns.django_comment.read(),h=h||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(h=h||this.__patterns.smarty_comment.read(),h=h||this.__patterns.smarty_literal.read(),h=h||this.__patterns.smarty.read()));return h},i.exports.TemplatablePattern=l}],P={};function W(i){var L=P[i];if(L!==void 0)return L.exports;var v=P[i]={exports:{}};return B[i](v,v.exports,W),v.exports}var H=W(0);M=H})();var X=M;!(oe=[],$=function(){return{js_beautify:X}}.apply(Te,oe),$!==void 0&&(Ze.exports=$))})()},"746U":function(Ze,Te,Z){"use strict";Z.d(Te,"f",function(){return oe}),Z.d(Te,"l",function(){return $}),Z.d(Te,"k",function(){return M}),Z.d(Te,"j",function(){return X}),Z.d(Te,"g",function(){return B}),Z.d(Te,"m",function(){return P}),Z.d(Te,"h",function(){return W}),Z.d(Te,"n",function(){return H}),Z.d(Te,"c",function(){return i}),Z.d(Te,"a",function(){return L}),Z.d(Te,"i",function(){return v}),Z.d(Te,"o",function(){return m}),Z.d(Te,"e",function(){return h}),Z.d(Te,"d",function(){return f}),Z.d(Te,"p",function(){return o}),Z.d(Te,"b",function(){return u});function oe(s){return Array.isArray(s)}function $(s){return typeof s=="string"}function M(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&!(s instanceof RegExp)&&!(s instanceof Date)}function X(s){return typeof s=="number"&&!isNaN(s)}function B(s){return s===!0||s===!1}function P(s){return typeof s=="undefined"}function W(s){return!H(s)}function H(s){return P(s)||s===null}function i(s,a){if(!s)throw new Error(a?`Unexpected type, expected '${a}'`:"Unexpected type")}function L(s){if(H(s))throw new Error("Assertion Failed: argument is undefined or null");return s}function v(s){return typeof s=="function"}function m(s,a){const C=Math.min(s.length,a.length);for(let _=0;_<C;_++)p(s[_],a[_])}function p(s,a){if($(a)){if(typeof s!==a)throw new Error(`argument does not match constraint: typeof ${a}`)}else if(v(a)){try{if(s instanceof a)return}catch(C){}if(!H(s)&&s.constructor===a)return;if(a.length===1&&a.call(void 0,s)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function l(s){let a=[],C=Object.getPrototypeOf(s);for(;Object.prototype!==C;)a=a.concat(Object.getOwnPropertyNames(C)),C=Object.getPrototypeOf(C);return a}function h(s){const a=[];for(const C of l(s))typeof s[C]=="function"&&a.push(C);return a}function f(s,a){const C=T=>function(){const R=Array.prototype.slice.call(arguments,0);return a(T,R)};let _={};for(const T of s)_[T]=C(T);return _}function o(s){return s===null?void 0:s}function u(s,a="Unreachable"){throw new Error(a)}},"7Cbv":function(Ze,Te,Z){"use strict";var oe=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),$=new Uint8Array(16);function M(){if(!oe)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return oe($)}var X=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function B(p){return typeof p=="string"&&X.test(p)}for(var P=B,W=[],H=0;H<256;++H)W.push((H+256).toString(16).substr(1));function i(p){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,h=(W[p[l+0]]+W[p[l+1]]+W[p[l+2]]+W[p[l+3]]+"-"+W[p[l+4]]+W[p[l+5]]+"-"+W[p[l+6]]+W[p[l+7]]+"-"+W[p[l+8]]+W[p[l+9]]+"-"+W[p[l+10]]+W[p[l+11]]+W[p[l+12]]+W[p[l+13]]+W[p[l+14]]+W[p[l+15]]).toLowerCase();if(!P(h))throw TypeError("Stringified UUID is invalid");return h}var L=i;function v(p,l,h){p=p||{};var f=p.random||(p.rng||M)();if(f[6]=f[6]&15|64,f[8]=f[8]&63|128,l){h=h||0;for(var o=0;o<16;++o)l[h+o]=f[o];return l}return L(f)}var m=Te.a=v},"7ahc":function(Ze,Te,Z){"use strict";Z.d(Te,"a",function(){return C});var oe=Z("k1fw"),$=Z("0Owb"),M=Z("+L6B"),X=Z("2/Rp"),B=Z("y8nQ"),P=Z("Vl3Y"),W=Z("tJVT"),H=Z("OaEy"),i=Z("2fM7"),L=Z("q1tI"),v=Z.n(L),m=Z("VrN/"),p=Z.n(m),l=Z("p77/"),h=Z.n(l),f=Z("c5Ni"),o=Z.n(f),u=i.a.Option,s={labelCol:{span:4},wrapperCol:{span:20}},a={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"]};Te.b=function(_){var T=_.callback,R=_.onCancel,O=Object(L.useState)("python"),S=Object(W.a)(O,2),w=S[0],E=S[1];function c(y){E(a[y][1])}function x(y){T(y)}return v.a.createElement(P.a,Object($.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:x}),v.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},v.a.createElement(i.a,{onChange:c},Object.keys(a).map(function(y){return v.a.createElement(u,{key:y,value:y},a[y][0])}))),v.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},v.a.createElement(C,{mode:w})),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(X.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function C(_){var T=_.value,R=_.onChange,O=_.mode,S=_.options,w=S===void 0?{}:S,E=Object(L.useRef)(),c=Object(L.useState)(),x=Object(W.a)(c,2),y=x[0],g=x[1];return Object(L.useEffect)(function(){if(y){function F(U){var A=U.getValue();R&&R(A)}return y.on("change",F),function(){y.off("change",F)}}},[y,R]),Object(L.useEffect)(function(){y&&y.setOption("mode",O)},[y,O]),Object(L.useEffect)(function(){y&&((T!==y.getValue()||T==="")&&setTimeout(function(){y.setValue(T||" ")},300))},[y,T]),Object(L.useEffect)(function(){if(E.current&&!y){var F=p.a.fromTextArea(E.current,Object(oe.a)({mode:O,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},w));g(F)}},[E.current,y]),v.a.createElement("div",{className:"my-codemirror-container"},v.a.createElement("textarea",{ref:E}))}},"8EBN":function(Ze,Te,Z){(function(oe){oe(Z("VrN/"))})(function(oe){"use strict";oe.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var $=0;$<oe.modeInfo.length;$++){var M=oe.modeInfo[$];M.mimes&&(M.mime=M.mimes[0])}oe.findModeByMIME=function(X){X=X.toLowerCase();for(var B=0;B<oe.modeInfo.length;B++){var P=oe.modeInfo[B];if(P.mime==X)return P;if(P.mimes){for(var W=0;W<P.mimes.length;W++)if(P.mimes[W]==X)return P}}if(/\+xml$/.test(X))return oe.findModeByMIME("application/xml");if(/\+json$/.test(X))return oe.findModeByMIME("application/json")},oe.findModeByExtension=function(X){X=X.toLowerCase();for(var B=0;B<oe.modeInfo.length;B++){var P=oe.modeInfo[B];if(P.ext){for(var W=0;W<P.ext.length;W++)if(P.ext[W]==X)return P}}},oe.findModeByFileName=function(X){for(var B=0;B<oe.modeInfo.length;B++){var P=oe.modeInfo[B];if(P.file&&P.file.test(X))return P}var W=X.lastIndexOf("."),H=W>-1&&X.substring(W+1,X.length);if(H)return oe.findModeByExtension(H)},oe.findModeByName=function(X){X=X.toLowerCase();for(var B=0;B<oe.modeInfo.length;B++){var P=oe.modeInfo[B];if(P.name.toLowerCase()==X)return P;if(P.alias){for(var W=0;W<P.alias.length;W++)if(P.alias[W].toLowerCase()==X)return P}}}})},"8HAY":function(Ze,Te,Z){"use strict";Z.d(Te,"a",function(){return B}),Z.d(Te,"b",function(){return P}),Z.d(Te,"d",function(){return W}),Z.d(Te,"e",function(){return H}),Z.d(Te,"c",function(){return i});var oe=Z("MI8n"),$=Z("pmY6"),M=Z("3/fG"),X=function(L,v,m,p){function l(h){return h instanceof m?h:new m(function(f){f(h)})}return new(m||(m=Promise))(function(h,f){function o(a){try{s(p.next(a))}catch(C){f(C)}}function u(a){try{s(p.throw(a))}catch(C){f(C)}}function s(a){a.done?h(a.value):l(a.value).then(o,u)}s((p=p.apply(L,v||[])).next())})};class B extends $.a{constructor(L,v="",m="",p=!0,l){super();this._onDidChange=this._register(new oe.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=L,this._label=v,this._cssClass=m,this._enabled=p,this._actionCallback=l}get id(){return this._id}get label(){return this._label}set label(L){this._setLabel(L)}_setLabel(L){this._label!==L&&(this._label=L,this._onDidChange.fire({label:L}))}get tooltip(){return this._tooltip||""}set tooltip(L){this._setTooltip(L)}_setTooltip(L){this._tooltip!==L&&(this._tooltip=L,this._onDidChange.fire({tooltip:L}))}get class(){return this._cssClass}set class(L){this._setClass(L)}_setClass(L){this._cssClass!==L&&(this._cssClass=L,this._onDidChange.fire({class:L}))}get enabled(){return this._enabled}set enabled(L){this._setEnabled(L)}_setEnabled(L){this._enabled!==L&&(this._enabled=L,this._onDidChange.fire({enabled:L}))}get checked(){return this._checked}set checked(L){this._setChecked(L)}_setChecked(L){this._checked!==L&&(this._checked=L,this._onDidChange.fire({checked:L}))}run(L,v){return X(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(L))})}}class P extends $.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new oe.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new oe.b),this.onDidRun=this._onDidRun.event}run(L,v){return X(this,void 0,void 0,function*(){if(!L.enabled)return;this._onBeforeRun.fire({action:L});let m;try{yield this.runAction(L,v)}catch(p){m=p}this._onDidRun.fire({action:L,error:m})})}runAction(L,v){return X(this,void 0,void 0,function*(){yield L.run(v)})}}class W extends B{constructor(L){super(W.ID,L,L?"separator text":"separator");this.checked=!1,this.enabled=!1}}W.ID="vs.actions.separator";class H{constructor(L,v,m,p){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=L,this.label=v,this.class=p,this._actions=m}get actions(){return this._actions}dispose(){}run(){return X(this,void 0,void 0,function*(){})}}class i extends B{constructor(){super(i.ID,M.a("submenu.empty","(empty)"),void 0,!1)}}i.ID="vs.actions.empty"},"8hTe":function(Ze,Te,Z){Ze.exports={button:"button___1wy9m"}},"9Bee":function(Ze,Te,Z){"use strict";var oe=Z("DYRE"),$=Z("zeV3"),M=Z("+L6B"),X=Z("2/Rp"),B=Z("k1fw"),P=Z("9og8"),W=Z("tJVT"),H=Z("WmNS"),i=Z.n(H),L=Z("q1tI"),v=Z.n(L),m=Z("vg9a"),p=Z("DlQD"),l=Z.n(p),h=Z("rUJ1");function f(le,q){var te=le.match(/^(\s+)(?:```)/);if(te===null)return q;var se=te[1];return q.split(`
|
|
`).map(function(he){var ie=he.match(/^\s+/);if(ie===null)return he;var ae=Object(W.a)(ie,1),pe=ae[0];return pe.length>=se.length?he.slice(se.length):he}).join(`
|
|
`)}var o=[],u=["<ul>"],s=new l.a.Renderer,a=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function C(){o.length=0,u=["<ul>"]}var _={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function T(le,q,te,se){if(q>=le.length||le[q].level<=te)return q;var he=le[q];se.push("<li><a href='#"+he.anchor+"'>"+he.text+"</a>"),q++;var ie=[];return q=T(le,q,he.level,ie),ie.length>0&&(se.push("<ul>"),ie.forEach(function(ae){se.push(ae)}),se.push("</ul>")),se.push("</li>"),q=T(le,q,te,se),q}function R(){return T(o,0,0,u),u.push("</ul>"),u.join("")}var O={heading:function(q){var te=a.exec(q);if(te)return{type:"heading",raw:te[0],depth:te[1].length,text:te[2]}},fences:function(q){var te=this.rules.block.fences.exec(q);if(te){var se=te[0],he=f(se,te[3]||""),ie=te[2]?te[2].trim():te[2];if(["latex","katex","math"].indexOf(ie)>=0){var ae=E(),pe=he;he=ae,c[ae]={type:"block",expression:pe}}return{type:"code",raw:se,lang:ie,text:he}}}},S=/(?:\${2})([^\n`]+?)(?:\${2})/gi,w=0,E=function(){return"__special_katext_id_".concat(w++,"__")},c={};function x(){return c}function y(){w=0,c={}}function g(le){return le=le.replace(S,function(q,te){var se=E();return c[se]={type:"inline",expression:te},se}),le}var F=s.listitem;s.listitem=function(le){return F(g(le))};var U=s.paragraph;s.paragraph=function(le){return U(g(le))};var A=s.tablecell;s.tablecell=function(le,q){return A(g(le),q)},s.code=function(le,q,te){var se=(q||"").match(/\S*/)[0];return se?["latex","katex","math"].indexOf(se)>=0?"<p class='editormd-tex'>".concat(le,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(q,'">').concat(te?le:Object(h.escape)(le,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(te?le:Object(h.escape)(le,!0))+"</code></pre>"},s.heading=function(le,q,te){var se=this.options.headerPrefix+te.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return o.push({anchor:se,level:q,text:le}),"<h"+q+' id="'+se+'">'+le+"</h"+q+">"},l.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),l.a.use({tokenizer:O,renderer:s});var j=l.a,N=Z("SJMd"),b=Z("ulZh"),Y=Z.n(b),re=Z("m3rI"),fe=Z("Oy/b"),ve=Z("p5ED"),ke=Z("ErOA"),Se=Z("STEk");/* **********************************
|
|
cropro version 1.2.0
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
copyright Alan Mendelevich
|
|
see README and LICENSE for details
|
|
********************************** *//*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var Le=function(le,q){return(Le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(te,se){te.__proto__=se}||function(te,se){for(var he in se)Object.prototype.hasOwnProperty.call(se,he)&&(te[he]=se[he])})(le,q)};function ye(le,q){if(typeof q!="function"&&q!==null)throw new TypeError("Class extends value "+String(q)+" is not a constructor or null");function te(){this.constructor=le}Le(le,q),le.prototype=q===null?Object.create(q):(te.prototype=q.prototype,new te)}function _e(le,q,te,se){return new(te||(te=Promise))(function(he,ie){function ae(xe){try{me(se.next(xe))}catch(Oe){ie(Oe)}}function pe(xe){try{me(se.throw(xe))}catch(Oe){ie(Oe)}}function me(xe){var Oe;xe.done?he(xe.value):(Oe=xe.value,Oe instanceof te?Oe:new te(function(Pe){Pe(Oe)})).then(ae,pe)}me((se=se.apply(le,q||[])).next())})}function de(le,q){var te,se,he,ie,ae={label:0,sent:function(){if(1&he[0])throw he[1];return he[1]},trys:[],ops:[]};return ie={next:pe(0),throw:pe(1),return:pe(2)},typeof Symbol=="function"&&(ie[Symbol.iterator]=function(){return this}),ie;function pe(me){return function(xe){return function(Oe){if(te)throw new TypeError("Generator is already executing.");for(;ae;)try{if(te=1,se&&(he=2&Oe[0]?se.return:Oe[0]?se.throw||((he=se.return)&&he.call(se),0):se.next)&&!(he=he.call(se,Oe[1])).done)return he;switch(se=0,he&&(Oe=[2&Oe[0],he.value]),Oe[0]){case 0:case 1:he=Oe;break;case 4:return ae.label++,{value:Oe[1],done:!1};case 5:ae.label++,se=Oe[1],Oe=[0];continue;case 7:Oe=ae.ops.pop(),ae.trys.pop();continue;default:if(!(he=ae.trys,(he=he.length>0&&he[he.length-1])||Oe[0]!==6&&Oe[0]!==2)){ae=0;continue}if(Oe[0]===3&&(!he||Oe[1]>he[0]&&Oe[1]<he[3])){ae.label=Oe[1];break}if(Oe[0]===6&&ae.label<he[1]){ae.label=he[1],he=Oe;break}if(he&&ae.label<he[2]){ae.label=he[2],ae.ops.push(Oe);break}he[2]&&ae.ops.pop(),ae.trys.pop();continue}Oe=q.call(le,ae)}catch(Pe){Oe=[6,Pe],se=0}finally{te=he=0}if(5&Oe[0])throw Oe[1];return{value:Oe[0]?Oe[1]:void 0,done:!0}}([me,xe])}}}var z=function(){function le(){}return le.addKey=function(q){le.key=q},Object.defineProperty(le,"isLicensed",{get:function(){return!!le.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(le.key)},enumerable:!1,configurable:!0}),le}(),D=function(){function le(){}return le.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},le.setAttributes=function(q,te){for(var se=0,he=te;se<he.length;se++){var ie=he[se],ae=ie[0],pe=ie[1];q.setAttribute(ae,pe)}},le.createRect=function(q,te,se){var he=document.createElementNS("http://www.w3.org/2000/svg","rect");return he.setAttribute("width",q.toString()),he.setAttribute("height",te.toString()),se&&le.setAttributes(he,se),he},le.createLine=function(q,te,se,he,ie){var ae=document.createElementNS("http://www.w3.org/2000/svg","line");return ae.setAttribute("x1",q.toString()),ae.setAttribute("y1",te.toString()),ae.setAttribute("x2",se.toString()),ae.setAttribute("y2",he.toString()),ie&&le.setAttributes(ae,ie),ae},le.createPolygon=function(q,te){var se=document.createElementNS("http://www.w3.org/2000/svg","polygon");return se.setAttribute("points",q),te&&le.setAttributes(se,te),se},le.createCircle=function(q,te){var se=document.createElementNS("http://www.w3.org/2000/svg","circle");return se.setAttribute("cx",(q/2).toString()),se.setAttribute("cy",(q/2).toString()),se.setAttribute("r",q.toString()),te&&le.setAttributes(se,te),se},le.createEllipse=function(q,te,se){var he=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return he.setAttribute("cx",(q/2).toString()),he.setAttribute("cy",(te/2).toString()),he.setAttribute("rx",(q/2).toString()),he.setAttribute("ry",(te/2).toString()),se&&le.setAttributes(he,se),he},le.createGroup=function(q){var te=document.createElementNS("http://www.w3.org/2000/svg","g");return q&&le.setAttributes(te,q),te},le.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},le.createMarker=function(q,te,se,he,ie,ae,pe){var me=document.createElementNS("http://www.w3.org/2000/svg","marker");return le.setAttributes(me,[["id",q],["orient",te],["markerWidth",se.toString()],["markerHeight",he.toString()],["refX",ie.toString()],["refY",ae.toString()]]),me.appendChild(pe),me},le.createText=function(q){var te=document.createElementNS("http://www.w3.org/2000/svg","text");return te.setAttribute("x","0"),te.setAttribute("y","0"),q&&le.setAttributes(te,q),te},le.createTSpan=function(q,te){var se=document.createElementNS("http://www.w3.org/2000/svg","tspan");return se.textContent=q,te&&le.setAttributes(se,te),se},le.createImage=function(q){var te=document.createElementNS("http://www.w3.org/2000/svg","image");return q&&le.setAttributes(te,q),te},le.createPoint=function(q,te){var se=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return se.x=q,se.y=te,se},le.createPath=function(q,te){var se=document.createElementNS("http://www.w3.org/2000/svg","path");return se.setAttribute("d",q),te&&le.setAttributes(se,te),se},le.createElement=function(q,te){var se=document.createElementNS("http://www.w3.org/2000/svg",q);return te&&le.setAttributes(se,te),se},le.getHollowRectanglePath=function(q,te,se,he,ie,ae,pe,me){return"M"+q+","+te+"V"+(te+he)+"H"+(q+se)+"V"+te+"H"+ie+"V"+ae+"H"+(ie+pe)+"V"+(ae+me)+"H"+ie+"V"+te+"Z"},le}(),I=function(){function le(q){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+q+"_"}return Object.defineProperty(le.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),le.prototype.addClass=function(q){return this.styleSheet===void 0&&this.addStyleSheet(),q.name=""+this.classNamePrefix+q.localName,this.classes.push(q),this.styleSheet.sheet.insertRule("."+q.name+" {"+q.style+"}",this.styleSheet.sheet.cssRules.length),q},le.prototype.addRule=function(q){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(q),this.styleSheet.sheet.insertRule(q.selector+" {"+q.style+"}",this.styleSheet.sheet.cssRules.length)},le.prototype.addStyleSheet=function(){var q;this.styleSheet=document.createElement("style"),((q=this.styleSheetRoot)!==null&&q!==void 0?q:document.head).appendChild(this.styleSheet),this.addRule(new V("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new V("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new V("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Q("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Q("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},le.prototype.removeStyleSheet=function(){var q;this.styleSheet&&(((q=this.styleSheetRoot)!==null&&q!==void 0?q:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},le}(),V=function(le,q){this.selector=le,this.style=q},Q=function(le,q){this.localName=le,this.style=q},G=function(){function le(){this.blocks=[],this.display=""}return le.prototype.addButtonBlock=function(q){q.className=this.blockClassName,q.buttonClassName=this.buttonClassName,q.buttonColorsClassName=this.buttonColorsClassName,q.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(q)},le.prototype.addElementBlock=function(q){q.className===void 0&&(q.className=this.blockClassName),this.blocks.push(q)},le.prototype.getUI=function(){var q=document.createElement("div");return q.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,q.style.display=this.display,this.blocks.forEach(function(te){return q.appendChild(te.getUI())}),q},le}(),ce=function(){function le(){}return le.prototype.getUI=function(){var q=document.createElement("div");if(q.className=this.className,this.minWidth!==void 0&&(q.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":q.style.justifyContent="flex-start";break;case"center":q.style.justifyContent="center";break;case"end":q.style.justifyContent="flex-end"}return q.style.whiteSpace="nowrap",q},le}(),Ce=function(le){function q(){var te=le!==null&&le.apply(this,arguments)||this;return te.buttons=[],te}return ye(q,le),q.prototype.addButton=function(te){te.className=this.buttonClassName,te.colorsClassName=this.buttonColorsClassName,te.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(te)},q.prototype.getUI=function(){var te=le.prototype.getUI.call(this);return this.buttons.forEach(function(se){return te.appendChild(se.getUI())}),te},q}(ce),De=function(){function le(q,te){this._isActive=!1,this._isHidden=!1,this._icon=q,this.title=te,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(le.prototype,"icon",{get:function(){return this._icon},set:function(q){this._icon=q,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isActive",{get:function(){return this._isActive},set:function(q){this._isActive=q,this.adjustClassName()},enumerable:!1,configurable:!0}),le.prototype.getUI=function(){var q=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 q.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},le.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},le.prototype.hide=function(){this._isHidden=!0},le}(),ue=function(le){function q(){var te=le!==null&&le.apply(this,arguments)||this;return te.elements=[],te}return ye(q,le),q.prototype.addElement=function(te){this.elements.push(te)},q.prototype.getUI=function(){var te=le.prototype.getUI.call(this);return this.elements.forEach(function(se){return te.appendChild(se)}),te},q}(ce),ge=function(){function le(q,te){this.horizontal=q,this.vertical=te}return Object.defineProperty(le.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),le.prototype.getVerticalLength=function(q){return q/this.ratio},le.prototype.getHorizontalLength=function(q){return q*this.ratio},le}(),we=function(){function le(){}return le.getIcon=function(q,te){if(q>0&&te>0){var se=new ge(q,te),he=se.ratio>=1?20:se.getHorizontalLength(20),ie=se.ratio<1?20:se.getVerticalLength(20),ae=document.createElementNS("http://www.w3.org/2000/svg","svg");ae.setAttribute("xmlns","http://www.w3.org/2000/svg"),ae.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ae);var pe=D.createDefs();ae.appendChild(pe);var me=D.createElement("clipPath",[["id","text-bg-clip"]]);pe.appendChild(me);var xe=D.createPath(D.getHollowRectanglePath((24-he)/2,(24-ie)/2,he,ie,(24-he)/2+2,(24-ie)/2+2,he-4,ie-4));ae.appendChild(xe);var Oe=D.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Oe.appendChild(D.createTSpan(q+":"+te)),ae.appendChild(Oe);var Pe=Oe.getBBox();D.setAttributes(Oe,[["x",((24-Pe.width)/2).toString()],["y",((24-Pe.height)/2-Pe.y).toString()]]);var ze=D.createPath(D.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Pe.width))/2,(24-Math.ceil(Pe.height))/2,Math.ceil(Pe.width),Math.ceil(Pe.height)));return me.appendChild(ze),D.setAttributes(xe,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ae),ae.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},le}(),Ae=function(le){function q(te,se,he){var ie=le.call(this,te,se)||this;return ie.isDropdownOpen=!1,ie.onClick=ie.dropdownButtonClicked,ie.dropdownButtons=he,ie}return ye(q,le),q.prototype.setupDropdown=function(){var te=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(se){se.className=te.className,se.colorsClassName=te.colorsClassName,te.dropdownBlock.appendChild(se.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},q.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},q.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},q.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},q.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},q.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},q}(De),Ne=function(){function le(q,te){this.GRIP_SIZE=10,this.color=q,this.fillColor=te,this.visual=D.createGroup(),this.visual.appendChild(D.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(D.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return le.prototype.ownsTarget=function(q){return q===this.visual||q===this.visual.childNodes[0]||q===this.visual.childNodes[1]},le.prototype.setCenter=function(q,te){this.visual.childNodes.forEach(function(se){return D.setAttributes(se,[["cx",q.toString()],["cy",te.toString()]])})},le}(),Be=function(){function le(q,te,se,he){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=q,this.canvasHeight=te,this.margin=se,this.container=he,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(le.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(q){this._aspectRatio=q,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(q){this._isGridVisible=q,this.gridContainer&&D.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(q){this._zoomFactor=q,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),le.prototype.open=function(){var q=this;this.cropShadeElement=D.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=D.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var te=0;te<this.numberOfGridLines;te++)this.horizontalGridLines.push(D.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(D.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(se){return q.gridContainer.appendChild(se)}),this.verticalGridLines.forEach(function(se){return q.gridContainer.appendChild(se)}),this.cropRectElement=D.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Ne(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Ne(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Ne(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Ne(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},le.prototype.setCropRectangle=function(q){this.cropRect=q;var te=Object.assign({},this.cropRect);this.zoomFactor!==1&&(te.width=this.cropRect.width*this.zoomFactor,te.height=this.cropRect.height*this.zoomFactor,te.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-te.width/2,te.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-te.height/2),D.setAttributes(this.cropRectElement,[["x",te.x.toString()],["y",te.y.toString()],["width",te.width.toString()],["height",te.height.toString()]]);var se=te.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(ie,ae){var pe=te.y+se*(ae+1);D.setAttributes(ie,[["x1",""+te.x],["y1",""+pe],["x2",""+(te.x+te.width)],["y2",""+pe]])});var he=te.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(ie,ae){var pe=te.x+he*(ae+1);D.setAttributes(ie,[["x1",""+pe],["y1",""+te.y],["x2",""+pe],["y2",""+(te.y+te.height)]])}),D.setAttributes(this.cropShadeElement,[["d",D.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,te.x,te.y,te.width,te.height)]]),this.topLeftGrip.setCenter(te.x,te.y),this.topRightGrip.setCenter(te.x+te.width,te.y),this.bottomLeftGrip.setCenter(te.x,te.y+te.height),this.bottomRightGrip.setCenter(te.x+te.width,te.y+te.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},le.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},le.prototype.clientToLocalCoordinates=function(q,te){var se=this.container.getBoundingClientRect();return{x:q-se.left+this.margin,y:te-se.top+this.margin}},le.prototype.onPointerDown=function(q){this.container.setPointerCapture(q.pointerId),this.previousPoint=this.clientToLocalCoordinates(q.clientX,q.clientY),this.cropRectElement===q.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(q.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(q.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(q.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(q.target)&&(this.activeGrip=this.bottomRightGrip)},le.prototype.onPointerMove=function(q){if(this.isMoving)this.move(this.clientToLocalCoordinates(q.clientX,q.clientY));else if(this.activeGrip){var te=this.clientToLocalCoordinates(q.clientX,q.clientY);this.resize(te)}q.preventDefault()},le.prototype.onPointerUp=function(q){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(q.pointerId)},le.prototype.move=function(q){var te=q.x-this.previousPoint.x,se=q.y-this.previousPoint.y;this.zoomFactor!==1&&(te=-te/this.zoomFactor,se=-se/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+te),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+se),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=q},le.prototype.resize=function(q){var te=Object.assign({},this.cropRect),se=q.x-this.previousPoint.x,he=q.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:te.x+se<this.margin&&(se=this.margin-te.x),te.x+=se,te.width=this.cropRect.x+this.cropRect.width-te.x;break;case this.bottomRightGrip:case this.topRightGrip:te.width+se>this.canvasWidth*this.zoomFactor&&(se=this.canvasWidth*this.zoomFactor-te.width),te.width+=se}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(te.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(se),te.height=this.aspectRatio.getVerticalLength(te.width)):(te.y+=he,te.height=this.cropRect.y+this.cropRect.height-te.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?te.height=this.aspectRatio.getVerticalLength(te.width):te.height+=he}te.width<10&&(te.x=this.cropRect.x,te.width=10),te.height<10&&(te.y=this.cropRect.y,te.height=10),this.previousPoint=q,te.x>=this.margin&&te.y>=this.margin&&te.x-this.margin+te.width<=this.canvasWidth&&te.y-this.margin+te.height<=this.canvasHeight&&(this.cropRect=te,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},le.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var q=this.cropRect.x+this.cropRect.width/2,te=this.cropRect.y+this.cropRect.height/2,se=this.aspectRatio.getHorizontalLength(this.cropRect.height),he=this.aspectRatio.getVerticalLength(this.cropRect.width);se/this.canvasWidth<he/this.canvasHeight?this.cropRect.width=se:this.cropRect.height=he,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=q-this.cropRect.width/2,this.cropRect.y=te-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},le.prototype.getRescaledRect=function(q,te,se,he,ie,ae){var pe=se/q,me=he/te;return{x:(ie.x-ae)*pe+ae,y:(ie.y-ae)*me+ae,width:ie.width*pe,height:ie.height*me}},le.prototype.scaleCanvas=function(q,te){var se=this.getRescaledRect(this.canvasWidth,this.canvasHeight,q,te,this.cropRect,this.margin);this.canvasWidth=q,this.canvasHeight=te,this.onCropChange&&this.onCropChange(se),this.setCropRectangle(se)},le}(),Ge=function(){function le(q){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=q,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(le.prototype,"angle",{get:function(){return this._angle},set:function(q){this._angle=q,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),le.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},le.prototype.onPointerDown=function(q){this.controlContainer.setPointerCapture(q.pointerId),this.isDragging=!0,this.previousPoint={x:q.clientX,y:q.clientY}},le.prototype.onPointerMove=function(q){this.isDragging&&(this.onAngleChange&&this.onAngleChange((q.clientX-this.previousPoint.x)/5),this.previousPoint.x=q.clientX)},le.prototype.onPointerUp=function(q){this.isDragging&&this.onAngleChange&&this.onAngleChange((q.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(q.pointerId)},le.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var q=this.angleLabelText.getBBox();D.setAttributes(this.angleLabelElement,[["x",((this.width-q.width)/2).toString()],["y",(this.height/2).toString()]])}},le.prototype.positionScaleShape=function(){if(this.scaleShape){var q=this.scaleShape.transform.baseVal.getItem(0);q.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(q,0)}},le.prototype.getVisual=function(){var q=document.createElementNS("http://www.w3.org/2000/svg","svg");q.setAttribute("xmlns","http://www.w3.org/2000/svg"),q.setAttribute("width",this.width+"px"),q.setAttribute("height",this.height+"px"),q.setAttribute("viewBox","0 0 "+this.width+" "+this.height),q.style.flexShrink="0",document.body.appendChild(q);for(var te="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,se=1;se<=this.width/5+10;se++){var he=se%5==0?this.height/3:this.height/6;te+="h4v"+-he+"h1v"+he}te+="v1H0Z",this.scaleShape=D.createPath(te);var ie=D.createTransform();this.scaleShape.transform.baseVal.appendItem(ie),q.appendChild(this.scaleShape),this.angleLabelElement=D.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=D.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ae=D.createTSpan("");return ae.innerHTML="°",this.angleLabelElement.appendChild(ae),q.appendChild(this.angleLabelElement),document.body.removeChild(q),q},le}(),He=function(){function le(){this.naturalSize=!1,this.imageType="image/png"}return le.prototype.rasterize=function(q,te,se,he,ie,ae,pe){var me=this;return new Promise(function(xe){var Oe=document.createElement("canvas");Oe.width=q.width.baseVal.value-2*he,Oe.height=q.height.baseVal.value-2*he;var Pe=1,ze=1;me.naturalSize===!0?(Pe=te.naturalWidth/(q.width.baseVal.value-2*he)/ae,ze=te.naturalHeight/(q.height.baseVal.value-2*he)/pe,Oe.width=te.naturalWidth/ae,Oe.height=te.naturalHeight/pe):me.width!==void 0&&me.height!==void 0&&(Pe=me.width/se.width,ze=me.height/se.height,Oe.width*=Pe,Oe.height*=ze);var tt=Oe.getContext("2d");tt.translate(Oe.width/2,Oe.height/2),tt.rotate(ie*Math.PI/180),tt.scale(ae,pe),tt.translate(-Oe.width/2,-Oe.height/2),tt.drawImage(te,0,0,Oe.width,Oe.height);var rt=document.createElement("canvas");rt.width=se.width*Pe,rt.height=se.height*ze,rt.getContext("2d").putImageData(tt.getImageData((se.x-he)*Pe,(se.y-he)*ze,se.width*Pe,se.height*ze),0,0),xe(rt.toDataURL(me.imageType,me.imageQuality))})},le}(),qe=function(){function le(q){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=le.instanceCounter++,this.styles=new I(this.instanceNo),this.target=q,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(le.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(q){this._zoomToCropEnabled=q,q?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(q){this._isGridVisible=q,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"gridLines",{get:function(){return this._gridLines},set:function(q){this._gridLines=q,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(q){this._rotationAngle=q,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"aspectRatio",{get:function(){var q;return(q=this._aspectRatio)!==null&&q!==void 0?q:this.aspectRatios[0]},set:function(q){this._aspectRatio=q},enumerable:!1,configurable:!0}),le.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},le.prototype.show=function(){this.showUI(),this.open()},le.prototype.close=function(q){q===void 0&&(q=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),q||this.closeEventListeners.forEach(function(te){return te()}),this._isOpen=!1)},le.prototype.addRenderEventListener=function(q){this.renderEventListeners.push(q)},le.prototype.removeRenderEventListener=function(q){this.renderEventListeners.indexOf(q)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(q),1)},le.prototype.addCloseEventListener=function(q){this.closeEventListeners.push(q)},le.prototype.removeCloseEventListener=function(q){this.closeEventListeners.indexOf(q)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(q),1)},le.prototype.setupResizeObserver=function(){var q=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){q.resize(q.target.clientWidth,q.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},le.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var q=1*this.target.clientWidth/this.target.clientHeight,te=this.contentDiv.clientWidth/q>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*q:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,se=te+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/q;this.resize(te,se)}},le.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},le.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",D.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},le.prototype.resize=function(q,te){this.imageWidth=Math.round(q),this.imageHeight=Math.round(te),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},le.prototype.setEditingTarget=function(){var q=document.createElement("canvas");q.width=this.target.naturalWidth,q.height=this.target.naturalHeight,q.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var te=q.toDataURL();D.setAttributes(this.editingTarget,[["href",te]]),this.setEditingTargetSize()},le.prototype.setTopLeft=function(){var q=this.target.getBoundingClientRect(),te=this.editorCanvas.getBoundingClientRect();this.left=q.left-te.left-this.CANVAS_MARGIN,this.top=q.top-te.top-this.CANVAS_MARGIN},le.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=D.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=D.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=D.createGroup(),this.editingTargetRotationScaleContainer=D.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var q=D.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(q);var te=D.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(te),this.editingTargetContainer=D.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},le.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},le.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=D.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Be(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},le.prototype.zoomToCrop=function(){if(this.cropRect){var q=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,te=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=q+"px "+te+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-q+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-te+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},le.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},le.prototype.cropRectChanged=function(q){this.cropRect=q,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},le.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},le.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},le.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},le.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var q=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,te=this.target.offsetTop>q+this.CANVAS_MARGIN?this.target.offsetTop-(q+this.CANVAS_MARGIN):0;this.coverDiv.style.top=te+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},le.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},le.prototype.addTopToolbar=function(){var q=this;this.topToolbar=new G,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 te=new Ce;te.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(te);var se=[];this.aspectRatios.forEach(function(ze){var tt=new De(we.getIcon(ze.horizontal,ze.vertical),ze.horizontal===0&&ze.vertical===0?"FREE":ze.horizontal+":"+ze.vertical);tt.onClick=function(){return q.ratioButtonClicked(ze)},se.push(tt)}),this.aspectRatioButton=new Ae(we.getIcon(0,0),"Aspect ratio",se),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,te.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var he=new De('<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");he.isActive=this.isGridVisible,he.onClick=function(){q.isGridVisible=!q.isGridVisible,he.isActive=q.isGridVisible},te.addButton(he);var ie=new De('<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(ie.isActive=this.zoomToCropEnabled,ie.onClick=function(){q.zoomToCropEnabled=!q.zoomToCropEnabled,ie.isActive=q.zoomToCropEnabled},te.addButton(ie),!z.isLicensed){var ae=new ue;this.topToolbar.addElementBlock(ae);var pe=document.createElement("div");pe.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var me=document.createElement("a");me.style.color="currentColor",me.href="https://markerjs.com/products/cropro",me.target="_blank",me.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>',pe.appendChild(me),ae.addElement(pe)}var xe=new Ce;xe.minWidth=3*this.toolbarHeight+"px",xe.contentAlign="end",this.topToolbar.addButtonBlock(xe);var Oe=new De('<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");Oe.onClick=this.startRenderAndClose,xe.addButton(Oe),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Oe.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Pe=new De('<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");Pe.onClick=this.close,xe.addButton(Pe),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Pe.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},le.prototype.addBottomToolbar=function(){var q=this;this.bottomToolbar=new G,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 te=new Ce;te.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(te);var se=new De('<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");se.onClick=this.rotateLeftButtonClicked,te.addButton(se);var he=new De('<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");he.onClick=this.rotateRightButtonClicked,te.addButton(he);var ie=new ue;ie.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(ie),this.straightener=new Ge("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(xe){q.rotateBy(xe),q.straightener.angle=q.rotationAngle},ie.addElement(this.straightener.getUI());var ae=new Ce;ae.minWidth=2*this.toolbarHeight+"px",ae.contentAlign="end",this.bottomToolbar.addButtonBlock(ae);var pe=new De('<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");pe.onClick=this.flipHorizontallyButtonClicked,ae.addButton(pe);var me=new De('<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");me.onClick=this.flipVerticallyButtonClicked,ae.addButton(me)},le.prototype.ratioButtonClicked=function(q){this.aspectRatio=q,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},le.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=we.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},le.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new ge(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},le.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},le.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},le.prototype.restoreState=function(q){if(q){var te=this.cropLayer.getRescaledRect(q.width,q.height,this.imageWidth,this.imageHeight,q.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(te),this.cropRectChanged(te),this.flippedHorizontally=q.flippedHorizontally,this.flippedVertically=q.flippedVertically,this.applyFlip(),this.rotationAngle=q.rotationAngle,this.applyRotation()}},le.prototype.clientToLocalCoordinates=function(q,te){var se=this.cropImage.getBoundingClientRect();return{x:q-se.left,y:te-se.top}},le.prototype.onWindowResize=function(){this.positionUI()},le.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var q=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=q+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},le.prototype.rotateLeftButtonClicked=function(){var q=this.rotationAngle-90;this.rotationAngle%90!=0&&(q+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(q)},le.prototype.rotateRightButtonClicked=function(){var q=this.rotationAngle+90;this.rotationAngle%90!=0&&(q-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(q)},le.prototype.rotateTo=function(q){q=(q=q>180?q-360:q)<=-180?q+360:q,this.rotationAngle=q,this.applyRotation()},le.prototype.rotateBy=function(q){this.rotateTo((this.rotationAngle+q)%360)},le.prototype.applyRotation=function(){var q=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var te=this.editingTargetRotationContainer.transform.baseVal.getItem(0);te.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(te,0);var se=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/se.width,this.imageHeight/se.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=q},le.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},le.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},le.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},le.prototype.startRenderAndClose=function(){return _e(this,void 0,void 0,function(){var q,te;return de(this,function(se){switch(se.label){case 0:return[4,this.render()];case 1:return q=se.sent(),te=this.getState(),this.renderEventListeners.forEach(function(he){return he(q,te)}),this.close(!0),[2]}})})},le.prototype.render=function(){return _e(this,void 0,void 0,function(){var q;return de(this,function(te){switch(te.label){case 0:return(q=new He).naturalSize=this.renderAtNaturalSize,q.imageType=this.renderImageType,q.imageQuality=this.renderImageQuality,q.width=this.renderWidth,q.height=this.renderHeight,this.unzoomFromCrop(),D.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,q.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 te.sent(),[4,q.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,te.sent()]}})})},le.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Q("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 Q("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Q("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var q=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Q("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*q)+`px;
|
|
height: `+(this.toolbarHeight-2*q)+`px;
|
|
padding: `+q+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Q("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Q("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new V("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new V("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Q("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 Q("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Q("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 Q("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*q)+`px;
|
|
padding: `+q+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Q("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},le.instanceCounter=0,le}(),je=Z("8hTe"),Ke=Z.n(je),Me=/<pre[^>]*>/g;function et(le){var q=document.createElement("div");return q.innerHTML=le,q.childNodes.length===0?"":q.childNodes[0].nodeValue}var Je=Te.a=function(le){var q=le.value,te=q===void 0?"":q,se=le.edit,he=se===void 0?!1:se,ie=le.className,ae=le.showTextOnly,pe=le.showLines,me=le.replaces,xe=le.zoomImg,Oe=le.hasMask,Pe=le.style,ze=Pe===void 0?{}:Pe,tt=le.stylesPrev,rt=tt===void 0?{}:tt,yt=String(te),ot=Object(L.useRef)(),at=Object(L.useRef)(),Lt=Object(L.useState)(""),_t=Object(W.a)(Lt,2),Bt=_t[0],Ft=_t[1],Tt=Object(L.useState)("office"),si=Object(W.a)(Tt,2),Ei=si[0],zt=si[1],di=function(){var Ct=new qe(at.current);Ct.displayMode="popup",Ct.addRenderEventListener(function(){var Ot=Object(P.a)(i.a.mark(function ct(pt){var wt;return i.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return ot.current.style.display="none",Ut.next=3,Object(ke.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:pt}});case 3:wt=Ut.sent,wt!=null&&wt.id&&me(at.current.getAttribute("src").replace(re.a.API_SERVER,""),"/api/attachments/".concat(wt==null?void 0:wt.id,"?type=").concat(wt.content_type));case 5:case"end":return Ut.stop()}},ct)}));return function(ct){return Ot.apply(this,arguments)}}()),Ct.show()},dt=function(){var Ct=new Se.a(at.current);Ct.settings.displayMode="popup",Ct.addEventListener("render",function(){var Ot=Object(P.a)(i.a.mark(function ct(pt){var wt;return i.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:if(ot.current.style.display="none",!at.current){Ut.next=6;break}return Ut.next=4,Object(ke.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:pt.dataUrl}});case 4:wt=Ut.sent,wt!=null&&wt.id&&me(at.current.getAttribute("src").replace(re.a.API_SERVER,""),"/api/attachments/".concat(wt==null?void 0:wt.id,"?type=").concat(wt.content_type));case 6:case"end":return Ut.stop()}},ct)}));return function(ct){return Ot.apply(this,arguments)}}()),Ct.show(),window.markerArea=Ct},vt=Object(L.useMemo)(function(){ot.current&&(ot.current.style.zIndex=-1);try{var Qe=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ct=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Ot=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;yt=yt.replace(Qe,"("+re.a.API_SERVER+"/api/attachments/").replace(Ct,'"'+re.a.API_SERVER+"/api/attachments/").replace(Ot,'"'+re.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`)}catch(ii){}var ct=j(yt),pt=x();if(yt.match(/\[TOC\]/)&&(ct=ct.replace("<p>[TOC]</p>",R()),C()),ct=ct.replace(/(__special_katext_id_\d+__)/g,function(ii,Ut){var We=pt[Ut],ft=We.type,ir=We.expression;return Object(fe.renderToString)(et(ir)||"",{displayMode:ft==="block",throwOnError:!1,output:"html"})}),ct=ct.replace(/▁/g,"\u2581\u2581\u2581"),y(),ae){var wt=document.createElement("div");return wt.innerHTML=ct,wt.innerText}return setTimeout(function(){return oi()},500),ct},[yt]),Et=Object(L.useRef)();_.WebkitLineClamp=pe,pe&&(ze=Object(B.a)(Object(B.a)({},ze),_));function Ht(Qe){var Ct=Qe.target;if(Ct.tagName.toUpperCase()==="IMG"){if(xe){var Ot=Ct.getAttribute("src");Ft(Ot),zt("image")}}else if(Ct.tagName.toUpperCase()==="A"){var ct=Ct.getAttribute("href");if(ct.indexOf("office")>-1)Qe.preventDefault(),Ft(ct),zt("office");else if(ct.indexOf("application/pdf")>-1)Qe.preventDefault(),Ft(ct),zt("pdf");else if(ct.indexOf("text/html")>-1)Qe.preventDefault(),Ft(ct),zt("html");else if(ct.startsWith("#")){Qe.preventDefault();var pt=document.getElementById(ct.replace("#",""));pt&&pt.scrollIntoView(!0)}}}var oi=function(){var Ct,Ot=(Ct=Et.current)===null||Ct===void 0?void 0:Ct.querySelectorAll("video");Ot==null||Ot.forEach(function(ct){if(ct.oncontextmenu=function(){return!1},ct.src.indexOf(".m3u8")>-1&&!ct.canPlayType("application/vnd.apple.mpegurl")){if(Y.a.isSupported()){var pt=new Y.a;pt.loadSource(ct.src),pt.attachMedia(ct)}}})};Object(L.useEffect)(function(){if(Et.current&&vt&&(vt.match(Me)&&window.PR.prettyPrint()),Et.current)return Et.current.addEventListener("click",Ht),function(){Et.current.removeEventListener("click",Ht),y(),C()}},[vt,Et.current,Ht]);var Mt=function(Ct){if(!he)return;Ct.target.nodeName==="IMG"?(ot.current.style.zIndex=1,ot.current.style.display="flex",ot.current.style.width=Ct.target.clientWidth+"px",ot.current.style.height=Ct.target.clientHeight+"px",ot.current.style.top=Ct.target.offsetTop+"px",ot.current.style.left=Ct.target.offsetLeft+"px",at.current.src=Ct.target.getAttribute("src")):ot.current.style.display="none"};return v.a.createElement("div",{style:{position:"relative"}},v.a.createElement("div",{ref:Et,style:Object(B.a)({},ze),className:"".concat(ie||""," markdown-body ").concat(Ke.a.mdBody),onMouseOver:Mt,dangerouslySetInnerHTML:{__html:vt}}),v.a.createElement("div",{ref:ot,className:Ke.a.button},v.a.createElement($.a,null,v.a.createElement(X.a,{onClick:function(){return di()}},"\u88C1\u526A"),v.a.createElement(X.a,{onClick:function(){return dt()}},"\u7F16\u8F91"))),v.a.createElement("img",{ref:at,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),v.a.createElement(ve.a,{close:!0,data:Bt,type:Bt!=null&&Bt.length?Ei:"",style:Object(B.a)({},rt),onClose:function(){return Ft("")}}))}},"9VGf":function(Ze,Te,Z){"use strict";Z.d(Te,"a",function(){return M});var oe=Z("q1tI"),$=Z.n(oe);function M(X,B){var P=Object(oe.useRef)();Object(oe.useEffect)(function(){P.current=X}),Object(oe.useEffect)(function(){function W(){P.current()}if(B!==null){var H=setInterval(W,B);return function(){return clearInterval(H)}}},[B])}},BU3w:function(Ze,Te,Z){"use strict";Z.d(Te,"a",function(){return P});var oe=Z("MNnm"),$="rc-util-key";function M(W){if(W.attachTo)return W.attachTo;var H=document.querySelector("head");return H||document.body}function X(W){var H,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(oe.a)())return null;var L=document.createElement("style");if((H=i.csp)===null||H===void 0?void 0:H.nonce){var v;L.nonce=(v=i.csp)===null||v===void 0?void 0:v.nonce}L.innerHTML=W;var m=M(i),p=m.firstChild;return i.prepend&&m.prepend?m.prepend(L):i.prepend&&p?m.insertBefore(L,p):m.appendChild(L),L}var B=new Map;function P(W,H){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},L=M(i);if(!B.has(L)){var v=X("",i),m=v.parentNode;B.set(L,m),m.removeChild(v)}var p=Array.from(B.get(L).children).find(function(u){return u.tagName==="STYLE"&&u[$]===H});if(p){var l,h;if(((l=i.csp)===null||l===void 0?void 0:l.nonce)&&p.nonce!==((h=i.csp)===null||h===void 0?void 0:h.nonce)){var f;p.nonce=(f=i.csp)===null||f===void 0?void 0:f.nonce}return p.innerHTML!==W&&(p.innerHTML=W),p}var o=X(W,i);return o[$]=H,o}},Bd2K:function(Ze,Te,Z){(function(oe){oe(Z("VrN/"),Z("osHv"))})(function(oe){oe.defineOption("autoCloseTags",!1,function(i,L,v){if(v!=oe.Init&&v&&i.removeKeyMap("autoCloseTags"),!L)return;var m={name:"autoCloseTags"};(typeof L!="object"||L.whenClosing!==!1)&&(m["'/'"]=function(p){return P(p)}),(typeof L!="object"||L.whenOpening!==!1)&&(m["'>'"]=function(p){return X(p)}),i.addKeyMap(m)});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 X(i){if(i.getOption("disableInput"))return oe.Pass;for(var L=i.listSelections(),v=[],m=i.getOption("autoCloseTags"),p=0;p<L.length;p++){if(!L[p].empty())return oe.Pass;var l=L[p].head,h=i.getTokenAt(l),f=oe.innerMode(i.getMode(),h.state),o=f.state,u=f.mode.xmlCurrentTag&&f.mode.xmlCurrentTag(o),s=u&&u.name;if(!s)return oe.Pass;var a=f.mode.configuration=="html",C=typeof m=="object"&&m.dontCloseTags||a&&$,_=typeof m=="object"&&m.indentTags||a&&M;h.end>l.ch&&(s=s.slice(0,s.length-h.end+l.ch));var T=s.toLowerCase();if(!s||h.type=="string"&&(h.end!=l.ch||!/[\"\']/.test(h.string.charAt(h.string.length-1))||h.string.length==1)||h.type=="tag"&&u.close||h.string.indexOf("/")==l.ch-h.start-1||C&&W(C,T)>-1||H(i,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(o)||[],s,l,!0))return oe.Pass;var R=typeof m=="object"&&m.emptyTags;if(R&&W(R,s)>-1){v[p]={text:"/>",newPos:oe.Pos(l.line,l.ch+2)};continue}var O=_&&W(_,T)>-1;v[p]={indent:O,text:">"+(O?`
|
|
|
|
`:"")+"</"+s+">",newPos:O?oe.Pos(l.line+1,0):oe.Pos(l.line,l.ch+1)}}for(var S=typeof m=="object"&&m.dontIndentOnAutoClose,p=L.length-1;p>=0;p--){var w=v[p];i.replaceRange(w.text,L[p].head,L[p].anchor,"+insert");var E=i.listSelections().slice(0);E[p]={head:w.newPos,anchor:w.newPos},i.setSelections(E),!S&&w.indent&&(i.indentLine(w.newPos.line,null,!0),i.indentLine(w.newPos.line+1,null,!0))}}function B(i,L){for(var v=i.listSelections(),m=[],p=L?"/":"</",l=i.getOption("autoCloseTags"),h=typeof l=="object"&&l.dontIndentOnSlash,f=0;f<v.length;f++){if(!v[f].empty())return oe.Pass;var o=v[f].head,u=i.getTokenAt(o),s=oe.innerMode(i.getMode(),u.state),a=s.state;if(L&&(u.type=="string"||u.string.charAt(0)!="<"||u.start!=o.ch-1))return oe.Pass;var C,_=s.mode.name!="xml"&&i.getMode().name=="htmlmixed";if(_&&s.mode.name=="javascript")C=p+"script";else if(_&&s.mode.name=="css")C=p+"style";else{var T=s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(a);if(!T||T.length&&H(i,T,T[T.length-1],o))return oe.Pass;C=p+T[T.length-1]}i.getLine(o.line).charAt(u.end)!=">"&&(C+=">"),m[f]=C}if(i.replaceSelections(m),v=i.listSelections(),!h)for(var f=0;f<v.length;f++)(f==v.length-1||v[f].head.line<v[f+1].head.line)&&i.indentLine(v[f].head.line)}function P(i){return i.getOption("disableInput")?oe.Pass:B(i,!0)}oe.commands.closeTag=function(i){return B(i)};function W(i,L){if(i.indexOf)return i.indexOf(L);for(var v=0,m=i.length;v<m;++v)if(i[v]==L)return v;return-1}function H(i,L,v,m,p){if(!oe.scanForClosingTag)return!1;var l=Math.min(i.lastLine()+1,m.line+500),h=oe.scanForClosingTag(i,m,null,l);if(!h||h.tag!=v)return!1;for(var f=p?1:0,o=L.length-1;o>=0&&L[o]==v;o--)++f;m=h.to;for(var o=1;o<f;o++){var u=oe.scanForClosingTag(i,m,null,l);if(!u||u.tag!=v)return!1;m=u.to}return!0}})},BjJ7:function(Ze,Te,Z){"use strict";Z.d(Te,"d",function(){return $}),Z.d(Te,"c",function(){return M}),Z.d(Te,"e",function(){return X}),Z.d(Te,"b",function(){return B}),Z.d(Te,"a",function(){return W});var oe=Z("m3rI");function $(H){var i=!0;if(H.length>0){for(var L=0;L<H.length;L++)if(H[L].compile_success==0||!H[L].compile_success){i=!1;break}}else i=!1;return i}function M(H){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",L=[],v=0;v<H.length;v++){var m=H[v],p=i?"".concat(i,"/").concat(m.name):"".concat(m.name);L.push({title:m.name,isLeaf:!(m.type==="tree"),key:p})}return L}function X(H,i,L){for(var v=0;v<H.length;v++){var m=H[v];if(m.key===i){m.children=L;break}m.children&&X(m.children,i,L)}return H}function B(H,i,L){var v;return function(){var m=this,p=arguments,l=function(){v=null,L||H.apply(m,p)},h=L&&!v;clearTimeout(v),v=setTimeout(l,i),h&&H.apply(m,p)}}var P=!0,W=oe.a.API_SERVER},"C+DQ":function(Ze,Te,Z){},"C/vA":function(Ze,Te,Z){"use strict";Z.d(Te,"a",function(){return oe});function oe($){const M=this;let X=!1,B;return function(){return X||(X=!0,B=$.apply(M,arguments)),B}}},"Cg/j":function(Ze,Te,Z){"use strict";Z.d(Te,"b",function(){return oe}),Z.d(Te,"a",function(){return $}),Z.d(Te,"c",function(){return X}),Z.d(Te,"d",function(){return B});var oe;(function(P){P.serviceIds=new Map,P.DI_TARGET="$di$target",P.DI_DEPENDENCIES="$di$dependencies";function W(H){return H[P.DI_DEPENDENCIES]||[]}P.getServiceDependencies=W})(oe||(oe={}));const $=X("instantiationService");function M(P,W,H,i){W[oe.DI_TARGET]===W?W[oe.DI_DEPENDENCIES].push({id:P,index:H,optional:i}):(W[oe.DI_DEPENDENCIES]=[{id:P,index:H,optional:i}],W[oe.DI_TARGET]=W)}function X(P){if(oe.serviceIds.has(P))return oe.serviceIds.get(P);const W=function(H,i,L){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");M(W,H,L,!1)};return W.toString=()=>P,oe.serviceIds.set(P,W),W}function B(P){return function(W,H,i){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");M(P,W,i,!0)}}},DlQD:function(Ze,Te,Z){(function(oe,$){Ze.exports=$()})(this,function(){"use strict";function oe(te,se){for(var he=0;he<se.length;he++){var ie=se[he];ie.enumerable=ie.enumerable||!1,ie.configurable=!0,"value"in ie&&(ie.writable=!0),Object.defineProperty(te,ie.key,ie)}}function $(te,se,he){return se&&oe(te.prototype,se),he&&oe(te,he),te}function M(te,se){if(!te)return;if(typeof te=="string")return X(te,se);var he=Object.prototype.toString.call(te).slice(8,-1);if(he==="Object"&&te.constructor&&(he=te.constructor.name),he==="Map"||he==="Set")return Array.from(te);if(he==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(he))return X(te,se)}function X(te,se){(se==null||se>te.length)&&(se=te.length);for(var he=0,ie=new Array(se);he<se;he++)ie[he]=te[he];return ie}function B(te,se){var he;if(typeof Symbol=="undefined"||te[Symbol.iterator]==null){if(Array.isArray(te)||(he=M(te))||se&&te&&typeof te.length=="number"){he&&(te=he);var ie=0;return function(){return ie>=te.length?{done:!0}:{done:!1,value:te[ie++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return he=te[Symbol.iterator](),he.next.bind(he)}function P(te,se){return se={exports:{}},te(se,se.exports),se.exports}var W=P(function(te){function se(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function he(ie){te.exports.defaults=ie}te.exports={defaults:se(),getDefaults:se,changeDefaults:he}}),H=W.defaults,i=W.getDefaults,L=W.changeDefaults,v=/[&<>"']/,m=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,h={"&":"&","<":"<",">":">",'"':""","'":"'"},f=function(se){return h[se]};function o(te,se){if(se){if(v.test(te))return te.replace(m,f)}else if(p.test(te))return te.replace(l,f);return te}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(te){return te.replace(u,function(se,he){return he=he.toLowerCase(),he==="colon"?":":he.charAt(0)==="#"?he.charAt(1)==="x"?String.fromCharCode(parseInt(he.substring(2),16)):String.fromCharCode(+he.substring(1)):""})}var a=/(^|[^\[])\^/g;function C(te,se){te=te.source||te,se=se||"";var he={replace:function(ae,pe){return pe=pe.source||pe,pe=pe.replace(a,"$1"),te=te.replace(ae,pe),he},getRegex:function(){return new RegExp(te,se)}};return he}var _=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(te,se,he){if(te){var ie;try{ie=decodeURIComponent(s(he)).replace(_,"").toLowerCase()}catch(ae){return null}if(ie.indexOf("javascript:")===0||ie.indexOf("vbscript:")===0||ie.indexOf("data:")===0)return null}se&&!T.test(he)&&(he=c(se,he));try{he=encodeURI(he).replace(/%25/g,"%")}catch(ae){return null}return he}var O={},S=/^[^:]+:\/*[^/]*$/,w=/^([^:]+:)[\s\S]*$/,E=/^([^:]+:\/*[^/]*)[\s\S]*$/;function c(te,se){O[" "+te]||(S.test(te)?O[" "+te]=te+"/":O[" "+te]=F(te,"/",!0)),te=O[" "+te];var he=te.indexOf(":")===-1;return se.substring(0,2)==="//"?he?se:te.replace(w,"$1")+se:se.charAt(0)==="/"?he?se:te.replace(E,"$1")+se:te+se}var x={exec:function(){}};function y(te){for(var se=1,he,ie;se<arguments.length;se++){he=arguments[se];for(ie in he)Object.prototype.hasOwnProperty.call(he,ie)&&(te[ie]=he[ie])}return te}function g(te,se){var he=te.replace(/\|/g,function(pe,me,xe){for(var Oe=!1,Pe=me;--Pe>=0&&xe[Pe]==="\\";)Oe=!Oe;return Oe?"|":" |"}),ie=he.split(/ \|/),ae=0;if(ie.length>se)ie.splice(se);else for(;ie.length<se;)ie.push("");for(;ae<ie.length;ae++)ie[ae]=ie[ae].trim().replace(/\\\|/g,"|");return ie}function F(te,se,he){var ie=te.length;if(ie===0)return"";for(var ae=0;ae<ie;){var pe=te.charAt(ie-ae-1);if(pe===se&&!he)ae++;else if(pe!==se&&he)ae++;else break}return te.substr(0,ie-ae)}function U(te,se){if(te.indexOf(se[1])===-1)return-1;for(var he=te.length,ie=0,ae=0;ae<he;ae++)if(te[ae]==="\\")ae++;else if(te[ae]===se[0])ie++;else if(te[ae]===se[1]&&(ie--,ie<0))return ae;return-1}function A(te){te&&te.sanitize&&!te.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var j={escape:o,unescape:s,edit:C,cleanUrl:R,resolveUrl:c,noopTest:x,merge:y,splitCells:g,rtrim:F,findClosingBracket:U,checkSanitizeDeprecation:A},N=W.defaults,b=j.rtrim,Y=j.splitCells,re=j.escape,fe=j.findClosingBracket;function ve(te,se,he){var ie=se.href,ae=se.title?re(se.title):null,pe=te[1].replace(/\\([\[\]])/g,"$1");return te[0].charAt(0)!=="!"?{type:"link",raw:he,href:ie,title:ae,text:pe}:{type:"image",raw:he,href:ie,title:ae,text:re(pe)}}function ke(te,se){var he=te.match(/^(\s+)(?:```)/);if(he===null)return se;var ie=he[1];return se.split(`
|
|
`).map(function(ae){var pe=ae.match(/^\s+/);if(pe===null)return ae;var me=pe[0];return me.length>=ie.length?ae.slice(ie.length):ae}).join(`
|
|
`)}var Se=function(){function te(he){this.options=he||N}var se=te.prototype;return se.space=function(ie){var ae=this.rules.block.newline.exec(ie);if(ae)return ae[0].length>1?{type:"space",raw:ae[0]}:{raw:`
|
|
`}},se.code=function(ie,ae){var pe=this.rules.block.code.exec(ie);if(pe){var me=ae[ae.length-1];if(me&&me.type==="paragraph")return{raw:pe[0],text:pe[0].trimRight()};var xe=pe[0].replace(/^ {4}/gm,"");return{type:"code",raw:pe[0],codeBlockStyle:"indented",text:this.options.pedantic?xe:b(xe,`
|
|
`)}}},se.fences=function(ie){var ae=this.rules.block.fences.exec(ie);if(ae){var pe=ae[0],me=ke(pe,ae[3]||"");return{type:"code",raw:pe,lang:ae[2]?ae[2].trim():ae[2],text:me}}},se.heading=function(ie){var ae=this.rules.block.heading.exec(ie);if(ae)return{type:"heading",raw:ae[0],depth:ae[1].length,text:ae[2]}},se.nptable=function(ie){var ae=this.rules.block.nptable.exec(ie);if(ae){var pe={type:"table",header:Y(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
|
|
`):[],raw:ae[0]};if(pe.header.length===pe.align.length){var me=pe.align.length,xe;for(xe=0;xe<me;xe++)/^ *-+: *$/.test(pe.align[xe])?pe.align[xe]="right":/^ *:-+: *$/.test(pe.align[xe])?pe.align[xe]="center":/^ *:-+ *$/.test(pe.align[xe])?pe.align[xe]="left":pe.align[xe]=null;for(me=pe.cells.length,xe=0;xe<me;xe++)pe.cells[xe]=Y(pe.cells[xe],pe.header.length);return pe}}},se.hr=function(ie){var ae=this.rules.block.hr.exec(ie);if(ae)return{type:"hr",raw:ae[0]}},se.blockquote=function(ie){var ae=this.rules.block.blockquote.exec(ie);if(ae){var pe=ae[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ae[0],text:pe}}},se.list=function(ie){var ae=this.rules.block.list.exec(ie);if(ae){for(var pe=ae[0],me=ae[2],xe=me.length>1,Oe=me[me.length-1]===")",Pe={type:"list",raw:pe,ordered:xe,start:xe?+me.slice(0,-1):"",loose:!1,items:[]},ze=ae[0].match(this.rules.block.item),tt=!1,rt,yt,ot,at,Lt,_t,Bt,Ft=ze.length,Tt=0;Tt<Ft;Tt++)rt=ze[Tt],pe=rt,yt=rt.length,rt=rt.replace(/^ *([*+-]|\d+[.)]) */,""),~rt.indexOf(`
|
|
`)&&(yt-=rt.length,rt=this.options.pedantic?rt.replace(/^ {1,4}/gm,""):rt.replace(new RegExp("^ {1,"+yt+"}","gm"),"")),Tt!==Ft-1&&(ot=this.rules.block.bullet.exec(ze[Tt+1])[0],(xe?ot.length===1||!Oe&&ot[ot.length-1]===")":ot.length>1||this.options.smartLists&&ot!==me)&&(at=ze.slice(Tt+1).join(`
|
|
`),Pe.raw=Pe.raw.substring(0,Pe.raw.length-at.length),Tt=Ft-1)),Lt=tt||/\n\n(?!\s*$)/.test(rt),Tt!==Ft-1&&(tt=rt.charAt(rt.length-1)===`
|
|
`,Lt||(Lt=tt)),Lt&&(Pe.loose=!0),_t=/^\[[ xX]\] /.test(rt),Bt=void 0,_t&&(Bt=rt[1]!==" ",rt=rt.replace(/^\[[ xX]\] +/,"")),Pe.items.push({type:"list_item",raw:pe,task:_t,checked:Bt,loose:Lt,text:rt});return Pe}},se.html=function(ie){var ae=this.rules.block.html.exec(ie);if(ae)return{type:this.options.sanitize?"paragraph":"html",raw:ae[0],pre:!this.options.sanitizer&&(ae[1]==="pre"||ae[1]==="script"||ae[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ae[0]):re(ae[0]):ae[0]}},se.def=function(ie){var ae=this.rules.block.def.exec(ie);if(ae){ae[3]&&(ae[3]=ae[3].substring(1,ae[3].length-1));var pe=ae[1].toLowerCase().replace(/\s+/g," ");return{tag:pe,raw:ae[0],href:ae[2],title:ae[3]}}},se.table=function(ie){var ae=this.rules.block.table.exec(ie);if(ae){var pe={type:"table",header:Y(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
|
|
`):[]};if(pe.header.length===pe.align.length){pe.raw=ae[0];var me=pe.align.length,xe;for(xe=0;xe<me;xe++)/^ *-+: *$/.test(pe.align[xe])?pe.align[xe]="right":/^ *:-+: *$/.test(pe.align[xe])?pe.align[xe]="center":/^ *:-+ *$/.test(pe.align[xe])?pe.align[xe]="left":pe.align[xe]=null;for(me=pe.cells.length,xe=0;xe<me;xe++)pe.cells[xe]=Y(pe.cells[xe].replace(/^ *\| *| *\| *$/g,""),pe.header.length);return pe}}},se.lheading=function(ie){var ae=this.rules.block.lheading.exec(ie);if(ae)return{type:"heading",raw:ae[0],depth:ae[2].charAt(0)==="="?1:2,text:ae[1]}},se.paragraph=function(ie){var ae=this.rules.block.paragraph.exec(ie);if(ae)return{type:"paragraph",raw:ae[0],text:ae[1].charAt(ae[1].length-1)===`
|
|
`?ae[1].slice(0,-1):ae[1]}},se.text=function(ie,ae){var pe=this.rules.block.text.exec(ie);if(pe){var me=ae[ae.length-1];return me&&me.type==="text"?{raw:pe[0],text:pe[0]}:{type:"text",raw:pe[0],text:pe[0]}}},se.escape=function(ie){var ae=this.rules.inline.escape.exec(ie);if(ae)return{type:"escape",raw:ae[0],text:re(ae[1])}},se.tag=function(ie,ae,pe){var me=this.rules.inline.tag.exec(ie);if(me)return!ae&&/^<a /i.test(me[0])?ae=!0:ae&&/^<\/a>/i.test(me[0])&&(ae=!1),!pe&&/^<(pre|code|kbd|script)(\s|>)/i.test(me[0])?pe=!0:pe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(me[0])&&(pe=!1),{type:this.options.sanitize?"text":"html",raw:me[0],inLink:ae,inRawBlock:pe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):re(me[0]):me[0]}},se.link=function(ie){var ae=this.rules.inline.link.exec(ie);if(ae){var pe=fe(ae[2],"()");if(pe>-1){var me=ae[0].indexOf("!")===0?5:4,xe=me+ae[1].length+pe;ae[2]=ae[2].substring(0,pe),ae[0]=ae[0].substring(0,xe).trim(),ae[3]=""}var Oe=ae[2],Pe="";if(this.options.pedantic){var ze=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Oe);ze?(Oe=ze[1],Pe=ze[3]):Pe=""}else Pe=ae[3]?ae[3].slice(1,-1):"";Oe=Oe.trim().replace(/^<([\s\S]*)>$/,"$1");var tt=ve(ae,{href:Oe&&Oe.replace(this.rules.inline._escapes,"$1"),title:Pe&&Pe.replace(this.rules.inline._escapes,"$1")},ae[0]);return tt}},se.reflink=function(ie,ae){var pe;if((pe=this.rules.inline.reflink.exec(ie))||(pe=this.rules.inline.nolink.exec(ie))){var me=(pe[2]||pe[1]).replace(/\s+/g," ");if(me=ae[me.toLowerCase()],!me||!me.href){var xe=pe[0].charAt(0);return{type:"text",raw:xe,text:xe}}var Oe=ve(pe,me,pe[0]);return Oe}},se.strong=function(ie,ae,pe){pe===void 0&&(pe="");var me=this.rules.inline.strong.start.exec(ie);if(me&&(!me[1]||me[1]&&(pe===""||this.rules.inline.punctuation.exec(pe)))){ae=ae.slice(-1*ie.length);var xe=me[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;xe.lastIndex=0;for(var Oe;(me=xe.exec(ae))!=null;)if(Oe=this.rules.inline.strong.middle.exec(ae.slice(0,me.index+3)),Oe)return{type:"strong",raw:ie.slice(0,Oe[0].length),text:ie.slice(2,Oe[0].length-2)}}},se.em=function(ie,ae,pe){pe===void 0&&(pe="");var me=this.rules.inline.em.start.exec(ie);if(me&&(!me[1]||me[1]&&(pe===""||this.rules.inline.punctuation.exec(pe)))){ae=ae.slice(-1*ie.length);var xe=me[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;xe.lastIndex=0;for(var Oe;(me=xe.exec(ae))!=null;)if(Oe=this.rules.inline.em.middle.exec(ae.slice(0,me.index+2)),Oe)return{type:"em",raw:ie.slice(0,Oe[0].length),text:ie.slice(1,Oe[0].length-1)}}},se.codespan=function(ie){var ae=this.rules.inline.code.exec(ie);if(ae){var pe=ae[2].replace(/\n/g," "),me=/[^ ]/.test(pe),xe=pe.startsWith(" ")&&pe.endsWith(" ");return me&&xe&&(pe=pe.substring(1,pe.length-1)),pe=re(pe,!0),{type:"codespan",raw:ae[0],text:pe}}},se.br=function(ie){var ae=this.rules.inline.br.exec(ie);if(ae)return{type:"br",raw:ae[0]}},se.del=function(ie){var ae=this.rules.inline.del.exec(ie);if(ae)return{type:"del",raw:ae[0],text:ae[1]}},se.autolink=function(ie,ae){var pe=this.rules.inline.autolink.exec(ie);if(pe){var me,xe;return pe[2]==="@"?(me=re(this.options.mangle?ae(pe[1]):pe[1]),xe="mailto:"+me):(me=re(pe[1]),xe=me),{type:"link",raw:pe[0],text:me,href:xe,tokens:[{type:"text",raw:me,text:me}]}}},se.url=function(ie,ae){var pe;if(pe=this.rules.inline.url.exec(ie)){var me,xe;if(pe[2]==="@")me=re(this.options.mangle?ae(pe[0]):pe[0]),xe="mailto:"+me;else{var Oe;do Oe=pe[0],pe[0]=this.rules.inline._backpedal.exec(pe[0])[0];while(Oe!==pe[0]);me=re(pe[0]),pe[1]==="www."?xe="http://"+me:xe=me}return{type:"link",raw:pe[0],text:me,href:xe,tokens:[{type:"text",raw:me,text:me}]}}},se.inlineText=function(ie,ae,pe){var me=this.rules.inline.text.exec(ie);if(me){var xe;return ae?xe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):re(me[0]):me[0]:xe=re(this.options.smartypants?pe(me[0]):me[0]),{type:"text",raw:me[0],text:xe}}},te}(),Le=j.noopTest,ye=j.edit,_e=j.merge,de={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Le,table:Le,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};de._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,de._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,de.def=ye(de.def).replace("label",de._label).replace("title",de._title).getRegex(),de.bullet=/(?:[*+-]|\d{1,9}[.)])/,de.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,de.item=ye(de.item,"gm").replace(/bull/g,de.bullet).getRegex(),de.list=ye(de.list).replace(/bull/g,de.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+de.def.source+")").getRegex(),de._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",de._comment=/<!--(?!-?>)[\s\S]*?-->/,de.html=ye(de.html,"i").replace("comment",de._comment).replace("tag",de._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),de.paragraph=ye(de._paragraph).replace("hr",de.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",de._tag).getRegex(),de.blockquote=ye(de.blockquote).replace("paragraph",de.paragraph).getRegex(),de.normal=_e({},de),de.gfm=_e({},de.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*|$)"}),de.gfm.nptable=ye(de.gfm.nptable).replace("hr",de.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",de._tag).getRegex(),de.gfm.table=ye(de.gfm.table).replace("hr",de.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",de._tag).getRegex(),de.pedantic=_e({},de.normal,{html:ye(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",de._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Le,paragraph:ye(de.normal._paragraph).replace("hr",de.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",de.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var z={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Le,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Le,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};z._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",z.punctuation=ye(z.punctuation).replace(/punctuation/g,z._punctuation).getRegex(),z._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",z._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",z.em.start=ye(z.em.start).replace(/punctuation/g,z._punctuation).getRegex(),z.em.middle=ye(z.em.middle).replace(/punctuation/g,z._punctuation).replace(/overlapSkip/g,z._overlapSkip).getRegex(),z.em.endAst=ye(z.em.endAst,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.em.endUnd=ye(z.em.endUnd,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.strong.start=ye(z.strong.start).replace(/punctuation/g,z._punctuation).getRegex(),z.strong.middle=ye(z.strong.middle).replace(/punctuation/g,z._punctuation).replace(/blockSkip/g,z._blockSkip).getRegex(),z.strong.endAst=ye(z.strong.endAst,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.strong.endUnd=ye(z.strong.endUnd,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.blockSkip=ye(z._blockSkip,"g").getRegex(),z.overlapSkip=ye(z._overlapSkip,"g").getRegex(),z._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,z._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,z._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])?)+(?![-_])/,z.autolink=ye(z.autolink).replace("scheme",z._scheme).replace("email",z._email).getRegex(),z._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,z.tag=ye(z.tag).replace("comment",de._comment).replace("attribute",z._attribute).getRegex(),z._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,z._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,z._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,z.link=ye(z.link).replace("label",z._label).replace("href",z._href).replace("title",z._title).getRegex(),z.reflink=ye(z.reflink).replace("label",z._label).getRegex(),z.reflinkSearch=ye(z.reflinkSearch,"g").replace("reflink",z.reflink).replace("nolink",z.nolink).getRegex(),z.normal=_e({},z),z.pedantic=_e({},z.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:ye(/^!?\[(label)\]\((.*?)\)/).replace("label",z._label).getRegex(),reflink:ye(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",z._label).getRegex()}),z.gfm=_e({},z.normal,{escape:ye(z.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),z.gfm.url=ye(z.gfm.url,"i").replace("email",z.gfm._extended_email).getRegex(),z.breaks=_e({},z.gfm,{br:ye(z.br).replace("{2,}","*").getRegex(),text:ye(z.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var D={block:de,inline:z},I=W.defaults,V=D.block,Q=D.inline;function G(te){return te.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function ce(te){var se="",he,ie,ae=te.length;for(he=0;he<ae;he++)ie=te.charCodeAt(he),Math.random()>.5&&(ie="x"+ie.toString(16)),se+="&#"+ie+";";return se}var Ce=function(){function te(he){this.tokens=[],this.tokens.links=Object.create(null),this.options=he||I,this.options.tokenizer=this.options.tokenizer||new Se,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ie={block:V.normal,inline:Q.normal};this.options.pedantic?(ie.block=V.pedantic,ie.inline=Q.pedantic):this.options.gfm&&(ie.block=V.gfm,this.options.breaks?ie.inline=Q.breaks:ie.inline=Q.gfm),this.tokenizer.rules=ie}te.lex=function(ie,ae){var pe=new te(ae);return pe.lex(ie)};var se=te.prototype;return se.lex=function(ie){return ie=ie.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(ie,this.tokens,!0),this.inline(this.tokens),this.tokens},se.blockTokens=function(ie,ae,pe){ae===void 0&&(ae=[]),pe===void 0&&(pe=!0),ie=ie.replace(/^ +$/gm,"");for(var me,xe,Oe,Pe;ie;){if(me=this.tokenizer.space(ie)){ie=ie.substring(me.raw.length),me.type&&ae.push(me);continue}if(me=this.tokenizer.code(ie,ae)){ie=ie.substring(me.raw.length),me.type?ae.push(me):(Pe=ae[ae.length-1],Pe.raw+=`
|
|
`+me.raw,Pe.text+=`
|
|
`+me.text);continue}if(me=this.tokenizer.fences(ie)){ie=ie.substring(me.raw.length),ae.push(me);continue}if(me=this.tokenizer.heading(ie)){ie=ie.substring(me.raw.length),ae.push(me);continue}if(me=this.tokenizer.nptable(ie)){ie=ie.substring(me.raw.length),ae.push(me);continue}if(me=this.tokenizer.hr(ie)){ie=ie.substring(me.raw.length),ae.push(me);continue}if(me=this.tokenizer.blockquote(ie)){ie=ie.substring(me.raw.length),me.tokens=this.blockTokens(me.text,[],pe),ae.push(me);continue}if(me=this.tokenizer.list(ie)){for(ie=ie.substring(me.raw.length),Oe=me.items.length,xe=0;xe<Oe;xe++)me.items[xe].tokens=this.blockTokens(me.items[xe].text,[],!1);ae.push(me);continue}if(me=this.tokenizer.html(ie)){ie=ie.substring(me.raw.length),ae.push(me);continue}if(pe&&(me=this.tokenizer.def(ie))){ie=ie.substring(me.raw.length),this.tokens.links[me.tag]||(this.tokens.links[me.tag]={href:me.href,title:me.title});continue}if(me=this.tokenizer.table(ie)){ie=ie.substring(me.raw.length),ae.push(me);continue}if(me=this.tokenizer.lheading(ie)){ie=ie.substring(me.raw.length),ae.push(me);continue}if(pe&&(me=this.tokenizer.paragraph(ie))){ie=ie.substring(me.raw.length),ae.push(me);continue}if(me=this.tokenizer.text(ie,ae)){ie=ie.substring(me.raw.length),me.type?ae.push(me):(Pe=ae[ae.length-1],Pe.raw+=`
|
|
`+me.raw,Pe.text+=`
|
|
`+me.text);continue}if(ie){var ze="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(ze);break}else throw new Error(ze)}}return ae},se.inline=function(ie){var ae,pe,me,xe,Oe,Pe,ze=ie.length;for(ae=0;ae<ze;ae++){Pe=ie[ae];switch(Pe.type){case"paragraph":case"text":case"heading":{Pe.tokens=[],this.inlineTokens(Pe.text,Pe.tokens);break}case"table":{for(Pe.tokens={header:[],cells:[]},xe=Pe.header.length,pe=0;pe<xe;pe++)Pe.tokens.header[pe]=[],this.inlineTokens(Pe.header[pe],Pe.tokens.header[pe]);for(xe=Pe.cells.length,pe=0;pe<xe;pe++)for(Oe=Pe.cells[pe],Pe.tokens.cells[pe]=[],me=0;me<Oe.length;me++)Pe.tokens.cells[pe][me]=[],this.inlineTokens(Oe[me],Pe.tokens.cells[pe][me]);break}case"blockquote":{this.inline(Pe.tokens);break}case"list":{for(xe=Pe.items.length,pe=0;pe<xe;pe++)this.inline(Pe.items[pe].tokens);break}}}return ie},se.inlineTokens=function(ie,ae,pe,me,xe){ae===void 0&&(ae=[]),pe===void 0&&(pe=!1),me===void 0&&(me=!1),xe===void 0&&(xe="");var Oe,Pe=ie,ze;if(this.tokens.links){var tt=Object.keys(this.tokens.links);if(tt.length>0)for(;(ze=this.tokenizer.rules.inline.reflinkSearch.exec(Pe))!=null;)tt.includes(ze[0].slice(ze[0].lastIndexOf("[")+1,-1))&&(Pe=Pe.slice(0,ze.index)+"["+"a".repeat(ze[0].length-2)+"]"+Pe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ze=this.tokenizer.rules.inline.blockSkip.exec(Pe))!=null;)Pe=Pe.slice(0,ze.index)+"["+"a".repeat(ze[0].length-2)+"]"+Pe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ie;){if(Oe=this.tokenizer.escape(ie)){ie=ie.substring(Oe.raw.length),ae.push(Oe);continue}if(Oe=this.tokenizer.tag(ie,pe,me)){ie=ie.substring(Oe.raw.length),pe=Oe.inLink,me=Oe.inRawBlock,ae.push(Oe);continue}if(Oe=this.tokenizer.link(ie)){ie=ie.substring(Oe.raw.length),Oe.type==="link"&&(Oe.tokens=this.inlineTokens(Oe.text,[],!0,me)),ae.push(Oe);continue}if(Oe=this.tokenizer.reflink(ie,this.tokens.links)){ie=ie.substring(Oe.raw.length),Oe.type==="link"&&(Oe.tokens=this.inlineTokens(Oe.text,[],!0,me)),ae.push(Oe);continue}if(Oe=this.tokenizer.strong(ie,Pe,xe)){ie=ie.substring(Oe.raw.length),Oe.tokens=this.inlineTokens(Oe.text,[],pe,me),ae.push(Oe);continue}if(Oe=this.tokenizer.em(ie,Pe,xe)){ie=ie.substring(Oe.raw.length),Oe.tokens=this.inlineTokens(Oe.text,[],pe,me),ae.push(Oe);continue}if(Oe=this.tokenizer.codespan(ie)){ie=ie.substring(Oe.raw.length),ae.push(Oe);continue}if(Oe=this.tokenizer.br(ie)){ie=ie.substring(Oe.raw.length),ae.push(Oe);continue}if(Oe=this.tokenizer.del(ie)){ie=ie.substring(Oe.raw.length),Oe.tokens=this.inlineTokens(Oe.text,[],pe,me),ae.push(Oe);continue}if(Oe=this.tokenizer.autolink(ie,ce)){ie=ie.substring(Oe.raw.length),ae.push(Oe);continue}if(!pe&&(Oe=this.tokenizer.url(ie,ce))){ie=ie.substring(Oe.raw.length),ae.push(Oe);continue}if(Oe=this.tokenizer.inlineText(ie,me,G)){ie=ie.substring(Oe.raw.length),xe=Oe.raw.slice(-1),ae.push(Oe);continue}if(ie){var rt="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(rt);break}else throw new Error(rt)}}return ae},$(te,null,[{key:"rules",get:function(){return{block:V,inline:Q}}}]),te}(),De=W.defaults,ue=j.cleanUrl,ge=j.escape,we=function(){function te(he){this.options=he||De}var se=te.prototype;return se.code=function(ie,ae,pe){var me=(ae||"").match(/\S*/)[0];if(this.options.highlight){var xe=this.options.highlight(ie,me);xe!=null&&xe!==ie&&(pe=!0,ie=xe)}return me?'<pre><code class="'+this.options.langPrefix+ge(me,!0)+'">'+(pe?ie:ge(ie,!0))+`</code></pre>
|
|
`:"<pre><code>"+(pe?ie:ge(ie,!0))+`</code></pre>
|
|
`},se.blockquote=function(ie){return`<blockquote>
|
|
`+ie+`</blockquote>
|
|
`},se.html=function(ie){return ie},se.heading=function(ie,ae,pe,me){return this.options.headerIds?"<h"+ae+' id="'+this.options.headerPrefix+me.slug(pe)+'">'+ie+"</h"+ae+`>
|
|
`:"<h"+ae+">"+ie+"</h"+ae+`>
|
|
`},se.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},se.list=function(ie,ae,pe){var me=ae?"ol":"ul",xe=ae&&pe!==1?' start="'+pe+'"':"";return"<"+me+xe+`>
|
|
`+ie+"</"+me+`>
|
|
`},se.listitem=function(ie){return"<li>"+ie+`</li>
|
|
`},se.checkbox=function(ie){return"<input "+(ie?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},se.paragraph=function(ie){return"<p>"+ie+`</p>
|
|
`},se.table=function(ie,ae){return ae&&(ae="<tbody>"+ae+"</tbody>"),`<table>
|
|
<thead>
|
|
`+ie+`</thead>
|
|
`+ae+`</table>
|
|
`},se.tablerow=function(ie){return`<tr>
|
|
`+ie+`</tr>
|
|
`},se.tablecell=function(ie,ae){var pe=ae.header?"th":"td",me=ae.align?"<"+pe+' align="'+ae.align+'">':"<"+pe+">";return me+ie+"</"+pe+`>
|
|
`},se.strong=function(ie){return"<strong>"+ie+"</strong>"},se.em=function(ie){return"<em>"+ie+"</em>"},se.codespan=function(ie){return"<code>"+ie+"</code>"},se.br=function(){return this.options.xhtml?"<br/>":"<br>"},se.del=function(ie){return"<del>"+ie+"</del>"},se.link=function(ie,ae,pe){if(ie=ue(this.options.sanitize,this.options.baseUrl,ie),ie===null)return pe;var me='<a href="'+ge(ie)+'"';return ae&&(me+=' title="'+ae+'"'),me+=">"+pe+"</a>",me},se.image=function(ie,ae,pe){if(ie=ue(this.options.sanitize,this.options.baseUrl,ie),ie===null)return pe;var me='<img src="'+ie+'" alt="'+pe+'"';return ae&&(me+=' title="'+ae+'"'),me+=this.options.xhtml?"/>":">",me},se.text=function(ie){return ie},te}(),Ae=function(){function te(){}var se=te.prototype;return se.strong=function(ie){return ie},se.em=function(ie){return ie},se.codespan=function(ie){return ie},se.del=function(ie){return ie},se.html=function(ie){return ie},se.text=function(ie){return ie},se.link=function(ie,ae,pe){return""+pe},se.image=function(ie,ae,pe){return""+pe},se.br=function(){return""},te}(),Ne=function(){function te(){this.seen={}}var se=te.prototype;return se.slug=function(ie){var ae=ie.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ae)){var pe=ae;do this.seen[pe]++,ae=pe+"-"+this.seen[pe];while(this.seen.hasOwnProperty(ae))}return this.seen[ae]=0,ae},te}(),Be=W.defaults,Ge=j.unescape,He=function(){function te(he){this.options=he||Be,this.options.renderer=this.options.renderer||new we,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ae,this.slugger=new Ne}te.parse=function(ie,ae){var pe=new te(ae);return pe.parse(ie)};var se=te.prototype;return se.parse=function(ie,ae){ae===void 0&&(ae=!0);var pe="",me,xe,Oe,Pe,ze,tt,rt,yt,ot,at,Lt,_t,Bt,Ft,Tt,si,Ei,zt,di=ie.length;for(me=0;me<di;me++){at=ie[me];switch(at.type){case"space":continue;case"hr":{pe+=this.renderer.hr();continue}case"heading":{pe+=this.renderer.heading(this.parseInline(at.tokens),at.depth,Ge(this.parseInline(at.tokens,this.textRenderer)),this.slugger);continue}case"code":{pe+=this.renderer.code(at.text,at.lang,at.escaped);continue}case"table":{for(yt="",rt="",Pe=at.header.length,xe=0;xe<Pe;xe++)rt+=this.renderer.tablecell(this.parseInline(at.tokens.header[xe]),{header:!0,align:at.align[xe]});for(yt+=this.renderer.tablerow(rt),ot="",Pe=at.cells.length,xe=0;xe<Pe;xe++){for(tt=at.tokens.cells[xe],rt="",ze=tt.length,Oe=0;Oe<ze;Oe++)rt+=this.renderer.tablecell(this.parseInline(tt[Oe]),{header:!1,align:at.align[Oe]});ot+=this.renderer.tablerow(rt)}pe+=this.renderer.table(yt,ot);continue}case"blockquote":{ot=this.parse(at.tokens),pe+=this.renderer.blockquote(ot);continue}case"list":{for(Lt=at.ordered,_t=at.start,Bt=at.loose,Pe=at.items.length,ot="",xe=0;xe<Pe;xe++)Tt=at.items[xe],si=Tt.checked,Ei=Tt.task,Ft="",Tt.task&&(zt=this.renderer.checkbox(si),Bt?Tt.tokens.length>0&&Tt.tokens[0].type==="text"?(Tt.tokens[0].text=zt+" "+Tt.tokens[0].text,Tt.tokens[0].tokens&&Tt.tokens[0].tokens.length>0&&Tt.tokens[0].tokens[0].type==="text"&&(Tt.tokens[0].tokens[0].text=zt+" "+Tt.tokens[0].tokens[0].text)):Tt.tokens.unshift({type:"text",text:zt}):Ft+=zt),Ft+=this.parse(Tt.tokens,Bt),ot+=this.renderer.listitem(Ft,Ei,si);pe+=this.renderer.list(ot,Lt,_t);continue}case"html":{pe+=this.renderer.html(at.text);continue}case"paragraph":{pe+=this.renderer.paragraph(this.parseInline(at.tokens));continue}case"text":{for(ot=at.tokens?this.parseInline(at.tokens):at.text;me+1<di&&ie[me+1].type==="text";)at=ie[++me],ot+=`
|
|
`+(at.tokens?this.parseInline(at.tokens):at.text);pe+=ae?this.renderer.paragraph(ot):ot;continue}default:{var dt='Token with "'+at.type+'" type was not found.';if(this.options.silent){console.error(dt);return}else throw new Error(dt)}}}return pe},se.parseInline=function(ie,ae){ae=ae||this.renderer;var pe="",me,xe,Oe=ie.length;for(me=0;me<Oe;me++){xe=ie[me];switch(xe.type){case"escape":{pe+=ae.text(xe.text);break}case"html":{pe+=ae.html(xe.text);break}case"link":{pe+=ae.link(xe.href,xe.title,this.parseInline(xe.tokens,ae));break}case"image":{pe+=ae.image(xe.href,xe.title,xe.text);break}case"strong":{pe+=ae.strong(this.parseInline(xe.tokens,ae));break}case"em":{pe+=ae.em(this.parseInline(xe.tokens,ae));break}case"codespan":{pe+=ae.codespan(xe.text);break}case"br":{pe+=ae.br();break}case"del":{pe+=ae.del(this.parseInline(xe.tokens,ae));break}case"text":{pe+=ae.text(xe.text);break}default:{var Pe='Token with "'+xe.type+'" type was not found.';if(this.options.silent){console.error(Pe);return}else throw new Error(Pe)}}}return pe},te}(),qe=j.merge,je=j.checkSanitizeDeprecation,Ke=j.escape,Me=W.getDefaults,et=W.changeDefaults,Je=W.defaults;function le(te,se,he){if(typeof te=="undefined"||te===null)throw new Error("marked(): input parameter is undefined or null");if(typeof te!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(te)+", string expected");if(typeof se=="function"&&(he=se,se=null),se=qe({},le.defaults,se||{}),je(se),he){var ie=se.highlight,ae;try{ae=Ce.lex(te,se)}catch(Oe){return he(Oe)}var pe=function(Pe){var ze;if(!Pe)try{ze=He.parse(ae,se)}catch(tt){Pe=tt}return se.highlight=ie,Pe?he(Pe):he(null,ze)};if(!ie||ie.length<3)return pe();if(delete se.highlight,!ae.length)return pe();var me=0;le.walkTokens(ae,function(Oe){Oe.type==="code"&&(me++,setTimeout(function(){ie(Oe.text,Oe.lang,function(Pe,ze){if(Pe)return pe(Pe);ze!=null&&ze!==Oe.text&&(Oe.text=ze,Oe.escaped=!0),me--,me===0&&pe()})},0))}),me===0&&pe();return}try{var xe=Ce.lex(te,se);return se.walkTokens&&le.walkTokens(xe,se.walkTokens),He.parse(xe,se)}catch(Oe){if(Oe.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,se.silent)return"<p>An error occurred:</p><pre>"+Ke(Oe.message+"",!0)+"</pre>";throw Oe}}le.options=le.setOptions=function(te){return qe(le.defaults,te),et(le.defaults),le},le.getDefaults=Me,le.defaults=Je,le.use=function(te){var se=qe({},te);if(te.renderer&&function(){var ie=le.defaults.renderer||new we,ae=function(xe){var Oe=ie[xe];ie[xe]=function(){for(var Pe=arguments.length,ze=new Array(Pe),tt=0;tt<Pe;tt++)ze[tt]=arguments[tt];var rt=te.renderer[xe].apply(ie,ze);return rt===!1&&(rt=Oe.apply(ie,ze)),rt}};for(var pe in te.renderer)ae(pe);se.renderer=ie}(),te.tokenizer&&function(){var ie=le.defaults.tokenizer||new Se,ae=function(xe){var Oe=ie[xe];ie[xe]=function(){for(var Pe=arguments.length,ze=new Array(Pe),tt=0;tt<Pe;tt++)ze[tt]=arguments[tt];var rt=te.tokenizer[xe].apply(ie,ze);return rt===!1&&(rt=Oe.apply(ie,ze)),rt}};for(var pe in te.tokenizer)ae(pe);se.tokenizer=ie}(),te.walkTokens){var he=le.defaults.walkTokens;se.walkTokens=function(ie){te.walkTokens(ie),he&&he(ie)}}le.setOptions(se)},le.walkTokens=function(te,se){for(var he=B(te),ie;!(ie=he()).done;){var ae=ie.value;se(ae);switch(ae.type){case"table":{for(var pe=B(ae.tokens.header),me;!(me=pe()).done;){var xe=me.value;le.walkTokens(xe,se)}for(var Oe=B(ae.tokens.cells),Pe;!(Pe=Oe()).done;)for(var ze=Pe.value,tt=B(ze),rt;!(rt=tt()).done;){var yt=rt.value;le.walkTokens(yt,se)}break}case"list":{le.walkTokens(ae.items,se);break}default:ae.tokens&&le.walkTokens(ae.tokens,se)}}},le.Parser=He,le.parser=He.parse,le.Renderer=we,le.TextRenderer=Ae,le.Lexer=Ce,le.lexer=Ce.lex,le.Tokenizer=Se,le.Slugger=Ne,le.parse=le;var q=le;return q})},ELLl:function(Ze,Te,Z){(function(oe){oe(Z("VrN/"))})(function(oe){var $={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},M=oe.Pos;oe.defineOption("autoCloseBrackets",!1,function(h,f,o){o&&o!=oe.Init&&(h.removeKeyMap(B),h.state.closeBrackets=null),f&&(P(X(f,"pairs")),h.state.closeBrackets=f,h.addKeyMap(B))});function X(h,f){return f=="pairs"&&typeof h=="string"?h:typeof h=="object"&&h[f]!=null?h[f]:$[f]}var B={Backspace:i,Enter:L};function P(h){for(var f=0;f<h.length;f++){var o=h.charAt(f),u="'"+o+"'";B[u]||(B[u]=W(o))}}P($.pairs+"`");function W(h){return function(f){return m(f,h)}}function H(h){var f=h.state.closeBrackets;if(!f||f.override)return f;var o=h.getModeAt(h.getCursor());return o.closeBrackets||f}function i(h){var f=H(h);if(!f||h.getOption("disableInput"))return oe.Pass;for(var o=X(f,"pairs"),u=h.listSelections(),s=0;s<u.length;s++){if(!u[s].empty())return oe.Pass;var a=p(h,u[s].head);if(!a||o.indexOf(a)%2!=0)return oe.Pass}for(var s=u.length-1;s>=0;s--){var C=u[s].head;h.replaceRange("",M(C.line,C.ch-1),M(C.line,C.ch+1),"+delete")}}function L(h){var f=H(h),o=f&&X(f,"explode");if(!o||h.getOption("disableInput"))return oe.Pass;for(var u=h.listSelections(),s=0;s<u.length;s++){if(!u[s].empty())return oe.Pass;var a=p(h,u[s].head);if(!a||o.indexOf(a)%2!=0)return oe.Pass}h.operation(function(){var C=h.lineSeparator()||`
|
|
`;h.replaceSelection(C+C,null),h.execCommand("goCharLeft"),u=h.listSelections();for(var _=0;_<u.length;_++){var T=u[_].head.line;h.indentLine(T,null,!0),h.indentLine(T+1,null,!0)}})}function v(h){var f=oe.cmpPos(h.anchor,h.head)>0;return{anchor:new M(h.anchor.line,h.anchor.ch+(f?-1:1)),head:new M(h.head.line,h.head.ch+(f?1:-1))}}function m(h,f){var o=H(h);if(!o||h.getOption("disableInput"))return oe.Pass;var u=X(o,"pairs"),s=u.indexOf(f);if(s==-1)return oe.Pass;for(var a=X(o,"closeBefore"),C=X(o,"triples"),_=u.charAt(s+1)==f,T=h.listSelections(),R=s%2==0,O,S=0;S<T.length;S++){var w=T[S],E=w.head,c,x=h.getRange(E,M(E.line,E.ch+1));if(R&&!w.empty())c="surround";else if((_||!R)&&x==f)_&&l(h,E)?c="both":C.indexOf(f)>=0&&h.getRange(E,M(E.line,E.ch+3))==f+f+f?c="skipThree":c="skip";else if(_&&E.ch>1&&C.indexOf(f)>=0&&h.getRange(M(E.line,E.ch-2),E)==f+f){if(E.ch>2&&/\bstring/.test(h.getTokenTypeAt(M(E.line,E.ch-2))))return oe.Pass;c="addFour"}else if(_){var y=E.ch==0?" ":h.getRange(M(E.line,E.ch-1),E);if(!oe.isWordChar(x)&&y!=f&&!oe.isWordChar(y))c="both";else return oe.Pass}else if(R&&(x.length===0||/\s/.test(x)||a.indexOf(x)>-1))c="both";else return oe.Pass;if(!O)O=c;else if(O!=c)return oe.Pass}var g=s%2?u.charAt(s-1):f,F=s%2?f:u.charAt(s+1);h.operation(function(){if(O=="skip")h.execCommand("goCharRight");else if(O=="skipThree")for(var U=0;U<3;U++)h.execCommand("goCharRight");else if(O=="surround"){for(var A=h.getSelections(),U=0;U<A.length;U++)A[U]=g+A[U]+F;h.replaceSelections(A,"around"),A=h.listSelections().slice();for(var U=0;U<A.length;U++)A[U]=v(A[U]);h.setSelections(A)}else O=="both"?(h.replaceSelection(g+F,null),h.triggerElectric(g+F),h.execCommand("goCharLeft")):O=="addFour"&&(h.replaceSelection(g+g+g+g,"before"),h.execCommand("goCharRight"))})}function p(h,f){var o=h.getRange(M(f.line,f.ch-1),M(f.line,f.ch+1));return o.length==2?o:null}function l(h,f){var o=h.getTokenAt(M(f.line,f.ch+1));return/\bstring/.test(o.type)&&o.start==f.ch&&(f.ch==0||!/\bstring/.test(h.getTokenTypeAt(f)))}})},FWmy:function(Ze,Te,Z){"use strict";Z.d(Te,"a",function(){return oe});function oe($,M){if(!$)throw new Error(M?`Assertion failed (${M})`:"Assertion Failed")}},HmJG:function(Ze,Te,Z){},JYp7:function(Ze,Te,Z){"use strict";Z.d(Te,"a",function(){return oe});var oe;(function($){function M(a){return a&&typeof a=="object"&&typeof a[Symbol.iterator]=="function"}$.is=M;const X=Object.freeze([]);function B(){return X}$.empty=B;function*P(a){yield a}$.single=P;function W(a){return a||X}$.from=W;function H(a){return!a||a[Symbol.iterator]().next().done===!0}$.isEmpty=H;function i(a){return a[Symbol.iterator]().next().value}$.first=i;function L(a,C){for(const _ of a)if(C(_))return!0;return!1}$.some=L;function v(a,C){for(const _ of a)if(C(_))return _;return}$.find=v;function*m(a,C){for(const _ of a)C(_)&&(yield _)}$.filter=m;function*p(a,C){let _=0;for(const T of a)yield C(T,_++)}$.map=p;function*l(...a){for(const C of a)for(const _ of C)yield _}$.concat=l;function*h(a){for(const C of a)for(const _ of C)yield _}$.concatNested=h;function f(a,C,_){let T=_;for(const R of a)T=C(T,R);return T}$.reduce=f;function*o(a,C,_=a.length){for(C<0&&(C+=a.length),_<0?_+=a.length:_>a.length&&(_=a.length);C<_;C++)yield a[C]}$.slice=o;function u(a,C=Number.POSITIVE_INFINITY){const _=[];if(C===0)return[_,a];const T=a[Symbol.iterator]();for(let R=0;R<C;R++){const O=T.next();if(O.done)return[_,$.empty()];_.push(O.value)}return[_,{[Symbol.iterator](){return T}}]}$.consume=u;function s(a,C,_=(T,R)=>T===R){const T=a[Symbol.iterator](),R=C[Symbol.iterator]();for(;;){const O=T.next(),S=R.next();if(O.done!==S.done)return!1;if(O.done)return!0;if(!_(O.value,S.value))return!1}}$.equals=s})(oe||(oe={}))},LdHM:function(Ze,Te,Z){"use strict";Z.d(Te,"b",function(){return a}),Z.d(Te,"a",function(){return _});var oe=Z("1OyB"),$=Z("vuIU"),M=Z("Ji7U"),X=Z("LK+K"),B=Z("q1tI"),P=Z("rePB"),W=Z("Ff2n"),H=Z("ODXe"),i=Z("4IlW"),L=Z("bX4T"),v=Z("YrtM"),m=Z("TSYQ"),p=Z.n(m),l=Z("+nKL"),h=Z("8OUc"),f=function(Y,re){var fe=Y.prefixCls,ve=Y.id,ke=Y.flattenOptions,Se=Y.childrenAsData,Le=Y.values,ye=Y.searchValue,_e=Y.multiple,de=Y.defaultActiveFirstOption,z=Y.height,D=Y.itemHeight,I=Y.notFoundContent,V=Y.open,Q=Y.menuItemSelectedIcon,G=Y.virtual,ce=Y.onSelect,Ce=Y.onToggleOpen,De=Y.onActiveValue,ue=Y.onScroll,ge=Y.onMouseEnter,we="".concat(fe,"-item"),Ae=Object(v.a)(function(){return ke},[V,ke],function(q,te){return te[0]&&q[1]!==te[1]}),Ne=B.useRef(null),Be=function(te){te.preventDefault()},Ge=function(te){Ne.current&&Ne.current.scrollTo({index:te})},He=function(te){for(var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,he=Ae.length,ie=0;ie<he;ie+=1){var ae=(te+ie*se+he)%he,pe=Ae[ae],me=pe.group,xe=pe.data;if(!me&&!xe.disabled)return ae}return-1},qe=B.useState(function(){return He(0)}),je=Object(H.a)(qe,2),Ke=je[0],Me=je[1],et=function(te){Me(te);var se=Ae[te];if(!se){De(null,-1);return}De(se.data.value,te)};B.useEffect(function(){et(de!==!1?He(0):-1)},[Ae.length,ye]),B.useEffect(function(){var q=setTimeout(function(){if(!_e&&V&&Le.size===1){var te=Array.from(Le)[0],se=Ae.findIndex(function(he){var ie=he.data;return ie.value===te});et(se),Ge(se)}});return function(){return clearTimeout(q)}},[V]);var Je=function(te){te!==void 0&&ce(te,{selected:!Le.has(te)}),_e||Ce(!1)};if(B.useImperativeHandle(re,function(){return{onKeyDown:function(te){var se=te.which;switch(se){case i.a.UP:case i.a.DOWN:{var he=0;if(se===i.a.UP?he=-1:se===i.a.DOWN&&(he=1),he!==0){var ie=He(Ke+he,he);Ge(ie),et(ie)}break}case i.a.ENTER:{var ae=Ae[Ke];ae&&!ae.data.disabled?Je(ae.data.value):Je(void 0),V&&te.preventDefault();break}case i.a.ESC:Ce(!1)}},onKeyUp:function(){},scrollTo:function(te){Ge(te)}}}),Ae.length===0)return B.createElement("div",{role:"listbox",id:"".concat(ve,"_list"),className:"".concat(we,"-empty"),onMouseDown:Be},I);function le(q){var te=Ae[q];if(!te)return null;var se=te.data||{},he=se.value,ie=se.label,ae=se.children,pe=Object(L.a)(se,!0),me=Se?ae:ie;return te?B.createElement("div",Object.assign({"aria-label":typeof me=="string"?me:null},pe,{key:q,role:"option",id:"".concat(ve,"_list_").concat(q),"aria-selected":Le.has(he)}),he):null}return B.createElement(B.Fragment,null,B.createElement("div",{role:"listbox",id:"".concat(ve,"_list"),style:{height:0,width:0,overflow:"hidden"}},le(Ke-1),le(Ke),le(Ke+1)),B.createElement(l.a,{itemKey:"key",ref:Ne,data:Ae,height:z,itemHeight:D,fullHeight:!1,onMouseDown:Be,onScroll:ue,virtual:G,onMouseEnter:ge},function(q,te){var se,he=q.group,ie=q.groupOption,ae=q.data,pe=ae.label,me=ae.key;if(he)return B.createElement("div",{className:p()(we,"".concat(we,"-group"))},pe!==void 0?pe:me);var xe=ae.disabled,Oe=ae.value,Pe=ae.title,ze=ae.children,tt=ae.style,rt=ae.className,yt=Object(W.a)(ae,["disabled","value","title","children","style","className"]),ot=Le.has(Oe),at="".concat(we,"-option"),Lt=p()(we,at,rt,(se={},Object(P.a)(se,"".concat(at,"-grouped"),ie),Object(P.a)(se,"".concat(at,"-active"),Ke===te&&!xe),Object(P.a)(se,"".concat(at,"-disabled"),xe),Object(P.a)(se,"".concat(at,"-selected"),ot),se)),_t=Se?ze:pe,Bt=!Q||typeof Q=="function"||ot;return B.createElement("div",Object.assign({},yt,{"aria-selected":ot,className:Lt,title:Pe,onMouseMove:function(){if(Ke===te||xe)return;et(te)},onClick:function(){xe||Je(Oe)},style:tt}),B.createElement("div",{className:"".concat(at,"-content")},_t||Oe),B.isValidElement(Q)||ot,Bt&&B.createElement(h.a,{className:"".concat(we,"-option-state"),customizeIcon:Q,customizeIconProps:{isSelected:ot}},ot?"\u2713":null))}))},o=B.forwardRef(f);o.displayName="OptionList";var u=o,s=function(){return null};s.isSelectOption=!0;var a=s,C=function(){return null};C.isSelectOptGroup=!0;var _=C,T=Z("VTBJ"),R=Z("Zm9Q");function O(b){var Y=b.key,re=b.props,fe=re.children,ve=re.value,ke=Object(W.a)(re,["children","value"]);return Object(T.a)({key:Y,value:ve!==void 0?ve:Y,children:fe},ke)}function S(b){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(b).map(function(re,fe){if(!B.isValidElement(re)||!re.type)return null;var ve=re.type.isSelectOptGroup,ke=re.key,Se=re.props,Le=Se.children,ye=Object(W.a)(Se,["children"]);return Y||!ve?O(re):Object(T.a)(Object(T.a)({key:"__RC_SELECT_GRP__".concat(ke===null?fe:ke,"__"),label:ke},ye),{},{options:S(Le)})}).filter(function(re){return re})}var w=Z("2Qr1"),E=Z("qNPg"),c=Z("U8pU"),x=Z("Kwbf"),y=Z("WKfj");function g(b){var Y=b.mode,re=b.options,fe=b.children,ve=b.backfill,ke=b.allowClear,Se=b.placeholder,Le=b.getInputElement,ye=b.showSearch,_e=b.onSearch,de=b.defaultOpen,z=b.autoFocus,D=b.labelInValue,I=b.value,V=b.inputValue,Q=b.optionLabelProp,G=Y==="multiple"||Y==="tags",ce=ye!==void 0?ye:G||Y==="combobox",Ce=re||S(fe);if(Object(x.a)(Y!=="tags"||Ce.every(function(we){return!we.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Y==="tags"||Y==="combobox"){var De=Ce.some(function(we){return we.options?we.options.some(function(Ae){return typeof("value"in Ae?Ae.value:Ae.key)=="number"}):typeof("value"in we?we.value:we.key)=="number"});Object(x.a)(!De,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(x.a)(Y!=="combobox"||!Q,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(x.a)(Y==="combobox"||!ve,"`backfill` only works with `combobox` mode."),Object(x.a)(Y==="combobox"||!Le,"`getInputElement` only work with `combobox` mode."),Object(x.b)(Y!=="combobox"||!Le||!ke||!Se,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),_e&&!ce&&Y!=="combobox"&&Y!=="tags"&&Object(x.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(x.b)(!de||z,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),I!=null){var ue=Object(y.d)(I);Object(x.a)(!D||ue.every(function(we){return Object(c.a)(we)==="object"&&("key"in we||"value"in we)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(x.a)(!G||Array.isArray(I),"`value` should be array when `mode` is `multiple` or `tags`")}if(fe){var ge=null;Object(R.a)(fe).some(function(we){if(!B.isValidElement(we)||!we.type)return!1;var Ae=we.type;if(Ae.isSelectOption)return!1;if(Ae.isSelectOptGroup){var Ne=Object(R.a)(we.props.children).every(function(Be){return!B.isValidElement(Be)||!we.type||Be.type.isSelectOption?!0:(ge=Be.type,!1)});return!Ne}return ge=Ae,!0}),ge&&Object(x.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ge.displayName||ge.name||ge,"`.")),Object(x.a)(V===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var F=g,U=Object(E.a)({prefixCls:"rc-select",components:{optionList:u},convertChildrenToData:S,flattenOptions:w.d,getLabeledValue:w.e,filterOptions:w.b,isValueDisabled:w.g,findValueOption:w.c,warningProps:F,fillOptionsWithMissingValue:w.a}),A=function(b){Object(M.a)(re,b);var Y=Object(X.a)(re);function re(){var fe;return Object(oe.a)(this,re),fe=Y.apply(this,arguments),fe.selectRef=B.createRef(),fe.focus=function(){fe.selectRef.current.focus()},fe.blur=function(){fe.selectRef.current.blur()},fe}return Object($.a)(re,[{key:"render",value:function(){return B.createElement(U,Object.assign({ref:this.selectRef},this.props))}}]),re}(B.Component);A.Option=a,A.OptGroup=_;var j=A,N=Te.c=j},M8RZ:function(Ze,Te,Z){"use strict";Z.d(Te,"a",function(){return i});var oe=Z("fWQN"),$=Z("mtLc"),M=Z("yKVA"),X=Z("879j"),B=Z("q1tI"),P=Z.n(B),W=Z("i8i4"),H=Z.n(W),i=function(L){Object(M.a)(m,L);var v=Object(X.a)(m);function m(p){var l;Object(oe.a)(this,m),l=v.call(this,p);var h=window.document;return l.node=h.createElement("div"),h.body.appendChild(l.node),l}return Object($.a)(m,[{key:"render",value:function(){var l=this.props.children;return Object(W.createPortal)(l,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(P.a.Component)},MI8n:function(Ze,Te,Z){"use strict";Z.d(Te,"c",function(){return B}),Z.d(Te,"b",function(){return i}),Z.d(Te,"e",function(){return L}),Z.d(Te,"a",function(){return v}),Z.d(Te,"d",function(){return m}),Z.d(Te,"f",function(){return p});var oe=Z("/cxE"),$=Z("pmY6"),M=Z("24hK"),X=Z("5Y4S"),B;(function(l){l.None=()=>$.a.None;function h(g){return(F,U=null,A)=>{let j=!1,N;return N=g(b=>j?void 0:(N?N.dispose():j=!0,F.call(U,b)),null,A),j&&N.dispose(),N}}l.once=h;function f(g,F){return _((U,A=null,j)=>g(N=>U.call(A,F(N)),null,j))}l.map=f;function o(g,F){return _((U,A=null,j)=>g(N=>{F(N),U.call(A,N)},null,j))}l.forEach=o;function u(g,F){return _((U,A=null,j)=>g(N=>F(N)&&U.call(A,N),null,j))}l.filter=u;function s(g){return g}l.signal=s;function a(...g){return(F,U=null,A)=>Object($.e)(...g.map(j=>j(N=>F.call(U,N),null,A)))}l.any=a;function C(g,F,U){let A=U;return f(g,j=>(A=F(A,j),A))}l.reduce=C;function _(g){let F;const U=new i({onFirstListenerAdd(){F=g(U.fire,U)},onLastListenerRemove(){F.dispose()}});return U.event}function T(g,F,U=100,A=!1,j){let N,b,Y,re=0;const fe=new i({leakWarningThreshold:j,onFirstListenerAdd(){N=g(ve=>{re++,b=F(b,ve),A&&!Y&&(fe.fire(b),b=void 0),clearTimeout(Y),Y=setTimeout(()=>{const ke=b;b=void 0,Y=void 0,(!A||re>1)&&fe.fire(ke),re=0},U)})},onLastListenerRemove(){N.dispose()}});return fe.event}l.debounce=T;function R(g,F=(U,A)=>U===A){let U=!0,A;return u(g,j=>{const N=U||!F(j,A);return U=!1,A=j,N})}l.latch=R;function O(g,F){return[l.filter(g,F),l.filter(g,U=>!F(U))]}l.split=O;function S(g,F=!1,U=[]){let A=U.slice(),j=g(Y=>{A?A.push(Y):b.fire(Y)});const N=()=>{A&&A.forEach(Y=>b.fire(Y)),A=null},b=new i({onFirstListenerAdd(){j||(j=g(Y=>b.fire(Y)))},onFirstListenerDidAdd(){A&&(F?setTimeout(N):N())},onLastListenerRemove(){j&&j.dispose(),j=null}});return b.event}l.buffer=S;class w{constructor(g){this.event=g}map(g){return new w(f(this.event,g))}forEach(g){return new w(o(this.event,g))}filter(g){return new w(u(this.event,g))}reduce(g,F){return new w(C(this.event,g,F))}latch(){return new w(R(this.event))}debounce(g,F=100,U=!1,A){return new w(T(this.event,g,F,U,A))}on(g,F,U){return this.event(g,F,U)}once(g,F,U){return h(this.event)(g,F,U)}}function E(g){return new w(g)}l.chain=E;function c(g,F,U=A=>A){const A=(...Y)=>b.fire(U(...Y)),j=()=>g.on(F,A),N=()=>g.removeListener(F,A),b=new i({onFirstListenerAdd:j,onLastListenerRemove:N});return b.event}l.fromNodeEventEmitter=c;function x(g,F,U=A=>A){const A=(...Y)=>b.fire(U(...Y)),j=()=>g.addEventListener(F,A),N=()=>g.removeEventListener(F,A),b=new i({onFirstListenerAdd:j,onLastListenerRemove:N});return b.event}l.fromDOMEventEmitter=x;function y(g){return new Promise(F=>h(g)(F))}l.toPromise=y})(B||(B={}));class P{constructor(l){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${l}_${P._idPool++}`}start(l){this._stopWatch=new X.a(!0),this._listenerCount=l}stop(){if(this._stopWatch){const l=this._stopWatch.elapsed();this._elapsedOverall+=l,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${l.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}P._idPool=0;let W=-1;class H{constructor(l,h=Math.random().toString(18).slice(2,5)){this.customThreshold=l,this.name=h,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(l){let h=W;if(typeof this.customThreshold=="number"&&(h=this.customThreshold),h<=0||l<h)return;this._stacks||(this._stacks=new Map);const f=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),o=this._stacks.get(f)||0;if(this._stacks.set(f,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=h*.5;let u,s=0;for(const[a,C]of this._stacks)(!u||s<C)&&(u=a,s=C);console.warn(`[${this.name}] potential listener LEAK detected, having ${l} listeners already. MOST frequent listener (${s}):`),console.warn(u)}return()=>{const u=this._stacks.get(f)||0;this._stacks.set(f,u-1)}}}class i{constructor(l){var h;this._disposed=!1,this._options=l,this._leakageMon=W>0?new H(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((h=this._options)===null||h===void 0?void 0:h._profName)?new P(this._options._profName):void 0}get event(){return this._event||(this._event=(l,h,f)=>{var o;this._listeners||(this._listeners=new M.a);const u=this._listeners.isEmpty();u&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const s=this._listeners.push(h?[l,h]:l);u&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,l,h);const a=(o=this._leakageMon)===null||o===void 0?void 0:o.check(this._listeners.size),C=Object($.i)(()=>{if(a&&a(),!this._disposed&&(s(),this._options&&this._options.onLastListenerRemove)){const _=this._listeners&&!this._listeners.isEmpty();_||this._options.onLastListenerRemove(this)}});return f instanceof $.b?f.add(C):Array.isArray(f)&&f.push(C),C}),this._event}fire(l){var h,f;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new M.a);for(let o of this._listeners)this._deliveryQueue.push([o,l]);for((h=this._perfMon)===null||h===void 0||h.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[o,u]=this._deliveryQueue.shift();try{typeof o=="function"?o.call(void 0,u):o[0].call(o[1],u)}catch(s){Object(oe.f)(s)}}(f=this._perfMon)===null||f===void 0||f.stop()}}dispose(){var l,h,f,o,u;this._disposed||(this._disposed=!0,(l=this._listeners)===null||l===void 0||l.clear(),(h=this._deliveryQueue)===null||h===void 0||h.clear(),(o=(f=this._options)===null||f===void 0?void 0:f.onLastListenerRemove)===null||o===void 0||o.call(f),(u=this._leakageMon)===null||u===void 0||u.dispose())}}class L extends i{constructor(l){super(l);this._isPaused=0,this._eventQueue=new M.a,this._mergeFn=l==null?void 0:l.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const l=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(l))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(l){this._listeners&&(this._isPaused!==0?this._eventQueue.push(l):super.fire(l))}}class v extends L{constructor(l){var h;super(l);this._delay=(h=l.delay)!==null&&h!==void 0?h:100}fire(l){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(l)}}class m{constructor(){this.buffers=[]}wrapEvent(l){return(h,f,o)=>l(u=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>h.call(f,u)):h.call(f,u)},void 0,o)}bufferEvents(l){const h=[];this.buffers.push(h);const f=l();return this.buffers.pop(),h.forEach(o=>o()),f}}class p{constructor(){this.listening=!1,this.inputEvent=B.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(l){this.inputEvent=l,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=l(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(Ze,Te,Z){"use strict";(function(oe,$){Z.d(Te,"b",function(){return f}),Z.d(Te,"i",function(){return a}),Z.d(Te,"f",function(){return C}),Z.d(Te,"d",function(){return _}),Z.d(Te,"g",function(){return T}),Z.d(Te,"h",function(){return R}),Z.d(Te,"c",function(){return O}),Z.d(Te,"k",function(){return S}),Z.d(Te,"j",function(){return w}),Z.d(Te,"a",function(){return E}),Z.d(Te,"e",function(){return y});var M;const X="en";let B=!1,P=!1,W=!1,H=!1,i=!1,L=!1,v=!1,m,p=X,l,h;const f=typeof self=="object"?self:typeof oe=="object"?oe:{};let o;typeof f.vscode!="undefined"&&typeof f.vscode.process!="undefined"?o=f.vscode.process:typeof $!="undefined"&&(o=$);const u=typeof((M=o==null?void 0:o.versions)===null||M===void 0?void 0:M.electron)=="string"&&o.type==="renderer";if(typeof navigator=="object"&&!u)h=navigator.userAgent,B=h.indexOf("Windows")>=0,P=h.indexOf("Macintosh")>=0,v=(h.indexOf("Macintosh")>=0||h.indexOf("iPad")>=0||h.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,W=h.indexOf("Linux")>=0,L=!0,m=navigator.language,p=m;else if(typeof o=="object"){B=o.platform==="win32",P=o.platform==="darwin",W=o.platform==="linux",H=W&&!!o.env.SNAP&&!!o.env.SNAP_REVISION,m=X,p=X;const g=o.env.VSCODE_NLS_CONFIG;if(g)try{const F=JSON.parse(g),U=F.availableLanguages["*"];m=F.locale,p=U||X,l=F._translationsConfigFile}catch(F){}i=!0}else console.error("Unable to resolve platform.");let s=0;P?s=1:B?s=3:W&&(s=2);const a=B,C=P,_=W,T=i,R=L,O=v,S=h,w=function(){if(f.setImmediate)return f.setImmediate.bind(f);if(typeof f.postMessage=="function"&&!f.importScripts){let U=[];f.addEventListener("message",j=>{if(j.data&&j.data.vscodeSetImmediateId)for(let N=0,b=U.length;N<b;N++){const Y=U[N];if(Y.id===j.data.vscodeSetImmediateId){U.splice(N,1),Y.callback();return}}});let A=0;return j=>{const N=++A;U.push({id:N,callback:j}),f.postMessage({vscodeSetImmediateId:N},"*")}}if(typeof(o==null?void 0:o.nextTick)=="function")return o.nextTick.bind(o);const F=Promise.resolve();return U=>F.then(U)}(),E=P||v?2:B?1:3;let c=!0,x=!1;function y(){if(!x){x=!0;const g=new Uint8Array(2);g[0]=1,g[1]=2;const F=new Uint16Array(g.buffer);c=F[0]===(2<<8)+1}return c}}).call(this,Z("IyRk"),Z("Q2Ig"))},N0LK:function(Ze,Te,Z){"use strict";Z.d(Te,"C",function(){return oe}),Z.d(Te,"v",function(){return M}),Z.d(Te,"s",function(){return X}),Z.d(Te,"t",function(){return B}),Z.d(Te,"U",function(){return P}),Z.d(Te,"J",function(){return W}),Z.d(Te,"O",function(){return H}),Z.d(Te,"p",function(){return i}),Z.d(Te,"T",function(){return L}),Z.d(Te,"q",function(){return v}),Z.d(Te,"N",function(){return m}),Z.d(Te,"M",function(){return p}),Z.d(Te,"Q",function(){return l}),Z.d(Te,"u",function(){return h}),Z.d(Te,"x",function(){return f}),Z.d(Te,"I",function(){return o}),Z.d(Te,"f",function(){return u}),Z.d(Te,"h",function(){return s}),Z.d(Te,"g",function(){return a}),Z.d(Te,"i",function(){return C}),Z.d(Te,"G",function(){return _}),Z.d(Te,"H",function(){return T}),Z.d(Te,"r",function(){return R}),Z.d(Te,"R",function(){return O}),Z.d(Te,"d",function(){return S}),Z.d(Te,"e",function(){return w}),Z.d(Te,"E",function(){return E}),Z.d(Te,"F",function(){return c}),Z.d(Te,"j",function(){return x}),Z.d(Te,"z",function(){return y}),Z.d(Te,"K",function(){return F}),Z.d(Te,"L",function(){return U}),Z.d(Te,"m",function(){return j}),Z.d(Te,"k",function(){return b}),Z.d(Te,"A",function(){return re}),Z.d(Te,"a",function(){return fe}),Z.d(Te,"n",function(){return ve}),Z.d(Te,"l",function(){return ke}),Z.d(Te,"D",function(){return Se}),Z.d(Te,"B",function(){return Le}),Z.d(Te,"b",function(){return ye}),Z.d(Te,"S",function(){return _e}),Z.d(Te,"o",function(){return de}),Z.d(Te,"P",function(){return z}),Z.d(Te,"w",function(){return D}),Z.d(Te,"c",function(){return I}),Z.d(Te,"y",function(){return G});function oe(ue){return!ue||typeof ue!="string"?!0:ue.trim().length===0}const $=/{(\d+)}/g;function M(ue,...ge){return ge.length===0?ue:ue.replace($,function(we,Ae){const Ne=parseInt(Ae,10);return isNaN(Ne)||Ne<0||Ne>=ge.length?we:ge[Ne]})}function X(ue){return ue.replace(/[<>&]/g,function(ge){switch(ge){case"<":return"<";case">":return">";case"&":return"&";default:return ge}})}function B(ue){return ue.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function P(ue,ge=" "){const we=W(ue,ge);return H(we,ge)}function W(ue,ge){if(!ue||!ge)return ue;const we=ge.length;if(we===0||ue.length===0)return ue;let Ae=0;for(;ue.indexOf(ge,Ae)===Ae;)Ae=Ae+we;return ue.substring(Ae)}function H(ue,ge){if(!ue||!ge)return ue;const we=ge.length,Ae=ue.length;if(we===0||Ae===0)return ue;let Ne=Ae,Be=-1;for(;!(Be=ue.lastIndexOf(ge,Ne-1),Be===-1||Be+we!==Ne);){if(Be===0)return"";Ne=Be}return ue.substring(0,Ne)}function i(ue){return ue.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function L(ue){return ue.replace(/\*/g,"")}function v(ue,ge,we={}){if(!ue)throw new Error("Cannot create regex from empty string");ge||(ue=B(ue)),we.wholeWord&&(/\B/.test(ue.charAt(0))||(ue="\\b"+ue),/\B/.test(ue.charAt(ue.length-1))||(ue=ue+"\\b"));let Ae="";return we.global&&(Ae+="g"),we.matchCase||(Ae+="i"),we.multiline&&(Ae+="m"),we.unicode&&(Ae+="u"),new RegExp(ue,Ae)}function m(ue){if(ue.source==="^"||ue.source==="^$"||ue.source==="$"||ue.source==="^\\s*$")return!1;const ge=ue.exec("");return!!(ge&&ue.lastIndex===0)}function p(ue){return(ue.global?"g":"")+(ue.ignoreCase?"i":"")+(ue.multiline?"m":"")+(ue.unicode?"u":"")}function l(ue){return ue.split(/\r\n|\r|\n/)}function h(ue){for(let ge=0,we=ue.length;ge<we;ge++){const Ae=ue.charCodeAt(ge);if(Ae!==32&&Ae!==9)return ge}return-1}function f(ue,ge=0,we=ue.length){for(let Ae=ge;Ae<we;Ae++){const Ne=ue.charCodeAt(Ae);if(Ne!==32&&Ne!==9)return ue.substring(ge,Ae)}return ue.substring(ge,we)}function o(ue,ge=ue.length-1){for(let we=ge;we>=0;we--){const Ae=ue.charCodeAt(we);if(Ae!==32&&Ae!==9)return we}return-1}function u(ue,ge){return ue<ge?-1:ue>ge?1:0}function s(ue,ge,we=0,Ae=ue.length,Ne=0,Be=ge.length){for(;we<Ae&&Ne<Be;we++,Ne++){let qe=ue.charCodeAt(we),je=ge.charCodeAt(Ne);if(qe<je)return-1;if(qe>je)return 1}const Ge=Ae-we,He=Be-Ne;return Ge<He?-1:Ge>He?1:0}function a(ue,ge){return C(ue,ge,0,ue.length,0,ge.length)}function C(ue,ge,we=0,Ae=ue.length,Ne=0,Be=ge.length){for(;we<Ae&&Ne<Be;we++,Ne++){let qe=ue.charCodeAt(we),je=ge.charCodeAt(Ne);if(qe===je)continue;if(qe>=128||je>=128)return s(ue.toLowerCase(),ge.toLowerCase(),we,Ae,Ne,Be);_(qe)&&(qe-=32),_(je)&&(je-=32);const Ke=qe-je;if(Ke===0)continue;return Ke}const Ge=Ae-we,He=Be-Ne;return Ge<He?-1:Ge>He?1:0}function _(ue){return ue>=97&&ue<=122}function T(ue){return ue>=65&&ue<=90}function R(ue,ge){return ue.length===ge.length&&C(ue,ge)===0}function O(ue,ge){const we=ge.length;return ge.length>ue.length?!1:C(ue,ge,0,we)===0}function S(ue,ge){let we,Ae=Math.min(ue.length,ge.length);for(we=0;we<Ae;we++)if(ue.charCodeAt(we)!==ge.charCodeAt(we))return we;return Ae}function w(ue,ge){let we,Ae=Math.min(ue.length,ge.length);const Ne=ue.length-1,Be=ge.length-1;for(we=0;we<Ae;we++)if(ue.charCodeAt(Ne-we)!==ge.charCodeAt(Be-we))return we;return Ae}function E(ue){return 55296<=ue&&ue<=56319}function c(ue){return 56320<=ue&&ue<=57343}function x(ue,ge){return(ue-55296<<10)+(ge-56320)+65536}function y(ue,ge,we){const Ae=ue.charCodeAt(we);if(E(Ae)&&we+1<ge){const Ne=ue.charCodeAt(we+1);if(c(Ne))return x(Ae,Ne)}return Ae}function g(ue,ge){const we=ue.charCodeAt(ge-1);if(c(we)&&ge>1){const Ae=ue.charCodeAt(ge-2);if(E(Ae))return x(Ae,we)}return we}function F(ue,ge){const we=V.getInstance(),Ae=ge,Ne=ue.length,Be=y(ue,Ne,ge);ge+=Be>=65536?2:1;let Ge=we.getGraphemeBreakType(Be);for(;ge<Ne;){const He=y(ue,Ne,ge),qe=we.getGraphemeBreakType(He);if(I(Ge,qe))break;ge+=He>=65536?2:1,Ge=qe}return ge-Ae}function U(ue,ge){const we=V.getInstance(),Ae=ge,Ne=g(ue,ge);ge-=Ne>=65536?2:1;let Be=we.getGraphemeBreakType(Ne);for(;ge>0;){const Ge=g(ue,ge),He=we.getGraphemeBreakType(Ge);if(I(He,Be))break;ge-=Ge>=65536?2:1,Be=He}return Ae-ge}const A=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function j(ue){return A.test(ue)}const N=/(?:[\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(ue){return N.test(ue)}const Y=/^[\t\n\r\x20-\x7E]*$/;function re(ue){return Y.test(ue)}const fe=/[\u2028\u2029]/;function ve(ue){return fe.test(ue)}function ke(ue){for(let ge=0,we=ue.length;ge<we;ge++)if(Se(ue.charCodeAt(ge)))return!0;return!1}function Se(ue){return ue=+ue,ue>=11904&&ue<=55215||ue>=63744&&ue<=64255||ue>=65281&&ue<=65374}function Le(ue){return ue>=127462&&ue<=127487||ue===8986||ue===8987||ue===9200||ue===9203||ue>=9728&&ue<=10175||ue===11088||ue===11093||ue>=127744&&ue<=128591||ue>=128640&&ue<=128764||ue>=128992&&ue<=129003||ue>=129280&&ue<=129535||ue>=129648&&ue<=129750}const ye=String.fromCharCode(65279);function _e(ue){return!!(ue&&ue.length>0&&ue.charCodeAt(0)===65279)}function de(ue,ge=!1){return ue?(ge&&(ue=ue.replace(/\\./g,"")),ue.toLowerCase()!==ue):!1}function z(ue){const ge=90-65+1;return ue=ue%(2*ge),ue<ge?String.fromCharCode(97+ue):String.fromCharCode(65+ue-ge)}function D(ue){const ge=V.getInstance();return ge.getGraphemeBreakType(ue)}function I(ue,ge){return ue===0?ge!==5&&ge!==7:ue===2&&ge===3?!1:ue===4||ue===2||ue===3||(ge===4||ge===2||ge===3)?!0:ue===8&&(ge===8||ge===9||ge===11||ge===12)||((ue===11||ue===9)&&(ge===9||ge===10)||((ue===12||ue===10)&&ge===10||(ge===5||ge===13||(ge===7||(ue===1||ue===13&&ge===14)))))?!1:!(ue===6&&ge===6)}class V{constructor(){this._data=Q()}static getInstance(){return V._INSTANCE||(V._INSTANCE=new V),V._INSTANCE}getGraphemeBreakType(ue){if(ue<32)return ue===10?3:ue===13?2:4;if(ue<127)return 0;const ge=this._data,we=ge.length/3;let Ae=1;for(;Ae<=we;)if(ue<ge[3*Ae])Ae=2*Ae;else if(ue>ge[3*Ae+1])Ae=2*Ae+1;else return ge[3*Ae+2];return 0}}V._INSTANCE=null;function Q(){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 G(ue,ge){if(ue===0)return 0;const we=ce(ue,ge);if(we!==void 0)return we;const Ae=g(ge,ue);return ue-=Ce(Ae),ue}function ce(ue,ge){let we=g(ge,ue);for(ue-=Ce(we);De(we)||we===65039||we===8419;){if(ue===0)return;we=g(ge,ue),ue-=Ce(we)}if(!Le(we))return;if(ue>=0){const Ae=g(ge,ue);Ae===8205&&(ue-=Ce(Ae))}return ue}function Ce(ue){return ue>=65536?2:1}function De(ue){return 127995<=ue&&ue<=127999}},Ot1p:function(Ze,Te,Z){"use strict";var oe=Z("2qtc"),$=Z("kLXV"),M=Z("rAM+"),X=Z("miYZ"),B=Z("tsqr"),P=Z("9og8"),W=Z("tJVT"),H=Z("jrin"),i=Z("WmNS"),L=Z.n(i),v=Z("q1tI"),m=Z.n(v),p=Z("VrN/"),l=Z.n(p),h=Z("bdgK"),f=Z("p77/"),o=Z("Bd2K"),u=Z("ELLl"),s=Z("19Vz"),a=Z("lZu9"),C=Z("+NIl"),_=Z("kSUc"),T=Z("9Bee"),R=function(xe){var Oe=xe.value,Pe=Oe===void 0?"":Oe,ze=xe.className,tt=xe.showTextOnly,rt=xe.showLines,yt=xe.style,ot=yt===void 0?{}:yt,at=Object(v.useMemo)(function(){return""},[Pe]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:at}}))},O=Z("0Owb"),S=Z("dejd"),w=Z("C+DQ"),E=Z("1vsH"),c=Z("m3rI"),x=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function y(xe){var Oe=xe.onActionCallback,Pe=xe.title,ze=xe.icon,tt=xe.actionName,rt=xe.className,yt=rt===void 0?"":rt,ot=xe.children;function at(){Oe(tt)}return m.a.createElement("a",{title:Pe,className:yt,onClick:at},m.a.createElement("i",{className:"md-iconfont ".concat(ze)}),ot)}var g=function(xe){var Oe=xe.watch,Pe=xe.showNullButton,ze=xe.onActionCallback,tt=xe.fullScreen,rt=xe.insertTemp,yt=xe.hidetoolBar,ot=xe.uuid,at=xe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(E.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(E.F)("_educoder_session"),"&key=").concat(ot,"&api=").concat(encodeURIComponent(c.a.PROXY_SERVER)));var Lt=[].concat(x,[{title:"".concat(Oe?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Oe?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!yt&&Lt.map(function(_t,Bt){return m.a.createElement("li",{key:Bt},_t.actionName?m.a.createElement(y,Object(O.a)({},_t,{onActionCallback:ze})):m.a.createElement("span",{className:"v-line"}))}),Pe?m.a.createElement("li",null,m.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ze},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,rt&&m.a.createElement("li",null,m.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(rt),onActionCallback:ze},m.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),m.a.createElement("li",{className:"btn-full-screen"},m.a.createElement(y,{icon:"".concat(tt?"icon-shrink":"icon-enlarge"),title:tt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ze})))},F=Z("M8RZ"),U=Z("+L6B"),A=Z("2/Rp"),j=Z("y8nQ"),N=Z("Vl3Y"),b=Z("5NDa"),Y=Z("5rEg"),re={labelCol:{span:4},wrapperCol:{span:20}},fe=function(xe){var Oe=xe.callback,Pe=xe.onCancel;function ze(tt){Oe(tt)}return m.a.createElement(N.a,Object(O.a)({},re,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ze}),m.a.createElement(N.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(Y.a,null)),m.a.createElement(N.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(Y.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(A.a,{type:"ghost",onClick:Pe},"\u53D6\u6D88")))},ve=Z("7ahc"),ke=Z("HmJG"),Se=Z("BjJ7"),Le=N.a.useForm,ye={width:280,marginRight:10},_e={labelCol:{span:5},wrapperCol:{span:19}},de=function(xe){var Oe=xe.callback,Pe=xe.onCancel,ze=Le(),tt=Object(W.a)(ze,1),rt=tt[0];function yt(Lt){Oe(Lt)}function ot(Lt,_t){if(Lt.status===-1){B.b.error(Lt.message);return}rt.setFieldsValue({src:"/api/attachments/".concat(Lt.id),type:_t.type})}function at(Lt){var _t=Lt.target.files[0];D(_t,ot)}return m.a.createElement(N.a,Object(O.a)({form:rt},_e,{className:"upload-image-panel",onFinish:yt}),m.a.createElement(N.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(N.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(Y.a,{style:ye})),m.a.createElement(z,{onFileChange:at}))),m.a.createElement(N.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(Y.a,{style:{width:264}})),m.a.createElement(N.a.Item,{style:{textAlign:"right"}},m.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(A.a,{type:"ghost",onClick:Pe},"\u53D6\u6D88")))};function z(xe){var Oe=xe.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:Oe}))}function D(xe,Oe){if(!xe)throw new String("\u6CA1\u6709\u6587\u4EF6");var Pe=new FormData;Pe.append("editormd-image-file",xe),Pe.append("file_param_name","editormd-image-file"),Pe.append("byxhr","true");var ze=new window.XMLHttpRequest;ze.withCredentials=!0,ze.addEventListener("load",function(tt){Oe(JSON.parse(tt.target.responseText),xe)},!1),ze.addEventListener("error",function(tt){console.error(tt)},!1),ze.open("POST","".concat(Se.a,"/api/attachments.json")),ze.send(Pe)}var I=Z("giR+"),V=Z("fyUT"),Q=Z("7Kak"),G=Z("9yH6"),ce=G.a.Group,Ce={margin:"0 8px"},De=function(xe){var Oe=xe.callback,Pe=xe.onCancel;function ze(tt){Oe(tt)}return m.a.createElement(N.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ze},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:Ce},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:Ce},"\u884C\u6570"),m.a.createElement(N.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(V.a,null)),m.a.createElement("span",{style:Ce},"\u5217\u6570"),m.a.createElement(N.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(V.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:Ce},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(N.a.Item,{name:"align"},m.a.createElement(ce,null,m.a.createElement(G.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(G.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(G.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(G.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(A.a,{type:"ghost",onClick:Pe},"\u53D6\u6D88")))},ue=Z("ErOA"),ge=Z("7Cbv"),we="link",Ae="upload-image",Ne="code-block",Be="add-table",Ge="------------",He={default:Ge,left:":".concat(Ge),center:":".concat(Ge,":"),right:"".concat(Ge,":")},qe=Z("9VGf"),je,Ke;function Me(){}var et=0,Je=1e4,le="\u2581",q=`
|
|
**\u6A21\u677F\u6807\u9898**
|
|
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function te(xe){return/^\d+$/.test(xe)?"".concat(xe,"px"):xe}var se=navigator.platform.toUpperCase().indexOf("MAC")>=0,he=se?"Cmd":"Ctrl",ie=["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"],ae=(je={},Object(H.a)(je,he+"-B","bold"),Object(H.a)(je,he+"-I","italic"),je),pe=(Ke={},Object(H.a)(Ke,we,"\u6DFB\u52A0\u94FE\u63A5"),Object(H.a)(Ke,Ne,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(H.a)(Ke,Ae,"\u6DFB\u52A0\u6587\u4EF6"),Object(H.a)(Ke,Be,"\u6DFB\u52A0\u8868\u683C"),Ke),me=Te.a=function(xe){var Oe=xe.defaultValue,Pe=Oe===void 0?"":Oe,ze=xe.onChange,tt=xe.width,rt=tt===void 0?"100%":tt,yt=xe.height,ot=yt===void 0?400:yt,at=xe.miniToolbar,Lt=at===void 0?!1:at,_t=xe.isFocus,Bt=_t===void 0?!1:_t,Ft=xe.watch,Tt=xe.insertTemp,si=xe.mode,Ei=si===void 0?"markdown":si,zt=xe.id,di=zt===void 0?"markdown-editor-id":zt,dt=xe.showResizeBar,vt=dt===void 0?!1:dt,Et=xe.noStorage,Ht=Et===void 0?!1:Et,oi=xe.showNullButton,Mt=oi===void 0?!1:oi,Qe=xe.hidetoolBar,Ct=Qe===void 0?!1:Qe,Ot=xe.fullScreen,ct=Ot===void 0?!1:Ot,pt=xe.onBlur,wt=xe.onCMBeforeChange,ii=xe.onFullScreen,Ut=xe.className,We=Ut===void 0?"":Ut,ft=xe.disablePaste,ir=ft===void 0?!1:ft,br=xe.placeholder,_r=br===void 0?"":br,rr=xe.values,Er=rr===void 0?"":rr,gt=Object(v.useState)(null),An=Object(W.a)(gt,2),Ve=An[0],xr=An[1],Si=Object(v.useState)(Pe),zr=Object(W.a)(Si,2),nr=zr[0],Ai=zr[1],Vr=Object(v.useState)(Ft),Yr=Object(W.a)(Vr,2),Oi=Yr[0],Xr=Yr[1],On=Object(v.useState)(ct),$r=Object(W.a)(On,2),Ri=$r[0],Rn=$r[1],aa=Object(v.useState)(""),Jr=Object(W.a)(aa,2),li=Jr[0],Vi=Jr[1],sa=Object(v.useState)(0),ar=Object(W.a)(sa,2),Li=ar[0],Qr=ar[1],oa=Object(v.useState)(ot),Ln=Object(W.a)(oa,2),In=Ln[0],Tr=Ln[1],Dn=Object(v.useState)(!1),kn=Object(W.a)(Dn,2),la=kn[0],wr=kn[1],sr=Object(v.useRef)(Object(ge.a)()),or=Object(v.useRef)(!1),Sr=Object(v.useRef)(),Ui=Object(v.useRef)(),ji=Object(v.useRef)(),Hi=Object(v.useRef)(),Cr=Object(v.useRef)(),Mn=function(){var st=Object(P.a)(L.a.mark(function mt(){var ut,xt;return L.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,Object(ue.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:sr.current}});case 2:xt=Pt.sent,xt!=null&&(ut=xt.attachments)!==null&&ut!==void 0&&ut.length&&(console.log("cm:",Ve,Ui),xt.attachments.map(function(At){At.content_type.indexOf("image")>-1?Ve.replaceSelection(".concat(At.content_type,")")):At.content_type.indexOf("video")>-1?Ve.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):At.content_type.indexOf("pdf")>-1?Ve.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(At.id,"?type=").concat(At.content_type,'&disposition=inline" target="_blank">').concat(At.name,"</a>")):Ve.replaceSelection("[".concat(At.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(At.id,"?type=").concat(At.content_type,")"))}));case 4:case"end":return Pt.stop()}},mt)}));return function(){return st.apply(this,arguments)}}();Object(v.useEffect)(function(){Ai(Er),Ve==null||Ve.setValue(Er)},[Er]),Object(v.useEffect)(function(){ii==null||ii(Ri)},[Ri]),Object(v.useEffect)(function(){if(Ui.current){var st=l.a.fromTextArea(Ui.current,{mode:Ei,lineNumbers:!Lt,lineWrapping:!0,value:Pe,autoCloseTags:!0,autoCloseBrackets:!0});Bt&&st.focus();function mt(ut,xt){if(ir){xt.preventDefault();return}var Rt=xt.clipboardData;if(Rt){var Pt=Rt.types.toString(),At=Rt.items;if(Pt==="Files"||Rt.types.indexOf("Files")>-1){if(xt.preventDefault(),Ei=="stex")return;try{var Xt,ci=At[1];((Xt=At[0])===null||Xt===void 0?void 0:Xt.kind)==="file"&&(ci=At[0]);var St=ci.getAsFile(),Wi=St.name.split(".").pop();D(St,function(It){if(It.id){var fi,ri,Ci;(St==null||((fi=St.type)===null||fi===void 0)?void 0:fi.indexOf("image"))>-1?st.replaceSelection(".concat(It.content_type,")")):(St==null||((ri=St.type)===null||ri===void 0)?void 0:ri.indexOf("video"))>-1?st.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(It.id,'"></video>')):(St==null||((Ci=St.type)===null||Ci===void 0)?void 0:Ci.indexOf("pdf"))>-1?st.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(It.id,"?type=").concat(St.type,'&disposition=inline" target="_blank">').concat(St.name,"</a>")):ie.includes(Wi)?st.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(It.id,'?type=office&disposition=inline" target="_blank">').concat(St.name,"</a>")):st.replaceSelection("[".concat(St.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(It.id,"?type=").concat(It.content_type,")"))}else(It==null?void 0:It.status)===401&&(document.location.href="/user/login")})}catch(It){B.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return st.on("paste",mt),st.on("dragleave",function(ut,xt){ji.current.classList.remove("mouse-hover-md")}),st.on("dragover",function(ut,xt){ji.current.classList.add("mouse-hover-md")}),st.on("drop",function(ut,xt){ji.current.classList.add("mouse-hover-md");var Rt;if(Rt=xt.dataTransfer.files,Rt.length>0){xt.preventDefault(),xt.stopPropagation();for(var Pt=function(ci){var St=Rt[ci],Wi=St.name.split(".").pop();D(St,function(It){if(It.id){var fi,ri,Ci;(St==null||((fi=St.type)===null||fi===void 0)?void 0:fi.indexOf("image"))>-1?st.replaceSelection(".concat(It.content_type,")")):(St==null||((ri=St.type)===null||ri===void 0)?void 0:ri.indexOf("video"))>-1?st.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(It.id,'"></video>')):(St==null||((Ci=St.type)===null||Ci===void 0)?void 0:Ci.indexOf("pdf"))>-1?st.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(It.id,"?type=").concat(St.type,'&disposition=inline" target="_blank">').concat(St.name,"</a>")):ie.includes(Wi)?st.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(It.id,'?type=office&disposition=inline" target="_blank">').concat(St.name,"</a>")):st.replaceSelection("[".concat(St.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(It.id,"?type=").concat(It.content_type,")"))}else(It==null?void 0:It.status)===401&&(document.location.href="/user/login")})},At=0;At<Rt.length;At++)Pt(At)}}),xr(st),function(){st.off("paste",mt)}}},[]);var xi=Object(v.useCallback)(function(){if(ji.current)try{}catch(st){console.log(st,"---- to set md editor body height")}},[In,ji,Ri]);Object(v.useEffect)(function(){function st(){var ut=new h.default(function(xt){var Rt=Object(M.a)(xt),Pt;try{for(Rt.s();!(Pt=Rt.n()).done;){var At=Pt.value;(At.target.offsetHeight>0||At.target.offsetWidth>0)&&(xi(),Ve.setSize("100%","100%"),Ve.refresh())}}catch(Xt){Rt.e(Xt)}finally{Rt.f()}});return ut.observe(Ui.current.parentElement),ut}if(Ve){var mt=st();return function(){mt.unobserve(Ui.current.parentElement)}}},[Ve,xi]),Object(v.useEffect)(function(){if(Ve){for(var st=[],mt=function(){var At=xt[ut];Rt=Object(W.a)(At,2);var Xt=Rt[0],ci=Rt[1],St=Object(H.a)({},Xt,function(){Pn(ci)});st.push(St),Ve.addKeyMap(St)},ut=0,xt=Object.entries(ae);ut<xt.length;ut++){var Rt;mt()}return Sr.current=setInterval(function(){or.current&&Mn()},4e3),function(){clearInterval(Sr.current);var Pt=Object(M.a)(st),At;try{for(Pt.s();!(At=Pt.n()).done;){var Xt=At.value;Ve.removeKeyMap(Xt)}}catch(ci){Pt.e(ci)}finally{Pt.f()}}}},[Ve]),Object(v.useEffect)(function(){ct!==Ri&&Rn(ct)},[ct]),Object(qe.a)(function(){if(!Ht&&Li>0){var st=new Date().getTime(),mt=window.sessionStorage.getItem(di);st>=Li+Je&&(!mt||mt!==nr)&&(window.sessionStorage.setItem(di,nr),wr(!0))}},Je),Object(v.useEffect)(function(){Xr(Ft)},[Ve,Ft]),Object(v.useEffect)(function(){Ve&&(Bt&&Ve.focus())},[Ve,Bt]),Object(v.useEffect)(function(){if(Oi&&Ve){var st=Ve.getScrollerElement();function mt(ut){var xt=ut.target;if(Cr.current){var Rt=xt.scrollTop/xt.scrollHeight;Cr.current.scrollTop=Cr.current.scrollHeight*Rt}}return st.addEventListener("scroll",mt),function(){st.removeEventListener("scroll",mt)}}},[Ve,Oi]),Object(v.useEffect)(function(){if(Ve&&wt){function st(mt,ut){wt(mt,ut)}return Ve.on("beforeChange",st),function(){Ve.off("beforeChange",st)}}},[Ve,wt]),Object(v.useEffect)(function(){if(Ve&&pt){function st(){pt(Ve.getValue())}return Ve.on("blur",st),function(){Ve.off("blur",st)}}},[Ve,pt]),Object(v.useEffect)(function(){if(Ve){function st(mt){var ut=mt.getValue();Ai(ut),Qr(new Date().getTime()),mt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ze&&ze(ut)}return Ve.on("change",st),function(){Ve.off("change",st)}}},[Ve,ze]),Object(v.useEffect)(function(){Ve&&(Pe==null?(Ve.setValue(""),Ai("")):Pe!==Ve.getValue()&&(Ve.setValue(Pe),Ai(Pe),Ve.setCursor(Ve.lineCount(),0)))},[Ve,Pe]);var Pn=Object(v.useCallback)(function(st){var mt=Ve.getCursor(),ut=Ve.getSelection(),xt=ut.split(`
|
|
`);switch(st){case"bold":return Ve.replaceSelection("**"+ut+"**"),ut===""&&Ve.setCursor(mt.line,mt.ch+2),Ve.focus();case"italic":return Ve.replaceSelection("*"+ut+"*"),ut===""&&Ve.setCursor(mt.line,mt.ch+1),Ve.focus();case"code":return Ve.replaceSelection("`"+ut+"`"),ut===""&&Ve.setCursor(mt.line,mt.ch+1),Ve.focus();case"inline-latex":return Ve.replaceSelection("`$$"+ut+"$$`"),ut===""&&Ve.setCursor(mt.line,mt.ch+3),Ve.focus();case"latex":return Ve.replaceSelection("```latex\n"+ut+"\n```"),Ve.setCursor(mt.line+1,ut.length+1),Ve.focus();case"line-break":return Ve.replaceSelection(`<br/>
|
|
`),Ve.focus();case"list-ul":return ut===""?Ve.replaceSelection("- "+ut):Ve.replaceSelection(xt.map(function(Rt){return Rt===""?"":"- ".concat(Rt)}).join(`
|
|
`)),Ve.focus();case"list-ol":return ut===""?Ve.replaceSelection("1. "+ut):Ve.replaceSelection(xt.map(function(Rt,Pt){return Rt===""?"":"".concat(Pt+1,". ").concat(Rt)}).join(`
|
|
`)),Ve.focus();case"add-null-ch":return ut===""&&Ve.setCursor(mt.line,mt.ch+1),Ve.replaceSelection(le),Ve.focus();case"inster-template-1":return ut===""&&Ve.setCursor(mt.line,mt.ch),Ve.replaceSelection(q),Ve.focus();case"eraser":return Ve.setValue(""),Ve.focus();case"trigger-watch":return Xr(!Oi),Ve.focus();case"trigger-full-screen":return Rn(!Ri),Ve.focus();case we:Vi(we);return;case Ne:Vi(Ne);return;case Ae:Vi(Ae);return;case Be:Vi(Be);return;default:throw new Error}},[Ve,Oi,Ri]),Ar=Object(v.useCallback)(function(st){Vi("");switch(li){case we:var mt=st.title,ut=st.link;return Ve.replaceSelection("[".concat(mt,"](").concat(ut,")")),Ve.focus();case Ne:var xt=st.language,Rt=st.content;return Ve.replaceSelection(["```"+xt,Rt,"```"].join(`
|
|
`)),Ve.focus();case Ae:var Pt=st.src,At=st.alt;return At?Ve.replaceSelection(".concat(Pt,' "').concat(At,'" )')):Ve.replaceSelection("")),Ve.focus();case Be:for(var Xt=st.row,ci=st.col,St=st.align,Wi=`
|
|
`,It=0;It<Xt;It++){for(var fi=[],ri=[],Ci=0;Ci<ci;Ci++)It===1&&ri.push(He[St]),fi.push(" ");It===1&&(Wi+="| ".concat(ri.join(" | "),` |
|
|
`)),Wi+="| ".concat(fi.join(ci===1?"":" | "),` |
|
|
`)}return Ve.replaceSelection(Wi+`
|
|
`),Ve.focus();default:throw new Error}},[Ve,li]),Zr=Object(v.useMemo)(function(){switch(li){case we:return m.a.createElement(fe,{callback:Ar,onCancel:Yi});case Ne:return m.a.createElement(ve.b,{callback:Ar,onCancel:Yi});case Ae:return m.a.createElement(de,{callback:Ar,onCancel:Yi});case Be:return m.a.createElement(De,{callback:Ar,onCancel:Yi});default:return null}},[li]);function Yi(){Vi("")}Object(v.useEffect)(function(){if(Hi.current){var st=Hi.current,mt=!1,ut=0;function xt(At){mt=!0,ut=At.pageY}function Rt(){mt=!1}function Pt(At){if(mt){var Xt=At.pageY-ut;Xt<0&&(Xt=0),Xt>300&&(Xt=300);var ci=ot+Xt+"px";Tr(ci)}}return st.addEventListener("mousedown",xt),document.addEventListener("mousemove",Pt),document.addEventListener("mouseup",Rt),function(){st.removeEventListener("mousedown",xt),document.removeEventListener("mousemove",Pt),document.removeEventListener("mouseup",Rt)}}},[Ve,Hi]),Object(v.useEffect)(function(){Tr(ot)},[ot]);var Pi=te(rt),qr=te(In),Ii={width:Pi,height:qr},en=Object(v.useMemo)(function(){if(Li){var st=new Date(Li),mt=st.getHours(),ut=st.getMinutes(),xt=st.getSeconds();return mt=mt<10?"0"+mt:mt,ut=ut<10?"0"+ut:ut,xt=xt<10?"0"+xt:xt,"".concat(mt,":").concat(ut,":").concat(xt)}return 0},[Li]);function Nn(){window.sessionStorage.removeItem(di),wr(!1),Qr(0)}function lr(){wr(!1),Qr(0),Ve.setValue(window.sessionStorage.getItem(di))}function ua(st,mt){var ut=Ve.getValue();ut=ut.replace(st,mt),Ai(ut),Ve==null||Ve.setValue(ut)}return m.a.createElement(v.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:ji},m.a.createElement("div",{className:"markdown-editor-container ".concat(We," ").concat(Oi?"on-preview":""," ").concat(Lt?"mini":""," ").concat(Ri?"full-screen":""),style:Ii},m.a.createElement(g,{insertTemp:Tt,watch:Oi,fullScreen:Ri,showNullButton:Mt,onActionCallback:Pn,hidetoolBar:Ct,uuid:sr.current,setOpenPhones:function(){or.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:Ui,placeholder:_r})),Oi?m.a.createElement("div",{ref:Cr,className:"preview-container"},Ei==="stex"&&m.a.createElement(R,{value:nr}),Ei!=="stex"&&m.a.createElement(T.a,{edit:!0,value:nr,replaces:ua})):null))),vt?m.a.createElement("a",{ref:Hi,className:"editor-resize"}):null,m.a.createElement(F.a,null,pe[li]?m.a.createElement($.a,{centered:!0,title:pe[li],visible:!0,onCancel:Yi,footer:null,className:"markdown-popup-form"},Zr):null))}},RxwV:function(Ze,Te,Z){"use strict";var oe=Z("q1tI"),$=Z("uciX"),M=Z("2W6z"),X=Z.n(M),B=Z("4IlW"),P=Z("uK0f"),W=Z.n(P);function H(ye,_e){if(ye===_e)return!0;if(!ye||!_e)return!1;var de=ye.length;if(_e.length!==de)return!1;for(var z=0;z<de;z++)if(ye[z]!==_e[z])return!1;return!0}function i(ye){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?i=function(de){return typeof de}:i=function(de){return de&&typeof Symbol=="function"&&de.constructor===Symbol&&de!==Symbol.prototype?"symbol":typeof de},i(ye)}function L(ye,_e){if(!(ye instanceof _e))throw new TypeError("Cannot call a class as a function")}function v(ye,_e){for(var de=0;de<_e.length;de++){var z=_e[de];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(ye,z.key,z)}}function m(ye,_e,de){return _e&&v(ye.prototype,_e),de&&v(ye,de),ye}function p(ye,_e){if(typeof _e!="function"&&_e!==null)throw new TypeError("Super expression must either be null or a function");ye.prototype=Object.create(_e&&_e.prototype,{constructor:{value:ye,writable:!0,configurable:!0}}),_e&&l(ye,_e)}function l(ye,_e){return l=Object.setPrototypeOf||function(z,D){return z.__proto__=D,z},l(ye,_e)}function h(ye){var _e=u();return function(){var de=s(ye),z;if(_e){var D=s(this).constructor;z=Reflect.construct(de,arguments,D)}else z=de.apply(this,arguments);return f(this,z)}}function f(ye,_e){return _e&&(i(_e)==="object"||typeof _e=="function")?_e:o(ye)}function o(ye){if(ye===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ye}function u(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(ye){return!1}}function s(ye){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(de){return de.__proto__||Object.getPrototypeOf(de)},s(ye)}var a=function(){var ye=function(_e){p(z,_e);var de=h(z);function z(){var D;return L(this,z),D=de.apply(this,arguments),D.menuItems={},D.saveMenuItem=function(I){return function(V){D.menuItems[I]=V}},D}return m(z,[{key:"componentDidMount",value:function(){this.scrollActiveItemToView()}},{key:"componentDidUpdate",value:function(I){!I.visible&&this.props.visible&&this.scrollActiveItemToView()}},{key:"getFieldName",value:function(I){var V=this.props,Q=V.fieldNames,G=V.defaultFieldNames;return Q[I]||G[I]}},{key:"getOption",value:function(I,V){var Q=this.props,G=Q.prefixCls,ce=Q.expandTrigger,Ce=Q.expandIcon,De=Q.loadingIcon,ue=this.props.onSelect.bind(this,I,V),ge=this.props.onItemDoubleClick.bind(this,I,V),we={onClick:ue,onDoubleClick:ge},Ae="".concat(G,"-menu-item"),Ne=null,Be=I[this.getFieldName("children")]&&I[this.getFieldName("children")].length>0;(Be||I.isLeaf===!1)&&(Ae+=" ".concat(G,"-menu-item-expand"),I.loading||(Ne=oe.createElement("span",{className:"".concat(G,"-menu-item-expand-icon")},Ce))),ce==="hover"&&(Be||I.isLeaf===!1)&&(we={onMouseEnter:this.delayOnSelect.bind(this,ue),onMouseLeave:this.delayOnSelect.bind(this),onClick:ue}),this.isActiveOption(I,V)&&(Ae+=" ".concat(G,"-menu-item-active"),we.ref=this.saveMenuItem(V)),I.disabled&&(Ae+=" ".concat(G,"-menu-item-disabled"));var Ge=null;I.loading&&(Ae+=" ".concat(G,"-menu-item-loading"),Ge=De||null);var He="";return"title"in I?He=I.title:typeof I[this.getFieldName("label")]=="string"&&(He=I[this.getFieldName("label")]),oe.createElement("li",Object.assign({key:I[this.getFieldName("value")],className:Ae,title:He},we,{role:"menuitem",onMouseDown:function(je){return je.preventDefault()}}),I[this.getFieldName("label")],Ne,Ge)}},{key:"getActiveOptions",value:function(I){var V=this,Q=this.props.options,G=I||this.props.activeValue;return W()(Q,function(ce,Ce){return ce[V.getFieldName("value")]===G[Ce]},{childrenKeyName:this.getFieldName("children")})}},{key:"getShowOptions",value:function(){var I=this,V=this.props.options,Q=this.getActiveOptions().map(function(G){return G[I.getFieldName("children")]}).filter(function(G){return!!G});return Q.unshift(V),Q}},{key:"delayOnSelect",value:function(I){for(var V=this,Q=arguments.length,G=new Array(Q>1?Q-1:0),ce=1;ce<Q;ce++)G[ce-1]=arguments[ce];this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null),typeof I=="function"&&(this.delayTimer=window.setTimeout(function(){I(G),V.delayTimer=null},150))}},{key:"scrollActiveItemToView",value:function(){for(var I=this.getShowOptions().length,V=0;V<I;V++){var Q=this.menuItems[V];Q&&Q.parentElement&&(Q.parentElement.scrollTop=Q.offsetTop)}}},{key:"isActiveOption",value:function(I,V){var Q=this.props.activeValue,G=Q===void 0?[]:Q;return G[V]===I[this.getFieldName("value")]}},{key:"render",value:function(){var I=this,V=this.props,Q=V.prefixCls,G=V.dropdownMenuColumnStyle;return oe.createElement("div",null,this.getShowOptions().map(function(ce,Ce){return oe.createElement("ul",{className:"".concat(Q,"-menu"),key:Ce,style:G},ce.map(function(De){return I.getOption(De,Ce)}))}))}}]),z}(oe.Component);return ye.defaultProps={options:[],value:[],activeValue:[],onSelect:function(){},prefixCls:"rc-cascader-menus",visible:!1,expandTrigger:"click"},ye}(),C=a,_={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:1,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:1,adjustY:1}}},T=_;function R(ye){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?R=function(de){return typeof de}:R=function(de){return de&&typeof Symbol=="function"&&de.constructor===Symbol&&de!==Symbol.prototype?"symbol":typeof de},R(ye)}function O(ye,_e){if(ye==null)return{};var de=S(ye,_e),z,D;if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(ye);for(D=0;D<I.length;D++){if(z=I[D],_e.indexOf(z)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(ye,z))continue;de[z]=ye[z]}}return de}function S(ye,_e){if(ye==null)return{};var de={},z=Object.keys(ye),D,I;for(I=0;I<z.length;I++){if(D=z[I],_e.indexOf(D)>=0)continue;de[D]=ye[D]}return de}function w(ye){return y(ye)||x(ye)||c(ye)||E()}function E(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c(ye,_e){if(!ye)return;if(typeof ye=="string")return g(ye,_e);var de=Object.prototype.toString.call(ye).slice(8,-1);if(de==="Object"&&ye.constructor&&(de=ye.constructor.name),de==="Map"||de==="Set")return Array.from(ye);if(de==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(de))return g(ye,_e)}function x(ye){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(ye))return Array.from(ye)}function y(ye){if(Array.isArray(ye))return g(ye)}function g(ye,_e){(_e==null||_e>ye.length)&&(_e=ye.length);for(var de=0,z=new Array(_e);de<_e;de++)z[de]=ye[de];return z}function F(ye,_e){if(!(ye instanceof _e))throw new TypeError("Cannot call a class as a function")}function U(ye,_e){for(var de=0;de<_e.length;de++){var z=_e[de];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(ye,z.key,z)}}function A(ye,_e,de){return _e&&U(ye.prototype,_e),de&&U(ye,de),ye}function j(ye,_e){if(typeof _e!="function"&&_e!==null)throw new TypeError("Super expression must either be null or a function");ye.prototype=Object.create(_e&&_e.prototype,{constructor:{value:ye,writable:!0,configurable:!0}}),_e&&N(ye,_e)}function N(ye,_e){return N=Object.setPrototypeOf||function(z,D){return z.__proto__=D,z},N(ye,_e)}function b(ye){var _e=fe();return function(){var de=ve(ye),z;if(_e){var D=ve(this).constructor;z=Reflect.construct(de,arguments,D)}else z=de.apply(this,arguments);return Y(this,z)}}function Y(ye,_e){return _e&&(R(_e)==="object"||typeof _e=="function")?_e:re(ye)}function re(ye){if(ye===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ye}function fe(){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(ye){return!1}}function ve(ye){return ve=Object.setPrototypeOf?Object.getPrototypeOf:function(de){return de.__proto__||Object.getPrototypeOf(de)},ve(ye)}var ke=function(){var ye=function(_e){j(z,_e);var de=b(z);function z(D){var I;F(this,z),I=de.call(this,D),I.setPopupVisible=function(Q){var G=I.state.value;"popupVisible"in I.props||I.setState({popupVisible:Q}),Q&&!I.state.popupVisible&&I.setState({activeValue:G}),I.props.onPopupVisibleChange(Q)},I.handleChange=function(Q,G,ce){var Ce=G.visible;(ce.type!=="keydown"||ce.keyCode===B.a.ENTER)&&(I.props.onChange(Q.map(function(De){return De[I.getFieldName("value")]}),Q),I.setPopupVisible(Ce))},I.handlePopupVisibleChange=function(Q){I.setPopupVisible(Q)},I.handleMenuSelect=function(Q,G,ce){var Ce=I.trigger.getRootDomNode();Ce&&Ce.focus&&Ce.focus();var De=I.props,ue=De.changeOnSelect,ge=De.loadData,we=De.expandTrigger;if(!Q||Q.disabled)return;var Ae=I.state.activeValue;Ae=Ae.slice(0,G+1),Ae[G]=Q[I.getFieldName("value")];var Ne=I.getActiveOptions(Ae);if(Q.isLeaf===!1&&!Q[I.getFieldName("children")]&&ge){ue&&I.handleChange(Ne,{visible:!0},ce),I.setState({activeValue:Ae}),ge(Ne);return}var Be={};!Q[I.getFieldName("children")]||!Q[I.getFieldName("children")].length?(I.handleChange(Ne,{visible:!1},ce),Be.value=Ae):ue&&(ce.type==="click"||ce.type==="keydown")&&(we==="hover"?I.handleChange(Ne,{visible:!1},ce):I.handleChange(Ne,{visible:!0},ce),Be.value=Ae),Be.activeValue=Ae,("value"in I.props||ce.type==="keydown"&&ce.keyCode!==B.a.ENTER)&&delete Be.value,I.setState(Be)},I.handleItemDoubleClick=function(){var Q=I.props.changeOnSelect;Q&&I.setPopupVisible(!1)},I.handleKeyDown=function(Q){var G=I.props.children;if(G&&G.props.onKeyDown){G.props.onKeyDown(Q);return}var ce=w(I.state.activeValue),Ce=ce.length-1<0?0:ce.length-1,De=I.getCurrentLevelOptions(),ue=De.map(function(Ne){return Ne[I.getFieldName("value")]}).indexOf(ce[Ce]);if(Q.keyCode!==B.a.DOWN&&Q.keyCode!==B.a.UP&&Q.keyCode!==B.a.LEFT&&Q.keyCode!==B.a.RIGHT&&Q.keyCode!==B.a.ENTER&&Q.keyCode!==B.a.SPACE&&Q.keyCode!==B.a.BACKSPACE&&Q.keyCode!==B.a.ESC&&Q.keyCode!==B.a.TAB)return;if(!I.state.popupVisible&&Q.keyCode!==B.a.BACKSPACE&&Q.keyCode!==B.a.LEFT&&Q.keyCode!==B.a.RIGHT&&Q.keyCode!==B.a.ESC&&Q.keyCode!==B.a.TAB){I.setPopupVisible(!0);return}if(Q.keyCode===B.a.DOWN||Q.keyCode===B.a.UP){Q.preventDefault();var ge=ue;ge!==-1?Q.keyCode===B.a.DOWN?(ge+=1,ge=ge>=De.length?0:ge):(ge-=1,ge=ge<0?De.length-1:ge):ge=0,ce[Ce]=De[ge][I.getFieldName("value")]}else if(Q.keyCode===B.a.LEFT||Q.keyCode===B.a.BACKSPACE)Q.preventDefault(),ce.splice(ce.length-1,1);else if(Q.keyCode===B.a.RIGHT)Q.preventDefault(),De[ue]&&De[ue][I.getFieldName("children")]&&ce.push(De[ue][I.getFieldName("children")][0][I.getFieldName("value")]);else if(Q.keyCode===B.a.ESC||Q.keyCode===B.a.TAB){I.setPopupVisible(!1);return}(!ce||ce.length===0)&&I.setPopupVisible(!1);var we=I.getActiveOptions(ce),Ae=we[we.length-1];I.handleMenuSelect(Ae,we.length-1,Q),I.props.onKeyDown&&I.props.onKeyDown(Q)},I.saveTrigger=function(Q){I.trigger=Q};var V=[];return"value"in D?V=D.value||[]:"defaultValue"in D&&(V=D.defaultValue||[]),X()(!("filedNames"in D),"`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead."),I.state={popupVisible:D.popupVisible,activeValue:V,value:V,prevProps:D},I.defaultFieldNames={label:"label",value:"value",children:"children"},I}return A(z,[{key:"getPopupDOMNode",value:function(){return this.trigger.getPopupDomNode()}},{key:"getFieldName",value:function(I){var V=this.defaultFieldNames,Q=this.props,G=Q.fieldNames,ce=Q.filedNames;return"filedNames"in this.props?ce[I]||V[I]:G[I]||V[I]}},{key:"getFieldNames",value:function(){var I=this.props,V=I.fieldNames,Q=I.filedNames;return"filedNames"in this.props?Q:V}},{key:"getCurrentLevelOptions",value:function(){var I=this,V=this.props.options,Q=V===void 0?[]:V,G=this.state.activeValue,ce=G===void 0?[]:G,Ce=W()(Q,function(De,ue){return De[I.getFieldName("value")]===ce[ue]},{childrenKeyName:this.getFieldName("children")});return Ce[Ce.length-2]?Ce[Ce.length-2][this.getFieldName("children")]:w(Q).filter(function(De){return!De.disabled})}},{key:"getActiveOptions",value:function(I){var V=this;return W()(this.props.options||[],function(Q,G){return Q[V.getFieldName("value")]===I[G]},{childrenKeyName:this.getFieldName("children")})}},{key:"render",value:function(){var I=this.props,V=I.prefixCls,Q=I.transitionName,G=I.popupClassName,ce=I.options,Ce=ce===void 0?[]:ce,De=I.disabled,ue=I.builtinPlacements,ge=I.popupPlacement,we=I.children,Ae=I.dropdownRender,Ne=O(I,["prefixCls","transitionName","popupClassName","options","disabled","builtinPlacements","popupPlacement","children","dropdownRender"]),Be=oe.createElement("div",null),Ge="";Ce&&Ce.length>0?Be=oe.createElement(C,Object.assign({},this.props,{fieldNames:this.getFieldNames(),defaultFieldNames:this.defaultFieldNames,activeValue:this.state.activeValue,onSelect:this.handleMenuSelect,onItemDoubleClick:this.handleItemDoubleClick,visible:this.state.popupVisible})):Ge=" ".concat(V,"-menus-empty");var He=Be;return Ae&&(He=Ae(Be)),oe.createElement($.a,Object.assign({ref:this.saveTrigger},Ne,{popupPlacement:ge,builtinPlacements:ue,popupTransitionName:Q,action:De?[]:["click"],popupVisible:De?!1:this.state.popupVisible,onPopupVisibleChange:this.handlePopupVisibleChange,prefixCls:"".concat(V,"-menus"),popupClassName:G+Ge,popup:He}),oe.cloneElement(we,{onKeyDown:this.handleKeyDown,tabIndex:De?void 0:0}))}}],[{key:"getDerivedStateFromProps",value:function(I,V){var Q=V.prevProps,G=Q===void 0?{}:Q,ce={prevProps:I};return"value"in I&&!H(G.value,I.value)&&(ce.value=I.value||[],"loadData"in I||(ce.activeValue=I.value||[])),"popupVisible"in I&&(ce.popupVisible=I.popupVisible),ce}}]),z}(oe.Component);return ye.defaultProps={onChange:function(){},onPopupVisibleChange:function(){},disabled:!1,transitionName:"",prefixCls:"rc-cascader",popupClassName:"",popupPlacement:"bottomLeft",builtinPlacements:T,expandTrigger:"click",fieldNames:{label:"label",value:"value",children:"children"},expandIcon:">"},ye}(),Se=ke,Le=Te.a=Se},SJMd:function(Ze,Te){/**
|
|
* @license
|
|
* Copyright (C) 2006 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var Z,oe,$,M=!1,X,B;window.PR_SHOULD_USE_CONTINUATION=!0;var P,W;(function(){var H=window,i=["break,continue,do,else,for,if,return,while"],L=[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"],v=[L,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],m=[v,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],p=[v,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],l=[v,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],h="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",f=[v,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],o="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",u=[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"],s=[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"],a=[i,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],C=[m,l,p,f,o,u,s,a],_=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,T="str",R="kwd",O="com",S="typ",w="lit",E="pun",c="pln",x="tag",y="dec",g="src",F="atn",U="atv",A="nocode",j="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function N(ce){for(var Ce=0,De=!1,ue=!1,ge=0,we=ce.length;ge<we;++ge){var Ae=ce[ge];if(Ae.ignoreCase)ue=!0;else if(/[a-z]/i.test(Ae.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){De=!0,ue=!1;break}}var Ne={b:8,t:9,n:10,v:11,f:12,r:13};function Be(Ke){var Me=Ke.charCodeAt(0);if(Me!==92)return Me;var et=Ke.charAt(1);return Me=Ne[et],Me||("0"<=et&&et<="7"?parseInt(Ke.substring(1),8):et==="u"||et==="x"?parseInt(Ke.substring(2),16):Ke.charCodeAt(1))}function Ge(Ke){if(Ke<32)return(Ke<16?"\\x0":"\\x")+Ke.toString(16);var Me=String.fromCharCode(Ke);return Me==="\\"||Me==="-"||Me==="]"||Me==="^"?"\\"+Me:Me}function He(Ke){var Me=Ke.substring(1,Ke.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),et=[],Je=Me[0]==="^",le=["["];Je&&le.push("^");for(var q=Je?1:0,te=Me.length;q<te;++q){var se=Me[q];if(/\\[bdsw]/i.test(se))le.push(se);else{var he=Be(se),ie;q+2<te&&Me[q+1]==="-"?(ie=Be(Me[q+2]),q+=2):ie=he,et.push([he,ie]),ie<65||he>122||(ie<65||he>90||et.push([Math.max(65,he)|32,Math.min(ie,90)|32]),ie<97||he>122||et.push([Math.max(97,he)&~32,Math.min(ie,122)&~32]))}}et.sort(function(xe,Oe){return xe[0]-Oe[0]||Oe[1]-xe[1]});for(var ae=[],pe=[],q=0;q<et.length;++q){var me=et[q];me[0]<=pe[1]+1?pe[1]=Math.max(pe[1],me[1]):ae.push(pe=me)}for(var q=0;q<ae.length;++q){var me=ae[q];le.push(Ge(me[0])),me[1]>me[0]&&(me[1]+1>me[0]&&le.push("-"),le.push(Ge(me[1])))}return le.push("]"),le.join("")}function qe(Ke){for(var Me=Ke.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),et=Me.length,Je=[],le=0,q=0;le<et;++le){var te=Me[le];if(te==="(")++q;else if(te.charAt(0)==="\\"){var se=+te.substring(1);se&&(se<=q?Je[se]=-1:Me[le]=Ge(se))}}for(var le=1;le<Je.length;++le)Je[le]===-1&&(Je[le]=++Ce);for(var le=0,q=0;le<et;++le){var te=Me[le];if(te==="(")++q,Je[q]||(Me[le]="(?:");else if(te.charAt(0)==="\\"){var se=+te.substring(1);se&&se<=q&&(Me[le]="\\"+Je[se])}}for(var le=0;le<et;++le)Me[le]==="^"&&Me[le+1]!=="^"&&(Me[le]="");if(Ke.ignoreCase&&De)for(var le=0;le<et;++le){var te=Me[le],he=te.charAt(0);te.length>=2&&he==="["?Me[le]=He(te):he!=="\\"&&(Me[le]=te.replace(/[a-zA-Z]/g,function(pe){var me=pe.charCodeAt(0);return"["+String.fromCharCode(me&~32,me|32)+"]"}))}return Me.join("")}for(var je=[],ge=0,we=ce.length;ge<we;++ge){var Ae=ce[ge];if(Ae.global||Ae.multiline)throw new Error(""+Ae);je.push("(?:"+qe(Ae)+")")}return new RegExp(je.join("|"),ue?"gi":"g")}function b(ce,Ce){var De=/(?:^|\s)nocode(?:\s|$)/,ue=[],ge=0,we=[],Ae=0;function Ne(Be){var Ge=Be.nodeType;if(Ge==1){if(De.test(Be.className))return;for(var He=Be.firstChild;He;He=He.nextSibling)Ne(He);var qe=Be.nodeName.toLowerCase();(qe==="br"||qe==="li")&&(ue[Ae]=`
|
|
`,we[Ae<<1]=ge++,we[Ae++<<1|1]=Be)}else if(Ge==3||Ge==4){var je=Be.nodeValue;je.length&&(Ce?je=je.replace(/\r\n?/g,`
|
|
`):je=je.replace(/[ \t\r\n]+/g," "),ue[Ae]=je,we[Ae<<1]=ge,ge+=je.length,we[Ae++<<1|1]=Be)}}return Ne(ce),{sourceCode:ue.join("").replace(/\n$/,""),spans:we}}function Y(ce,Ce,De,ue,ge){if(!De)return;var we={sourceNode:ce,pre:1,langExtension:null,numberLines:null,sourceCode:De,spans:null,basePos:Ce,decorations:null};ue(we),ge.push.apply(ge,we.decorations)}var re=/\S/;function fe(ce){for(var Ce=void 0,De=ce.firstChild;De;De=De.nextSibling){var ue=De.nodeType;Ce=ue===1?Ce?ce:De:ue===3&&re.test(De.nodeValue)?ce:Ce}return Ce===ce?void 0:Ce}function ve(ce,Ce){var De={},ue;(function(){for(var Ae=ce.concat(Ce),Ne=[],Be={},Ge=0,He=Ae.length;Ge<He;++Ge){var qe=Ae[Ge],je=qe[3];if(je)for(var Ke=je.length;--Ke>=0;)De[je.charAt(Ke)]=qe;var Me=qe[1],et=""+Me;Be.hasOwnProperty(et)||(Ne.push(Me),Be[et]=null)}Ne.push(/[\0-\uffff]/),ue=N(Ne)})();var ge=Ce.length,we=function(Ae){for(var Ne=Ae.sourceCode,Be=Ae.basePos,Ge=Ae.sourceNode,He=[Be,c],qe=0,je=Ne.match(ue)||[],Ke={},Me=0,et=je.length;Me<et;++Me){var Je=je[Me],le=Ke[Je],q=void 0,te;if(typeof le=="string")te=!1;else{var se=De[Je.charAt(0)];if(se)q=Je.match(se[1]),le=se[0];else{for(var he=0;he<ge;++he)if(se=Ce[he],q=Je.match(se[1]),q){le=se[0];break}q||(le=c)}te=le.length>=5&&le.substring(0,5)==="lang-",te&&!(q&&typeof q[1]=="string")&&(te=!1,le=g),te||(Ke[Je]=le)}var ie=qe;if(qe+=Je.length,!te)He.push(Be+ie,le);else{var ae=q[1],pe=Je.indexOf(ae),me=pe+ae.length;q[2]&&(me=Je.length-q[2].length,pe=me-ae.length);var xe=le.substring(5);Y(Ge,Be+ie,Je.substring(0,pe),we,He),Y(Ge,Be+ie+pe,ae,z(xe,ae),He),Y(Ge,Be+ie+me,Je.substring(me),we,He)}}Ae.decorations=He};return we}function ke(ce){var Ce=[],De=[];ce.tripleQuotedStrings?Ce.push([T,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ce.multiLineStrings?Ce.push([T,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ce.push([T,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ce.verbatimStrings&&De.push([T,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var ue=ce.hashComments;ue&&(ce.cStyleComments?(ue>1?Ce.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ce.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),De.push([T,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ce.push([O,/^#[^\r\n]*/,null,"#"])),ce.cStyleComments&&(De.push([O,/^\/\/[^\r\n]*/,null]),De.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ge=ce.regexLiterals;if(ge){var we=ge>1?"":`
|
|
\r`,Ae=we?".":"[\\S\\s]",Ne="/(?=[^/*"+we+"])(?:[^/\\x5B\\x5C"+we+"]|\\x5C"+Ae+"|\\x5B(?:[^\\x5C\\x5D"+we+"]|\\x5C"+Ae+")*(?:\\x5D|$))+/";De.push(["lang-regex",RegExp("^"+j+"("+Ne+")")])}var Be=ce.types;Be&&De.push([S,Be]);var Ge=(""+ce.keywords).replace(/^ | $/g,"");Ge.length&&De.push([R,new RegExp("^(?:"+Ge.replace(/[\s,]+/g,"|")+")\\b"),null]),Ce.push([c,/^\s+/,null,` \r
|
|
\xA0`]);var He="^.[^\\s\\w.$@'\"`/\\\\]*";return ce.regexLiterals&&(He+="(?!s*/)"),De.push([w,/^@[a-z_$][a-z_$@0-9]*/i,null],[S,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[c,/^[a-z_$][a-z_$@0-9]*/i,null],[w,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[c,/^\\[\s\S]?/,null],[E,new RegExp(He),null]),ve(Ce,De)}var Se=ke({keywords:C,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Le(ce,Ce,De){for(var ue=/(?:^|\s)nocode(?:\s|$)/,ge=/\r\n?|\n/,we=ce.ownerDocument,Ae=we.createElement("li");ce.firstChild;)Ae.appendChild(ce.firstChild);var Ne=[Ae];function Be(Me){var et=Me.nodeType;if(et==1&&!ue.test(Me.className))if(Me.nodeName==="br")Ge(Me),Me.parentNode&&Me.parentNode.removeChild(Me);else for(var Je=Me.firstChild;Je;Je=Je.nextSibling)Be(Je);else if((et==3||et==4)&&De){var le=Me.nodeValue,q=le.match(ge);if(q){var te=le.substring(0,q.index);Me.nodeValue=te;var se=le.substring(q.index+q[0].length);if(se){var he=Me.parentNode;he.insertBefore(we.createTextNode(se),Me.nextSibling)}Ge(Me),te||Me.parentNode.removeChild(Me)}}}function Ge(Me){for(;!Me.nextSibling;)if(Me=Me.parentNode,!Me)return;function et(q,te){var se=te?q.cloneNode(!1):q,he=q.parentNode;if(he){var ie=et(he,1),ae=q.nextSibling;ie.appendChild(se);for(var pe=ae;pe;pe=ae)ae=pe.nextSibling,ie.appendChild(pe)}return se}for(var Je=et(Me.nextSibling,0),le;(le=Je.parentNode)&&le.nodeType===1;)Je=le;Ne.push(Je)}for(var He=0;He<Ne.length;++He)Be(Ne[He]);Ce===(Ce|0)&&Ne[0].setAttribute("value",Ce);var qe=we.createElement("ol");qe.className="linenums";for(var je=Math.max(0,Ce-1|0)||0,He=0,Ke=Ne.length;He<Ke;++He)Ae=Ne[He],Ae.className="L"+(He+je)%10,Ae.firstChild||Ae.appendChild(we.createTextNode("\xA0")),qe.appendChild(Ae);ce.appendChild(qe)}function ye(ce){var Ce=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ce=Ce&&+Ce[1]<=8;var De=/\n/g,ue=ce.sourceCode,ge=ue.length,we=0,Ae=ce.spans,Ne=Ae.length,Be=0,Ge=ce.decorations,He=Ge.length,qe=0;Ge[He]=ge;var je,Ke;for(Ke=je=0;Ke<He;)Ge[Ke]!==Ge[Ke+2]?(Ge[je++]=Ge[Ke++],Ge[je++]=Ge[Ke++]):Ke+=2;for(He=je,Ke=je=0;Ke<He;){for(var Me=Ge[Ke],et=Ge[Ke+1],Je=Ke+2;Je+2<=He&&Ge[Je+1]===et;)Je+=2;Ge[je++]=Me,Ge[je++]=et,Ke=Je}He=Ge.length=je;var le=ce.sourceNode,q="";le&&(q=le.style.display,le.style.display="none");try{for(var te=null;Be<Ne;){var se=Ae[Be],he=Ae[Be+2]||ge,ie=Ge[qe+2]||ge,Je=Math.min(he,ie),ae=Ae[Be+1],pe;if(ae.nodeType!==1&&(pe=ue.substring(we,Je))){Ce&&(pe=pe.replace(De,"\r")),ae.nodeValue=pe;var me=ae.ownerDocument,xe=me.createElement("span");xe.className=Ge[qe+1];var Oe=ae.parentNode;Oe.replaceChild(xe,ae),xe.appendChild(ae),we<he&&(Ae[Be+1]=ae=me.createTextNode(ue.substring(Je,he)),Oe.insertBefore(ae,xe.nextSibling))}we=Je,we>=he&&(Be+=2),we>=ie&&(qe+=2)}}finally{le&&(le.style.display=q)}}var _e={};function de(ce,Ce){for(var De=Ce.length;--De>=0;){var ue=Ce[De];_e.hasOwnProperty(ue)?H.console&&console.warn("cannot override language handler %s",ue):_e[ue]=ce}}function z(ce,Ce){return ce&&_e.hasOwnProperty(ce)||(ce=/^\s*</.test(Ce)?"default-markup":"default-code"),_e[ce]}de(Se,["default-code"]),de(ve([],[[c,/^[^<?]+/],[y,/^<!\w[^>]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[E,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),de(ve([[c,/^[\s]+/,null,` \r
|
|
`],[U,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[x,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[F,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[E,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),de(ve([],[[U,/^[\s\S]+/]]),["uq.val"]),de(ke({keywords:m,hashComments:!0,cStyleComments:!0,types:_}),["c","cc","cpp","cxx","cyc","m"]),de(ke({keywords:"null,true,false"}),["json"]),de(ke({keywords:l,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:_}),["cs"]),de(ke({keywords:p,cStyleComments:!0}),["java"]),de(ke({keywords:a,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),de(ke({keywords:u,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),de(ke({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),de(ke({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),de(ke({keywords:f,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),de(ke({keywords:h,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),de(ve([],[[T,/^[\s\S]+/]]),["regex"]);function D(ce){var Ce=ce.langExtension;try{var De=b(ce.sourceNode,ce.pre),ue=De.sourceCode;ce.sourceCode=ue,ce.spans=De.spans,ce.basePos=0,z(Ce,ue)(ce),ye(ce)}catch(ge){H.console&&console.log(ge&&ge.stack||ge)}}function I(ce,Ce,De){var ue=De||!1,ge=Ce||null,we=document.createElement("div");we.innerHTML="<pre>"+ce+"</pre>",we=we.firstChild,ue&&Le(we,ue,!0);var Ae={langExtension:ge,numberLines:ue,sourceNode:we,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return D(Ae),we.innerHTML}function V(ce,Ce){var De=Ce||document.body,ue=De.ownerDocument||document;function ge(se){return De.getElementsByTagName(se)}for(var we=[ge("pre"),ge("code"),ge("xmp")],Ae=[],Ne=0;Ne<we.length;++Ne)for(var Be=0,Ge=we[Ne].length;Be<Ge;++Be)Ae.push(we[Ne][Be]);we=null;var He=Date;He.now||(He={now:function(){return+new Date}});var qe=0,je=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ke=/\bprettyprint\b/,Me=/\bprettyprinted\b/,et=/pre|xmp/i,Je=/^code$/i,le=/^(?:pre|code|xmp)$/i,q={};function te(){for(var se=H.PR_SHOULD_USE_CONTINUATION?He.now()+250:Infinity;qe<Ae.length&&He.now()<se;qe++){for(var he=Ae[qe],ie=q,ae=he;ae=ae.previousSibling;){var pe=ae.nodeType,me=(pe===7||pe===8)&&ae.nodeValue;if(me?!/^\??prettify\b/.test(me):pe!==3||/\S/.test(ae.nodeValue))break;if(me){ie={},me.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Ft,Tt,si){ie[Tt]=si});break}}var xe=he.className;if((ie!==q||Ke.test(xe))&&!Me.test(xe)){for(var Oe=!1,Pe=he.parentNode;Pe;Pe=Pe.parentNode){var ze=Pe.tagName;if(le.test(ze)&&Pe.className&&Ke.test(Pe.className)){Oe=!0;break}}if(!Oe){he.className+=" prettyprinted";var tt=ie.lang;if(!tt){tt=xe.match(je);var rt;!tt&&(rt=fe(he))&&Je.test(rt.tagName)&&(tt=rt.className.match(je)),tt&&(tt=tt[1])}var yt;if(et.test(he.tagName))yt=1;else{var ot=he.currentStyle,at=ue.defaultView,Lt=ot?ot.whiteSpace:at&&at.getComputedStyle?at.getComputedStyle(he,null).getPropertyValue("white-space"):0;yt=Lt&&Lt.substring(0,3)==="pre"}var _t=ie.linenums;(_t=_t==="true"||+_t)||(_t=xe.match(/\blinenums\b(?::(\d+))?/),_t=_t?_t[1]&&_t[1].length?+_t[1]:!0:!1),_t&&Le(he,_t,yt);var Bt={langExtension:tt,sourceNode:he,numberLines:_t,pre:yt,sourceCode:null,basePos:null,spans:null,decorations:null};D(Bt)}}}qe<Ae.length?H.setTimeout(te,250):typeof ce=="function"&&ce()}te()}var Q=H.PR={createSimpleLexer:ve,registerLangHandler:de,sourceDecorator:ke,PR_ATTRIB_NAME:F,PR_ATTRIB_VALUE:U,PR_COMMENT:O,PR_DECLARATION:y,PR_KEYWORD:R,PR_LITERAL:w,PR_NOCODE:A,PR_PLAIN:c,PR_PUNCTUATION:E,PR_SOURCE:g,PR_STRING:T,PR_TAG:x,PR_TYPE:S,prettyPrintOne:M?H.prettyPrintOne=I:P=I,prettyPrint:W=M?H.prettyPrint=V:W=V},G=H.define;typeof G=="function"&&G.amd&&G("google-code-prettify",[],function(){return Q})})()},STEk:function(Ze,Te,Z){"use strict";Z.d(Te,"a",function(){return de});/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var oe=function(z,D){return(oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,V){I.__proto__=V}||function(I,V){for(var Q in V)Object.prototype.hasOwnProperty.call(V,Q)&&(I[Q]=V[Q])})(z,D)};function $(z,D){function I(){this.constructor=z}oe(z,D),z.prototype=D===null?Object.create(D):(I.prototype=D.prototype,new I)}function M(z,D,I,V){return new(I||(I=Promise))(function(Q,G){function ce(ue){try{De(V.next(ue))}catch(ge){G(ge)}}function Ce(ue){try{De(V.throw(ue))}catch(ge){G(ge)}}function De(ue){var ge;ue.done?Q(ue.value):(ge=ue.value,ge instanceof I?ge:new I(function(we){we(ge)})).then(ce,Ce)}De((V=V.apply(z,D||[])).next())})}function X(z,D){var I,V,Q,G,ce={label:0,sent:function(){if(1&Q[0])throw Q[1];return Q[1]},trys:[],ops:[]};return G={next:Ce(0),throw:Ce(1),return:Ce(2)},typeof Symbol=="function"&&(G[Symbol.iterator]=function(){return this}),G;function Ce(De){return function(ue){return function(ge){if(I)throw new TypeError("Generator is already executing.");for(;ce;)try{if(I=1,V&&(Q=2&ge[0]?V.return:ge[0]?V.throw||((Q=V.return)&&Q.call(V),0):V.next)&&!(Q=Q.call(V,ge[1])).done)return Q;switch(V=0,Q&&(ge=[2&ge[0],Q.value]),ge[0]){case 0:case 1:Q=ge;break;case 4:return ce.label++,{value:ge[1],done:!1};case 5:ce.label++,V=ge[1],ge=[0];continue;case 7:ge=ce.ops.pop(),ce.trys.pop();continue;default:if(!(Q=ce.trys,(Q=Q.length>0&&Q[Q.length-1])||ge[0]!==6&&ge[0]!==2)){ce=0;continue}if(ge[0]===3&&(!Q||ge[1]>Q[0]&&ge[1]<Q[3])){ce.label=ge[1];break}if(ge[0]===6&&ce.label<Q[1]){ce.label=Q[1],Q=ge;break}if(Q&&ce.label<Q[2]){ce.label=Q[2],ce.ops.push(ge);break}Q[2]&&ce.ops.pop(),ce.trys.pop();continue}ge=D.call(z,ce)}catch(we){ge=[6,we],V=0}finally{I=Q=0}if(5&ge[0])throw ge[1];return{value:ge[0]?ge[1]:void 0,done:!0}}([De,ue])}}}function B(){for(var z=0,D=0,I=arguments.length;D<I;D++)z+=arguments[D].length;var V=Array(z),Q=0;for(D=0;D<I;D++)for(var G=arguments[D],ce=0,Ce=G.length;ce<Ce;ce++,Q++)V[Q]=G[ce];return V}var P=function(){function z(){}return z.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},z.setAttributes=function(D,I){for(var V=0,Q=I;V<Q.length;V++){var G=Q[V],ce=G[0],Ce=G[1];D.setAttribute(ce,Ce)}},z.createRect=function(D,I,V){var Q=document.createElementNS("http://www.w3.org/2000/svg","rect");return Q.setAttribute("width",D.toString()),Q.setAttribute("height",I.toString()),V&&z.setAttributes(Q,V),Q},z.createLine=function(D,I,V,Q,G){var ce=document.createElementNS("http://www.w3.org/2000/svg","line");return ce.setAttribute("x1",D.toString()),ce.setAttribute("y1",I.toString()),ce.setAttribute("x2",V.toString()),ce.setAttribute("y2",Q.toString()),G&&z.setAttributes(ce,G),ce},z.createPolygon=function(D,I){var V=document.createElementNS("http://www.w3.org/2000/svg","polygon");return V.setAttribute("points",D),I&&z.setAttributes(V,I),V},z.createCircle=function(D,I){var V=document.createElementNS("http://www.w3.org/2000/svg","circle");return V.setAttribute("cx",(D/2).toString()),V.setAttribute("cy",(D/2).toString()),V.setAttribute("r",D.toString()),I&&z.setAttributes(V,I),V},z.createEllipse=function(D,I,V){var Q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return Q.setAttribute("cx",(D/2).toString()),Q.setAttribute("cy",(I/2).toString()),Q.setAttribute("rx",(D/2).toString()),Q.setAttribute("ry",(I/2).toString()),V&&z.setAttributes(Q,V),Q},z.createGroup=function(D){var I=document.createElementNS("http://www.w3.org/2000/svg","g");return D&&z.setAttributes(I,D),I},z.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},z.createMarker=function(D,I,V,Q,G,ce,Ce){var De=document.createElementNS("http://www.w3.org/2000/svg","marker");return z.setAttributes(De,[["id",D],["orient",I],["markerWidth",V.toString()],["markerHeight",Q.toString()],["refX",G.toString()],["refY",ce.toString()]]),De.appendChild(Ce),De},z.createText=function(D){var I=document.createElementNS("http://www.w3.org/2000/svg","text");return I.setAttribute("x","0"),I.setAttribute("y","0"),D&&z.setAttributes(I,D),I},z.createTSpan=function(D,I){var V=document.createElementNS("http://www.w3.org/2000/svg","tspan");return V.textContent=D,I&&z.setAttributes(V,I),V},z.createImage=function(D){var I=document.createElementNS("http://www.w3.org/2000/svg","image");return D&&z.setAttributes(I,D),I},z.createPoint=function(D,I){var V=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return V.x=D,V.y=I,V},z.createPath=function(D,I){var V=document.createElementNS("http://www.w3.org/2000/svg","path");return V.setAttribute("d",D),I&&z.setAttributes(V,I),V},z}(),W=function(){function z(){}return z.addKey=function(D){z.key=D},Object.defineProperty(z,"isLicensed",{get:function(){return!!z.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(z.key)},enumerable:!1,configurable:!0}),z}(),H=function(){function z(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return z.prototype.rasterize=function(D,I,V){var Q=this;return new Promise(function(G){var ce=V!==void 0?V:document.createElement("canvas");D===null&&(Q.markersOnly=!0,Q.naturalSize=!1);var Ce=document.createElementNS("http://www.w3.org/2000/svg","svg");Ce.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ce.setAttribute("width",I.width.baseVal.valueAsString),Ce.setAttribute("height",I.height.baseVal.valueAsString),Ce.setAttribute("viewBox","0 0 "+I.viewBox.baseVal.width.toString()+" "+I.viewBox.baseVal.height.toString()),Ce.innerHTML=I.innerHTML,Q.naturalSize===!0?(Ce.width.baseVal.value=D.naturalWidth,Ce.height.baseVal.value=D.naturalHeight):Q.width!==void 0&&Q.height!==void 0&&(Ce.width.baseVal.value=Q.width,Ce.height.baseVal.value=Q.height),ce.width=Ce.width.baseVal.value,ce.height=Ce.height.baseVal.value;var De=Ce.outerHTML,ue=ce.getContext("2d");Q.markersOnly!==!0&&ue.drawImage(D,0,0,ce.width,ce.height);var ge=window.URL,we=new Image(ce.width,ce.height);we.setAttribute("crossOrigin","anonymous");var Ae=new Blob([De],{type:"image/svg+xml"}),Ne=ge.createObjectURL(Ae);we.onload=function(){ue.drawImage(we,0,0),ge.revokeObjectURL(Ne);var Be=ce.toDataURL(Q.imageType,Q.imageQuality);G(Be)},we.src=Ne})},z}(),i=function(){},L=function(){function z(D){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+D+"_"}return Object.defineProperty(z.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(z.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(z.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),z.prototype.addClass=function(D){return this.styleSheet===void 0&&this.addStyleSheet(),D.name=""+this.classNamePrefix+D.localName,this.classes.push(D),this.styleSheet.sheet.insertRule("."+D.name+" {"+D.style+"}",this.styleSheet.sheet.cssRules.length),D},z.prototype.addRule=function(D){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(D),this.styleSheet.sheet.insertRule(D.selector+" {"+D.style+"}",this.styleSheet.sheet.cssRules.length)},z.prototype.addStyleSheet=function(){var D;this.styleSheet=document.createElement("style"),((D=this.styleSheetRoot)!==null&&D!==void 0?D:document.head).appendChild(this.styleSheet),this.addRule(new v("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new v("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new v("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new m("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new m("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},z.prototype.removeStyleSheet=function(){var D;this.styleSheet&&(((D=this.styleSheetRoot)!==null&&D!==void 0?D:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},z}(),v=function(z,D){this.selector=z,this.style=D},m=function(z,D){this.localName=z,this.style=D},p=function(){function z(D,I,V,Q,G){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=D,this.displayMode=I,this.markerItems=V,this.uiStyleSettings=Q,this.styles=G,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return z.prototype.show=function(D){var I=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=D,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var V=document.createElement("div");V.className=this.toolbarBlockStyleClass.name,V.style.whiteSpace="nowrap",this.uiContainer.appendChild(V),this.addActionButton(V,'<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(V,'<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(V,'<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(V,'<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(V,'<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(V,'<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(V,'<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(V,'<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(G){var ce=document.createElement("div");ce.className=""+I.toolbarButtonStyleClass.name,ce.setAttribute("data-type-name",G.typeName),ce.innerHTML=G.icon,ce.addEventListener("click",function(){I.markerToolbarButtonClicked(ce,G)}),I.buttons.push(ce),I.markerButtons.push(ce)}),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()},z.prototype.addButtonClickListener=function(D){this.buttonClickListeners.push(D)},z.prototype.removeButtonClickListener=function(D){this.buttonClickListeners.indexOf(D)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(D),1)},z.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},z.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var D=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<D||I===D&&this.markerButtons.length-1===D?this.markerButtonBlock.appendChild(this.markerButtons[I]):(I===D&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[I]))}},z.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")},z.prototype.resetButtonStyles=function(){var D=this;this.buttons.forEach(function(I){I.className=I.className.replace(D.uiStyleSettings.toolbarButtonStyleColorsClassName?D.uiStyleSettings.toolbarButtonStyleColorsClassName:D.toolbarButtonStyleColorsClass.name,"").trim(),I.className=I.className.replace(D.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?D.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:D.toolbarActiveButtonStyleColorsClass.name,"").trim(),I.className+=" "+(D.uiStyleSettings.toolbarButtonStyleColorsClassName?D.uiStyleSettings.toolbarButtonStyleColorsClassName:D.toolbarButtonStyleColorsClass.name)})},z.prototype.addActionButton=function(D,I,V){var Q=this,G=document.createElement("div");switch(G.className=""+this.toolbarButtonStyleClass.name,G.innerHTML=I,G.setAttribute("data-action",V),G.addEventListener("click",function(){Q.actionToolbarButtonClicked(G,V)}),V){case"select":G.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":G.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":G.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":G.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":G.style.fill=this.uiStyleSettings.closeButtonColor}D.appendChild(G),this.buttons.push(G)},z.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new m("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 m("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new m("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new m("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 m("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var D=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new m("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*D)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*D)+`px;
|
|
padding: `+D+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new m("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new m("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new v("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new v("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},z.prototype.markerToolbarButtonClicked=function(D,I){this.setActiveButton(D),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(V){return V("marker",I)}),this.markerButtonOverflowBlock.style.display="none"},z.prototype.actionToolbarButtonClicked=function(D,I){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(V){return V("action",I)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},z.prototype.setActiveButton=function(D){this.resetButtonStyles(),D.className=D.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),D.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},z.prototype.setActiveMarkerButton=function(D){var I=this.markerButtons.find(function(V){return V.getAttribute("data-type-name")===D});I&&this.setActiveButton(I)},z.prototype.setCurrentMarker=function(D){var I=this;this.currentMarker=D,this.buttons.filter(function(V){return/delete|notes/.test(V.getAttribute("data-action"))}).forEach(function(V){I.currentMarker===void 0?(V.style.fillOpacity="0.4",V.style.pointerEvents="none"):(V.style.fillOpacity="1",V.style.pointerEvents="all")})},z}(),l=function(){function z(D,I,V,Q){this.panels=[],this.panelButtons=[],this.markerjsContainer=D,this.displayMode=I,this.uiStyleSettings=V,this.styles=Q,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return z.prototype.addStyles=function(){var D;this.toolboxStyleClass=this.styles.addClass(new m("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 m("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var I=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new m("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new m("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new m("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 m("toolbox-panel-row_colors",`
|
|
background-color: `+((D=this.uiStyleSettings.toolboxBackgroundColor)!==null&&D!==void 0?D:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new m("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 m("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new m("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new v("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new v("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},z.prototype.show=function(D){var I;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=D,this.uiContainer.className=this.toolboxStyleClass.name+" "+((I=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&I!==void 0?I:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},z.prototype.setPanelButtons=function(D){var I,V,Q=this;this.panels=D,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+" "+((V=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&V!==void 0?V:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(G){var ce;G.uiStyleSettings=Q.uiStyleSettings;var Ce=document.createElement("div");Ce.className=Q.toolboxButtonStyleClass.name+" "+((ce=Q.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ce!==void 0?ce:Q.toolboxButtonStyleColorsClass.name),Ce.innerHTML=G.icon,Ce.title=G.title,Ce.addEventListener("click",function(){Q.panelButtonClick(G)}),Q.panelButtons.push(Ce),Q.buttonRow.appendChild(Ce)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},z.prototype.panelButtonClick=function(D){var I=this,V=-1;if(D!==this.activePanel){V=this.panels.indexOf(D),this.panelRow.innerHTML="";var Q=D.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=D}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(G,ce){var Ce,De;G.className=I.toolboxButtonStyleClass.name+" "+(ce===V?""+((Ce=I.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ce!==void 0?Ce:I.toolboxActiveButtonStyleColorsClass.name):""+((De=I.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&De!==void 0?De:I.toolboxButtonStyleColorsClass.name))})},z}(),h=function(z,D){this.title=z,this.icon=D},f=function(z){function D(I,V,Q,G){var ce=z.call(this,I,G||'<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 ce.colors=[],ce.addTransparent=!1,ce.colorBoxes=[],ce.colors=V,ce.currentColor=Q,ce.setCurrentColor=ce.setCurrentColor.bind(ce),ce.getColorBox=ce.getColorBox.bind(ce),ce}return $(D,z),D.prototype.getUi=function(){var I=this,V=document.createElement("div");return V.style.overflow="hidden",V.style.whiteSpace="nowrap",this.colors.forEach(function(Q){var G=I.getColorBox(Q);V.appendChild(G),I.colorBoxes.push(G)}),V},D.prototype.getColorBox=function(I){var V=this,Q=this.uiStyleSettings.toolbarHeight/4,G=this.uiStyleSettings.toolbarHeight-Q,ce=document.createElement("div");ce.style.display="inline-block",ce.style.boxSizing="content-box",ce.style.width=G-2+"px",ce.style.height=G-2+"px",ce.style.padding="1px",ce.style.marginRight="2px",ce.style.marginBottom="2px",ce.style.borderWidth="2px",ce.style.borderStyle="solid",ce.style.borderRadius=(G+2)/2+"px",ce.style.borderColor=I===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ce.addEventListener("click",function(){V.setCurrentColor(I,ce)});var Ce=document.createElement("div");return Ce.style.display="inline-block",Ce.style.width=G-2+"px",Ce.style.height=G-2+"px",Ce.style.backgroundColor=I,Ce.style.borderRadius=G/2+"px",I==="transparent"&&(Ce.style.fill=this.uiStyleSettings.toolboxAccentColor,Ce.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>`),ce.appendChild(Ce),ce},D.prototype.setCurrentColor=function(I,V){var Q=this;this.currentColor=I,this.colorBoxes.forEach(function(G){G.style.borderColor=G===V?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(I)},D}(h),o=function(){function z(D,I,V){this._state="new",this._isSelected=!1,this._container=D,this._overlayContainer=I,this.globalSettings=V,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(z.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),z.prototype.ownsTarget=function(D){return!1},Object.defineProperty(z.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),z.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},z.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},z.prototype.pointerDown=function(D,I){},z.prototype.dblClick=function(D,I){},z.prototype.manipulate=function(D){},z.prototype.pointerUp=function(D){this.stateChanged()},z.prototype.dispose=function(){},z.prototype.addMarkerVisualToContainer=function(D){this.container.childNodes.length>0?this.container.insertBefore(D,this.container.childNodes[0]):this.container.appendChild(D)},z.prototype.getState=function(){return{typeName:z.typeName,state:this.state,notes:this.notes}},z.prototype.restoreState=function(D){this._state=D.state,this.notes=D.notes},z.prototype.scale=function(D,I){},z.prototype.colorChanged=function(D){this.onColorChanged&&this.onColorChanged(D),this.stateChanged()},z.prototype.fillColorChanged=function(D){this.onFillColorChanged&&this.onFillColorChanged(D),this.stateChanged()},z.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var D=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),D.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(D)&&this.onStateChanged(this)}},z.typeName="MarkerBase",z}(),u=function(){function z(){this.findGripByVisual=this.findGripByVisual.bind(this)}return z.prototype.findGripByVisual=function(D){return this.topLeft.ownsTarget(D)?this.topLeft:this.topCenter.ownsTarget(D)?this.topCenter:this.topRight.ownsTarget(D)?this.topRight:this.centerLeft.ownsTarget(D)?this.centerLeft:this.centerRight.ownsTarget(D)?this.centerRight:this.bottomLeft.ownsTarget(D)?this.bottomLeft:this.bottomCenter.ownsTarget(D)?this.bottomCenter:this.bottomRight.ownsTarget(D)?this.bottomRight:void 0},z}(),s=function(){function z(){this.GRIP_SIZE=10,this.visual=P.createGroup(),this.visual.appendChild(P.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(P.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return z.prototype.ownsTarget=function(D){return D===this.visual||D===this.visual.childNodes[0]||D===this.visual.childNodes[1]},z}(),a=function(){function z(){}return z.toITransformMatrix=function(D){return{a:D.a,b:D.b,c:D.c,d:D.d,e:D.e,f:D.f}},z.toSVGMatrix=function(D,I){return D.a=I.a,D.b=I.b,D.c=I.c,D.d=I.d,D.e=I.e,D.f=I.f,D},z}(),C=function(z){function D(I,V,Q){var G=z.call(this,I,V,Q)||this;return G.left=0,G.top=0,G.width=0,G.height=0,G.defaultSize={x:50,y:20},G.offsetX=0,G.offsetY=0,G.rotationAngle=0,G.CB_DISTANCE=10,G._suppressMarkerCreateEvent=!1,G.container.transform.baseVal.appendItem(P.createTransform()),G.setupControlBox(),G}return $(D,z),Object.defineProperty(D.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"visual",{get:function(){return this._visual},set:function(I){this._visual=I;var V=P.createTransform();this._visual.transform.baseVal.appendItem(V)},enumerable:!1,configurable:!0}),D.prototype.ownsTarget=function(I){return!!z.prototype.ownsTarget.call(this,I)||!!(this.controlGrips.findGripByVisual(I)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(I))},D.prototype.pointerDown=function(I,V){z.prototype.pointerDown.call(this,I,V),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(V),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(V)){this.activeGrip=this.rotatorGrip;var G=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=G.x-this.width/2,this.top=G.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ce=this.container.transform.baseVal.getItem(0);ce.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ce,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},D.prototype.pointerUp=function(I){var V=this.state;z.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",V==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},D.prototype.moveVisual=function(I){this.visual.style.transform="translate("+I.x+"px, "+I.y+"px)"},D.prototype.manipulate=function(I){var V=this.unrotatePoint(I);this.state==="creating"?this.resize(I):this.state==="move"?(this.left=this.manipulationStartLeft+(V.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(V.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(V):this.state==="rotate"&&this.rotate(I)},D.prototype.resize=function(I){var V=this.manipulationStartLeft,Q=this.manipulationStartWidth,G=this.manipulationStartTop,ce=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:V=this.manipulationStartLeft+I.x-this.manipulationStartX,Q=this.manipulationStartWidth+this.manipulationStartLeft-V;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:G=this.manipulationStartTop+I.y-this.manipulationStartY,ce=this.manipulationStartHeight+this.manipulationStartTop-G;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ce=this.manipulationStartHeight+I.y-this.manipulationStartY}Q>=0?(this.left=V,this.width=Q):(this.left=V+Q,this.width=-Q),ce>=0?(this.top=G,this.height=ce):(this.top=G+ce,this.height=-ce),this.setSize()},D.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},D.prototype.rotate=function(I){if(Math.abs(I.x-this.centerX)>.1){var V=Math.sign(I.x-this.centerX);this.rotationAngle=180*Math.atan((I.y-this.centerY)/(I.x-this.centerX))/Math.PI+90*V,this.applyRotation()}},D.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)},D.prototype.rotatePoint=function(I){if(this.rotationAngle===0)return I;var V=this.container.getCTM(),Q=P.createPoint(I.x,I.y);return{x:(Q=Q.matrixTransform(V)).x,y:Q.y}},D.prototype.unrotatePoint=function(I){if(this.rotationAngle===0)return I;var V=this.container.getCTM();V=V.inverse();var Q=P.createPoint(I.x,I.y);return{x:(Q=Q.matrixTransform(V)).x,y:Q.y}},D.prototype.select=function(){z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},D.prototype.deselect=function(){z.prototype.deselect.call(this),this.controlBox.style.display="none"},D.prototype.setupControlBox=function(){this.controlBox=P.createGroup();var I=P.createTransform();I.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(I),this.container.appendChild(this.controlBox),this.controlRect=P.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=P.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new u,this.addControlGrips(),this.controlBox.style.display="none"},D.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()},D.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()},D.prototype.createGrip=function(){var I=new s;return I.visual.transform.baseVal.appendItem(P.createTransform()),this.controlBox.appendChild(I.visual),I},D.prototype.positionGrips=function(){var I=this.controlGrips.topLeft.GRIP_SIZE,V=-I/2,Q=V,G=(this.width+this.CB_DISTANCE)/2-I/2,ce=(this.height+this.CB_DISTANCE)/2-I/2,Ce=this.height+this.CB_DISTANCE-I/2,De=this.width+this.CB_DISTANCE-I/2;this.positionGrip(this.controlGrips.topLeft.visual,V,Q),this.positionGrip(this.controlGrips.topCenter.visual,G,Q),this.positionGrip(this.controlGrips.topRight.visual,De,Q),this.positionGrip(this.controlGrips.centerLeft.visual,V,ce),this.positionGrip(this.controlGrips.centerRight.visual,De,ce),this.positionGrip(this.controlGrips.bottomLeft.visual,V,Ce),this.positionGrip(this.controlGrips.bottomCenter.visual,G,Ce),this.positionGrip(this.controlGrips.bottomRight.visual,De,Ce),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,G,Q-3*this.CB_DISTANCE)},D.prototype.positionGrip=function(I,V,Q){var G=I.transform.baseVal.getItem(0);G.setTranslate(V,Q),I.transform.baseVal.replaceItem(G,0)},D.prototype.hideControlBox=function(){this.controlBox.style.display="none"},D.prototype.showControlBox=function(){this.controlBox.style.display=""},D.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:a.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:a.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},z.prototype.getState.call(this))},D.prototype.restoreState=function(I){z.prototype.restoreState.call(this,I);var V=I;this.left=V.left,this.top=V.top,this.width=V.width,this.height=V.height,this.rotationAngle=V.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(a.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,V.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(a.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,V.containerTransformMatrix))},D.prototype.scale=function(I,V){z.prototype.scale.call(this,I,V);var Q=this.rotatePoint({x:this.left,y:this.top}),G=this.unrotatePoint({x:Q.x*I,y:Q.y*V});this.left=G.x,this.top=G.y,this.width=this.width*I,this.height=this.height*V,this.adjustControlBox()},D}(o),_=function(z){function D(I,V,Q){var G=z.call(this,I,V,Q)||this;return G.fillColor="transparent",G.strokeColor="transparent",G.strokeWidth=0,G.strokeDasharray="",G.opacity=1,G.setStrokeColor=G.setStrokeColor.bind(G),G.setFillColor=G.setFillColor.bind(G),G.setStrokeWidth=G.setStrokeWidth.bind(G),G.setStrokeDasharray=G.setStrokeDasharray.bind(G),G.createVisual=G.createVisual.bind(G),G}return $(D,z),D.prototype.ownsTarget=function(I){return!(!z.prototype.ownsTarget.call(this,I)&&I!==this.visual)},D.prototype.createVisual=function(){this.visual=P.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)},D.prototype.pointerDown=function(I,V){z.prototype.pointerDown.call(this,I,V),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},D.prototype.manipulate=function(I){z.prototype.manipulate.call(this,I)},D.prototype.resize=function(I){z.prototype.resize.call(this,I),this.setSize()},D.prototype.setSize=function(){z.prototype.setSize.call(this),P.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},D.prototype.pointerUp=function(I){z.prototype.pointerUp.call(this,I),this.setSize()},D.prototype.setStrokeColor=function(I){this.strokeColor=I,this.visual&&P.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(I),this.stateChanged()},D.prototype.setFillColor=function(I){this.fillColor=I,this.visual&&P.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},D.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.visual&&P.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},D.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.visual&&P.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},D.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},z.prototype.getState.call(this))},D.prototype.restoreState=function(I){var V=I;this.fillColor=V.fillColor,this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.opacity=V.opacity,this.createVisual(),z.prototype.restoreState.call(this,I),this.setSize()},D.prototype.scale=function(I,V){z.prototype.scale.call(this,I,V),this.setSize()},D.title="Rectangle marker",D}(C),T=function(z){function D(I,V,Q,G){var ce=z.call(this,I,G||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ce.widths=[],ce.widthBoxes=[],ce.widths=V,ce.currentWidth=Q,ce.setCurrentWidth=ce.setCurrentWidth.bind(ce),ce}return $(D,z),D.prototype.getUi=function(){var I=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",this.widths.forEach(function(Q){var G=document.createElement("div");G.style.display="flex",G.style.flexGrow="2",G.style.alignItems="center",G.style.justifyContent="space-between",G.style.padding="5px",G.style.borderWidth="2px",G.style.borderStyle="solid",G.style.borderColor=Q===I.currentWidth?I.uiStyleSettings.toolboxAccentColor:"transparent",G.addEventListener("click",function(){I.setCurrentWidth(Q,G)}),V.appendChild(G);var ce=document.createElement("div");ce.innerText=Q.toString(),ce.style.marginRight="5px",G.appendChild(ce);var Ce=document.createElement("div");Ce.style.minHeight="20px",Ce.style.flexGrow="2",Ce.style.display="flex",Ce.style.alignItems="center";var De=document.createElement("hr");De.style.minWidth="20px",De.style.border="0px",De.style.borderTop=Q+"px solid "+I.uiStyleSettings.toolboxColor,De.style.flexGrow="2",Ce.appendChild(De),G.appendChild(Ce),I.widthBoxes.push(G)}),V},D.prototype.setCurrentWidth=function(I,V){var Q=this;this.currentWidth=I,this.widthBoxes.forEach(function(G){G.style.borderColor=G===V?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},D}(h),R=function(z){function D(I,V,Q,G){var ce=z.call(this,I,G||'<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 ce.styles=[],ce.styleBoxes=[],ce.styles=V,ce.currentStyle=Q,ce.setCurrentStyle=ce.setCurrentStyle.bind(ce),ce}return $(D,z),D.prototype.getUi=function(){var I=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",this.styles.forEach(function(Q){var G=document.createElement("div");G.style.display="flex",G.style.alignItems="center",G.style.justifyContent="space-between",G.style.padding="5px",G.style.borderWidth="2px",G.style.borderStyle="solid",G.style.overflow="hidden",G.style.maxWidth=100/I.styles.length-5+"%",G.style.borderColor=Q===I.currentStyle?I.uiStyleSettings.toolboxAccentColor:"transparent",G.addEventListener("click",function(){I.setCurrentStyle(Q,G)}),V.appendChild(G);var ce=document.createElement("div");ce.style.minHeight="20px",ce.style.flexGrow="2",ce.style.overflow="hidden";var Ce=`<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>`;ce.innerHTML=Ce,G.appendChild(ce),I.styleBoxes.push(G)}),V},D.prototype.setCurrentStyle=function(I,V){var Q=this;this.currentStyle=I,this.styleBoxes.forEach(function(G){G.style.borderColor=G===V?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},D}(h),O=function(z){function D(I,V,Q){var G=z.call(this,I,V,Q)||this;return G.strokeColor=Q.defaultColor,G.strokeWidth=Q.defaultStrokeWidth,G.strokeDasharray=Q.defaultStrokeDasharray,G.strokePanel=new f("Line color",Q.defaultColorSet,Q.defaultColor),G.strokePanel.onColorChanged=G.setStrokeColor,G.strokeWidthPanel=new T("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),G.strokeWidthPanel.onWidthChanged=G.setStrokeWidth,G.strokeStylePanel=new R("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),G.strokeStylePanel.onStyleChanged=G.setStrokeDasharray,G}return $(D,z),Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var I=z.prototype.getState.call(this);return I.typeName=D.typeName,I},D.typeName="FrameMarker",D.title="Frame marker",D.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',D}(_),S=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},w=function(z){function D(I,V,Q){var G=z.call(this,I,V,Q)||this;return G.x1=0,G.y1=0,G.x2=0,G.y2=0,G.defaultLength=50,G.manipulationStartX=0,G.manipulationStartY=0,G.manipulationStartX1=0,G.manipulationStartY1=0,G.manipulationStartX2=0,G.manipulationStartY2=0,G.setupControlBox(),G}return $(D,z),D.prototype.ownsTarget=function(I){return!!z.prototype.ownsTarget.call(this,I)||!(!this.grip1.ownsTarget(I)&&!this.grip2.ownsTarget(I))},D.prototype.pointerDown=function(I,V){z.prototype.pointerDown.call(this,I,V),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(V)?this.activeGrip=this.grip1:this.grip2.ownsTarget(V)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},D.prototype.pointerUp=function(I){var V=this.state;z.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",V==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},D.prototype.adjustVisual=function(){},D.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)},D.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()},D.prototype.select=function(){z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},D.prototype.deselect=function(){z.prototype.deselect.call(this),this.controlBox.style.display="none"},D.prototype.setupControlBox=function(){this.controlBox=P.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},D.prototype.adjustControlBox=function(){this.positionGrips()},D.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},D.prototype.createGrip=function(){var I=new s;return I.visual.transform.baseVal.appendItem(P.createTransform()),this.controlBox.appendChild(I.visual),I},D.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)},D.prototype.positionGrip=function(I,V,Q){var G=I.transform.baseVal.getItem(0);G.setTranslate(V,Q),I.transform.baseVal.replaceItem(G,0)},D.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},z.prototype.getState.call(this))},D.prototype.restoreState=function(I){z.prototype.restoreState.call(this,I);var V=I;this.x1=V.x1,this.y1=V.y1,this.x2=V.x2,this.y2=V.y2},D.prototype.scale=function(I,V){z.prototype.scale.call(this,I,V),this.x1=this.x1*I,this.y1=this.y1*V,this.x2=this.x2*I,this.y2=this.y2*V,this.adjustVisual(),this.adjustControlBox()},D}(o),E=function(z){function D(I,V,Q){var G=z.call(this,I,V,Q)||this;return G.strokeColor="transparent",G.strokeWidth=0,G.strokeDasharray="",G.setStrokeColor=G.setStrokeColor.bind(G),G.setStrokeWidth=G.setStrokeWidth.bind(G),G.setStrokeDasharray=G.setStrokeDasharray.bind(G),G.strokeColor=Q.defaultColor,G.strokeWidth=Q.defaultStrokeWidth,G.strokeDasharray=Q.defaultStrokeDasharray,G.strokePanel=new f("Line color",Q.defaultColorSet,Q.defaultColor),G.strokePanel.onColorChanged=G.setStrokeColor,G.strokeWidthPanel=new T("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),G.strokeWidthPanel.onWidthChanged=G.setStrokeWidth,G.strokeStylePanel=new R("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),G.strokeStylePanel.onStyleChanged=G.setStrokeDasharray,G}return $(D,z),D.prototype.ownsTarget=function(I){return!(!z.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.selectorLine&&I!==this.visibleLine)},D.prototype.createVisual=function(){this.visual=P.createGroup(),this.selectorLine=P.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=P.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)},D.prototype.pointerDown=function(I,V){z.prototype.pointerDown.call(this,I,V),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},D.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()),P.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),P.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),P.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},D.prototype.setStrokeColor=function(I){this.strokeColor=I,this.adjustVisual(),this.colorChanged(I)},D.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.adjustVisual()},D.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.adjustVisual(),this.stateChanged()},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var I=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},z.prototype.getState.call(this));return I.typeName=D.typeName,I},D.prototype.restoreState=function(I){z.prototype.restoreState.call(this,I);var V=I;this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.createVisual(),this.adjustVisual()},D.typeName="LineMarker",D.title="Line marker",D.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',D}(w),c=function(z){function D(I,V,Q,G){var ce=z.call(this,I,G||'<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 ce.fonts=[],ce.fontBoxes=[],ce.fonts=V,ce.currentFont=Q,ce.setCurrentFont=ce.setCurrentFont.bind(ce),ce}return $(D,z),D.prototype.getUi=function(){var I=this,V=document.createElement("div");return V.style.overflow="hidden",V.style.flexGrow="2",this.fonts.forEach(function(Q){var G=document.createElement("div");G.style.display="inline-block",G.style.alignItems="center",G.style.justifyContent="space-between",G.style.padding="5px",G.style.borderWidth="2px",G.style.borderStyle="solid",G.style.overflow="hidden",G.style.maxWidth=100/I.fonts.length-5+"%",G.style.borderColor=Q===I.currentFont?I.uiStyleSettings.toolboxAccentColor:"transparent",G.addEventListener("click",function(){I.setCurrentFont(Q,G)}),V.appendChild(G);var ce=document.createElement("div");ce.style.display="flex",ce.style.minHeight="20px",ce.style.flexGrow="2",ce.style.fontFamily=Q,ce.style.overflow="hidden";var Ce=document.createElement("div");Ce.style.whiteSpace="nowrap",Ce.style.overflow="hidden",Ce.style.textOverflow="ellipsis",Ce.innerHTML="The quick brown fox jumps over the lazy dog",ce.appendChild(Ce),G.appendChild(ce),I.fontBoxes.push(G)}),V},D.prototype.setCurrentFont=function(I,V){var Q=this;this.currentFont=I,this.fontBoxes.forEach(function(G){G.style.borderColor=G===V?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},D}(h),x=function(z){function D(I,V,Q){var G=z.call(this,I,V,Q)||this;return G.color="transparent",G.padding=5,G.DEFAULT_TEXT="your text here",G.text=G.DEFAULT_TEXT,G.isMoved=!1,G.color=Q.defaultColor,G.fontFamily=Q.defaultFontFamily,G.defaultSize={x:100,y:30},G.setColor=G.setColor.bind(G),G.setFont=G.setFont.bind(G),G.renderText=G.renderText.bind(G),G.sizeText=G.sizeText.bind(G),G.textEditDivClicked=G.textEditDivClicked.bind(G),G.showTextEditor=G.showTextEditor.bind(G),G.setSize=G.setSize.bind(G),G.positionTextEditor=G.positionTextEditor.bind(G),G.colorPanel=new f("Color",Q.defaultColorSet,Q.defaultColor),G.colorPanel.onColorChanged=G.setColor,G.fontFamilyPanel=new c("Font",Q.defaultFontFamilies,Q.defaultFontFamily),G.fontFamilyPanel.onFontChanged=G.setFont,G}return $(D,z),D.prototype.ownsTarget=function(I){if(z.prototype.ownsTarget.call(this,I)||I===this.visual||I===this.textElement||I===this.bgRectangle)return!0;var V=!1;return this.textElement.childNodes.forEach(function(Q){Q===I&&(V=!0)}),V},D.prototype.createVisual=function(){this.visual=P.createGroup(),this.bgRectangle=P.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=P.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(P.createTransform()),this.textElement.transform.baseVal.appendItem(P.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},D.prototype.pointerDown=function(I,V){z.prototype.pointerDown.call(this,I,V),this.isMoved=!1,this.pointerDownPoint=I,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},D.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(V){I.textElement.appendChild(P.createTSpan(V.trim()===""?" ":V.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},D.prototype.getTextScale=function(){var I=this.textElement.getBBox(),V=1;if(I.width>0&&I.height>0){var Q=(1*this.width-this.width*this.padding*2/100)/I.width,G=(1*this.height-this.height*this.padding*2/100)/I.height;V=Math.min(Q,G)}return V},D.prototype.getTextPosition=function(I){var V=this.textElement.getBBox(),Q=0,G=0;return V.width>0&&V.height>0&&(Q=(this.width-V.width*I)/2,G=this.height/2-V.height*I/2),{x:Q,y:G}},D.prototype.sizeText=function(){var I=this.textElement.getBBox(),V=this.getTextScale(),Q=this.getTextPosition(V);Q.y-=I.y*V,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+Q.x+"px, "+Q.y+"px) scale("+V+", "+V+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(Q.x,Q.y),this.textElement.transform.baseVal.getItem(1).setScale(V,V))},D.prototype.manipulate=function(I){z.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)},D.prototype.resize=function(I){z.prototype.resize.call(this,I),this.isMoved=!0,this.setSize(),this.sizeText()},D.prototype.setSize=function(){z.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(P.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),P.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},D.prototype.pointerUp=function(I){var V=this.state;V==="creating"&&(this._suppressMarkerCreateEvent=!0),z.prototype.pointerUp.call(this,I),this.setSize(),(V==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},D.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(V){V.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var V=Number.parseFloat(I.textEditor.style.fontSize);I.textEditor.clientWidth>=Number.parseInt(I.textEditor.style.maxWidth)&&V>.9;)V-=.1,I.textEditor.style.fontSize=Math.max(V,.9)+"em"}),this.textEditor.addEventListener("keyup",function(V){V.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(V){if(V.clipboardData){var Q=V.clipboardData.getData("text"),G=window.getSelection();if(!G.rangeCount)return!1;G.deleteFromDocument(),G.getRangeAt(0).insertNode(document.createTextNode(Q)),V.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")},D.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var I=this.getTextScale(),V=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),Q=this.textElement.getBBox(),G={x:Q.width*I,y:Q.height*I};V.x-=G.x/2,V.y-=G.y/2,this.textEditor.style.top=V.y+"px",this.textEditor.style.left=V.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-V.x+"px",this.textEditor.style.fontSize=Math.max(16*I,12)+"px",this.textElement.style.display="none"}},D.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()},D.prototype.select=function(){z.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},D.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),z.prototype.deselect.call(this)},D.prototype.dblClick=function(I,V){z.prototype.dblClick.call(this,I,V),this.showTextEditor()},D.prototype.setColor=function(I){this.textElement&&P.setAttributes(this.textElement,[["fill",I]]),this.color=I,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(I)},D.prototype.setFont=function(I){this.textElement&&P.setAttributes(this.textElement,[["font-family",I]]),this.fontFamily=I,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},D.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},D.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var I=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},z.prototype.getState.call(this));return I.typeName=D.typeName,I},D.prototype.restoreState=function(I){var V=I;this.color=V.color,this.fontFamily=V.fontFamily,this.padding=V.padding,this.text=V.text,this.createVisual(),z.prototype.restoreState.call(this,I),this.setSize()},D.prototype.scale=function(I,V){z.prototype.scale.call(this,I,V),this.setSize(),this.sizeText(),this.positionTextEditor()},D.typeName="TextMarker",D.title="Text marker",D.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>',D}(C),y=function(z){function D(I,V,Q){var G=z.call(this,I,V,Q)||this;return G.color="transparent",G.lineWidth=3,G.drawing=!1,G.pixelRatio=1,G.color=Q.defaultColor,G.lineWidth=Q.defaultStrokeWidth,G.pixelRatio=Q.freehandPixelRatio,G.setColor=G.setColor.bind(G),G.addCanvas=G.addCanvas.bind(G),G.finishCreation=G.finishCreation.bind(G),G.setLineWidth=G.setLineWidth.bind(G),G.colorPanel=new f("Color",Q.defaultColorSet,Q.defaultColor),G.colorPanel.onColorChanged=G.setColor,G.lineWidthPanel=new T("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),G.lineWidthPanel.onWidthChanged=G.setLineWidth,G}return $(D,z),D.prototype.ownsTarget=function(I){return!(!z.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.drawingImage)},D.prototype.createVisual=function(){this.visual=P.createGroup(),this.drawingImage=P.createImage(),this.visual.appendChild(this.drawingImage);var I=P.createTransform();this.visual.transform.baseVal.appendItem(I),this.addMarkerVisualToContainer(this.visual)},D.prototype.pointerDown=function(I,V){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):z.prototype.pointerDown.call(this,I,V)},D.prototype.manipulate=function(I){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(I.x,I.y),this.canvasContext.stroke()):z.prototype.manipulate.call(this,I)},D.prototype.resize=function(I){z.prototype.resize.call(this,I),P.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),P.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},D.prototype.pointerUp=function(I){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):z.prototype.pointerUp.call(this,I)},D.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)},D.prototype.select=function(){this.state==="creating"&&this.finishCreation(),z.prototype.select.call(this)},D.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),z.prototype.deselect.call(this)},D.prototype.finishCreation=function(){for(var I=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),V=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],Q=V[0],G=V[1],ce=V[2],Ce=V[3],De=!1,ue=0;ue<this.canvasElement.height;ue++)for(var ge=0;ge<this.canvasElement.width;ge++)I.data[ue*this.canvasElement.width*4+4*ge+3]>0&&(De=!0,ue<G&&(G=ue),ge<Q&&(Q=ge),ue>Ce&&(Ce=ue),ge>ce&&(ce=ge));if(De){this.left=Q/this.pixelRatio,this.top=G/this.pixelRatio,this.width=(ce-Q)/this.pixelRatio,this.height=(Ce-G)/this.pixelRatio;var we=document.createElement("canvas");we.width=ce-Q,we.height=Ce-G,we.getContext("2d").putImageData(this.canvasContext.getImageData(Q,G,ce-Q,Ce-G),0,0),this.drawingImgUrl=we.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},D.prototype.setDrawingImage=function(){P.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),P.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},D.prototype.setColor=function(I){this.color=I,this.colorChanged(I)},D.prototype.setLineWidth=function(I){this.lineWidth=I},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var I=Object.assign({drawingImgUrl:this.drawingImgUrl},z.prototype.getState.call(this));return I.typeName=D.typeName,I},D.prototype.restoreState=function(I){this.createVisual(),z.prototype.restoreState.call(this,I),this.drawingImgUrl=I.drawingImgUrl,this.setDrawingImage()},D.prototype.scale=function(I,V){z.prototype.scale.call(this,I,V),this.setDrawingImage()},D.typeName="FreehandMarker",D.title="Freehand marker",D.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>',D}(C),g=function(z){function D(I,V,Q){var G=z.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 G.typeBoxes=[],G.currentType=V,G.setCurrentType=G.setCurrentType.bind(G),G}return $(D,z),D.prototype.getUi=function(){var I=this,V=document.createElement("div");V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2";for(var Q=function(Ce){var De="both";switch(Ce){case 0:De="both";break;case 1:De="start";break;case 2:De="end";break;case 3:De="none"}var ue=document.createElement("div");if(ue.style.display="flex",ue.style.flexGrow="2",ue.style.alignItems="center",ue.style.justifyContent="space-between",ue.style.padding="5px",ue.style.borderWidth="2px",ue.style.borderStyle="solid",ue.style.borderColor=De===G.currentType?G.uiStyleSettings.toolboxAccentColor:"transparent",ue.addEventListener("click",function(){I.setCurrentType(De,ue)}),V.appendChild(ue),De==="both"||De==="start"){var ge=document.createElement("div");ge.style.display="flex",ge.style.alignItems="center",ge.style.minHeight="20px",ge.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="`+(G.uiStyleSettings!==void 0?G.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,ge.style.marginLeft="5px",ue.appendChild(ge)}var we=document.createElement("div");we.style.display="flex",we.style.alignItems="center",we.style.minHeight="20px",we.style.flexGrow="2";var Ae=document.createElement("hr");if(Ae.style.minWidth="20px",Ae.style.border="0px",Ae.style.borderTop="3px solid "+(G.uiStyleSettings!==void 0?G.uiStyleSettings.toolboxColor:"#eeeeee"),Ae.style.flexGrow="2",we.appendChild(Ae),ue.appendChild(we),De==="both"||De==="end"){var Ne=document.createElement("div");Ne.style.display="flex",Ne.style.alignItems="center",Ne.style.minHeight="20px",Ne.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="`+(G.uiStyleSettings!==void 0?G.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Ne.style.marginRight="5px",ue.appendChild(Ne)}G.typeBoxes.push(ue)},G=this,ce=0;ce<4;ce++)Q(ce);return V},D.prototype.setCurrentType=function(I,V){var Q=this;this.currentType=I,this.typeBoxes.forEach(function(G){G.style.borderColor=G===V?Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},D}(h),F=function(z){function D(I,V,Q){var G=z.call(this,I,V,Q)||this;return G.arrowType="end",G.arrowBaseHeight=10,G.arrowBaseWidth=10,G.getArrowPoints=G.getArrowPoints.bind(G),G.setArrowType=G.setArrowType.bind(G),G.arrowTypePanel=new g("Arrow type","end"),G.arrowTypePanel.onArrowTypeChanged=G.setArrowType,G}return $(D,z),D.prototype.ownsTarget=function(I){return!(!z.prototype.ownsTarget.call(this,I)&&I!==this.arrow1&&I!==this.arrow2)},D.prototype.getArrowPoints=function(I,V){var Q=this.arrowBaseWidth+2*this.strokeWidth,G=this.arrowBaseHeight+2*this.strokeWidth;return I-Q/2+","+(V+G/2)+" "+I+","+(V-G/2)+" "+(I+Q/2)+","+(V+G/2)},D.prototype.createTips=function(){this.arrow1=P.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(P.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=P.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(P.createTransform()),this.visual.appendChild(this.arrow2)},D.prototype.pointerDown=function(I,V){z.prototype.pointerDown.call(this,I,V),this.state==="creating"&&this.createTips()},D.prototype.adjustVisual=function(){if(z.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",P.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),P.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),V=this.arrow1.transform.baseVal.getItem(0);V.setRotate(I,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(V,0);var Q=this.arrow2.transform.baseVal.getItem(0);Q.setRotate(I+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(Q,0)}},D.prototype.setArrowType=function(I){this.arrowType=I,this.adjustVisual(),this.stateChanged()},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var I=Object.assign({arrowType:this.arrowType},z.prototype.getState.call(this));return I.typeName=D.typeName,I},D.prototype.restoreState=function(I){z.prototype.restoreState.call(this,I);var V=I;this.arrowType=V.arrowType,this.createTips(),this.adjustVisual()},D.typeName="ArrowMarker",D.title="Arrow marker",D.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',D}(E),U=function(z){function D(I,V,Q){var G=z.call(this,I,V,Q)||this;return G.fillColor=Q.defaultFillColor,G.strokeWidth=0,G.fillPanel=new f("Color",Q.defaultColorSet,Q.defaultFillColor),G.fillPanel.onColorChanged=G.setFillColor,G}return $(D,z),Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var I=z.prototype.getState.call(this);return I.typeName=D.typeName,I},D.typeName="CoverMarker",D.title="Cover marker",D.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',D}(_),A=function(z){function D(I,V,Q,G){var ce=z.call(this,I,G||'<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 ce.opacities=[],ce.opacityBoxes=[],ce.opacities=V,ce.currentOpacity=Q,ce.setCurrentOpacity=ce.setCurrentOpacity.bind(ce),ce}return $(D,z),D.prototype.getUi=function(){var I=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",V.style.justifyContent="space-between",this.opacities.forEach(function(Q){var G=document.createElement("div");G.style.display="flex",G.style.alignItems="center",G.style.justifyContent="center",G.style.padding="5px",G.style.borderWidth="2px",G.style.borderStyle="solid",G.style.borderColor=Q===I.currentOpacity?I.uiStyleSettings.toolboxAccentColor:"transparent",G.addEventListener("click",function(){I.setCurrentOpacity(Q,G)}),V.appendChild(G);var ce=document.createElement("div");ce.innerText=100*Q+"%",G.appendChild(ce),I.opacityBoxes.push(G)}),V},D.prototype.setCurrentOpacity=function(I,V){var Q=this;this.currentOpacity=I,this.opacityBoxes.forEach(function(G){G.style.borderColor=G===V?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},D}(h),j=function(z){function D(I,V,Q){var G=z.call(this,I,V,Q)||this;return G.setOpacity=G.setOpacity.bind(G),G.fillColor=Q.defaultHighlightColor,G.strokeWidth=0,G.opacity=Q.defaultHighlightOpacity,G.fillPanel=new f("Color",Q.defaultColorSet,G.fillColor),G.fillPanel.onColorChanged=G.setFillColor,G.opacityPanel=new A("Opacity",Q.defaultOpacitySteps,G.opacity),G.opacityPanel.onOpacityChanged=G.setOpacity,G}return $(D,z),D.prototype.setOpacity=function(I){this.opacity=I,this.visual&&P.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var I=z.prototype.getState.call(this);return I.typeName=D.typeName,I},D.typeName="HighlightMarker",D.title="Highlight marker",D.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>',D}(U),N='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',b=function(z){function D(I,V,Q){var G=z.call(this,I,V,Q)||this;return G.bgColor="transparent",G.tipPosition={x:0,y:0},G.tipBase1Position={x:0,y:0},G.tipBase2Position={x:0,y:0},G.tipMoving=!1,G.color=Q.defaultStrokeColor,G.bgColor=Q.defaultFillColor,G.fontFamily=Q.defaultFontFamily,G.defaultSize={x:100,y:30},G.setBgColor=G.setBgColor.bind(G),G.getTipPoints=G.getTipPoints.bind(G),G.positionTip=G.positionTip.bind(G),G.setTipPoints=G.setTipPoints.bind(G),G.colorPanel=new f("Text color",Q.defaultColorSet,G.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>'),G.colorPanel.onColorChanged=G.setColor,G.bgColorPanel=new f("Fill color",Q.defaultColorSet,G.bgColor,N),G.bgColorPanel.onColorChanged=G.setBgColor,G.fontFamilyPanel=new c("Font",Q.defaultFontFamilies,Q.defaultFontFamily),G.fontFamilyPanel.onFontChanged=G.setFont,G.tipGrip=new s,G.tipGrip.visual.transform.baseVal.appendItem(P.createTransform()),G.controlBox.appendChild(G.tipGrip.visual),G}return $(D,z),D.prototype.ownsTarget=function(I){return z.prototype.ownsTarget.call(this,I)||this.tipGrip.ownsTarget(I)||this.tip===I},D.prototype.createTip=function(){P.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=P.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},D.prototype.pointerDown=function(I,V){this.state==="new"&&z.prototype.pointerDown.call(this,I,V),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(V)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):z.prototype.pointerDown.call(this,I,V)},D.prototype.pointerUp=function(I){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,z.prototype.pointerUp.call(this,I);else{var V=this.state==="creating";z.prototype.pointerUp.call(this,I),this.setTipPoints(V),this.positionTip()}},D.prototype.manipulate=function(I){if(this.tipMoving){var V=this.unrotatePoint(I);this.tipPosition={x:V.x-this.manipulationStartLeft,y:V.y-this.manipulationStartTop},this.positionTip()}else z.prototype.manipulate.call(this,I)},D.prototype.setBgColor=function(I){this.bgRectangle&&this.tip&&(P.setAttributes(this.bgRectangle,[["fill",I]]),P.setAttributes(this.tip,[["fill",I]])),this.bgColor=I,this.fillColorChanged(I)},D.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},D.prototype.setTipPoints=function(I){I===void 0&&(I=!1);var V=Math.min(this.height/2,15),Q=this.height/5;I&&(this.tipPosition={x:V+Q/2,y:this.height+20});var G=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?G<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(Q=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:V,y:0},this.tipBase2Position={x:V+Q,y:0}):(this.tipBase1Position={x:0,y:V},this.tipBase2Position={x:0,y:V+Q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?G<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(Q=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-V-Q,y:0},this.tipBase2Position={x:this.width-V,y:0}):(this.tipBase1Position={x:this.width,y:V},this.tipBase2Position={x:this.width,y:V+Q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?G<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(Q=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-V-Q,y:this.height},this.tipBase2Position={x:this.width-V,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-V-Q},this.tipBase2Position={x:this.width,y:this.height-V}):G<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(Q=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:V,y:this.height},this.tipBase2Position={x:V+Q,y:this.height}):(this.tipBase1Position={x:0,y:this.height-V},this.tipBase2Position={x:0,y:this.height-V-Q})},D.prototype.resize=function(I){z.prototype.resize.call(this,I),this.positionTip()},D.prototype.positionTip=function(){P.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(D.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),D.prototype.select=function(){this.positionTip(),z.prototype.select.call(this)},D.prototype.getState=function(){var I=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},z.prototype.getState.call(this));return I.typeName=D.typeName,I},D.prototype.restoreState=function(I){var V=I;this.bgColor=V.bgColor,this.tipPosition=V.tipPosition,z.prototype.restoreState.call(this,I),this.createTip(),this.setTipPoints()},D.prototype.scale=function(I,V){z.prototype.scale.call(this,I,V),this.tipPosition={x:this.tipPosition.x*I,y:this.tipPosition.y*V},this.positionTip()},D.typeName="CalloutMarker",D.title="Callout marker",D.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>',D}(x),Y=function(z){function D(I,V,Q){var G=z.call(this,I,V,Q)||this;return G.fillColor="transparent",G.strokeColor="transparent",G.strokeWidth=0,G.strokeDasharray="",G.opacity=1,G.strokeColor=Q.defaultColor,G.strokeWidth=Q.defaultStrokeWidth,G.strokeDasharray=Q.defaultStrokeDasharray,G.fillColor=Q.defaultFillColor,G.setStrokeColor=G.setStrokeColor.bind(G),G.setFillColor=G.setFillColor.bind(G),G.setStrokeWidth=G.setStrokeWidth.bind(G),G.setStrokeDasharray=G.setStrokeDasharray.bind(G),G.setOpacity=G.setOpacity.bind(G),G.createVisual=G.createVisual.bind(G),G.strokePanel=new f("Line color",B(Q.defaultColorSet,["transparent"]),Q.defaultColor),G.strokePanel.onColorChanged=G.setStrokeColor,G.fillPanel=new f("Fill color",B(Q.defaultColorSet,["transparent"]),G.fillColor,N),G.fillPanel.onColorChanged=G.setFillColor,G.strokeWidthPanel=new T("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),G.strokeWidthPanel.onWidthChanged=G.setStrokeWidth,G.strokeStylePanel=new R("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),G.strokeStylePanel.onStyleChanged=G.setStrokeDasharray,G.opacityPanel=new A("Opacity",Q.defaultOpacitySteps,G.opacity),G.opacityPanel.onOpacityChanged=G.setOpacity,G}return $(D,z),D.prototype.ownsTarget=function(I){return!(!z.prototype.ownsTarget.call(this,I)&&I!==this.visual)},D.prototype.createVisual=function(){this.visual=P.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)},D.prototype.pointerDown=function(I,V){z.prototype.pointerDown.call(this,I,V),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},D.prototype.manipulate=function(I){z.prototype.manipulate.call(this,I)},D.prototype.resize=function(I){z.prototype.resize.call(this,I),this.setSize()},D.prototype.setSize=function(){z.prototype.setSize.call(this),P.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},D.prototype.pointerUp=function(I){z.prototype.pointerUp.call(this,I),this.setSize()},D.prototype.setStrokeColor=function(I){this.strokeColor=I,this.visual&&P.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(I),this.stateChanged()},D.prototype.setFillColor=function(I){this.fillColor=I,this.visual&&P.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(I),this.stateChanged()},D.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.visual&&P.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},D.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.visual&&P.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},D.prototype.setOpacity=function(I){this.opacity=I,this.visual&&P.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var I=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},z.prototype.getState.call(this));return I.typeName=D.typeName,I},D.prototype.restoreState=function(I){var V=I;this.fillColor=V.fillColor,this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.opacity=V.opacity,this.createVisual(),z.prototype.restoreState.call(this,I),this.setSize()},D.prototype.scale=function(I,V){z.prototype.scale.call(this,I,V),this.setSize()},D.typeName="EllipseMarker",D.title="Ellipse marker",D.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>',D}(C),re=function(z){function D(I,V,Q){return z.call(this,I,V,Q)||this}return $(D,z),Object.defineProperty(D.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),D.prototype.ownsTarget=function(I){return!(!z.prototype.ownsTarget.call(this,I)&&I!==this.tip1&&I!==this.tip2)},D.prototype.createTips=function(){this.tip1=P.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(P.createTransform()),this.visual.appendChild(this.tip1),this.tip2=P.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(P.createTransform()),this.visual.appendChild(this.tip2)},D.prototype.pointerDown=function(I,V){z.prototype.pointerDown.call(this,I,V),this.state==="creating"&&this.createTips()},D.prototype.adjustVisual=function(){if(z.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(P.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()]]),P.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),V=this.tip1.transform.baseVal.getItem(0);V.setRotate(I,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(V,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(D.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var I=z.prototype.getState.call(this);return I.typeName=D.typeName,I},D.prototype.restoreState=function(I){z.prototype.restoreState.call(this,I),this.createTips(),this.adjustVisual()},D.typeName="MeasurementMarker",D.title="Measurement marker",D.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>',D}(E),fe=function(z){function D(I,V,Q){var G=z.call(this,I,V,Q)||this;return G.strokePanel.colors=Q.defaultColorSet,G.fillColor="transparent",G}return $(D,z),Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var I=z.prototype.getState.call(this);return I.typeName=D.typeName,I},D.typeName="EllipseFrameMarker",D.title="Ellipse frame marker",D.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>',D}(Y),ve=function(){function z(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(z.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),z.prototype.addUndoStep=function(D){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(D)||(this.undoStack.push(D),JSON.stringify(this.lastRedoStep)!==JSON.stringify(D)&&this.redoStack.splice(0,this.redoStack.length))},z.prototype.replaceLastUndoStep=function(D){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=D)},z.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},z.prototype.undo=function(){if(this.undoStack.length>1){var D=this.undoStack.pop();return D!==void 0&&this.redoStack.push(D),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},z.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},z}(),ke=function(z){function D(I,V,Q){var G=z.call(this,I,V,Q)||this;return G.strokeColor="transparent",G.strokeWidth=0,G.strokeDasharray="",G.curveX=0,G.curveY=0,G.manipulationStartCurveX=0,G.manipulationStartCurveY=0,G.setStrokeColor=G.setStrokeColor.bind(G),G.setStrokeWidth=G.setStrokeWidth.bind(G),G.setStrokeDasharray=G.setStrokeDasharray.bind(G),G.positionGrips=G.positionGrips.bind(G),G.addControlGrips=G.addControlGrips.bind(G),G.adjustVisual=G.adjustVisual.bind(G),G.setupControlBox=G.setupControlBox.bind(G),G.resize=G.resize.bind(G),G.strokeColor=Q.defaultColor,G.strokeWidth=Q.defaultStrokeWidth,G.strokeDasharray=Q.defaultStrokeDasharray,G.strokePanel=new f("Line color",Q.defaultColorSet,Q.defaultColor),G.strokePanel.onColorChanged=G.setStrokeColor,G.strokeWidthPanel=new T("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),G.strokeWidthPanel.onWidthChanged=G.setStrokeWidth,G.strokeStylePanel=new R("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),G.strokeStylePanel.onStyleChanged=G.setStrokeDasharray,G}return $(D,z),D.prototype.ownsTarget=function(I){return!(!z.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.selectorCurve&&I!==this.visibleCurve&&!this.curveGrip.ownsTarget(I))},D.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},D.prototype.createVisual=function(){this.visual=P.createGroup(),this.selectorCurve=P.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=P.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)},D.prototype.pointerDown=function(I,V){z.prototype.pointerDown.call(this,I,V),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(V)&&(this.activeGrip=this.curveGrip,this._state="resize")},D.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),P.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),P.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),P.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},D.prototype.setupControlBox=function(){z.prototype.setupControlBox.call(this),this.curveControlLine1=P.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=P.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)},D.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,z.prototype.addControlGrips.call(this)},D.prototype.positionGrips=function(){z.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()))},D.prototype.manipulate=function(I){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+I.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+I.y-this.manipulationStartY),z.prototype.manipulate.call(this,I)},D.prototype.resize=function(I){this.activeGrip===this.curveGrip&&(this.curveX=I.x,this.curveY=I.y),z.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)},D.prototype.setStrokeColor=function(I){this.strokeColor=I,this.adjustVisual(),this.colorChanged(I)},D.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.adjustVisual()},D.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.adjustVisual()},D.prototype.scale=function(I,V){this.curveX=this.curveX*I,this.curveY=this.curveY*V,z.prototype.scale.call(this,I,V)},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var I=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},z.prototype.getState.call(this));return I.typeName=D.typeName,I},D.prototype.restoreState=function(I){z.prototype.restoreState.call(this,I);var V=I;this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.curveX=V.curveX,this.curveY=V.curveY,this.createVisual(),this.adjustVisual()},D.typeName="CurveMarker",D.title="Curve marker",D.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>',D}(w),Se=function(){function z(D,I){I===void 0&&(I=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=D,this.cancelable=I}return Object.defineProperty(z.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),z.prototype.preventDefault=function(){this._defaultPrevented=!0},z}(),Le=function(z){function D(I,V,Q){var G=z.call(this,I,!1)||this;return G.dataUrl=V,G.state=Q,G}return $(D,z),D}(Se),ye=function(z){function D(I,V,Q){Q===void 0&&(Q=!1);var G=z.call(this,I,Q)||this;return G.marker=V,G}return $(D,z),D}(Se),_e=function(){function z(){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 z.prototype.addEventListener=function(D,I){this[D].push(I)},z.prototype.removeEventListener=function(D,I){var V=this[D].indexOf(I);V>-1&&this[D].splice(V,1)},z}(),de=function(){function z(D){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new S,this._isOpen=!1,this.undoRedoManager=new ve,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 _e,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=z.instanceCounter++,this.styles=new L(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=D,this.targetRoot=document.body,this.width=D.clientWidth,this.height=D.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(z.prototype,"ALL_MARKER_TYPES",{get:function(){return[O,y,F,x,fe,Y,j,b,re,U,E,ke]},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[O,y,F,x,Y,j,b]},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"BASIC_MARKER_TYPES",{get:function(){return[O,y,F,x,j]},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(D){var I=this;this._availableMarkerTypes.splice(0),D.forEach(function(V){if(typeof V=="string"){var Q=I.ALL_MARKER_TYPES.find(function(G){return G.typeName===V});Q!==void 0&&I._availableMarkerTypes.push(Q)}else I._availableMarkerTypes.push(V)})},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(D){this._zoomLevel=D,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(z.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),z.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),W.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},z.prototype.show=function(){var D=this;this.styles.styleSheetRoot===void 0&&i.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=i.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(I){return I(new Se(D))})},z.prototype.render=function(){return M(this,void 0,void 0,function(){var D;return X(this,function(I){switch(I.label){case 0:return this.setCurrentMarker(),(D=new H).naturalSize=this.renderAtNaturalSize,D.imageType=this.renderImageType,D.imageQuality=this.renderImageQuality,D.markersOnly=this.renderMarkersOnly,D.width=this.renderWidth,D.height=this.renderHeight,[4,D.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return I.sent(),[4,D.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,I.sent()]}})})},z.prototype.close=function(D){var I=this;if(D===void 0&&(D=!1),this.isOpen){var V=!1;D||this.eventListeners.beforeclose.forEach(function(Q){var G=new Se(I,!0);Q(G),G.defaultPrevented&&(V=!0)}),V||(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 Se(I))}),this.detachEvents(),this._isOpen=!1)}},z.prototype.addMarkersToToolbar=function(){for(var D,I=[],V=0;V<arguments.length;V++)I[V]=arguments[V];(D=this._availableMarkerTypes).push.apply(D,I)},z.prototype.addRenderEventListener=function(D){this.addEventListener("render",function(I){D(I.dataUrl,I.state)})},z.prototype.removeRenderEventListener=function(D){},z.prototype.addCloseEventListener=function(D){this.addEventListener("close",function(){D()})},z.prototype.removeCloseEventListener=function(D){},z.prototype.setupResizeObserver=function(){var D=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){D.resize(D.target.clientWidth,D.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return D.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},z.prototype.onPopupTargetResize=function(){var D=1*this.target.clientWidth/this.target.clientHeight,I=this.editorCanvas.clientWidth/D>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*D:this.editorCanvas.clientWidth,V=I<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/D;this.resize(I,V)},z.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},z.prototype.resize=function(D,I){this._isResizing=!0;var V=D/this.imageWidth,Q=I/this.imageHeight;this.imageWidth=Math.round(D),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(V,Q),this._isResizing=!1},z.prototype.scaleMarkers=function(D,I){var V,Q=this;this._currentMarker&&this._currentMarker instanceof x?this._currentMarker.scale(D,I):(V=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(G){G!==Q._currentMarker&&G.scale(D,I)}),V!==void 0&&this.setCurrentMarker(V)},z.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"},z.prototype.setTopLeft=function(){var D=this.editingTarget.getBoundingClientRect(),I=this.editorCanvas.getBoundingClientRect();this.left=D.left-I.left,this.top=D.top-I.top},z.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)},z.prototype.addDefs=function(){for(var D,I=[],V=0;V<arguments.length;V++)I[V]=arguments[V];this.defs=P.createDefs(),this.addDefsToImage(),(D=this.defs).append.apply(D,I)},z.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},z.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)},z.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},z.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},z.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)},z.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},z.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)},z.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 D=document.createElement("a");D.href="https://markerjs.com/",D.target="_blank",D.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>',D.title="Powered by marker.js",D.style.display="grid",D.style.alignItems="center",D.style.justifyItems="center",D.style.padding="3px",D.style.width="20px",D.style.height="20px",this.logoUI.appendChild(D),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},z.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")},z.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"},z.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},z.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 D=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=D+"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 p(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 l(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},z.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},z.prototype.removeMarker=function(D){this.markerImage.removeChild(D.container),this.markers.indexOf(D)>-1&&this.markers.splice(this.markers.indexOf(D),1),D.dispose()},z.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())},z.prototype.toolbarButtonClicked=function(D,I){if(D==="marker"&&I!==void 0)this.createNewMarker(I);else if(D==="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()}},z.prototype.deleteSelectedMarker=function(){var D=this;if(this._currentMarker!==void 0){var I=!1;if(this.eventListeners.markerbeforedelete.forEach(function(Q){var G=new ye(D,D._currentMarker,!0);Q(G),G.defaultPrevented&&(I=!0)}),!I){var V=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 ye(D,V))})}}},z.prototype.clear=function(){var D=this,I=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ce){var Ce=new ye(D,void 0,!0);ce(Ce),Ce.defaultPrevented&&(I=!0)}),!I)){this.setCurrentMarker();for(var V=function(ce){var Ce=Q.markers[ce];Q.setCurrentMarker(Q.markers[ce]),Q._currentMarker.dispose(),Q.markerImage.removeChild(Q._currentMarker.container),Q.markers.splice(Q.markers.indexOf(Q._currentMarker),1),Q.eventListeners.markerdelete.forEach(function(De){return De(new ye(D,Ce))})},Q=this,G=this.markers.length-1;G>=0;G--)V(G);this.addUndoStep()}},Object.defineProperty(z.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),z.prototype.showNotesEditor=function(){var D;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=(D=this._currentMarker.notes)!==null&&D!==void 0?D:"",this.overlayContainer.appendChild(this.notesArea))},z.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)},z.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},z.prototype.addUndoStep=function(){var D=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var I=this.getState(),V=this.undoRedoManager.getLastUndoStep();if(!V||V.width===I.width&&V.height===I.height){var Q=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(I),Q<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(G){return G(new Se(D))})}else this.undoRedoManager.replaceLastUndoStep(I),this.eventListeners.statechange.forEach(function(G){return G(new Se(D))})}},z.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},z.prototype.undoStep=function(){var D=this,I=this.undoRedoManager.undo();I!==void 0&&(this.restoreState(I),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(V){return V(new Se(D))}))},z.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},z.prototype.redoStep=function(){var D=this,I=this.undoRedoManager.redo();I!==void 0&&(this.restoreState(I),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(V){return V(new Se(D))}))},z.prototype.stepZoom=function(){var D=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=D<this.zoomSteps.length-1?this.zoomSteps[D+1]:this.zoomSteps[0]},z.prototype.panTo=function(D){this.contentDiv.scrollBy({left:this.prevPanPoint.x-D.x,top:this.prevPanPoint.y-D.y}),this.prevPanPoint=D},z.prototype.startRenderAndClose=function(){return M(this,void 0,void 0,function(){var D,I,V=this;return X(this,function(Q){switch(Q.label){case 0:return[4,this.render()];case 1:return D=Q.sent(),I=this.getState(),this.eventListeners.render.forEach(function(G){return G(new Le(V,D,I))}),this.close(!0),[2]}})})},z.prototype.getState=function(D){D===!0&&this.setCurrentMarker();var I={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(V){return I.markers.push(V.getState())}),I},z.prototype.restoreState=function(D){var I=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);D.markers.forEach(function(V){var Q=I._availableMarkerTypes.find(function(ce){return ce.typeName===V.typeName});if(Q!==void 0){var G=I.addNewMarker(Q);G.restoreState(V),I.markers.push(G)}}),D.width&&D.height&&(D.width!==this.imageWidth||D.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/D.width,this.imageHeight/D.height),this.eventListeners.restorestate.forEach(function(V){return V(new Se(I))})},z.prototype.addNewMarker=function(D){var I=P.createGroup();return this.markerImage.appendChild(I),new D(I,this.overlayContainer,this.settings)},z.prototype.createNewMarker=function(D){var I,V=this;(I=typeof D=="string"?this._availableMarkerTypes.find(function(Q){return Q.typeName===D}):D)&&(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 ye(V,V._currentMarker))}))},z.prototype.markerCreated=function(D){var I=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(D),this.setCurrentMarker(D),D instanceof y&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(y):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(V){return V(new ye(I,I._currentMarker))})},z.prototype.colorChanged=function(D){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=D,this.settings.defaultStrokeColor=D)},z.prototype.fillColorChanged=function(D){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=D)},z.prototype.markerStateChanged=function(D){var I=this;this.eventListeners.markerchange.forEach(function(V){return V(new ye(I,D))})},z.prototype.setCurrentMarker=function(D){var I=this;this._currentMarker!==D&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(V){return V(new ye(I,I._currentMarker))})),this._currentMarker=D,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(V){return V(new ye(I,I._currentMarker))}))},z.prototype.onPointerDown=function(D){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||D.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(V){return V.ownsTarget(D.target)});I!==void 0?(this.setCurrentMarker(I),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(D.clientX,D.clientY),D.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:D.clientX,y:D.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(D.clientX,D.clientY))},z.prototype.onDblClick=function(D){if(this._isFocused||this.focus(),this.mode==="select"){var I=this.markers.find(function(V){return V.ownsTarget(D.target)});I!==void 0&&I!==this._currentMarker&&this.setCurrentMarker(I),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(D.clientX,D.clientY),D.target):this.setCurrentMarker()}},z.prototype.onPointerMove=function(D){this.touchPoints!==1&&D.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||D.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(D.clientX,D.clientY)):this.zoomLevel>1&&this.panTo({x:D.clientX,y:D.clientY}))},z.prototype.onPointerUp=function(D){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(D.clientX,D.clientY)),this.isDragging=!1,this.addUndoStep()},z.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},z.prototype.onKeyUp=function(D){this._currentMarker===void 0||this.notesArea!==void 0||D.key!=="Delete"&&D.key!=="Backspace"||this.deleteSelectedMarker()},z.prototype.clientToLocalCoordinates=function(D,I){var V=this.markerImage.getBoundingClientRect();return{x:(D-V.left)/this.zoomLevel,y:(I-V.top)/this.zoomLevel}},z.prototype.onWindowResize=function(){this.positionUI()},z.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var D=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=D+"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()},z.prototype.addLicenseKey=function(D){W.addKey(D)},z.prototype.addEventListener=function(D,I){this.eventListeners.addEventListener(D,I)},z.prototype.removeEventListener=function(D,I){this.eventListeners.removeEventListener(D,I)},z.prototype.renderState=function(D){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(D),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(z.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),z.prototype.focus=function(){var D=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 Se(D))}))},z.prototype.blur=function(){var D=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(I){return I(new Se(D))}))},z.instanceCounter=0,z}()},T8No:function(Ze,Te,Z){"use strict";Z.d(Te,"a",function(){return W}),Z.d(Te,"e",function(){return H}),Z.d(Te,"c",function(){return E}),Z.d(Te,"b",function(){return c}),Z.d(Te,"d",function(){return x}),Z.d(Te,"f",function(){return F});var oe=Z("MNsG"),$=Z("N0LK"),M=Z("Cg/j");let X=oe.k||"";const B=new Map;B.set("false",!1),B.set("true",!0),B.set("isMac",oe.f),B.set("isLinux",oe.d),B.set("isWindows",oe.i),B.set("isWeb",oe.h),B.set("isMacNative",oe.f&&!oe.h),B.set("isEdge",X.indexOf("Edg/")>=0),B.set("isFirefox",X.indexOf("Firefox")>=0),B.set("isChrome",X.indexOf("Chrome")>=0),B.set("isSafari",X.indexOf("Safari")>=0);const P=Object.prototype.hasOwnProperty;class W{static has(A){return m.create(A)}static equals(A,j){return p.create(A,j)}static regex(A,j){return T.create(A,j)}static not(A){return o.create(A)}static and(...A){return S.create(A,null)}static or(...A){return w.create(A,null,!0)}static deserialize(A,j=!1){return A?this._deserializeOrExpression(A,j):void 0}static _deserializeOrExpression(A,j){let N=A.split("||");return w.create(N.map(b=>this._deserializeAndExpression(b,j)),null,!0)}static _deserializeAndExpression(A,j){let N=A.split("&&");return S.create(N.map(b=>this._deserializeOne(b,j)),null)}static _deserializeOne(A,j){if(A=A.trim(),A.indexOf("!=")>=0){let N=A.split("!=");return f.create(N[0].trim(),this._deserializeValue(N[1],j))}if(A.indexOf("==")>=0){let N=A.split("==");return p.create(N[0].trim(),this._deserializeValue(N[1],j))}if(A.indexOf("=~")>=0){let N=A.split("=~");return T.create(N[0].trim(),this._deserializeRegexValue(N[1],j))}if(A.indexOf(" in ")>=0){let N=A.split(" in ");return l.create(N[0].trim(),N[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(A)){const N=A.split(">=");return a.create(N[0].trim(),N[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(A)){const N=A.split(">");return s.create(N[0].trim(),N[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(A)){const N=A.split("<=");return _.create(N[0].trim(),N[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(A)){const N=A.split("<");return C.create(N[0].trim(),N[1].trim())}return/^\!\s*/.test(A)?o.create(A.substr(1).trim()):m.create(A)}static _deserializeValue(A,j){if(A=A.trim(),A==="true")return!0;if(A==="false")return!1;let N=/^'([^']*)'$/.exec(A);return N?N[1].trim():A}static _deserializeRegexValue(A,j){if(Object($.C)(A)){if(j)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let N=A.indexOf("/"),b=A.lastIndexOf("/");if(N===b||N<0){if(j)throw new Error(`bad regexp-value '${A}', missing /-enclosure`);return console.warn(`bad regexp-value '${A}', missing /-enclosure`),null}let Y=A.slice(N+1,b),re=A[b+1]==="i"?"i":"";try{return new RegExp(Y,re)}catch(fe){if(j)throw new Error(`bad regexp-value '${A}', parse error: ${fe}`);return console.warn(`bad regexp-value '${A}', parse error: ${fe}`),null}}}function H(A,j){const N=A?A.substituteConstants():void 0,b=j?j.substituteConstants():void 0;return!N&&!b?!0:!N||!b?!1:N.equals(b)}function i(A,j){return A.cmp(j)}class L{constructor(){this.type=0}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!1}serialize(){return"false"}keys(){return[]}negate(){return v.INSTANCE}}L.INSTANCE=new L;class v{constructor(){this.type=1}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!0}serialize(){return"true"}keys(){return[]}negate(){return L.INSTANCE}}v.INSTANCE=new v;class m{constructor(A,j){this.key=A,this.negated=j,this.type=2}static create(A,j=null){const N=B.get(A);return typeof N=="boolean"?N?v.INSTANCE:L.INSTANCE:new m(A,j)}cmp(A){return A.type!==this.type?this.type-A.type:y(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=B.get(this.key);return typeof A=="boolean"?A?v.INSTANCE:L.INSTANCE:this}evaluate(A){return!!A.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this)),this.negated}}class p{constructor(A,j,N){this.key=A,this.value=j,this.negated=N,this.type=4}static create(A,j,N=null){if(typeof j=="boolean")return j?m.create(A,N):o.create(A,N);const b=B.get(A);if(typeof b=="boolean"){const Y=b?"true":"false";return j===Y?v.INSTANCE:L.INSTANCE}return new p(A,j,N)}cmp(A){return A.type!==this.type?this.type-A.type:g(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=B.get(this.key);if(typeof A=="boolean"){const j=A?"true":"false";return this.value===j?v.INSTANCE:L.INSTANCE}return this}evaluate(A){return A.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this.value,this)),this.negated}}class l{constructor(A,j){this.key=A,this.valueKey=j,this.type=10,this.negated=null}static create(A,j){return new l(A,j)}cmp(A){return A.type!==this.type?this.type-A.type:g(this.key,this.valueKey,A.key,A.valueKey)}equals(A){return A.type===this.type?this.key===A.key&&this.valueKey===A.valueKey:!1}substituteConstants(){return this}evaluate(A){const j=A.getValue(this.valueKey),N=A.getValue(this.key);return Array.isArray(j)?j.indexOf(N)>=0:typeof N=="string"&&typeof j=="object"&&j!==null?P.call(j,N):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=h.create(this)),this.negated}}class h{constructor(A){this._actual=A,this.type=11}static create(A){return new h(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class f{constructor(A,j,N){this.key=A,this.value=j,this.negated=N,this.type=5}static create(A,j,N=null){if(typeof j=="boolean")return j?o.create(A,N):m.create(A,N);const b=B.get(A);if(typeof b=="boolean"){const Y=b?"true":"false";return j===Y?L.INSTANCE:v.INSTANCE}return new f(A,j,N)}cmp(A){return A.type!==this.type?this.type-A.type:g(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=B.get(this.key);if(typeof A=="boolean"){const j=A?"true":"false";return this.value===j?L.INSTANCE:v.INSTANCE}return this}evaluate(A){return A.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this.value,this)),this.negated}}class o{constructor(A,j){this.key=A,this.negated=j,this.type=3}static create(A,j=null){const N=B.get(A);return typeof N=="boolean"?N?L.INSTANCE:v.INSTANCE:new o(A,j)}cmp(A){return A.type!==this.type?this.type-A.type:y(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=B.get(this.key);return typeof A=="boolean"?A?L.INSTANCE:v.INSTANCE:this}evaluate(A){return!A.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this)),this.negated}}function u(A,j){if(typeof A=="string"){const N=parseFloat(A);isNaN(N)||(A=N)}return typeof A=="string"||typeof A=="number"?j(A):L.INSTANCE}class s{constructor(A,j,N){this.key=A,this.value=j,this.negated=N,this.type=12}static create(A,j,N=null){return u(j,b=>new s(A,b,N))}cmp(A){return A.type!==this.type?this.type-A.type:g(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=_.create(this.key,this.value,this)),this.negated}}class a{constructor(A,j,N){this.key=A,this.value=j,this.negated=N,this.type=13}static create(A,j,N=null){return u(j,b=>new a(A,b,N))}cmp(A){return A.type!==this.type?this.type-A.type:g(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=C.create(this.key,this.value,this)),this.negated}}class C{constructor(A,j,N){this.key=A,this.value=j,this.negated=N,this.type=14}static create(A,j,N=null){return u(j,b=>new C(A,b,N))}cmp(A){return A.type!==this.type?this.type-A.type:g(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=a.create(this.key,this.value,this)),this.negated}}class _{constructor(A,j,N){this.key=A,this.value=j,this.negated=N,this.type=15}static create(A,j,N=null){return u(j,b=>new _(A,b,N))}cmp(A){return A.type!==this.type?this.type-A.type:g(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this.value,this)),this.negated}}class T{constructor(A,j){this.key=A,this.regexp=j,this.type=7,this.negated=null}static create(A,j){return new T(A,j)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.key<A.key)return-1;if(this.key>A.key)return 1;const j=this.regexp?this.regexp.source:"",N=A.regexp?A.regexp.source:"";return j<N?-1:j>N?1:0}equals(A){if(A.type===this.type){const j=this.regexp?this.regexp.source:"",N=A.regexp?A.regexp.source:"";return this.key===A.key&&j===N}return!1}substituteConstants(){return this}evaluate(A){let j=A.getValue(this.key);return this.regexp?this.regexp.test(j):!1}serialize(){const A=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${A}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=R.create(this)),this.negated}}class R{constructor(A){this._actual=A,this.type=8}static create(A){return new R(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function O(A){let j=null;for(let N=0,b=A.length;N<b;N++){const Y=A[N].substituteConstants();if(A[N]!==Y&&j===null){j=[];for(let re=0;re<N;re++)j[re]=A[re]}j!==null&&(j[N]=Y)}return j===null?A:j}class S{constructor(A,j){this.expr=A,this.negated=j,this.type=6}static create(A,j){return S._normalizeArr(A,j)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.expr.length<A.expr.length)return-1;if(this.expr.length>A.expr.length)return 1;for(let j=0,N=this.expr.length;j<N;j++){const b=i(this.expr[j],A.expr[j]);if(b!==0)return b}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let j=0,N=this.expr.length;j<N;j++)if(!this.expr[j].equals(A.expr[j]))return!1;return!0}return!1}substituteConstants(){const A=O(this.expr);return A===this.expr?this:S.create(A,this.negated)}evaluate(A){for(let j=0,N=this.expr.length;j<N;j++)if(!this.expr[j].evaluate(A))return!1;return!0}static _normalizeArr(A,j){const N=[];let b=!1;for(const Y of A){if(!Y)continue;if(Y.type===1){b=!0;continue}if(Y.type===0)return L.INSTANCE;if(Y.type===6){N.push(...Y.expr);continue}N.push(Y)}if(N.length===0&&b)return v.INSTANCE;if(N.length===0)return;if(N.length===1)return N[0];N.sort(i);for(let Y=1;Y<N.length;Y++)N[Y-1].equals(N[Y])&&(N.splice(Y,1),Y--);if(N.length===1)return N[0];for(;N.length>1;){const Y=N[N.length-1];if(Y.type!==9)break;N.pop();const re=N.pop(),fe=N.length===0,ve=w.create(Y.expr.map(ke=>S.create([ke,re],null)),null,fe);ve&&(N.push(ve),N.sort(i))}return N.length===1?N[0]:new S(N,j)}serialize(){return this.expr.map(A=>A.serialize()).join(" && ")}keys(){const A=[];for(let j of this.expr)A.push(...j.keys());return A}negate(){if(!this.negated){const A=[];for(let j of this.expr)A.push(j.negate());this.negated=w.create(A,this,!0)}return this.negated}}class w{constructor(A,j){this.expr=A,this.negated=j,this.type=9}static create(A,j,N){return w._normalizeArr(A,j,N)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.expr.length<A.expr.length)return-1;if(this.expr.length>A.expr.length)return 1;for(let j=0,N=this.expr.length;j<N;j++){const b=i(this.expr[j],A.expr[j]);if(b!==0)return b}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let j=0,N=this.expr.length;j<N;j++)if(!this.expr[j].equals(A.expr[j]))return!1;return!0}return!1}substituteConstants(){const A=O(this.expr);return A===this.expr?this:w.create(A,this.negated,!1)}evaluate(A){for(let j=0,N=this.expr.length;j<N;j++)if(this.expr[j].evaluate(A))return!0;return!1}static _normalizeArr(A,j,N){let b=[],Y=!1;if(A){for(let re=0,fe=A.length;re<fe;re++){const ve=A[re];if(!ve)continue;if(ve.type===0){Y=!0;continue}if(ve.type===1)return v.INSTANCE;if(ve.type===9){b=b.concat(ve.expr);continue}b.push(ve)}if(b.length===0&&Y)return L.INSTANCE;b.sort(i)}if(b.length===0)return;if(b.length===1)return b[0];for(let re=1;re<b.length;re++)b[re-1].equals(b[re])&&(b.splice(re,1),re--);if(b.length===1)return b[0];if(N){for(let re=0;re<b.length;re++)for(let fe=re+1;fe<b.length;fe++)F(b[re],b[fe])&&(b.splice(fe,1),fe--);if(b.length===1)return b[0]}return new w(b,j)}serialize(){return this.expr.map(A=>A.serialize()).join(" || ")}keys(){const A=[];for(let j of this.expr)A.push(...j.keys());return A}negate(){if(!this.negated){let A=[];for(let j of this.expr)A.push(j.negate());for(;A.length>1;){const j=A.shift(),N=A.shift(),b=[];for(const re of U(j))for(const fe of U(N))b.push(S.create([re,fe],null));const Y=A.length===0;A.unshift(w.create(b,null,Y))}this.negated=A[0]}return this.negated}}class E extends m{constructor(A,j,N){super(A,null);this._defaultValue=j,typeof N=="object"?E._info.push(Object.assign(Object.assign({},N),{key:A})):N!==!0&&E._info.push({key:A,description:N,type:j!=null?typeof j:void 0})}static all(){return E._info.values()}bindTo(A){return A.createKey(this.key,this._defaultValue)}getValue(A){return A.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(A){return p.create(this.key,A)}}E._info=[];const c=Object(M.c)("contextKeyService"),x="setContext";function y(A,j){return A<j?-1:A>j?1:0}function g(A,j,N,b){return A<N?-1:A>N?1:j<b?-1:j>b?1:0}function F(A,j){if(j.type===6&&A.type!==9&&A.type!==6){for(const Y of j.expr)if(A.equals(Y))return!0}const N=A.negate(),b=U(N).concat(U(j));b.sort(i);for(let Y=0;Y<b.length;Y++){const re=b[Y],fe=re.negate();for(let ve=Y+1;ve<b.length;ve++){const ke=b[ve];if(fe.equals(ke))return!0}}return!1}function U(A){return A.type===9?A.expr:[A]}},TXwP:function(Ze,Te,Z){var oe,$;(function(){var M;(function(){"use strict";var B=[,,function(i){function L(p){this.__parent=p,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}L.prototype.clone_empty=function(){var p=new L(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},L.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},L.prototype.has_match=function(p){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(p))return!0;return!1},L.prototype.set_indent=function(p,l){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},L.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},L.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},L.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},L.prototype.is_empty=function(){return this.__items.length===0},L.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},L.prototype.push=function(p){this.__items.push(p);var l=p.lastIndexOf(`
|
|
`);l!==-1?this.__character_count=p.length-l:this.__character_count+=p.length},L.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},L.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},L.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},L.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},L.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function v(p,l){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),l=l||"",p.indent_level>0&&(l=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}v.prototype.get_indent_size=function(p,l){var h=this.__base_string_length;return l=l||0,p<0&&(h=0),h+=p*this.__indent_size,h+=l,h},v.prototype.get_indent_string=function(p,l){var h=this.__base_string;return l=l||0,p<0&&(p=0,h=""),l+=p*this.__indent_size,this.__ensure_cache(l),h+=this.__cache[l],h},v.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var p=this.__cache.length,l=0,h="";this.__indent_size&&p>=this.__indent_size&&(l=Math.floor(p/this.__indent_size),p-=l*this.__indent_size,h=new Array(l+1).join(this.__indent_string)),p&&(h+=new Array(p+1).join(" ")),this.__cache.push(h)};function m(p,l){this.__indent_cache=new v(p,l),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new L(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(p,l){return this.__indent_cache.get_indent_string(p,l)},m.prototype.get_indent_size=function(p,l){return this.__indent_cache.get_indent_size(p,l)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(p){this.trim(!0);var l=this.current_line.pop();l&&(l[l.length-1]===`
|
|
`&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var h=this.__lines.join(`
|
|
`);return p!==`
|
|
`&&(h=h.replace(/[\n]/g,p)),h},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,l){return p=p||0,l=l||0,this.next_line.set_indent(p,l),this.__lines.length>1?(this.current_line.set_indent(p,l),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var l=0;l<p.newlines;l++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},m.prototype.remove_indent=function(p){for(var l=this.__lines.length;p<l;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(p,l){for(var h=this.__lines.length-2;h>=0;){var f=this.__lines[h];if(f.is_empty())break;if(f.item(0).indexOf(p)!==0&&f.item(-1)!==l){this.__lines.splice(h+1,0,new L(this)),this.previous_line=this.__lines[this.__lines.length-2];break}h--}},i.exports.Output=m},,,,function(i){function L(p,l){this.raw_options=v(p,l),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}L.prototype._get_array=function(p,l){var h=this.raw_options[p],f=l||[];return typeof h=="object"?h!==null&&typeof h.concat=="function"&&(f=h.concat()):typeof h=="string"&&(f=h.split(/[^a-zA-Z0-9_\/\-]+/)),f},L.prototype._get_boolean=function(p,l){var h=this.raw_options[p],f=h===void 0?!!l:!!h;return f},L.prototype._get_characters=function(p,l){var h=this.raw_options[p],f=l||"";return typeof h=="string"&&(f=h.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),f},L.prototype._get_number=function(p,l){var h=this.raw_options[p];l=parseInt(l,10),isNaN(l)&&(l=0);var f=parseInt(h,10);return isNaN(f)&&(f=l),f},L.prototype._get_selection=function(p,l,h){var f=this._get_selection_list(p,l,h);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
|
|
`+l+`
|
|
You passed in: '`+this.raw_options[p]+"'");return f[0]},L.prototype._get_selection_list=function(p,l,h){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(h=h||[l[0]],!this._is_valid_selection(h,l))throw new Error("Invalid Default Value!");var f=this._get_array(p,h);if(!this._is_valid_selection(f,l))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
|
|
`+l+`
|
|
You passed in: '`+this.raw_options[p]+"'");return f},L.prototype._is_valid_selection=function(p,l){return p.length&&l.length&&!p.some(function(h){return l.indexOf(h)===-1})};function v(p,l){var h={};p=m(p);var f;for(f in p)f!==l&&(h[f]=p[f]);if(l&&p[l])for(f in p[l])h[f]=p[l][f];return h}function m(p){var l={},h;for(h in p){var f=h.replace(/-/g,"_");l[f]=p[h]}return l}i.exports.Options=L,i.exports.normalizeOpts=m,i.exports.mergeOpts=v},,function(i){var L=RegExp.prototype.hasOwnProperty("sticky");function v(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position<this.__input_length},v.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},v.prototype.peek=function(m){var p=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(p=this.__input.charAt(m)),p},v.prototype.__match=function(m,p){m.lastIndex=p;var l=m.exec(this.__input);return l&&!(L&&m.sticky)&&(l.index!==p&&(l=null)),l},v.prototype.test=function(m,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(m,p):!1},v.prototype.testChar=function(m,p){var l=this.peek(p);return m.lastIndex=0,l!==null&&m.test(l)},v.prototype.match=function(m){var p=this.__match(m,this.__position);return p?this.__position+=p[0].length:p=null,p},v.prototype.read=function(m,p,l){var h="",f;return m&&(f=this.match(m),f&&(h+=f[0])),p&&(f||!m)&&(h+=this.readUntil(p,l)),h},v.prototype.readUntil=function(m,p){var l="",h=this.__position;m.lastIndex=this.__position;var f=m.exec(this.__input);return f?(h=f.index,p&&(h+=f[0].length)):h=this.__input_length,l=this.__input.substring(this.__position,h),this.__position=h,l},v.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},v.prototype.get_regexp=function(m,p){var l=null,h="g";return p&&L&&(h="y"),typeof m=="string"&&m!==""?l=new RegExp(m,h):m&&(l=new RegExp(m.source,h)),l},v.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(m){var p=this.__position,l=this.readUntilAfter(m);return this.__position=p,l},v.prototype.lookBack=function(m){var p=this.__position-1;return p>=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},i.exports.InputScanner=v},,,,,function(i){function L(v,m){v=typeof v=="string"?v:v.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+m,"g")}L.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(v);p;)m[p[1]]=p[2],p=this.__directive_pattern.exec(v);return m},L.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},i.exports.Directives=L},,function(i,L,v){var m=v(16).Beautifier,p=v(17).Options;function l(h,f){var o=new m(h,f);return o.beautify()}i.exports=l,i.exports.defaultOptions=function(){return new p}},function(i,L,v){var m=v(17).Options,p=v(2).Output,l=v(8).InputScanner,h=v(13).Directives,f=new h(/\/\*/,/\*\//),o=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,s=/\s/,a=/(?:\s|\n)+/g,C=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,_=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function T(R,O){this._source_text=R||"",this._options=new m(O),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}T.prototype.eatString=function(R){var O="";for(this._ch=this._input.next();this._ch;){if(O+=this._ch,this._ch==="\\")O+=this._input.next();else if(R.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return O},T.prototype.eatWhitespace=function(R){for(var O=s.test(this._input.peek()),S=0;s.test(this._input.peek());)this._ch=this._input.next(),R&&this._ch===`
|
|
`&&((S===0||S<this._options.max_preserve_newlines)&&(S++,this._output.add_new_line(!0)));return O},T.prototype.foundNestedPseudoClass=function(){for(var R=0,O=1,S=this._input.peek(O);S;){if(S==="{")return!0;if(S==="(")R+=1;else if(S===")"){if(R===0)return!1;R-=1}else if(S===";"||S==="}")return!1;O++,S=this._input.peek(O)}return!1},T.prototype.print_string=function(R){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(R)},T.prototype.preserveSingleSpace=function(R){R&&(this._output.space_before_token=!0)},T.prototype.indent=function(){this._indentLevel++},T.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},T.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var R=this._source_text,O=this._options.eol;O==="auto"&&(O=`
|
|
`,R&&o.test(R||"")&&(O=R.match(o)[0])),R=R.replace(u,`
|
|
`);var S=R.match(/^[\t ]*/)[0];this._output=new p(this._options,S),this._input=new l(R),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var w=0,E=!1,c=!1,x=!1,y=!1,g=!1,F=!1,U=this._ch,A=!1,j,N,b;j=this._input.read(a),N=j!=="",b=U,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),U=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var Y=this._input.read(C),re=f.get_directives(Y);re&&re.ignore==="start"&&(Y+=f.readIgnored(this._input)),this.print_string(Y),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(N),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var fe=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);fe.match(/[ :]$/)&&(fe=this.eatString(": ").replace(/\s$/,""),this.print_string(fe),this._output.space_before_token=!0),fe=fe.replace(/\s$/,""),fe==="extend"?y=!0:fe==="import"&&(g=!0),fe in this.NESTED_AT_RULE?(this._nestedLevel+=1,fe in this.CONDITIONAL_GROUP_RULE&&(x=!0)):!E&&w===0&&fe.indexOf(":")!==-1&&(c=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(N),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")c&&(c=!1,this.outdent()),x?(x=!1,E=this._indentLevel>=this._nestedLevel):E=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&E&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(b==="("?this._output.space_before_token=!1:b!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),b==="{"&&this._output.trim(!0),g=!1,y=!1,c&&(this.outdent(),c=!1),this.print_string(this._ch),E=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var ve=0;ve<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ve++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ve])){A=!0;break}(E||x)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!y&&w===0?(this.print_string(":"),c||(c=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var ke=b==='"'||b==="'";this.preserveSingleSpace(ke||N),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")A=!1,w===0?(c&&(this.outdent(),c=!1),y=!1,g=!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 Se=!1;this._input.lookBack("with")&&(Se=!0),this.preserveSingleSpace(N||Se),this.print_string(this._ch),c&&b==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),F=!0):(this.eatWhitespace(),w++,this.indent())}else if(this._ch===")")w&&(w--,this.outdent()),F&&this._input.peek()===";"&&this._options.selector_separator_newline&&(F=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!c||F)&&w===0&&!g&&!y?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!c&&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&&s.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(N),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),s.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Le=b==='"'||b==="'";this.preserveSingleSpace(Le||N),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&A&&this._output.add_new_line()}var ye=this._output.get_code(O);return ye},i.exports.Beautifier=T},function(i,L,v){var m=v(6).Options;function p(l){m.call(this,l,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var h=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||h;var f=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var o=0;o<f.length;o++)f[o]!=="expand"?this.brace_style="collapse":this.brace_style=f[o]}p.prototype=new m,i.exports.Options=p}],P={};function W(i){var L=P[i];if(L!==void 0)return L.exports;var v=P[i]={exports:{}};return B[i](v,v.exports,W),v.exports}var H=W(15);M=H})();var X=M;!(oe=[],$=function(){return{css_beautify:X}}.apply(Te,oe),$!==void 0&&(Ze.exports=$))})()},Vhoy:function(Ze,Te,Z){"use strict";Z.d(Te,"d",function(){return X}),Z.d(Te,"e",function(){return B}),Z.d(Te,"c",function(){return P}),Z.d(Te,"b",function(){return W}),Z.d(Te,"a",function(){return H});var oe=Z("MI8n");class ${constructor(){this._icons=new Map,this._onDidRegister=new oe.b}add(i){const L=this._icons.get(i.id);L?i.description?L.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 $,X=M;function B(i,L){return new W(i,L)}function P(i){return i?i.replace(/\$\((.*?)\)/g,(L,v)=>` ${v} `).trim():""}class W{constructor(i,L,v){this.id=i,this.definition=L,this.description=v,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 H;(function(i){i.iconNameSegment="[A-Za-z0-9]+",i.iconNameExpression="[A-Za-z0-9\\-]+",i.iconModifierExpression="~[A-Za-z]+";const L=new RegExp(`^(${i.iconNameExpression})(${i.iconModifierExpression})?$`);function v(l){if(l instanceof W)return["codicon","codicon-"+l.id];const h=L.exec(l.id);if(!h)return v(W.error);let[,f,o]=h;const u=["codicon","codicon-"+f];return o&&u.push("codicon-modifier-"+o.substr(1)),u}i.asClassNameArray=v;function m(l){return v(l).join(" ")}i.asClassName=m;function p(l){return"."+v(l).join(".")}i.asCSSSelector=p})(H||(H={})),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"})}(W||(W={}))},"VrN/":function(Ze,Te,Z){(function(oe,$){Ze.exports=$()})(this,function(){"use strict";var oe=navigator.userAgent,$=navigator.platform,M=/gecko\/\d/i.test(oe),X=/MSIE \d/.test(oe),B=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(oe),P=/Edge\/(\d+)/.exec(oe),W=X||B||P,H=W&&(X?document.documentMode||6:+(P||B)[1]),i=!P&&/WebKit\//.test(oe),L=i&&/Qt\/\d+\.\d+/.test(oe),v=!P&&/Chrome\//.test(oe),m=/Opera\//.test(oe),p=/Apple Computer/.test(navigator.vendor),l=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(oe),h=/PhantomJS/.test(oe),f=!P&&/AppleWebKit/.test(oe)&&/Mobile\/\w+/.test(oe),o=/Android/.test(oe),u=f||o||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(oe),s=f||/Mac/.test($),a=/\bCrOS\b/.test(oe),C=/win/i.test($),_=m&&oe.match(/Version\/(\d*\.\d*)/);_&&(_=Number(_[1])),_&&_>=15&&(m=!1,i=!0);var T=s&&(L||m&&(_==null||_<12.11)),R=M||W&&H>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var S=function(e,t){var n=e.className,r=O(t).exec(n);if(r){var d=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(d?r[1]+d:"")}};function w(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function E(e,t){return w(e).appendChild(t)}function c(e,t,n,r){var d=document.createElement(e);if(n&&(d.className=n),r&&(d.style.cssText=r),typeof t=="string")d.appendChild(document.createTextNode(t));else if(t)for(var k=0;k<t.length;++k)d.appendChild(t[k]);return d}function x(e,t,n,r){var d=c(e,t,n,r);return d.setAttribute("role","presentation"),d}var y;document.createRange?y=function(e,t,n,r){var d=document.createRange();return d.setEnd(r||e,n),d.setStart(e,t),d}:y=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(d){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function g(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function F(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function U(e,t){var n=e.className;O(t).test(n)||(e.className+=(n?" ":"")+t)}function A(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!O(n[r]).test(t)&&(t+=" "+n[r]);return t}var j=function(e){e.select()};f?j=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:W&&(j=function(e){try{e.select()}catch(t){}});function N(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function b(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function Y(e,t,n,r,d){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var k=r||0,K=d||0;;){var J=e.indexOf(" ",k);if(J<0||J>=t)return K+(t-k);K+=J-k,K+=n-K%n,k=J+1}}var re=function(){this.id=null,this.f=null,this.time=0,this.handler=N(this.onTimeout,this)};re.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},re.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function fe(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var ve=50,ke={toString:function(){return"CodeMirror.Pass"}},Se={scroll:!1},Le={origin:"*mouse"},ye={origin:"+move"};function _e(e,t,n){for(var r=0,d=0;;){var k=e.indexOf(" ",r);k==-1&&(k=e.length);var K=k-r;if(k==e.length||d+K>=t)return r+Math.min(K,t-d);if(d+=k-r,d+=n-d%n,r=k+1,d>=t)return r}}var de=[""];function z(e){for(;de.length<=e;)de.push(D(de)+" ");return de[e]}function D(e){return e[e.length-1]}function I(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function V(e,t,n){for(var r=0,d=n(t);r<e.length&&n(e[r])<=d;)r++;e.splice(r,0,t)}function Q(){}function G(e,t){var n;return Object.create?n=Object.create(e):(Q.prototype=e,n=new Q),t&&b(t,n),n}var ce=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Ce(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ce.test(e))}function De(e,t){return t?t.source.indexOf("\\w")>-1&&Ce(e)?!0:t.test(e):Ce(e)}function ue(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ge=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function we(e){return e.charCodeAt(0)>=768&&ge.test(e)}function Ae(e,t,n){for(;(n<0?t>0:t<e.length)&&we(e.charAt(t));)t+=n;return t}function Ne(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var d=(t+n)/2,k=r<0?Math.ceil(d):Math.floor(d);if(k==t)return e(k)?t:n;e(k)?n=k:t=k+r}}function Be(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var d=!1,k=0;k<e.length;++k){var K=e[k];(K.from<n&&K.to>t||t==n&&K.to==t)&&(r(Math.max(K.from,t),Math.min(K.to,n),K.level==1?"rtl":"ltr",k),d=!0)}d||r(t,n,"ltr")}var Ge=null;function He(e,t,n){var r;Ge=null;for(var d=0;d<e.length;++d){var k=e[d];if(k.from<t&&k.to>t)return d;k.to==t&&(k.from!=k.to&&n=="before"?r=d:Ge=d),k.from==t&&(k.from!=k.to&&n!="before"?r=d:Ge=d)}return r!=null?r:Ge}var qe=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(ne){return ne<=247?e.charAt(ne):1424<=ne&&ne<=1524?"R":1536<=ne&&ne<=1785?t.charAt(ne-1536):1774<=ne&&ne<=2220?"r":8192<=ne&&ne<=8203?"w":ne==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,d=/[stwN]/,k=/[LRr]/,K=/[Lb1n]/,J=/[1n]/;function ee(ne,be,Ee){this.level=ne,this.from=be,this.to=Ee}return function(ne,be){var Ee=be=="ltr"?"L":"R";if(ne.length==0||be=="ltr"&&!r.test(ne))return!1;for(var Ie=ne.length,Re=[],Fe=0;Fe<Ie;++Fe)Re.push(n(ne.charCodeAt(Fe)));for(var Ue=0,Ye=Ee;Ue<Ie;++Ue){var Xe=Re[Ue];Xe=="m"?Re[Ue]=Ye:Ye=Xe}for(var it=0,$e=Ee;it<Ie;++it){var nt=Re[it];nt=="1"&&$e=="r"?Re[it]="n":k.test(nt)&&($e=nt,nt=="r"&&(Re[it]="R"))}for(var ht=1,lt=Re[0];ht<Ie-1;++ht){var bt=Re[ht];bt=="+"&<=="1"&&Re[ht+1]=="1"?Re[ht]="1":bt==","&<==Re[ht+1]&&(lt=="1"||lt=="n")&&(Re[ht]=lt),lt=bt}for(var Nt=0;Nt<Ie;++Nt){var Zt=Re[Nt];if(Zt==",")Re[Nt]="N";else if(Zt=="%"){var Wt=void 0;for(Wt=Nt+1;Wt<Ie&&Re[Wt]=="%";++Wt);for(var _i=Nt&&Re[Nt-1]=="!"||Wt<Ie&&Re[Wt]=="1"?"1":"N",gi=Nt;gi<Wt;++gi)Re[gi]=_i;Nt=Wt-1}}for(var Vt=0,vi=Ee;Vt<Ie;++Vt){var ti=Re[Vt];vi=="L"&&ti=="1"?Re[Vt]="L":k.test(ti)&&(vi=ti)}for(var $t=0;$t<Ie;++$t)if(d.test(Re[$t])){var Yt=void 0;for(Yt=$t+1;Yt<Ie&&d.test(Re[Yt]);++Yt);for(var Gt=($t?Re[$t-1]:Ee)=="L",yi=(Yt<Ie?Re[Yt]:Ee)=="L",Gr=Gt==yi?Gt?"L":"R":Ee,tr=$t;tr<Yt;++tr)Re[tr]=Gr;$t=Yt-1}for(var ai=[],Bi,qt=0;qt<Ie;)if(K.test(Re[qt])){var Va=qt;for(++qt;qt<Ie&&K.test(Re[qt]);++qt);ai.push(new ee(0,Va,qt))}else{var zi=qt,vr=ai.length,yr=be=="rtl"?1:0;for(++qt;qt<Ie&&Re[qt]!="L";++qt);for(var hi=zi;hi<qt;)if(J.test(Re[hi])){zi<hi&&(ai.splice(vr,0,new ee(1,zi,hi)),vr+=yr);var Kr=hi;for(++hi;hi<qt&&J.test(Re[hi]);++hi);ai.splice(vr,0,new ee(2,Kr,hi)),vr+=yr,zi=hi}else++hi;zi<qt&&ai.splice(vr,0,new ee(1,zi,qt))}return be=="ltr"&&(ai[0].level==1&&(Bi=ne.match(/^\s+/))&&(ai[0].from=Bi[0].length,ai.unshift(new ee(0,0,Bi[0].length))),D(ai).level==1&&(Bi=ne.match(/\s+$/))&&(D(ai).to-=Bi[0].length,ai.push(new ee(0,Ie-Bi[0].length,Ie)))),be=="rtl"?ai.reverse():ai}}();function je(e,t){var n=e.order;return n==null&&(n=e.order=qe(e.text,t)),n}var Ke=[],Me=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Ke).concat(n)}};function et(e,t){return e._handlers&&e._handlers[t]||Ke}function Je(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,d=r&&r[t];if(d){var k=fe(d,n);k>-1&&(r[t]=d.slice(0,k).concat(d.slice(k+1)))}}}function le(e,t){var n=et(e,t);if(!n.length)return;for(var r=Array.prototype.slice.call(arguments,2),d=0;d<n.length;++d)n[d].apply(null,r)}function q(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),le(e,n||t.type,e,t),pe(t)||t.codemirrorIgnore}function te(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)fe(n,t[r])==-1&&n.push(t[r])}function se(e,t){return et(e,t).length>0}function he(e){e.prototype.on=function(t,n){Me(this,t,n)},e.prototype.off=function(t,n){Je(this,t,n)}}function ie(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ae(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function pe(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function me(e){ie(e),ae(e)}function xe(e){return e.target||e.srcElement}function Oe(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),s&&e.ctrlKey&&t==1&&(t=3),t}var Pe=function(){if(W&&H<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),ze;function tt(e){if(ze==null){var t=c("span","\u200B");E(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(ze=t.offsetWidth<=1&&t.offsetHeight>2&&!(W&&H<8))}var n=ze?c("span","\u200B"):c("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var rt;function yt(e){if(rt!=null)return rt;var t=E(e,document.createTextNode("A\u062EA")),n=y(t,0,1).getBoundingClientRect(),r=y(t,1,2).getBoundingClientRect();return w(e),!n||n.left==n.right?!1:rt=r.right-n.right<3}var ot=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var d=e.indexOf(`
|
|
`,t);d==-1&&(d=e.length);var k=e.slice(t,e.charAt(d-1)=="\r"?d-1:d),K=k.indexOf("\r");K!=-1?(n.push(k.slice(0,K)),t+=K+1):(n.push(k),t=d+1)}return n}:function(e){return e.split(/\r\n?|\n/)},at=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Lt=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),_t=null;function Bt(e){if(_t!=null)return _t;var t=E(e,c("span","x")),n=t.getBoundingClientRect(),r=y(t,0,1).getBoundingClientRect();return _t=Math.abs(n.left-r.left)>1}var Ft={},Tt={};function si(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ft[e]=t}function Ei(e,t){Tt[e]=t}function zt(e){if(typeof e=="string"&&Tt.hasOwnProperty(e))e=Tt[e];else if(e&&typeof e.name=="string"&&Tt.hasOwnProperty(e.name)){var t=Tt[e.name];typeof t=="string"&&(t={name:t}),e=G(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return zt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return zt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function di(e,t){t=zt(t);var n=Ft[t.name];if(!n)return di(e,"text/plain");var r=n(e,t);if(dt.hasOwnProperty(t.name)){var d=dt[t.name];for(var k in d){if(!d.hasOwnProperty(k))continue;r.hasOwnProperty(k)&&(r["_"+k]=r[k]),r[k]=d[k]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var K in t.modeProps)r[K]=t.modeProps[K];return r}var dt={};function vt(e,t){var n=dt.hasOwnProperty(e)?dt[e]:dt[e]={};b(t,n)}function Et(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var d=t[r];d instanceof Array&&(d=d.concat([])),n[r]=d}return n}function Ht(e,t){for(var n;e.innerMode&&!(n=e.innerMode(t),!n||n.mode==e);)t=n.state,e=n.mode;return n||{mode:e,state:t}}function oi(e,t,n){return e.startState?e.startState(t,n):!0}var Mt=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Mt.prototype.eol=function(){return this.pos>=this.string.length},Mt.prototype.sol=function(){return this.pos==this.lineStart},Mt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Mt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Mt.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},Mt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Mt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Mt.prototype.skipToEnd=function(){this.pos=this.string.length},Mt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Mt.prototype.backUp=function(e){this.pos-=e},Mt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Y(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Y(this.string,this.lineStart,this.tabSize):0)},Mt.prototype.indentation=function(){return Y(this.string,null,this.tabSize)-(this.lineStart?Y(this.string,this.lineStart,this.tabSize):0)},Mt.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(K){return n?K.toLowerCase():K},d=this.string.substr(this.pos,e.length);if(r(d)==r(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)}},Mt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Mt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Mt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Mt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Qe(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var d=n.children[r],k=d.chunkSize();if(t<k){n=d;break}t-=k}return n.lines[t]}function Ct(e,t,n){var r=[],d=t.line;return e.iter(t.line,n.line+1,function(k){var K=k.text;d==n.line&&(K=K.slice(0,n.ch)),d==t.line&&(K=K.slice(t.ch)),r.push(K),++d}),r}function Ot(e,t,n){var r=[];return e.iter(t,n,function(d){r.push(d.text)}),r}function ct(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function pt(e){if(e.parent==null)return null;for(var t=e.parent,n=fe(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var d=0;!(r.children[d]==t);++d)n+=r.children[d].chunkSize();return n+t.first}function wt(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var d=e.children[r],k=d.height;if(t<k){e=d;continue e}t-=k,n+=d.chunkSize()}return n}while(!e.lines);for(var K=0;K<e.lines.length;++K){var J=e.lines[K],ee=J.height;if(t<ee)break;t-=ee}return n+K}function ii(e,t){return t>=e.first&&t<e.first+e.size}function Ut(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function We(e,t,n){if(n===void 0&&(n=null),!(this instanceof We))return new We(e,t,n);this.line=e,this.ch=t,this.sticky=n}function ft(e,t){return e.line-t.line||e.ch-t.ch}function ir(e,t){return e.sticky==t.sticky&&ft(e,t)==0}function br(e){return We(e.line,e.ch)}function _r(e,t){return ft(e,t)<0?t:e}function rr(e,t){return ft(e,t)<0?e:t}function Er(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function gt(e,t){if(t.line<e.first)return We(e.first,0);var n=e.first+e.size-1;return t.line>n?We(n,Qe(e,n).text.length):An(t,Qe(e,t.line).text.length)}function An(e,t){var n=e.ch;return n==null||n>t?We(e.line,t):n<0?We(e.line,0):e}function Ve(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=gt(e,t[r]);return n}var xr=function(e,t){this.state=e,this.lookAhead=t},Si=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Si.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Si.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}},Si.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Si.fromSaved=function(e,t,n){return t instanceof xr?new Si(e,Et(e.mode,t.state),n,t.lookAhead):new Si(e,Et(e.mode,t),n)},Si.prototype.save=function(e){var t=e!==!1?Et(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new xr(t,this.maxLookAhead):t};function zr(e,t,n,r){var d=[e.state.modeGen],k={};Ri(e,t.text,e.doc.mode,n,function(ne,be){return d.push(ne,be)},k,r);for(var K=n.state,J=function(ne){n.baseTokens=d;var be=e.state.overlays[ne],Ee=1,Ie=0;n.state=!0,Ri(e,t.text,be.mode,n,function(Re,Fe){for(var Ue=Ee;Ie<Re;){var Ye=d[Ee];Ye>Re&&d.splice(Ee,1,Re,d[Ee+1],Ye),Ee+=2,Ie=Math.min(Re,Ye)}if(!Fe)return;if(be.opaque)d.splice(Ue,Ee-Ue,Re,"overlay "+Fe),Ee=Ue+2;else for(;Ue<Ee;Ue+=2){var Xe=d[Ue+1];d[Ue+1]=(Xe?Xe+" ":"")+"overlay "+Fe}},k),n.state=K,n.baseTokens=null,n.baseTokenPos=1},ee=0;ee<e.state.overlays.length;++ee)J(ee);return{styles:d,classes:k.bgClass||k.textClass?k:null}}function nr(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Ai(e,pt(t)),d=t.text.length>e.options.maxHighlightLength&&Et(e.doc.mode,r.state),k=zr(e,t,r);d&&(r.state=d),t.stateAfter=r.save(!d),t.styles=k.styles,k.classes?t.styleClasses=k.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Ai(e,t,n){var r=e.doc,d=e.display;if(!r.mode.startState)return new Si(r,!0,t);var k=Rn(e,t,n),K=k>r.first&&Qe(r,k-1).stateAfter,J=K?Si.fromSaved(r,K,k):new Si(r,oi(r.mode),k);return r.iter(k,t,function(ee){Vr(e,ee.text,J);var ne=J.line;ee.stateAfter=ne==t-1||ne%5==0||ne>=d.viewFrom&&ne<d.viewTo?J.save():null,J.nextLine()}),n&&(r.modeFrontier=J.line),J}function Vr(e,t,n,r){var d=e.doc.mode,k=new Mt(t,e.options.tabSize,n);for(k.start=k.pos=r||0,t==""&&Yr(d,n.state);!k.eol();)Oi(d,k,n.state),k.start=k.pos}function Yr(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var n=Ht(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}function Oi(e,t,n,r){for(var d=0;d<10;d++){r&&(r[0]=Ht(e,n).mode);var k=e.token(t,n);if(t.pos>t.start)return k}throw new Error("Mode "+e.name+" failed to advance stream.")}var Xr=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function On(e,t,n,r){var d=e.doc,k=d.mode,K;t=gt(d,t);var J=Qe(d,t.line),ee=Ai(e,t.line,n),ne=new Mt(J.text,e.options.tabSize,ee),be;for(r&&(be=[]);(r||ne.pos<t.ch)&&!ne.eol();)ne.start=ne.pos,K=Oi(k,ne,ee.state),r&&be.push(new Xr(ne,K,Et(d.mode,ee.state)));return r?be:new Xr(ne,K,ee.state)}function $r(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Ri(e,t,n,r,d,k,K){var J=n.flattenSpans;J==null&&(J=e.options.flattenSpans);var ee=0,ne=null,be=new Mt(t,e.options.tabSize,r),Ee,Ie=e.options.addModeClass&&[null];for(t==""&&$r(Yr(n,r.state),k);!be.eol();){if(be.pos>e.options.maxHighlightLength?(J=!1,K&&Vr(e,t,r,be.pos),be.pos=t.length,Ee=null):Ee=$r(Oi(n,be,r.state,Ie),k),Ie){var Re=Ie[0].name;Re&&(Ee="m-"+(Ee?Re+" "+Ee:Re))}if(!J||ne!=Ee){for(;ee<be.start;)ee=Math.min(be.start,ee+5e3),d(ee,ne);ne=Ee}be.start=be.pos}for(;ee<be.pos;){var Fe=Math.min(be.pos,ee+5e3);d(Fe,ne),ee=Fe}}function Rn(e,t,n){for(var r,d,k=e.doc,K=n?-1:t-(e.doc.mode.innerMode?1e3:100),J=t;J>K;--J){if(J<=k.first)return k.first;var ee=Qe(k,J-1),ne=ee.stateAfter;if(ne&&(!n||J+(ne instanceof xr?ne.lookAhead:0)<=k.modeFrontier))return J;var be=Y(ee.text,null,e.options.tabSize);(d==null||r>be)&&(d=J-1,r=be)}return d}function aa(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var n=e.first,r=t-1;r>n;r--){var d=Qe(e,r).stateAfter;if(d&&(!(d instanceof xr)||r+d.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}var Jr=!1,li=!1;function Vi(){Jr=!0}function sa(){li=!0}function ar(e,t,n){this.marker=e,this.from=t,this.to=n}function Li(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Qr(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function oa(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Ln(e,t,n){var r;if(e)for(var d=0;d<e.length;++d){var k=e[d],K=k.marker,J=k.from==null||(K.inclusiveLeft?k.from<=t:k.from<t);if(J||k.from==t&&K.type=="bookmark"&&(!n||!k.marker.insertLeft)){var ee=k.to==null||(K.inclusiveRight?k.to>=t:k.to>t);(r||(r=[])).push(new ar(K,k.from,ee?null:k.to))}}return r}function In(e,t,n){var r;if(e)for(var d=0;d<e.length;++d){var k=e[d],K=k.marker,J=k.to==null||(K.inclusiveRight?k.to>=t:k.to>t);if(J||k.from==t&&K.type=="bookmark"&&(!n||k.marker.insertLeft)){var ee=k.from==null||(K.inclusiveLeft?k.from<=t:k.from<t);(r||(r=[])).push(new ar(K,ee?null:k.from-t,k.to==null?null:k.to-t))}}return r}function Tr(e,t){if(t.full)return null;var n=ii(e,t.from.line)&&Qe(e,t.from.line).markedSpans,r=ii(e,t.to.line)&&Qe(e,t.to.line).markedSpans;if(!n&&!r)return null;var d=t.from.ch,k=t.to.ch,K=ft(t.from,t.to)==0,J=Ln(n,d,K),ee=In(r,k,K),ne=t.text.length==1,be=D(t.text).length+(ne?d:0);if(J)for(var Ee=0;Ee<J.length;++Ee){var Ie=J[Ee];if(Ie.to==null){var Re=Li(ee,Ie.marker);Re?ne&&(Ie.to=Re.to==null?null:Re.to+be):Ie.to=d}}if(ee)for(var Fe=0;Fe<ee.length;++Fe){var Ue=ee[Fe];if(Ue.to!=null&&(Ue.to+=be),Ue.from==null){var Ye=Li(J,Ue.marker);Ye||(Ue.from=be,ne&&(J||(J=[])).push(Ue))}else Ue.from+=be,ne&&(J||(J=[])).push(Ue)}J&&(J=Dn(J)),ee&&ee!=J&&(ee=Dn(ee));var Xe=[J];if(!ne){var it=t.text.length-2,$e;if(it>0&&J)for(var nt=0;nt<J.length;++nt)J[nt].to==null&&($e||($e=[])).push(new ar(J[nt].marker,null,null));for(var ht=0;ht<it;++ht)Xe.push($e);Xe.push(ee)}return Xe}function Dn(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function kn(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(Re){if(Re.markedSpans)for(var Fe=0;Fe<Re.markedSpans.length;++Fe){var Ue=Re.markedSpans[Fe].marker;Ue.readOnly&&(!r||fe(r,Ue)==-1)&&(r||(r=[])).push(Ue)}}),!r)return null;for(var d=[{from:t,to:n}],k=0;k<r.length;++k)for(var K=r[k],J=K.find(0),ee=0;ee<d.length;++ee){var ne=d[ee];if(ft(ne.to,J.from)<0||ft(ne.from,J.to)>0)continue;var be=[ee,1],Ee=ft(ne.from,J.from),Ie=ft(ne.to,J.to);(Ee<0||!K.inclusiveLeft&&!Ee)&&be.push({from:ne.from,to:J.from}),(Ie>0||!K.inclusiveRight&&!Ie)&&be.push({from:J.to,to:ne.to}),d.splice.apply(d,be),ee+=be.length-3}return d}function la(e){var t=e.markedSpans;if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}function wr(e,t){if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}function sr(e){return e.inclusiveLeft?-1:0}function or(e){return e.inclusiveRight?1:0}function Sr(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),d=t.find(),k=ft(r.from,d.from)||sr(e)-sr(t);if(k)return-k;var K=ft(r.to,d.to)||or(e)-or(t);return K||t.id-e.id}function Ui(e,t){var n=li&&e.markedSpans,r;if(n)for(var d=void 0,k=0;k<n.length;++k)d=n[k],d.marker.collapsed&&(t?d.from:d.to)==null&&(!r||Sr(r,d.marker)<0)&&(r=d.marker);return r}function ji(e){return Ui(e,!0)}function Hi(e){return Ui(e,!1)}function Cr(e,t){var n=li&&e.markedSpans,r;if(n)for(var d=0;d<n.length;++d){var k=n[d];k.marker.collapsed&&(k.from==null||k.from<t)&&(k.to==null||k.to>t)&&(!r||Sr(r,k.marker)<0)&&(r=k.marker)}return r}function Mn(e,t,n,r,d){var k=Qe(e,t),K=li&&k.markedSpans;if(K)for(var J=0;J<K.length;++J){var ee=K[J];if(!ee.marker.collapsed)continue;var ne=ee.marker.find(0),be=ft(ne.from,n)||sr(ee.marker)-sr(d),Ee=ft(ne.to,r)||or(ee.marker)-or(d);if(be>=0&&Ee<=0||be<=0&&Ee>=0)continue;if(be<=0&&(ee.marker.inclusiveRight&&d.inclusiveLeft?ft(ne.to,n)>=0:ft(ne.to,n)>0)||be>=0&&(ee.marker.inclusiveRight&&d.inclusiveLeft?ft(ne.from,r)<=0:ft(ne.from,r)<0))return!0}}function xi(e){for(var t;t=ji(e);)e=t.find(-1,!0).line;return e}function Pn(e){for(var t;t=Hi(e);)e=t.find(1,!0).line;return e}function Ar(e){for(var t,n;t=Hi(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Zr(e,t){var n=Qe(e,t),r=xi(n);return n==r?t:pt(r)}function Yi(e,t){if(t>e.lastLine())return t;var n=Qe(e,t),r;if(!Pi(e,n))return t;for(;r=Hi(n);)n=r.find(1,!0).line;return pt(n)+1}function Pi(e,t){var n=li&&t.markedSpans;if(n)for(var r=void 0,d=0;d<n.length;++d){if(r=n[d],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&qr(e,t,r))return!0}}function qr(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return qr(e,r.line,Li(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var d=void 0,k=0;k<t.markedSpans.length;++k)if(d=t.markedSpans[k],d.marker.collapsed&&!d.marker.widgetNode&&d.from==n.to&&(d.to==null||d.to!=n.from)&&(d.marker.inclusiveLeft||n.marker.inclusiveRight)&&qr(e,t,d))return!0}function Ii(e){e=xi(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var d=n.lines[r];if(d==e)break;t+=d.height}for(var k=n.parent;k;n=k,k=n.parent)for(var K=0;K<k.children.length;++K){var J=k.children[K];if(J==n)break;t+=J.height}return t}function en(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=ji(r);){var d=n.find(0,!0);r=d.from.line,t+=d.from.ch-d.to.ch}for(r=e;n=Hi(r);){var k=n.find(0,!0);t-=r.text.length-k.from.ch,r=k.to.line,t+=r.text.length-k.to.ch}return t}function Nn(e){var t=e.display,n=e.doc;t.maxLine=Qe(n,n.first),t.maxLineLength=en(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var d=en(r);d>t.maxLineLength&&(t.maxLineLength=d,t.maxLine=r)})}var lr=function(e,t,n){this.text=e,wr(this,t),this.height=n?n(this):1};lr.prototype.lineNo=function(){return pt(this)},he(lr);function ua(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),la(e),wr(e,n);var d=r?r(e):1;d!=e.height&&ct(e,d)}function st(e){e.parent=null,la(e)}var mt={},ut={};function xt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?ut:mt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Rt(e,t){var n=x("span",null,null,i?"padding-right: .1px":null),r={pre:x("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var d=0;d<=(t.rest?t.rest.length:0);d++){var k=d?t.rest[d-1]:t.line,K=void 0;r.pos=0,r.addToken=At,yt(e.display.measure)&&(K=je(k,e.doc.direction))&&(r.addToken=ci(r.addToken,K)),r.map=[];var J=t!=e.display.externalMeasured&&pt(k);Wi(k,r,nr(e,k,J)),k.styleClasses&&(k.styleClasses.bgClass&&(r.bgClass=A(k.styleClasses.bgClass,r.bgClass||"")),k.styleClasses.textClass&&(r.textClass=A(k.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(tt(e.display.measure))),d==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(i){var ee=r.content.lastChild;(/\bcm-tab\b/.test(ee.className)||ee.querySelector&&ee.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return le(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=A(r.pre.className,r.textClass||"")),r}function Pt(e){var t=c("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function At(e,t,n,r,d,k,K){if(!t)return;var J=e.splitSpaces?Xt(t,e.trailingSpace):t,ee=e.cm.state.specialChars,ne=!1,be;if(!ee.test(t))e.col+=t.length,be=document.createTextNode(J),e.map.push(e.pos,e.pos+t.length,be),W&&H<9&&(ne=!0),e.pos+=t.length;else{be=document.createDocumentFragment();for(var Ee=0;;){ee.lastIndex=Ee;var Ie=ee.exec(t),Re=Ie?Ie.index-Ee:t.length-Ee;if(Re){var Fe=document.createTextNode(J.slice(Ee,Ee+Re));W&&H<9?be.appendChild(c("span",[Fe])):be.appendChild(Fe),e.map.push(e.pos,e.pos+Re,Fe),e.col+=Re,e.pos+=Re}if(!Ie)break;Ee+=Re+1;var Ue=void 0;if(Ie[0]==" "){var Ye=e.cm.options.tabSize,Xe=Ye-e.col%Ye;Ue=be.appendChild(c("span",z(Xe),"cm-tab")),Ue.setAttribute("role","presentation"),Ue.setAttribute("cm-text"," "),e.col+=Xe}else Ie[0]=="\r"||Ie[0]==`
|
|
`?(Ue=be.appendChild(c("span",Ie[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ue.setAttribute("cm-text",Ie[0]),e.col+=1):(Ue=e.cm.options.specialCharPlaceholder(Ie[0]),Ue.setAttribute("cm-text",Ie[0]),W&&H<9?be.appendChild(c("span",[Ue])):be.appendChild(Ue),e.col+=1);e.map.push(e.pos,e.pos+1,Ue),e.pos++}}if(e.trailingSpace=J.charCodeAt(t.length-1)==32,n||r||d||ne||k||K){var it=n||"";r&&(it+=r),d&&(it+=d);var $e=c("span",[be],it,k);if(K)for(var nt in K)K.hasOwnProperty(nt)&&nt!="style"&&nt!="class"&&$e.setAttribute(nt,K[nt]);return e.content.appendChild($e)}e.content.appendChild(be)}function Xt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",d=0;d<e.length;d++){var k=e.charAt(d);k==" "&&n&&(d==e.length-1||e.charCodeAt(d+1)==32)&&(k="\xA0"),r+=k,n=k==" "}return r}function ci(e,t){return function(n,r,d,k,K,J,ee){d=d?d+" cm-force-border":"cm-force-border";for(var ne=n.pos,be=ne+r.length;;){for(var Ee=void 0,Ie=0;Ie<t.length&&!(Ee=t[Ie],Ee.to>ne&&Ee.from<=ne);Ie++);if(Ee.to>=be)return e(n,r,d,k,K,J,ee);e(n,r.slice(0,Ee.to-ne),d,k,null,J,ee),k=null,r=r.slice(Ee.to-ne),ne=Ee.to}}}function St(e,t,n,r){var d=!r&&n.widgetNode;d&&e.map.push(e.pos,e.pos+t,d),!r&&e.cm.display.input.needsContentAttribute&&(d||(d=e.content.appendChild(document.createElement("span"))),d.setAttribute("cm-marker",n.id)),d&&(e.cm.display.input.setUneditable(d),e.content.appendChild(d)),e.pos+=t,e.trailingSpace=!1}function Wi(e,t,n){var r=e.markedSpans,d=e.text,k=0;if(!r){for(var K=1;K<n.length;K+=2)t.addToken(t,d.slice(k,k=n[K]),xt(n[K+1],t.cm.options));return}for(var J=d.length,ee=0,ne=1,be="",Ee,Ie,Re=0,Fe,Ue,Ye,Xe,it;;){if(Re==ee){Fe=Ue=Ye=Ie="",it=null,Xe=null,Re=Infinity;for(var $e=[],nt=void 0,ht=0;ht<r.length;++ht){var lt=r[ht],bt=lt.marker;if(bt.type=="bookmark"&<.from==ee&&bt.widgetNode)$e.push(bt);else if(lt.from<=ee&&(lt.to==null||lt.to>ee||bt.collapsed&<.to==ee&<.from==ee)){if(lt.to!=null&<.to!=ee&&Re>lt.to&&(Re=lt.to,Ue=""),bt.className&&(Fe+=" "+bt.className),bt.css&&(Ie=(Ie?Ie+";":"")+bt.css),bt.startStyle&<.from==ee&&(Ye+=" "+bt.startStyle),bt.endStyle&<.to==Re&&(nt||(nt=[])).push(bt.endStyle,lt.to),bt.title&&((it||(it={})).title=bt.title),bt.attributes)for(var Nt in bt.attributes)(it||(it={}))[Nt]=bt.attributes[Nt];bt.collapsed&&(!Xe||Sr(Xe.marker,bt)<0)&&(Xe=lt)}else lt.from>ee&&Re>lt.from&&(Re=lt.from)}if(nt)for(var Zt=0;Zt<nt.length;Zt+=2)nt[Zt+1]==Re&&(Ue+=" "+nt[Zt]);if(!Xe||Xe.from==ee)for(var Wt=0;Wt<$e.length;++Wt)St(t,0,$e[Wt]);if(Xe&&(Xe.from||0)==ee){if(St(t,(Xe.to==null?J+1:Xe.to)-ee,Xe.marker,Xe.from==null),Xe.to==null)return;Xe.to==ee&&(Xe=!1)}}if(ee>=J)break;for(var _i=Math.min(J,Re);;){if(be){var gi=ee+be.length;if(!Xe){var Vt=gi>_i?be.slice(0,_i-ee):be;t.addToken(t,Vt,Ee?Ee+Fe:Fe,Ye,ee+Vt.length==Re?Ue:"",Ie,it)}if(gi>=_i){be=be.slice(_i-ee),ee=_i;break}ee=gi,Ye=""}be=d.slice(k,k=n[ne++]),Ee=xt(n[ne++],t.cm.options)}}}function It(e,t,n){this.line=t,this.rest=Ar(t),this.size=this.rest?pt(D(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Pi(e,t)}function fi(e,t,n){for(var r=[],d,k=t;k<n;k=d){var K=new It(e.doc,Qe(e.doc,k),k);d=k+K.size,r.push(K)}return r}var ri=null;function Ci(e){ri?ri.ops.push(e):e.ownsGroup=ri={ops:[e],delayedCallbacks:[]}}function Lo(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var d=e.ops[r];if(d.cursorActivityHandlers)for(;d.cursorActivityCalled<d.cursorActivityHandlers.length;)d.cursorActivityHandlers[d.cursorActivityCalled++].call(null,d.cm)}}while(n<t.length)}function Io(e,t){var n=e.ownsGroup;if(!n)return;try{Lo(n)}finally{ri=null,t(n)}}var tn=null;function ei(e,t){var n=et(e,t);if(!n.length)return;var r=Array.prototype.slice.call(arguments,2),d;ri?d=ri.delayedCallbacks:tn?d=tn:(d=tn=[],setTimeout(Do,0));for(var k=function(J){d.push(function(){return n[J].apply(null,r)})},K=0;K<n.length;++K)k(K)}function Do(){var e=tn;tn=null;for(var t=0;t<e.length;++t)e[t]()}function Xa(e,t,n,r){for(var d=0;d<t.changes.length;d++){var k=t.changes[d];k=="text"?Mo(e,t):k=="gutter"?Ja(e,t,n,r):k=="class"?ha(e,t):k=="widget"&&Po(e,t,r)}t.changes=null}function rn(e){return e.node==e.text&&(e.node=c("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),W&&H<8&&(e.node.style.zIndex=2)),e.node}function ko(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=rn(t);t.background=r.insertBefore(c("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function $a(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Rt(e,t)}function Mo(e,t){var n=t.text.className,r=$a(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,ha(e,t)):n&&(t.text.className=n)}function ha(e,t){ko(e,t),t.line.wrapClass?rn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Ja(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var d=rn(t);t.gutterBackground=c("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),d.insertBefore(t.gutterBackground,t.text)}var k=t.line.gutterMarkers;if(e.options.lineNumbers||k){var K=rn(t),J=t.gutter=c("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(J),K.insertBefore(J,t.text),t.line.gutterClass&&(J.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!k||!k["CodeMirror-linenumbers"])&&(t.lineNumber=J.appendChild(c("div",Ut(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),k)for(var ee=0;ee<e.display.gutterSpecs.length;++ee){var ne=e.display.gutterSpecs[ee].className,be=k.hasOwnProperty(ne)&&k[ne];be&&J.appendChild(c("div",[be],"CodeMirror-gutter-elt","left: "+r.gutterLeft[ne]+"px; width: "+r.gutterWidth[ne]+"px"))}}}function Po(e,t,n){t.alignable&&(t.alignable=null);for(var r=O("CodeMirror-linewidget"),d=t.node.firstChild,k=void 0;d;d=k)k=d.nextSibling,r.test(d.className)&&t.node.removeChild(d);Qa(e,t,n)}function No(e,t,n,r){var d=$a(e,t);return t.text=t.node=d.pre,d.bgClass&&(t.bgClass=d.bgClass),d.textClass&&(t.textClass=d.textClass),ha(e,t),Ja(e,t,n,r),Qa(e,t,r),t.node}function Qa(e,t,n){if(Za(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Za(e,t.rest[r],t,n,!1)}function Za(e,t,n,r,d){if(!t.widgets)return;for(var k=rn(n),K=0,J=t.widgets;K<J.length;++K){var ee=J[K],ne=c("div",[ee.node],"CodeMirror-linewidget"+(ee.className?" "+ee.className:""));ee.handleMouseEvents||ne.setAttribute("cm-ignore-events","true"),Fo(ee,ne,n,r),e.display.input.setUneditable(ne),d&&ee.above?k.insertBefore(ne,n.gutter||n.text):k.appendChild(ne),ei(ee,"redraw")}}function Fo(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var d=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(d-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=d+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function nn(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!g(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),E(t.display.measure,c("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Gi(e,t){for(var n=xe(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function Fn(e){return e.lineSpace.offsetTop}function da(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function qa(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=E(e.measure,c("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Ni(e){return ve-e.display.nativeBarWidth}function ur(e){return e.display.scroller.clientWidth-Ni(e)-e.display.barWidth}function ca(e){return e.display.scroller.clientHeight-Ni(e)-e.display.barHeight}function Bo(e,t,n){var r=e.options.lineWrapping,d=r&&ur(e);if(!t.measure.heights||r&&t.measure.width!=d){var k=t.measure.heights=[];if(r){t.measure.width=d;for(var K=t.text.firstChild.getClientRects(),J=0;J<K.length-1;J++){var ee=K[J],ne=K[J+1];Math.abs(ee.bottom-ne.bottom)>2&&k.push((ee.bottom+ne.top)/2-n.top)}}k.push(n.bottom-n.top)}}function es(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var d=0;d<e.rest.length;d++)if(pt(e.rest[d])>n)return{map:e.measure.maps[d],cache:e.measure.caches[d],before:!0}}function Uo(e,t){t=xi(t);var n=pt(t),r=e.display.externalMeasured=new It(e.doc,t,n);r.lineN=n;var d=r.built=Rt(e,r);return r.text=d.pre,E(e.display.lineMeasure,d.pre),r}function ts(e,t,n,r){return Fi(e,Or(e,t),n,r)}function fa(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[cr(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Or(e,t){var n=pt(t),r=fa(e,n);r&&!r.text?r=null:r&&r.changes&&(Xa(e,r,n,ba(e)),e.curOp.forceUpdate=!0),r||(r=Uo(e,t));var d=es(r,t,n);return{line:t,view:r,rect:null,map:d.map,cache:d.cache,before:d.before,hasHeights:!1}}function Fi(e,t,n,r,d){t.before&&(n=-1);var k=n+(r||""),K;return t.cache.hasOwnProperty(k)?K=t.cache[k]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Bo(e,t.view,t.rect),t.hasHeights=!0),K=Ho(e,t,n,r),K.bogus||(t.cache[k]=K)),{left:K.left,right:K.right,top:d?K.rtop:K.top,bottom:d?K.rbottom:K.bottom}}var is={left:0,right:0,top:0,bottom:0};function rs(e,t,n){for(var r,d,k,K,J,ee,ne=0;ne<e.length;ne+=3)if(J=e[ne],ee=e[ne+1],t<J?(d=0,k=1,K="left"):t<ee?(d=t-J,k=d+1):(ne==e.length-3||t==ee&&e[ne+3]>t)&&(k=ee-J,d=k-1,t>=ee&&(K="right")),d!=null){if(r=e[ne+2],J==ee&&n==(r.insertLeft?"left":"right")&&(K=n),n=="left"&&d==0)for(;ne&&e[ne-2]==e[ne-3]&&e[ne-1].insertLeft;)r=e[(ne-=3)+2],K="left";if(n=="right"&&d==ee-J)for(;ne<e.length-3&&e[ne+3]==e[ne+4]&&!e[ne+5].insertLeft;)r=e[(ne+=3)+2],K="right";break}return{node:r,start:d,end:k,collapse:K,coverStart:J,coverEnd:ee}}function jo(e,t){var n=is;if(t=="left")for(var r=0;r<e.length&&!((n=e[r]).left!=n.right);r++);else for(var d=e.length-1;d>=0&&!((n=e[d]).left!=n.right);d--);return n}function Ho(e,t,n,r){var d=rs(t.map,n,r),k=d.node,K=d.start,J=d.end,ee=d.collapse,ne;if(k.nodeType==3){for(var be=0;be<4;be++){for(;K&&we(t.line.text.charAt(d.coverStart+K));)--K;for(;d.coverStart+J<d.coverEnd&&we(t.line.text.charAt(d.coverStart+J));)++J;if(W&&H<9&&K==0&&J==d.coverEnd-d.coverStart?ne=k.parentNode.getBoundingClientRect():ne=jo(y(k,K,J).getClientRects(),r),ne.left||ne.right||K==0)break;J=K,K=K-1,ee="right"}W&&H<11&&(ne=Wo(e.display.measure,ne))}else{K>0&&(ee=r="right");var Ee;e.options.lineWrapping&&(Ee=k.getClientRects()).length>1?ne=Ee[r=="right"?Ee.length-1:0]:ne=k.getBoundingClientRect()}if(W&&H<9&&!K&&(!ne||!ne.left&&!ne.right)){var Ie=k.parentNode.getClientRects()[0];Ie?ne={left:Ie.left,right:Ie.left+Lr(e.display),top:Ie.top,bottom:Ie.bottom}:ne=is}for(var Re=ne.top-t.rect.top,Fe=ne.bottom-t.rect.top,Ue=(Re+Fe)/2,Ye=t.view.measure.heights,Xe=0;Xe<Ye.length-1&&!(Ue<Ye[Xe]);Xe++);var it=Xe?Ye[Xe-1]:0,$e=Ye[Xe],nt={left:(ee=="right"?ne.right:ne.left)-t.rect.left,right:(ee=="left"?ne.left:ne.right)-t.rect.left,top:it,bottom:$e};return!ne.left&&!ne.right&&(nt.bogus=!0),e.options.singleCursorHeightPerLine||(nt.rtop=Re,nt.rbottom=Fe),nt}function Wo(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Bt(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function ns(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function as(e){e.display.externalMeasure=null,w(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ns(e.display.view[t])}function an(e){as(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ss(){return v&&o?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function os(){return v&&o?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function pa(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=nn(e.widgets[n]));return t}function Bn(e,t,n,r,d){if(!d){var k=pa(t);n.top+=k,n.bottom+=k}if(r=="line")return n;r||(r="local");var K=Ii(t);if(r=="local"?K+=Fn(e.display):K-=e.display.viewOffset,r=="page"||r=="window"){var J=e.display.lineSpace.getBoundingClientRect();K+=J.top+(r=="window"?0:os());var ee=J.left+(r=="window"?0:ss());n.left+=ee,n.right+=ee}return n.top+=K,n.bottom+=K,n}function ls(e,t,n){if(n=="div")return t;var r=t.left,d=t.top;if(n=="page")r-=ss(),d-=os();else if(n=="local"||!n){var k=e.display.sizer.getBoundingClientRect();r+=k.left,d+=k.top}var K=e.display.lineSpace.getBoundingClientRect();return{left:r-K.left,top:d-K.top}}function ma(e,t,n,r,d){return r||(r=Qe(e.doc,t.line)),Bn(e,r,ts(e,r,t.ch,d),n)}function Di(e,t,n,r,d,k){r=r||Qe(e.doc,t.line),d||(d=Or(e,r));function K(Fe,Ue){var Ye=Fi(e,d,Fe,Ue?"right":"left",k);return Ue?Ye.left=Ye.right:Ye.right=Ye.left,Bn(e,r,Ye,n)}var J=je(r,e.doc.direction),ee=t.ch,ne=t.sticky;if(ee>=r.text.length?(ee=r.text.length,ne="before"):ee<=0&&(ee=0,ne="after"),!J)return K(ne=="before"?ee-1:ee,ne=="before");function be(Fe,Ue,Ye){var Xe=J[Ue],it=Xe.level==1;return K(Ye?Fe-1:Fe,it!=Ye)}var Ee=He(J,ee,ne),Ie=Ge,Re=be(ee,Ee,ne=="before");return Ie!=null&&(Re.other=be(ee,Ie,ne!="before")),Re}function us(e,t){var n=0;t=gt(e.doc,t),e.options.lineWrapping||(n=Lr(e.display)*t.ch);var r=Qe(e.doc,t.line),d=Ii(r)+Fn(e.display);return{left:n,right:n,top:d,bottom:d+r.height}}function ga(e,t,n,r,d){var k=We(e,t,n);return k.xRel=d,r&&(k.outside=r),k}function va(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return ga(r.first,0,null,-1,-1);var d=wt(r,n),k=r.first+r.size-1;if(d>k)return ga(r.first+r.size-1,Qe(r,k).text.length,null,1,1);t<0&&(t=0);for(var K=Qe(r,d);;){var J=Go(e,K,d,t,n),ee=Cr(K,J.ch+(J.xRel>0||J.outside>0?1:0));if(!ee)return J;var ne=ee.find(1);if(ne.line==d)return ne;K=Qe(r,d=ne.line)}}function hs(e,t,n,r){r-=pa(t);var d=t.text.length,k=Ne(function(K){return Fi(e,n,K-1).bottom<=r},d,0);return d=Ne(function(K){return Fi(e,n,K).top>r},k,d),{begin:k,end:d}}function ds(e,t,n,r){n||(n=Or(e,t));var d=Bn(e,t,Fi(e,n,r),"line").top;return hs(e,t,n,d)}function ya(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function Go(e,t,n,r,d){d-=Ii(t);var k=Or(e,t),K=pa(t),J=0,ee=t.text.length,ne=!0,be=je(t,e.doc.direction);if(be){var Ee=(e.options.lineWrapping?zo:Ko)(e,t,n,k,be,r,d);ne=Ee.level!=1,J=ne?Ee.from:Ee.to-1,ee=ne?Ee.to:Ee.from-1}var Ie=null,Re=null,Fe=Ne(function(ht){var lt=Fi(e,k,ht);return lt.top+=K,lt.bottom+=K,ya(lt,r,d,!1)?(lt.top<=d&<.left<=r&&(Ie=ht,Re=lt),!0):!1},J,ee),Ue,Ye,Xe=!1;if(Re){var it=r-Re.left<Re.right-r,$e=it==ne;Fe=Ie+($e?0:1),Ye=$e?"after":"before",Ue=it?Re.left:Re.right}else{!ne&&(Fe==ee||Fe==J)&&Fe++,Ye=Fe==0?"after":Fe==t.text.length?"before":Fi(e,k,Fe-(ne?1:0)).bottom+K<=d==ne?"after":"before";var nt=Di(e,We(n,Fe,Ye),"line",t,k);Ue=nt.left,Xe=d<nt.top?-1:d>=nt.bottom?1:0}return Fe=Ae(t.text,Fe,1),ga(n,Fe,Ye,Xe,r-Ue)}function Ko(e,t,n,r,d,k,K){var J=Ne(function(Ee){var Ie=d[Ee],Re=Ie.level!=1;return ya(Di(e,We(n,Re?Ie.to:Ie.from,Re?"before":"after"),"line",t,r),k,K,!0)},0,d.length-1),ee=d[J];if(J>0){var ne=ee.level!=1,be=Di(e,We(n,ne?ee.from:ee.to,ne?"after":"before"),"line",t,r);ya(be,k,K,!0)&&be.top>K&&(ee=d[J-1])}return ee}function zo(e,t,n,r,d,k,K){var J=hs(e,t,r,K),ee=J.begin,ne=J.end;/\s/.test(t.text.charAt(ne-1))&&ne--;for(var be=null,Ee=null,Ie=0;Ie<d.length;Ie++){var Re=d[Ie];if(Re.from>=ne||Re.to<=ee)continue;var Fe=Re.level!=1,Ue=Fi(e,r,Fe?Math.min(ne,Re.to)-1:Math.max(ee,Re.from)).right,Ye=Ue<k?k-Ue+1e9:Ue-k;(!be||Ee>Ye)&&(be=Re,Ee=Ye)}return be||(be=d[d.length-1]),be.from<ee&&(be={from:ee,to:be.to,level:be.level}),be.to>ne&&(be={from:be.from,to:ne,level:be.level}),be}var hr;function Rr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(hr==null){hr=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)hr.appendChild(document.createTextNode("x")),hr.appendChild(c("br"));hr.appendChild(document.createTextNode("x"))}E(e.measure,hr);var n=hr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),w(e.measure),n||1}function Lr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),n=c("pre",[t],"CodeMirror-line-like");E(e.measure,n);var r=t.getBoundingClientRect(),d=(r.right-r.left)/10;return d>2&&(e.cachedCharWidth=d),d||10}function ba(e){for(var t=e.display,n={},r={},d=t.gutters.clientLeft,k=t.gutters.firstChild,K=0;k;k=k.nextSibling,++K){var J=e.display.gutterSpecs[K].className;n[J]=k.offsetLeft+k.clientLeft+d,r[J]=k.clientWidth}return{fixedPos:_a(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function _a(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function cs(e){var t=Rr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Lr(e.display)-3);return function(d){if(Pi(e.doc,d))return 0;var k=0;if(d.widgets)for(var K=0;K<d.widgets.length;K++)d.widgets[K].height&&(k+=d.widgets[K].height);return n?k+(Math.ceil(d.text.length/r)||1)*t:k+t}}function Ea(e){var t=e.doc,n=cs(e);t.iter(function(r){var d=n(r);d!=r.height&&ct(r,d)})}function dr(e,t,n,r){var d=e.display;if(!n&&xe(t).getAttribute("cm-not-content")=="true")return null;var k,K,J=d.lineSpace.getBoundingClientRect();try{k=t.clientX-J.left,K=t.clientY-J.top}catch(Ee){return null}var ee=va(e,k,K),ne;if(r&&ee.xRel>0&&(ne=Qe(e.doc,ee.line).text).length==ee.ch){var be=Y(ne,ne.length,e.options.tabSize)-ne.length;ee=We(ee.line,Math.max(0,Math.round((k-qa(e.display).left)/Lr(e.display))-be))}return ee}function cr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function pi(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var d=e.display;if(r&&n<d.viewTo&&(d.updateLineNumbers==null||d.updateLineNumbers>t)&&(d.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=d.viewTo)li&&Zr(e.doc,t)<d.viewTo&&$i(e);else if(n<=d.viewFrom)li&&Yi(e.doc,n+r)>d.viewFrom?$i(e):(d.viewFrom+=r,d.viewTo+=r);else if(t<=d.viewFrom&&n>=d.viewTo)$i(e);else if(t<=d.viewFrom){var k=Un(e,n,n+r,1);k?(d.view=d.view.slice(k.index),d.viewFrom=k.lineN,d.viewTo+=r):$i(e)}else if(n>=d.viewTo){var K=Un(e,t,t,-1);K?(d.view=d.view.slice(0,K.index),d.viewTo=K.lineN):$i(e)}else{var J=Un(e,t,t,-1),ee=Un(e,n,n+r,1);J&&ee?(d.view=d.view.slice(0,J.index).concat(fi(e,J.lineN,ee.lineN)).concat(d.view.slice(ee.index)),d.viewTo+=r):$i(e)}var ne=d.externalMeasured;ne&&(n<ne.lineN?ne.lineN+=r:t<ne.lineN+ne.size&&(d.externalMeasured=null))}function Xi(e,t,n){e.curOp.viewChanged=!0;var r=e.display,d=e.display.externalMeasured;if(d&&t>=d.lineN&&t<d.lineN+d.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var k=r.view[cr(e,t)];if(k.node==null)return;var K=k.changes||(k.changes=[]);fe(K,n)==-1&&K.push(n)}function $i(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Un(e,t,n,r){var d=cr(e,t),k,K=e.display.view;if(!li||n==e.doc.first+e.doc.size)return{index:d,lineN:n};for(var J=e.display.viewFrom,ee=0;ee<d;ee++)J+=K[ee].size;if(J!=t){if(r>0){if(d==K.length-1)return null;k=J+K[d].size-t,d++}else k=J-t;t+=k,n+=k}for(;Zr(e.doc,n)!=n;){if(d==(r<0?0:K.length-1))return null;n+=r*K[d-(r<0?1:0)].size,d+=r}return{index:d,lineN:n}}function Vo(e,t,n){var r=e.display,d=r.view;d.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=fi(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=fi(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(cr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(fi(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,cr(e,n)))),r.viewTo=n}function fs(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var d=t[r];!d.hidden&&(!d.node||d.changes)&&++n}return n}function sn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ps(e,t){t===void 0&&(t=!0);for(var n=e.doc,r={},d=r.cursors=document.createDocumentFragment(),k=r.selection=document.createDocumentFragment(),K=0;K<n.sel.ranges.length;K++){if(!t&&K==n.sel.primIndex)continue;var J=n.sel.ranges[K];if(J.from().line>=e.display.viewTo||J.to().line<e.display.viewFrom)continue;var ee=J.empty();(ee||e.options.showCursorWhenSelecting)&&ms(e,J.head,d),ee||Yo(e,J,k)}return r}function ms(e,t,n){var r=Di(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),d=n.appendChild(c("div","\xA0","CodeMirror-cursor"));if(d.style.left=r.left+"px",d.style.top=r.top+"px",d.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var k=n.appendChild(c("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));k.style.display="",k.style.left=r.other.left+"px",k.style.top=r.other.top+"px",k.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function jn(e,t){return e.top-t.top||e.left-t.left}function Yo(e,t,n){var r=e.display,d=e.doc,k=document.createDocumentFragment(),K=qa(e.display),J=K.left,ee=Math.max(r.sizerWidth,ur(e)-r.sizer.offsetLeft)-K.right,ne=d.direction=="ltr";function be($e,nt,ht,lt){nt<0&&(nt=0),nt=Math.round(nt),lt=Math.round(lt),k.appendChild(c("div",null,"CodeMirror-selected","position: absolute; left: "+$e+`px;
|
|
top: `+nt+"px; width: "+(ht==null?ee-$e:ht)+`px;
|
|
height: `+(lt-nt)+"px"))}function Ee($e,nt,ht){var lt=Qe(d,$e),bt=lt.text.length,Nt,Zt;function Wt(Vt,vi){return ma(e,We($e,Vt),"div",lt,vi)}function _i(Vt,vi,ti){var $t=ds(e,lt,null,Vt),Yt=vi=="ltr"==(ti=="after")?"left":"right",Gt=ti=="after"?$t.begin:$t.end-(/\s/.test(lt.text.charAt($t.end-1))?2:1);return Wt(Gt,Yt)[Yt]}var gi=je(lt,d.direction);return Be(gi,nt||0,ht==null?bt:ht,function(Vt,vi,ti,$t){var Yt=ti=="ltr",Gt=Wt(Vt,Yt?"left":"right"),yi=Wt(vi-1,Yt?"right":"left"),Gr=nt==null&&Vt==0,tr=ht==null&&vi==bt,ai=$t==0,Bi=!gi||$t==gi.length-1;if(yi.top-Gt.top<=3){var qt=(ne?Gr:tr)&&ai,Va=(ne?tr:Gr)&&Bi,zi=qt?J:(Yt?Gt:yi).left,vr=Va?ee:(Yt?yi:Gt).right;be(zi,Gt.top,vr-zi,Gt.bottom)}else{var yr,hi,Kr,Ya;Yt?(yr=ne&&Gr&&ai?J:Gt.left,hi=ne?ee:_i(Vt,ti,"before"),Kr=ne?J:_i(vi,ti,"after"),Ya=ne&&tr&&Bi?ee:yi.right):(yr=ne?_i(Vt,ti,"before"):J,hi=!ne&&Gr&&ai?ee:Gt.right,Kr=!ne&&tr&&Bi?J:yi.left,Ya=ne?_i(vi,ti,"after"):ee),be(yr,Gt.top,hi-yr,Gt.bottom),Gt.bottom<yi.top&&be(J,Gt.bottom,null,yi.top),be(Kr,yi.top,Ya-Kr,yi.bottom)}(!Nt||jn(Gt,Nt)<0)&&(Nt=Gt),jn(yi,Nt)<0&&(Nt=yi),(!Zt||jn(Gt,Zt)<0)&&(Zt=Gt),jn(yi,Zt)<0&&(Zt=yi)}),{start:Nt,end:Zt}}var Ie=t.from(),Re=t.to();if(Ie.line==Re.line)Ee(Ie.line,Ie.ch,Re.ch);else{var Fe=Qe(d,Ie.line),Ue=Qe(d,Re.line),Ye=xi(Fe)==xi(Ue),Xe=Ee(Ie.line,Ie.ch,Ye?Fe.text.length+1:null).end,it=Ee(Re.line,Ye?0:null,Re.ch).start;Ye&&(Xe.top<it.top-2?(be(Xe.right,Xe.top,null,Xe.bottom),be(J,it.top,it.left,it.bottom)):be(Xe.right,Xe.top,it.left-Xe.right,Xe.bottom)),Xe.bottom<it.top&&be(J,Xe.bottom,null,it.top)}n.appendChild(k)}function xa(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ir(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function gs(e){e.state.focused||(e.display.input.focus(),Ta(e))}function vs(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ir(e))},100)}function Ta(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(le(e,"focus",e,t),e.state.focused=!0,U(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 Ir(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(le(e,"blur",e,t),e.state.focused=!1,S(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Hn(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var d=t.view[r],k=e.options.lineWrapping,K=void 0,J=0;if(d.hidden)continue;if(W&&H<8){var ee=d.node.offsetTop+d.node.offsetHeight;K=ee-n,n=ee}else{var ne=d.node.getBoundingClientRect();K=ne.bottom-ne.top,!k&&d.text.firstChild&&(J=d.text.firstChild.getBoundingClientRect().right-ne.left-1)}var be=d.line.height-K;if((be>.005||be<-.005)&&(ct(d.line,K),ys(d.line),d.rest))for(var Ee=0;Ee<d.rest.length;Ee++)ys(d.rest[Ee]);if(J>e.display.sizerWidth){var Ie=Math.ceil(J/Lr(e.display));Ie>e.display.maxLineLength&&(e.display.maxLineLength=Ie,e.display.maxLine=d.line,e.display.maxLineChanged=!0)}}}function ys(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Wn(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Fn(e));var d=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,k=wt(t,r),K=wt(t,d);if(n&&n.ensure){var J=n.ensure.from.line,ee=n.ensure.to.line;J<k?(k=J,K=wt(t,Ii(Qe(t,J))+e.wrapper.clientHeight)):Math.min(ee,t.lastLine())>=K&&(k=wt(t,Ii(Qe(t,ee))-e.wrapper.clientHeight),K=ee)}return{from:k,to:Math.max(K,k+1)}}function Xo(e,t){if(q(e,"scrollCursorIntoView"))return;var n=e.display,r=n.sizer.getBoundingClientRect(),d=null;if(t.top+r.top<0?d=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(d=!1),d!=null&&!h){var k=c("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-n.viewOffset-Fn(e.display))+`px;
|
|
height: `+(t.bottom-t.top+Ni(e)+n.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(k),k.scrollIntoView(d),e.display.lineSpace.removeChild(k)}}function $o(e,t,n,r){r==null&&(r=0);var d;!e.options.lineWrapping&&t==n&&(t=t.ch?We(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,n=t.sticky=="before"?We(t.line,t.ch+1,"before"):t);for(var k=0;k<5;k++){var K=!1,J=Di(e,t),ee=!n||n==t?J:Di(e,n);d={left:Math.min(J.left,ee.left),top:Math.min(J.top,ee.top)-r,right:Math.max(J.left,ee.left),bottom:Math.max(J.bottom,ee.bottom)+r};var ne=wa(e,d),be=e.doc.scrollTop,Ee=e.doc.scrollLeft;if(ne.scrollTop!=null&&(ln(e,ne.scrollTop),Math.abs(e.doc.scrollTop-be)>1&&(K=!0)),ne.scrollLeft!=null&&(fr(e,ne.scrollLeft),Math.abs(e.doc.scrollLeft-Ee)>1&&(K=!0)),!K)break}return d}function Jo(e,t){var n=wa(e,t);n.scrollTop!=null&&ln(e,n.scrollTop),n.scrollLeft!=null&&fr(e,n.scrollLeft)}function wa(e,t){var n=e.display,r=Rr(e.display);t.top<0&&(t.top=0);var d=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,k=ca(e),K={};t.bottom-t.top>k&&(t.bottom=t.top+k);var J=e.doc.height+da(n),ee=t.top<r,ne=t.bottom>J-r;if(t.top<d)K.scrollTop=ee?0:t.top;else if(t.bottom>d+k){var be=Math.min(t.top,(ne?J:t.bottom)-k);be!=d&&(K.scrollTop=be)}var Ee=e.options.fixedGutter?0:n.gutters.offsetWidth,Ie=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-Ee,Re=ur(e)-n.gutters.offsetWidth,Fe=t.right-t.left>Re;return Fe&&(t.right=t.left+Re),t.left<10?K.scrollLeft=0:t.left<Ie?K.scrollLeft=Math.max(0,t.left+Ee-(Fe?0:10)):t.right>Re+Ie-3&&(K.scrollLeft=t.right+(Fe?0:10)-Re),K}function Sa(e,t){if(t==null)return;Gn(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Dr(e){Gn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function on(e,t,n){(t!=null||n!=null)&&Gn(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Qo(e,t){Gn(e),e.curOp.scrollToPos=t}function Gn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=us(e,t.from),r=us(e,t.to);bs(e,n,r,t.margin)}}function bs(e,t,n,r){var d=wa(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});on(e,d.scrollLeft,d.scrollTop)}function ln(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;M||Aa(e,{top:t}),_s(e,t,!0),M&&Aa(e),dn(e,100)}function _s(e,t,n){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!n)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function fr(e,t,n,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,Ss(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function un(e){var t=e.display,n=t.gutters.offsetWidth,r=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?n:0,docHeight:r,scrollHeight:r+Ni(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var pr=function(e,t,n){this.cm=n;var r=this.vert=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),d=this.horiz=c("div",[c("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=d.tabIndex=-1,e(r),e(d),Me(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Me(d,"scroll",function(){d.clientWidth&&t(d.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,W&&H<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};pr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var d=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+d)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var k=e.viewWidth-e.barLeft-(n?r: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&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},pr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},pr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},pr.prototype.zeroWidthHack=function(){var e=s&&!l?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new re,this.disableVert=new re},pr.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto";function r(){var d=e.getBoundingClientRect(),k=n=="vert"?document.elementFromPoint(d.right-1,(d.top+d.bottom)/2):document.elementFromPoint((d.right+d.left)/2,d.bottom-1);k!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},pr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var hn=function(){};hn.prototype.update=function(){return{bottom:0,right:0}},hn.prototype.setScrollLeft=function(){},hn.prototype.setScrollTop=function(){},hn.prototype.clear=function(){};function kr(e,t){t||(t=un(e));var n=e.display.barWidth,r=e.display.barHeight;Es(e,t);for(var d=0;d<4&&n!=e.display.barWidth||r!=e.display.barHeight;d++)n!=e.display.barWidth&&e.options.lineWrapping&&Hn(e),Es(e,un(e)),n=e.display.barWidth,r=e.display.barHeight}function Es(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var xs={native:pr,null:hn};function Ts(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&S(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new xs[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Me(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?fr(e,t):ln(e,t)},e),e.display.scrollbars.addClass&&U(e.display.wrapper,e.display.scrollbars.addClass)}var Zo=0;function mr(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},Ci(e.curOp)}function gr(e){var t=e.curOp;t&&Io(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;qo(n)})}function qo(e){for(var t=e.ops,n=0;n<t.length;n++)el(t[n]);for(var r=0;r<t.length;r++)tl(t[r]);for(var d=0;d<t.length;d++)il(t[d]);for(var k=0;k<t.length;k++)rl(t[k]);for(var K=0;K<t.length;K++)nl(t[K])}function el(e){var t=e.cm,n=t.display;sl(t),e.updateMaxLine&&Nn(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Kn(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,n=t.display;e.updatedDisplay&&Hn(t),e.barMeasure=un(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ts(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Ni(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-ur(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function rl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&fr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==F();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&kr(t,e.barMeasure),e.updatedDisplay&&Ra(t,e.barMeasure),e.selectionChanged&&xa(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&gs(e.cm)}function nl(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&ws(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&_s(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&fr(t,e.scrollLeft,!0,!0),e.scrollToPos){var d=$o(t,gt(r,e.scrollToPos.from),gt(r,e.scrollToPos.to),e.scrollToPos.margin);Xo(t,d)}var k=e.maybeHiddenMarkers,K=e.maybeUnhiddenMarkers;if(k)for(var J=0;J<k.length;++J)k[J].lines.length||le(k[J],"hide");if(K)for(var ee=0;ee<K.length;++ee)K[ee].lines.length&&le(K[ee],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&le(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function bi(e,t){if(e.curOp)return t();mr(e);try{return t()}finally{gr(e)}}function Jt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);mr(e);try{return t.apply(e,arguments)}finally{gr(e)}}}function ui(e){return function(){if(this.curOp)return e.apply(this,arguments);mr(this);try{return e.apply(this,arguments)}finally{gr(this)}}}function Qt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);mr(t);try{return e.apply(this,arguments)}finally{gr(t)}}}function dn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,N(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var n=+new Date+e.options.workTime,r=Ai(e,t.highlightFrontier),d=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(k){if(r.line>=e.display.viewFrom){var K=k.styles,J=k.text.length>e.options.maxHighlightLength?Et(t.mode,r.state):null,ee=zr(e,k,r,!0);J&&(r.state=J),k.styles=ee.styles;var ne=k.styleClasses,be=ee.classes;be?k.styleClasses=be:ne&&(k.styleClasses=null);for(var Ee=!K||K.length!=k.styles.length||ne!=be&&(!ne||!be||ne.bgClass!=be.bgClass||ne.textClass!=be.textClass),Ie=0;!Ee&&Ie<K.length;++Ie)Ee=K[Ie]!=k.styles[Ie];Ee&&d.push(r.line),k.stateAfter=r.save(),r.nextLine()}else k.text.length<=e.options.maxHighlightLength&&Vr(e,k.text,r),k.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return dn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),d.length&&bi(e,function(){for(var k=0;k<d.length;k++)Xi(e,d[k],"text")})}var Kn=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Wn(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=ur(e),this.force=n,this.dims=ba(e),this.events=[]};Kn.prototype.signal=function(e,t){se(e,t)&&this.events.push(arguments)},Kn.prototype.finish=function(){for(var e=0;e<this.events.length;e++)le.apply(null,this.events[e])};function sl(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ni(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ni(e)+"px",t.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var t=F();if(!t||!g(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&g(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function ll(e){if(!e||!e.activeElt||e.activeElt==F())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&g(document.body,e.anchorNode)&&g(document.body,e.focusNode)){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function Ca(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return $i(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&fs(e)==0)return!1;Cs(e)&&($i(e),t.dims=ba(e));var d=r.first+r.size,k=Math.max(t.visible.from-e.options.viewportMargin,r.first),K=Math.min(d,t.visible.to+e.options.viewportMargin);n.viewFrom<k&&k-n.viewFrom<20&&(k=Math.max(r.first,n.viewFrom)),n.viewTo>K&&n.viewTo-K<20&&(K=Math.min(d,n.viewTo)),li&&(k=Zr(e.doc,k),K=Yi(e.doc,K));var J=k!=n.viewFrom||K!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Vo(e,k,K),n.viewOffset=Ii(Qe(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var ee=fs(e);if(!J&&ee==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var ne=ol(e);return ee>4&&(n.lineDiv.style.display="none"),ul(e,n.updateLineNumbers,t.dims),ee>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,ll(ne),w(n.cursorDiv),w(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,J&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,dn(e,400)),n.updateLineNumbers=null,!0}function ws(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==ur(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+da(e.display)-ca(e),n.top)}),t.visible=Wn(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Wn(e.display,e.doc,n));if(!Ca(e,t))break;Hn(e);var d=un(e);sn(e),kr(e,d),Ra(e,d),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Aa(e,t){var n=new Kn(e,t);if(Ca(e,n)){Hn(e),ws(e,n);var r=un(e);sn(e),kr(e,r),Ra(e,r),n.finish()}}function ul(e,t,n){var r=e.display,d=e.options.lineNumbers,k=r.lineDiv,K=k.firstChild;function J(Fe){var Ue=Fe.nextSibling;return i&&s&&e.display.currentWheelTarget==Fe?Fe.style.display="none":Fe.parentNode.removeChild(Fe),Ue}for(var ee=r.view,ne=r.viewFrom,be=0;be<ee.length;be++){var Ee=ee[be];if(!Ee.hidden)if(!Ee.node||Ee.node.parentNode!=k){var Ie=No(e,Ee,ne,n);k.insertBefore(Ie,K)}else{for(;K!=Ee.node;)K=J(K);var Re=d&&t!=null&&t<=ne&&Ee.lineNumber;Ee.changes&&(fe(Ee.changes,"gutter")>-1&&(Re=!1),Xa(e,Ee,ne,n)),Re&&(w(Ee.lineNumber),Ee.lineNumber.appendChild(document.createTextNode(Ut(e.options,ne)))),K=Ee.node.nextSibling}ne+=Ee.size}for(;K;)K=J(K)}function Oa(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Ra(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+Ni(e)+"px"}function Ss(e){var t=e.display,n=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=_a(t)-t.scroller.scrollLeft+e.doc.scrollLeft,d=t.gutters.offsetWidth,k=r+"px",K=0;K<n.length;K++)if(!n[K].hidden){e.options.fixedGutter&&(n[K].gutter&&(n[K].gutter.style.left=k),n[K].gutterBackground&&(n[K].gutterBackground.style.left=k));var J=n[K].alignable;if(J)for(var ee=0;ee<J.length;ee++)J[ee].style.left=k}e.options.fixedGutter&&(t.gutters.style.left=r+d+"px")}function Cs(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=Ut(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var d=r.measure.appendChild(c("div",[c("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),k=d.firstChild.offsetWidth,K=d.offsetWidth-k;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(k,r.lineGutter.offsetWidth-K)+1,r.lineNumWidth=r.lineNumInnerWidth+K,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Oa(e.display),!0}return!1}function La(e,t){for(var n=[],r=!1,d=0;d<e.length;d++){var k=e[d],K=null;if(typeof k!="string"&&(K=k.style,k=k.className),k=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:k,style:K})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function As(e){var t=e.gutters,n=e.gutterSpecs;w(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var d=n[r],k=d.className,K=d.style,J=t.appendChild(c("div",null,"CodeMirror-gutter "+k));K&&(J.style.cssText=K),k=="CodeMirror-linenumbers"&&(e.lineGutter=J,J.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Oa(e)}function cn(e){As(e.display),pi(e),Ss(e)}function hl(e,t,n,r){var d=this;this.input=n,d.scrollbarFiller=c("div",null,"CodeMirror-scrollbar-filler"),d.scrollbarFiller.setAttribute("cm-not-content","true"),d.gutterFiller=c("div",null,"CodeMirror-gutter-filler"),d.gutterFiller.setAttribute("cm-not-content","true"),d.lineDiv=x("div",null,"CodeMirror-code"),d.selectionDiv=c("div",null,null,"position: relative; z-index: 1"),d.cursorDiv=c("div",null,"CodeMirror-cursors"),d.measure=c("div",null,"CodeMirror-measure"),d.lineMeasure=c("div",null,"CodeMirror-measure"),d.lineSpace=x("div",[d.measure,d.lineMeasure,d.selectionDiv,d.cursorDiv,d.lineDiv],null,"position: relative; outline: none");var k=x("div",[d.lineSpace],"CodeMirror-lines");d.mover=c("div",[k],null,"position: relative"),d.sizer=c("div",[d.mover],"CodeMirror-sizer"),d.sizerWidth=null,d.heightForcer=c("div",null,null,"position: absolute; height: "+ve+"px; width: 1px;"),d.gutters=c("div",null,"CodeMirror-gutters"),d.lineGutter=null,d.scroller=c("div",[d.sizer,d.heightForcer,d.gutters],"CodeMirror-scroll"),d.scroller.setAttribute("tabIndex","-1"),d.wrapper=c("div",[d.scrollbarFiller,d.gutterFiller,d.scroller],"CodeMirror"),W&&H<8&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),!i&&!(M&&u)&&(d.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(d.wrapper):e(d.wrapper)),d.viewFrom=d.viewTo=t.first,d.reportedViewFrom=d.reportedViewTo=t.first,d.view=[],d.renderedView=null,d.externalMeasured=null,d.viewOffset=0,d.lastWrapHeight=d.lastWrapWidth=0,d.updateLineNumbers=null,d.nativeBarWidth=d.barHeight=d.barWidth=0,d.scrollbarsClipped=!1,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.alignWidgets=!1,d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d.shift=!1,d.selForContextMenu=null,d.activeTouch=null,d.gutterSpecs=La(r.gutters,r.lineNumbers),As(d),n.init(d)}var zn=0,Ti=null;W?Ti=-.53:M?Ti=15:v?Ti=-.7:p&&(Ti=-1/3);function Os(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function dl(e){var t=Os(e);return t.x*=Ti,t.y*=Ti,t}function Rs(e,t){var n=Os(t),r=n.x,d=n.y,k=e.display,K=k.scroller,J=K.scrollWidth>K.clientWidth,ee=K.scrollHeight>K.clientHeight;if(!(r&&J||d&&ee))return;if(d&&s&&i){e:for(var ne=t.target,be=k.view;ne!=K;ne=ne.parentNode)for(var Ee=0;Ee<be.length;Ee++)if(be[Ee].node==ne){e.display.currentWheelTarget=ne;break e}}if(r&&!M&&!m&&Ti!=null){d&&ee&&ln(e,Math.max(0,K.scrollTop+d*Ti)),fr(e,Math.max(0,K.scrollLeft+r*Ti)),(!d||d&&ee)&&ie(t),k.wheelStartX=null;return}if(d&&Ti!=null){var Ie=d*Ti,Re=e.doc.scrollTop,Fe=Re+k.wrapper.clientHeight;Ie<0?Re=Math.max(0,Re+Ie-50):Fe=Math.min(e.doc.height,Fe+Ie+50),Aa(e,{top:Re,bottom:Fe})}zn<20&&(k.wheelStartX==null?(k.wheelStartX=K.scrollLeft,k.wheelStartY=K.scrollTop,k.wheelDX=r,k.wheelDY=d,setTimeout(function(){if(k.wheelStartX==null)return;var Ue=K.scrollLeft-k.wheelStartX,Ye=K.scrollTop-k.wheelStartY,Xe=Ye&&k.wheelDY&&Ye/k.wheelDY||Ue&&k.wheelDX&&Ue/k.wheelDX;if(k.wheelStartX=k.wheelStartY=null,!Xe)return;Ti=(Ti*zn+Xe)/(zn+1),++zn},200)):(k.wheelDX+=r,k.wheelDY+=d))}var wi=function(e,t){this.ranges=e,this.primIndex=t};wi.prototype.primary=function(){return this.ranges[this.primIndex]},wi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!ir(n.anchor,r.anchor)||!ir(n.head,r.head))return!1}return!0},wi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Dt(br(this.ranges[t].anchor),br(this.ranges[t].head));return new wi(e,this.primIndex)},wi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},wi.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(ft(t,r.from())>=0&&ft(e,r.to())<=0)return n}return-1};var Dt=function(e,t){this.anchor=e,this.head=t};Dt.prototype.from=function(){return rr(this.anchor,this.head)},Dt.prototype.to=function(){return _r(this.anchor,this.head)},Dt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ki(e,t,n){var r=e&&e.options.selectionsMayTouch,d=t[n];t.sort(function(Ie,Re){return ft(Ie.from(),Re.from())}),n=fe(t,d);for(var k=1;k<t.length;k++){var K=t[k],J=t[k-1],ee=ft(J.to(),K.from());if(r&&!K.empty()?ee>0:ee>=0){var ne=rr(J.from(),K.from()),be=_r(J.to(),K.to()),Ee=J.empty()?K.from()==K.head:J.from()==J.head;k<=n&&--n,t.splice(--k,2,new Dt(Ee?be:ne,Ee?ne:be))}}return new wi(t,n)}function Ji(e,t){return new wi([new Dt(e,t||e)],0)}function Qi(e){return e.text?We(e.from.line+e.text.length-1,D(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ls(e,t){if(ft(e,t.from)<0)return e;if(ft(e,t.to)<=0)return Qi(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Qi(t).ch-t.to.ch),We(n,r)}function Ia(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var d=e.sel.ranges[r];n.push(new Dt(Ls(d.anchor,t),Ls(d.head,t)))}return ki(e.cm,n,e.sel.primIndex)}function Is(e,t,n){return e.line==t.line?We(n.line,e.ch-t.ch+n.ch):We(n.line+(e.line-t.line),e.ch)}function cl(e,t,n){for(var r=[],d=We(e.first,0),k=d,K=0;K<t.length;K++){var J=t[K],ee=Is(J.from,d,k),ne=Is(Qi(J),d,k);if(d=J.to,k=ne,n=="around"){var be=e.sel.ranges[K],Ee=ft(be.head,be.anchor)<0;r[K]=new Dt(Ee?ne:ee,Ee?ee:ne)}else r[K]=new Dt(ee,ee)}return new wi(r,e.sel.primIndex)}function Da(e){e.doc.mode=di(e.options,e.doc.modeOption),fn(e)}function fn(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,dn(e,100),e.state.modeGen++,e.curOp&&pi(e)}function Ds(e,t){return t.from.ch==0&&t.to.ch==0&&D(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ka(e,t,n,r){function d(it){return n?n[it]:null}function k(it,$e,nt){ua(it,$e,nt,r),ei(it,"change",it,t)}function K(it,$e){for(var nt=[],ht=it;ht<$e;++ht)nt.push(new lr(ne[ht],d(ht),r));return nt}var J=t.from,ee=t.to,ne=t.text,be=Qe(e,J.line),Ee=Qe(e,ee.line),Ie=D(ne),Re=d(ne.length-1),Fe=ee.line-J.line;if(t.full)e.insert(0,K(0,ne.length)),e.remove(ne.length,e.size-ne.length);else if(Ds(e,t)){var Ue=K(0,ne.length-1);k(Ee,Ee.text,Re),Fe&&e.remove(J.line,Fe),Ue.length&&e.insert(J.line,Ue)}else if(be==Ee)if(ne.length==1)k(be,be.text.slice(0,J.ch)+Ie+be.text.slice(ee.ch),Re);else{var Ye=K(1,ne.length-1);Ye.push(new lr(Ie+be.text.slice(ee.ch),Re,r)),k(be,be.text.slice(0,J.ch)+ne[0],d(0)),e.insert(J.line+1,Ye)}else if(ne.length==1)k(be,be.text.slice(0,J.ch)+ne[0]+Ee.text.slice(ee.ch),d(0)),e.remove(J.line+1,Fe);else{k(be,be.text.slice(0,J.ch)+ne[0],d(0)),k(Ee,Ie+Ee.text.slice(ee.ch),Re);var Xe=K(1,ne.length-1);Fe>1&&e.remove(J.line+1,Fe-1),e.insert(J.line+1,Xe)}ei(e,"change",e,t)}function Zi(e,t,n){function r(d,k,K){if(d.linked)for(var J=0;J<d.linked.length;++J){var ee=d.linked[J];if(ee.doc==k)continue;var ne=K&&ee.sharedHist;if(n&&!ne)continue;t(ee.doc,ne),r(ee.doc,d,ne)}}r(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||Nn(e),e.options.mode=t.modeOption,pi(e)}function Ms(e){(e.doc.direction=="rtl"?U:S)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){bi(e,function(){Ms(e),pi(e)})}function Vn(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Ma(e,t){var n={from:br(t.from),to:Qi(t),text:Ct(e,t.from,t.to)};return Fs(e,n,t.from.line,t.to.line+1),Zi(e,function(r){return Fs(r,n,t.from.line,t.to.line+1)},!0),n}function Ps(e){for(;e.length;){var t=D(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ps(e.done),D(e.done);if(e.done.length&&!D(e.done).ranges)return D(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),D(e.done)}function Ns(e,t,n,r){var d=e.history;d.undone.length=0;var k=+new Date,K,J;if((d.lastOp==r||d.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&d.lastModTime>k-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(K=pl(d,d.lastOp==r)))J=D(K.changes),ft(t.from,t.to)==0&&ft(t.from,J.to)==0?J.to=Qi(t):K.changes.push(Ma(e,t));else{var ee=D(d.done);for((!ee||!ee.ranges)&&Yn(e.sel,d.done),K={changes:[Ma(e,t)],generation:d.generation},d.done.push(K);d.done.length>d.undoDepth;)d.done.shift(),d.done[0].ranges||d.done.shift()}d.done.push(n),d.generation=++d.maxGeneration,d.lastModTime=d.lastSelTime=k,d.lastOp=d.lastSelOp=r,d.lastOrigin=d.lastSelOrigin=t.origin,J||le(e,"historyAdded")}function ml(e,t,n,r){var d=t.charAt(0);return d=="*"||d=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,n,r){var d=e.history,k=r&&r.origin;n==d.lastSelOp||k&&d.lastSelOrigin==k&&(d.lastModTime==d.lastSelTime&&d.lastOrigin==k||ml(e,k,D(d.done),t))?d.done[d.done.length-1]=t:Yn(t,d.done),d.lastSelTime=+new Date,d.lastSelOrigin=k,d.lastSelOp=n,r&&r.clearRedo!==!1&&Ps(d.undone)}function Yn(e,t){var n=D(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Fs(e,t,n,r){var d=t["spans_"+e.id],k=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(K){K.markedSpans&&((d||(d=t["spans_"+e.id]={}))[k]=K.markedSpans),++k})}function vl(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function yl(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],d=0;d<t.text.length;++d)r.push(vl(n[d]));return r}function Bs(e,t){var n=yl(e,t),r=Tr(e,t);if(!n)return r;if(!r)return n;for(var d=0;d<n.length;++d){var k=n[d],K=r[d];if(k&&K){e:for(var J=0;J<K.length;++J){for(var ee=K[J],ne=0;ne<k.length;++ne)if(k[ne].marker==ee.marker)continue e;k.push(ee)}}else K&&(n[d]=K)}return n}function Mr(e,t,n){for(var r=[],d=0;d<e.length;++d){var k=e[d];if(k.ranges){r.push(n?wi.prototype.deepCopy.call(k):k);continue}var K=k.changes,J=[];r.push({changes:J});for(var ee=0;ee<K.length;++ee){var ne=K[ee],be=void 0;if(J.push({from:ne.from,to:ne.to,text:ne.text}),t)for(var Ee in ne)(be=Ee.match(/^spans_(\d+)$/))&&(fe(t,Number(be[1]))>-1&&(D(J)[Ee]=ne[Ee],delete ne[Ee]))}}return r}function Pa(e,t,n,r){if(r){var d=e.anchor;if(n){var k=ft(t,d)<0;k!=ft(n,d)<0?(d=t,t=n):k!=ft(t,n)<0&&(t=n)}return new Dt(d,t)}else return new Dt(n||t,t)}function Xn(e,t,n,r,d){d==null&&(d=e.cm&&(e.cm.display.shift||e.extend)),ni(e,new wi([Pa(e.sel.primary(),t,n,d)],0),r)}function Us(e,t,n){for(var r=[],d=e.cm&&(e.cm.display.shift||e.extend),k=0;k<e.sel.ranges.length;k++)r[k]=Pa(e.sel.ranges[k],t[k],null,d);var K=ki(e.cm,r,e.sel.primIndex);ni(e,K,n)}function Na(e,t,n,r){var d=e.sel.ranges.slice(0);d[t]=n,ni(e,ki(e.cm,d,e.sel.primIndex),r)}function js(e,t,n,r){ni(e,Ji(t,n),r)}function bl(e,t,n){var r={ranges:t.ranges,update:function(d){this.ranges=[];for(var k=0;k<d.length;k++)this.ranges[k]=new Dt(gt(e,d[k].anchor),gt(e,d[k].head))},origin:n&&n.origin};return le(e,"beforeSelectionChange",e,r),e.cm&&le(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?ki(e.cm,r.ranges,r.ranges.length-1):t}function Hs(e,t,n){var r=e.history.done,d=D(r);d&&d.ranges?(r[r.length-1]=t,$n(e,t,n)):ni(e,t,n)}function ni(e,t,n){$n(e,t,n),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function $n(e,t,n){(se(e,"beforeSelectionChange")||e.cm&&se(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,n));var r=n&&n.bias||(ft(t.primary().head,e.sel.primary().head)<0?-1:1);Ws(e,Ks(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&Dr(e.cm)}function Ws(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,te(e.cm)),ei(e,"cursorActivity",e)}function Gs(e){Ws(e,Ks(e,e.sel,null,!1))}function Ks(e,t,n,r){for(var d,k=0;k<t.ranges.length;k++){var K=t.ranges[k],J=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[k],ee=Jn(e,K.anchor,J&&J.anchor,n,r),ne=Jn(e,K.head,J&&J.head,n,r);(d||ee!=K.anchor||ne!=K.head)&&(d||(d=t.ranges.slice(0,k)),d[k]=new Dt(ee,ne))}return d?ki(e.cm,d,t.primIndex):t}function Pr(e,t,n,r,d){var k=Qe(e,t.line);if(k.markedSpans)for(var K=0;K<k.markedSpans.length;++K){var J=k.markedSpans[K],ee=J.marker,ne="selectLeft"in ee?!ee.selectLeft:ee.inclusiveLeft,be="selectRight"in ee?!ee.selectRight:ee.inclusiveRight;if((J.from==null||(ne?J.from<=t.ch:J.from<t.ch))&&(J.to==null||(be?J.to>=t.ch:J.to>t.ch))){if(d&&(le(ee,"beforeCursorEnter"),ee.explicitlyCleared))if(k.markedSpans){--K;continue}else break;if(!ee.atomic)continue;if(n){var Ee=ee.find(r<0?1:-1),Ie=void 0;if((r<0?be:ne)&&(Ee=zs(e,Ee,-r,Ee&&Ee.line==t.line?k:null)),Ee&&Ee.line==t.line&&(Ie=ft(Ee,n))&&(r<0?Ie<0:Ie>0))return Pr(e,Ee,t,r,d)}var Re=ee.find(r<0?-1:1);return(r<0?ne:be)&&(Re=zs(e,Re,r,Re.line==t.line?k:null)),Re?Pr(e,Re,t,r,d):null}}return t}function Jn(e,t,n,r,d){var k=r||1,K=Pr(e,t,n,k,d)||!d&&Pr(e,t,n,k,!0)||Pr(e,t,n,-k,d)||!d&&Pr(e,t,n,-k,!0);return K||(e.cantEdit=!0,We(e.first,0))}function zs(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?gt(e,We(t.line-1)):null:n>0&&t.ch==(r||Qe(e,t.line)).text.length?t.line<e.first+e.size-1?We(t.line+1,0):null:new We(t.line,t.ch+n)}function Vs(e){e.setSelection(We(e.firstLine(),0),We(e.lastLine()),Se)}function Ys(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(d,k,K,J){d&&(r.from=gt(e,d)),k&&(r.to=gt(e,k)),K&&(r.text=K),J!==void 0&&(r.origin=J)}),le(e,"beforeChange",e,r),e.cm&&le(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Nr(e,t,n){if(e.cm){if(!e.cm.curOp)return Jt(e.cm,Nr)(e,t,n);if(e.cm.state.suppressEdits)return}if((se(e,"beforeChange")||e.cm&&se(e.cm,"beforeChange"))&&(t=Ys(e,t,!0),!t))return;var r=Jr&&!n&&kn(e,t.from,t.to);if(r)for(var d=r.length-1;d>=0;--d)Xs(e,{from:r[d].from,to:r[d].to,text:d?[""]:t.text,origin:t.origin});else Xs(e,t)}function Xs(e,t){if(t.text.length==1&&t.text[0]==""&&ft(t.from,t.to)==0)return;var n=Ia(e,t);Ns(e,t,n,e.cm?e.cm.curOp.id:NaN),pn(e,t,n,Tr(e,t));var r=[];Zi(e,function(d,k){!k&&fe(r,d.history)==-1&&(Zs(d.history,t),r.push(d.history)),pn(d,t,null,Tr(d,t))})}function Qn(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!n)return;for(var d=e.history,k,K=e.sel,J=t=="undo"?d.done:d.undone,ee=t=="undo"?d.undone:d.done,ne=0;ne<J.length&&!(k=J[ne],n?k.ranges&&!k.equals(e.sel):!k.ranges);ne++);if(ne==J.length)return;for(d.lastOrigin=d.lastSelOrigin=null;;)if(k=J.pop(),k.ranges){if(Yn(k,ee),n&&!k.equals(e.sel)){ni(e,k,{clearRedo:!1});return}K=k}else if(r){J.push(k);return}else break;var be=[];Yn(K,ee),ee.push({changes:be,generation:d.generation}),d.generation=k.generation||++d.maxGeneration;for(var Ee=se(e,"beforeChange")||e.cm&&se(e.cm,"beforeChange"),Ie=function(Ue){var Ye=k.changes[Ue];if(Ye.origin=t,Ee&&!Ys(e,Ye,!1))return J.length=0,{};be.push(Ma(e,Ye));var Xe=Ue?Ia(e,Ye):D(J);pn(e,Ye,Xe,Bs(e,Ye)),!Ue&&e.cm&&e.cm.scrollIntoView({from:Ye.from,to:Qi(Ye)});var it=[];Zi(e,function($e,nt){!nt&&fe(it,$e.history)==-1&&(Zs($e.history,Ye),it.push($e.history)),pn($e,Ye,null,Bs($e,Ye))})},Re=k.changes.length-1;Re>=0;--Re){var Fe=Ie(Re);if(Fe)return Fe.v}}function $s(e,t){if(t==0)return;if(e.first+=t,e.sel=new wi(I(e.sel.ranges,function(d){return new Dt(We(d.anchor.line+t,d.anchor.ch),We(d.head.line+t,d.head.ch))}),e.sel.primIndex),e.cm){pi(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Xi(e.cm,r,"gutter")}}function pn(e,t,n,r){if(e.cm&&!e.cm.curOp)return Jt(e.cm,pn)(e,t,n,r);if(t.to.line<e.first){$s(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var d=t.text.length-1-(e.first-t.from.line);$s(e,d),t={from:We(e.first,0),to:We(t.to.line+d,t.to.ch),text:[D(t.text)],origin:t.origin}}var k=e.lastLine();t.to.line>k&&(t={from:t.from,to:We(k,Qe(e,k).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ct(e,t.from,t.to),n||(n=Ia(e,t)),e.cm?_l(e.cm,t,r):ka(e,t,r),$n(e,n,Se),e.cantEdit&&Jn(e,We(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,n){var r=e.doc,d=e.display,k=t.from,K=t.to,J=!1,ee=k.line;e.options.lineWrapping||(ee=pt(xi(Qe(r,k.line))),r.iter(ee,K.line+1,function(Re){if(Re==d.maxLine)return J=!0,!0})),r.sel.contains(t.from,t.to)>-1&&te(e),ka(r,t,n,cs(e)),e.options.lineWrapping||(r.iter(ee,k.line+t.text.length,function(Re){var Fe=en(Re);Fe>d.maxLineLength&&(d.maxLine=Re,d.maxLineLength=Fe,d.maxLineChanged=!0,J=!1)}),J&&(e.curOp.updateMaxLine=!0)),aa(r,k.line),dn(e,400);var ne=t.text.length-(K.line-k.line)-1;t.full?pi(e):k.line==K.line&&t.text.length==1&&!Ds(e.doc,t)?Xi(e,k.line,"text"):pi(e,k.line,K.line+1,ne);var be=se(e,"changes"),Ee=se(e,"change");if(Ee||be){var Ie={from:k,to:K,text:t.text,removed:t.removed,origin:t.origin};Ee&&ei(e,"change",e,Ie),be&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ie)}e.display.selForContextMenu=null}function Fr(e,t,n,r,d){var k;r||(r=n),ft(r,n)<0&&(k=[r,n],n=k[0],r=k[1]),typeof t=="string"&&(t=e.splitLines(t)),Nr(e,{from:n,to:r,text:t,origin:d})}function Js(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Qs(e,t,n,r){for(var d=0;d<e.length;++d){var k=e[d],K=!0;if(k.ranges){k.copied||(k=e[d]=k.deepCopy(),k.copied=!0);for(var J=0;J<k.ranges.length;J++)Js(k.ranges[J].anchor,t,n,r),Js(k.ranges[J].head,t,n,r);continue}for(var ee=0;ee<k.changes.length;++ee){var ne=k.changes[ee];if(n<ne.from.line)ne.from=We(ne.from.line+r,ne.from.ch),ne.to=We(ne.to.line+r,ne.to.ch);else if(t<=ne.to.line){K=!1;break}}K||(e.splice(0,d+1),d=0)}}function Zs(e,t){var n=t.from.line,r=t.to.line,d=t.text.length-(r-n)-1;Qs(e.done,n,r,d),Qs(e.undone,n,r,d)}function mn(e,t,n,r){var d=t,k=t;return typeof t=="number"?k=Qe(e,Er(e,t)):d=pt(t),d==null?null:(r(k,d)&&e.cm&&Xi(e.cm,d,n),k)}function gn(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}gn.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var d=this.lines[n];this.height-=d.height,st(d),ei(d,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function vn(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var d=e[r];t+=d.chunkSize(),n+=d.height,d.parent=this}this.size=t,this.height=n,this.parent=null}vn.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],d=r.chunkSize();if(e<d){var k=Math.min(t,d-e),K=r.height;if(r.removeInner(e,k),this.height-=K-r.height,d==k&&(this.children.splice(n--,1),r.parent=null),(t-=k)==0)break;e=0}else e-=d}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof gn))){var J=[];this.collapse(J),this.children=[new gn(J)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var d=this.children[r],k=d.chunkSize();if(e<=k){if(d.insertInner(e,t,n),d.lines&&d.lines.length>50){for(var K=d.lines.length%25+25,J=K;J<d.lines.length;){var ee=new gn(d.lines.slice(J,J+=25));d.height-=ee.height,this.children.splice(++r,0,ee),ee.parent=this}d.lines=d.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),n=new vn(t);if(e.parent){e.size-=n.size,e.height-=n.height;var d=fe(e.parent.children,e);e.parent.children.splice(d+1,0,n)}else{var r=new vn(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var d=this.children[r],k=d.chunkSize();if(e<k){var K=Math.min(t,k-e);if(d.iterN(e,K,n))return!0;if((t-=K)==0)break;e=0}else e-=k}}};var yn=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};yn.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=pt(n);if(r==null||!t)return;for(var d=0;d<t.length;++d)t[d]==this&&t.splice(d--,1);t.length||(n.widgets=null);var k=nn(this);ct(n,Math.max(0,n.height-k)),e&&(bi(e,function(){qs(e,n,-k),Xi(e,r,"widget")}),ei(e,"lineWidgetCleared",e,this,r))},yn.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var d=nn(this)-t;if(!d)return;Pi(this.doc,r)||ct(r,r.height+d),n&&bi(n,function(){n.curOp.forceUpdate=!0,qs(n,r,d),ei(n,"lineWidgetChanged",n,e,pt(r))})},he(yn);function qs(e,t,n){Ii(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Sa(e,n)}function El(e,t,n,r){var d=new yn(e,n,r),k=e.cm;return k&&d.noHScroll&&(k.display.alignWidgets=!0),mn(e,t,"widget",function(K){var J=K.widgets||(K.widgets=[]);if(d.insertAt==null?J.push(d):J.splice(Math.min(J.length-1,Math.max(0,d.insertAt)),0,d),d.line=K,k&&!Pi(e,K)){var ee=Ii(K)<e.scrollTop;ct(K,K.height+nn(d)),ee&&Sa(k,d.height),k.curOp.forceUpdate=!0}return!0}),k&&ei(k,"lineWidgetAdded",k,d,typeof t=="number"?t:pt(t)),d}var eo=0,qi=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++eo};qi.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&mr(e),se(this,"clear")){var n=this.find();n&&ei(this,"clear",n.from,n.to)}for(var r=null,d=null,k=0;k<this.lines.length;++k){var K=this.lines[k],J=Li(K.markedSpans,this);e&&!this.collapsed?Xi(e,pt(K),"text"):e&&(J.to!=null&&(d=pt(K)),J.from!=null&&(r=pt(K))),K.markedSpans=Qr(K.markedSpans,J),J.from==null&&this.collapsed&&!Pi(this.doc,K)&&e&&ct(K,Rr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var ee=0;ee<this.lines.length;++ee){var ne=xi(this.lines[ee]),be=en(ne);be>e.display.maxLineLength&&(e.display.maxLine=ne,e.display.maxLineLength=be,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&pi(e,r,d+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Gs(e.doc)),e&&ei(e,"markerCleared",e,this,r,d),t&&gr(e),this.parent&&this.parent.clear()},qi.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,d=0;d<this.lines.length;++d){var k=this.lines[d],K=Li(k.markedSpans,this);if(K.from!=null&&(n=We(t?k:pt(k),K.from),e==-1))return n;if(K.to!=null&&(r=We(t?k:pt(k),K.to),e==1))return r}return n&&{from:n,to:r}},qi.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;if(!t||!r)return;bi(r,function(){var d=t.line,k=pt(t.line),K=fa(r,k);if(K&&(ns(K),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Pi(n.doc,d)&&n.height!=null){var J=n.height;n.height=null;var ee=nn(n)-J;ee&&ct(d,d.height+ee)}ei(r,"markerChanged",r,e)})},qi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||fe(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},qi.prototype.detachLine=function(e){if(this.lines.splice(fe(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},he(qi);function Br(e,t,n,r,d){if(r&&r.shared)return xl(e,t,n,r,d);if(e.cm&&!e.cm.curOp)return Jt(e.cm,Br)(e,t,n,r,d);var k=new qi(e,d),K=ft(t,n);if(r&&b(r,k,!1),K>0||K==0&&k.clearWhenEmpty!==!1)return k;if(k.replacedWith&&(k.collapsed=!0,k.widgetNode=x("span",[k.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||k.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(k.widgetNode.insertLeft=!0)),k.collapsed){if(Mn(e,t.line,t,n,k)||t.line!=n.line&&Mn(e,n.line,t,n,k))throw new Error("Inserting collapsed marker partially overlapping an existing one");sa()}k.addToHistory&&Ns(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var J=t.line,ee=e.cm,ne;if(e.iter(J,n.line+1,function(Ee){ee&&k.collapsed&&!ee.options.lineWrapping&&xi(Ee)==ee.display.maxLine&&(ne=!0),k.collapsed&&J!=t.line&&ct(Ee,0),oa(Ee,new ar(k,J==t.line?t.ch:null,J==n.line?n.ch:null)),++J}),k.collapsed&&e.iter(t.line,n.line+1,function(Ee){Pi(e,Ee)&&ct(Ee,0)}),k.clearOnEnter&&Me(k,"beforeCursorEnter",function(){return k.clear()}),k.readOnly&&(Vi(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),k.collapsed&&(k.id=++eo,k.atomic=!0),ee){if(ne&&(ee.curOp.updateMaxLine=!0),k.collapsed)pi(ee,t.line,n.line+1);else if(k.className||k.startStyle||k.endStyle||k.css||k.attributes||k.title)for(var be=t.line;be<=n.line;be++)Xi(ee,be,"text");k.atomic&&Gs(ee.doc),ei(ee,"markerAdded",ee,k)}return k}var bn=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};bn.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ei(this,"clear")},bn.prototype.find=function(e,t){return this.primary.find(e,t)},he(bn);function xl(e,t,n,r,d){r=b(r),r.shared=!1;var k=[Br(e,t,n,r,d)],K=k[0],J=r.widgetNode;return Zi(e,function(ee){J&&(r.widgetNode=J.cloneNode(!0)),k.push(Br(ee,gt(ee,t),gt(ee,n),r,d));for(var ne=0;ne<ee.linked.length;++ne)if(ee.linked[ne].isParent)return;K=D(k)}),new bn(k,K)}function to(e){return e.findMarks(We(e.first,0),e.clipPos(We(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var n=0;n<t.length;n++){var r=t[n],d=r.find(),k=e.clipPos(d.from),K=e.clipPos(d.to);if(ft(k,K)){var J=Br(e,k,K,r.primary,r.primary.type);r.markers.push(J),J.parent=r}}}function wl(e){for(var t=function(r){var d=e[r],k=[d.primary.doc];Zi(d.primary.doc,function(ee){return k.push(ee)});for(var K=0;K<d.markers.length;K++){var J=d.markers[K];fe(k,J.doc)==-1&&(J.parent=null,d.markers.splice(K--,1))}},n=0;n<e.length;n++)t(n)}var Sl=0,mi=function(e,t,n,r,d){if(!(this instanceof mi))return new mi(e,t,n,r,d);n==null&&(n=0),vn.call(this,[new gn([new lr("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var k=We(n,0);this.sel=Ji(k),this.history=new Vn(null),this.id=++Sl,this.modeOption=t,this.lineSep=r,this.direction=d=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ka(this,{from:k,to:k,text:e}),ni(this,Ji(k),Se)};mi.prototype=G(vn.prototype,{constructor:mi,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ot(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Qt(function(e){var t=We(this.first,0),n=this.first+this.size-1;Nr(this,{from:t,to:We(n,Qe(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&on(this.cm,0,0),ni(this,Ji(t),Se)}),replaceRange:function(e,t,n,r){t=gt(this,t),n=n?gt(this,n):t,Fr(this,e,t,n,r)},getRange:function(e,t,n){var r=Ct(this,gt(this,e),gt(this,t));return n===!1?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(ii(this,e))return Qe(this,e)},getLineNumber:function(e){return pt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Qe(this,e)),xi(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return gt(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Qt(function(e,t,n){js(this,gt(this,typeof e=="number"?We(e,t||0):e),null,n)}),setSelection:Qt(function(e,t,n){js(this,gt(this,e),gt(this,t||e),n)}),extendSelection:Qt(function(e,t,n){Xn(this,gt(this,e),t&>(this,t),n)}),extendSelections:Qt(function(e,t){Us(this,Ve(this,e),t)}),extendSelectionsBy:Qt(function(e,t){var n=I(this.sel.ranges,e);Us(this,Ve(this,n),t)}),setSelections:Qt(function(e,t,n){if(!e.length)return;for(var r=[],d=0;d<e.length;d++)r[d]=new Dt(gt(this,e[d].anchor),gt(this,e[d].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),ni(this,ki(this.cm,r,t),n)}),addSelection:Qt(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Dt(gt(this,e),gt(this,t||e))),ni(this,ki(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var d=Ct(this,t[r].from(),t[r].to());n=n?n.concat(d):d}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var d=Ct(this,n[r].from(),n[r].to());e!==!1&&(d=d.join(e||this.lineSeparator())),t[r]=d}return t},replaceSelection:function(e,t,n){for(var r=[],d=0;d<this.sel.ranges.length;d++)r[d]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:Qt(function(e,t,n){for(var r=[],d=this.sel,k=0;k<d.ranges.length;k++){var K=d.ranges[k];r[k]={from:K.from(),to:K.to(),text:this.splitLines(e[k]),origin:n}}for(var J=t&&t!="end"&&cl(this,r,t),ee=r.length-1;ee>=0;ee--)Nr(this,r[ee]);J?Hs(this,J):this.cm&&Dr(this.cm)}),undo:Qt(function(){Qn(this,"undo")}),redo:Qt(function(){Qn(this,"redo")}),undoSelection:Qt(function(){Qn(this,"undo",!0)}),redoSelection:Qt(function(){Qn(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var d=0;d<e.undone.length;d++)e.undone[d].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Vn(this.history.maxGeneration),Zi(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:Mr(this.history.done),undone:Mr(this.history.undone)}},setHistory:function(e){var t=this.history=new Vn(this.history.maxGeneration);t.done=Mr(e.done.slice(0),null,!0),t.undone=Mr(e.undone.slice(0),null,!0)},setGutterMarker:Qt(function(e,t,n){return mn(this,e,"gutter",function(r){var d=r.gutterMarkers||(r.gutterMarkers={});return d[t]=n,!n&&ue(d)&&(r.gutterMarkers=null),!0})}),clearGutter:Qt(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&mn(t,n,"gutter",function(){return n.gutterMarkers[e]=null,ue(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!ii(this,e))return null;if(t=e,e=Qe(this,e),!e)return null}else if(t=pt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Qt(function(e,t,n){return mn(this,e,t=="gutter"?"gutter":"class",function(r){var d=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[d])r[d]=n;else{if(O(n).test(r[d]))return!1;r[d]+=" "+n}return!0})}),removeLineClass:Qt(function(e,t,n){return mn(this,e,t=="gutter"?"gutter":"class",function(r){var d=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",k=r[d];if(k)if(n==null)r[d]=null;else{var K=k.match(O(n));if(!K)return!1;var J=K.index+K[0].length;r[d]=k.slice(0,K.index)+(!K.index||J==k.length?"":" ")+k.slice(J)||null}else return!1;return!0})}),addLineWidget:Qt(function(e,t,n){return El(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Br(this,gt(this,e),gt(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=gt(this,e),Br(this,e,e,n,"bookmark")},findMarksAt:function(e){e=gt(this,e);var t=[],n=Qe(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var d=n[r];(d.from==null||d.from<=e.ch)&&(d.to==null||d.to>=e.ch)&&t.push(d.marker.parent||d.marker)}return t},findMarks:function(e,t,n){e=gt(this,e),t=gt(this,t);var r=[],d=e.line;return this.iter(e.line,t.line+1,function(k){var K=k.markedSpans;if(K)for(var J=0;J<K.length;J++){var ee=K[J];!(ee.to!=null&&d==e.line&&e.ch>=ee.to||ee.from==null&&d!=e.line||ee.from!=null&&d==t.line&&ee.from>=t.ch)&&(!n||n(ee.marker))&&r.push(ee.marker.parent||ee.marker)}++d}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(d){var k=d.text.length+r;if(k>e)return t=e,!0;e-=k,++n}),gt(this,We(n,t))},indexFromPos:function(e){e=gt(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+n}),t},copy:function(e){var t=new mi(Ot(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new mi(Ot(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(r,to(this)),r},unlinkDoc:function(e){if(e instanceof jt&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(to(this));break}if(e.history==this.history){var r=[e.id];Zi(e,function(d){return r.push(d.id)},!0),e.history=new Vn(null),e.history.done=Mr(this.history.done,r),e.history.undone=Mr(this.history.undone,r)}},iterLinkedDocs:function(e){Zi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):ot(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:Qt(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),mi.prototype.eachLine=mi.prototype.iter;var io=0;function Cl(e){var t=this;if(ro(t),q(t,e)||Gi(t.display,e))return;ie(e),W&&(io=+new Date);var n=dr(t,e,!0),r=e.dataTransfer.files;if(!n||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var d=r.length,k=Array(d),K=0,J=function(){++K==d&&Jt(t,function(){n=gt(t.doc,n);var Re={from:n,to:n,text:t.doc.splitLines(k.filter(function(Fe){return Fe!=null}).join(t.doc.lineSeparator())),origin:"paste"};Nr(t.doc,Re),Hs(t.doc,Ji(gt(t.doc,n),gt(t.doc,Qi(Re))))})()},ee=function(Re,Fe){if(t.options.allowDropFileTypes&&fe(t.options.allowDropFileTypes,Re.type)==-1){J();return}var Ue=new FileReader;Ue.onerror=function(){return J()},Ue.onload=function(){var Ye=Ue.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ye)){J();return}k[Fe]=Ye,J()},Ue.readAsText(Re)},ne=0;ne<r.length;ne++)ee(r[ne],ne);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var be=e.dataTransfer.getData("Text");if(be){var Ee;if(t.state.draggingText&&!t.state.draggingText.copy&&(Ee=t.listSelections()),$n(t.doc,Ji(n,n)),Ee)for(var Ie=0;Ie<Ee.length;++Ie)Fr(t.doc,"",Ee[Ie].anchor,Ee[Ie].head,"drag");t.replaceSelection(be,"around","paste"),t.display.input.focus()}}catch(Re){}}}function Al(e,t){if(W&&(!e.state.draggingText||+new Date-io<100)){me(t);return}if(q(e,t)||Gi(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p){var n=c("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",m&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),m&&n.parentNode.removeChild(n)}}function Ol(e,t){var n=dr(e,t);if(!n)return;var r=document.createDocumentFragment();ms(e,n,r),e.display.dragCursor||(e.display.dragCursor=c("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),E(e.display.dragCursor,r)}function ro(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function no(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var d=t[r].CodeMirror;d&&n.push(d)}n.length&&n[0].operation(function(){for(var k=0;k<n.length;k++)e(n[k])})}var ao=!1;function Rl(){if(ao)return;Ll(),ao=!0}function Ll(){var e;Me(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,no(Il)},100))}),Me(window,"blur",function(){return no(Ir)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var er={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"},_n=0;_n<10;_n++)er[_n+48]=er[_n+96]=String(_n);for(var Zn=65;Zn<=90;Zn++)er[Zn]=String.fromCharCode(Zn);for(var En=1;En<=12;En++)er[En+111]=er[En+63235]="F"+En;var Ki={};Ki.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"},Ki.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"},Ki.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"},Ki.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"]},Ki.default=s?Ki.macDefault:Ki.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,d,k,K=0;K<t.length-1;K++){var J=t[K];if(/^(cmd|meta|m)$/i.test(J))k=!0;else if(/^a(lt)?$/i.test(J))n=!0;else if(/^(c|ctrl|control)$/i.test(J))r=!0;else if(/^s(hift)?$/i.test(J))d=!0;else throw new Error("Unrecognized modifier name: "+J)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),k&&(e="Cmd-"+e),d&&(e="Shift-"+e),e}function kl(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}for(var d=I(n.split(" "),Dl),k=0;k<d.length;k++){var K=void 0,J=void 0;k==d.length-1?(J=d.join(" "),K=r):(J=d.slice(0,k+1).join(" "),K="...");var ee=t[J];if(!ee)t[J]=K;else if(ee!=K)throw new Error("Inconsistent bindings for "+J)}delete e[n]}for(var ne in t)e[ne]=t[ne];return e}function Ur(e,t,n,r){t=qn(t);var d=t.call?t.call(e,r):t[e];if(d===!1)return"nothing";if(d==="...")return"multi";if(d!=null&&n(d))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Ur(e,t.fallthrough,n,r);for(var k=0;k<t.fallthrough.length;k++){var K=Ur(e,t.fallthrough[k],n,r);if(K)return K}}}function so(e){var t=typeof e=="string"?e:er[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function oo(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(T?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(T?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function lo(e,t){if(m&&e.keyCode==34&&e.char)return!1;var n=er[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),oo(n,e,t))}function qn(e){return typeof e=="string"?Ki[e]:e}function jr(e,t){for(var n=e.doc.sel.ranges,r=[],d=0;d<n.length;d++){for(var k=t(n[d]);r.length&&ft(k.from,D(r).to)<=0;){var K=r.pop();if(ft(K.from,k.from)<0){k.from=K.from;break}}r.push(k)}bi(e,function(){for(var J=r.length-1;J>=0;J--)Fr(e.doc,"",r[J].from,r[J].to,"+delete");Dr(e)})}function Fa(e,t,n){var r=Ae(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Ba(e,t,n){var r=Fa(e,t.ch,n);return r==null?null:new We(t.line,r,n<0?"after":"before")}function Ua(e,t,n,r,d){if(e){t.doc.direction=="rtl"&&(d=-d);var k=je(n,t.doc.direction);if(k){var K=d<0?D(k):k[0],J=d<0==(K.level==1),ee=J?"after":"before",ne;if(K.level>0||t.doc.direction=="rtl"){var be=Or(t,n);ne=d<0?n.text.length-1:0;var Ee=Fi(t,be,ne).top;ne=Ne(function(Ie){return Fi(t,be,Ie).top==Ee},d<0==(K.level==1)?K.from:K.to-1,ne),ee=="before"&&(ne=Fa(n,ne,1))}else ne=d<0?K.to:K.from;return new We(r,ne,ee)}}return new We(r,d<0?n.text.length:0,d<0?"before":"after")}function Ml(e,t,n,r){var d=je(t,e.doc.direction);if(!d)return Ba(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var k=He(d,n.ch,n.sticky),K=d[k];if(e.doc.direction=="ltr"&&K.level%2==0&&(r>0?K.to>n.ch:K.from<n.ch))return Ba(t,n,r);var J=function(Xe,it){return Fa(t,Xe instanceof We?Xe.ch:Xe,it)},ee,ne=function(Xe){return e.options.lineWrapping?(ee=ee||Or(e,t),ds(e,t,ee,Xe)):{begin:0,end:t.text.length}},be=ne(n.sticky=="before"?J(n,-1):n.ch);if(e.doc.direction=="rtl"||K.level==1){var Ee=K.level==1==r<0,Ie=J(n,Ee?1:-1);if(Ie!=null&&(Ee?Ie<=K.to&&Ie<=be.end:Ie>=K.from&&Ie>=be.begin)){var Re=Ee?"before":"after";return new We(n.line,Ie,Re)}}var Fe=function(Xe,it,$e){for(var nt=function(Nt,Zt){return Zt?new We(n.line,J(Nt,1),"before"):new We(n.line,Nt,"after")};Xe>=0&&Xe<d.length;Xe+=it){var ht=d[Xe],lt=it>0==(ht.level!=1),bt=lt?$e.begin:J($e.end,-1);if(ht.from<=bt&&bt<ht.to)return nt(bt,lt);if(bt=lt?ht.from:J(ht.to,-1),$e.begin<=bt&&bt<$e.end)return nt(bt,lt)}},Ue=Fe(k+r,r,be);if(Ue)return Ue;var Ye=r>0?be.end:J(be.begin,-1);return Ye!=null&&!(r>0&&Ye==t.text.length)&&(Ue=Fe(r>0?0:d.length-1,r,ne(Ye)),Ue)?Ue:null}var xn={selectAll:Vs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Se)},killLine:function(e){return jr(e,function(t){if(t.empty()){var n=Qe(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:We(t.head.line+1,0)}:{from:t.head,to:We(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return jr(e,function(t){return{from:We(t.from().line,0),to:gt(e.doc,We(t.to().line+1,0))}})},delLineLeft:function(e){return jr(e,function(t){return{from:We(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return jr(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return jr(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},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(We(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(We(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return uo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ho(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Pl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},ye)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},ye)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?ho(e,t.head):r},ye)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,d=0;d<n.length;d++){var k=n[d].from(),K=Y(e.getLine(k.line),k.ch,r);t.push(z(r-K%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return bi(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var d=t[r].head,k=Qe(e.doc,d.line).text;if(k){if(d.ch==k.length&&(d=new We(d.line,d.ch-1)),d.ch>0)d=new We(d.line,d.ch+1),e.replaceRange(k.charAt(d.ch-1)+k.charAt(d.ch-2),We(d.line,d.ch-2),d,"+transpose");else if(d.line>e.doc.first){var K=Qe(e.doc,d.line-1).text;K&&(d=new We(d.line,1),e.replaceRange(k.charAt(0)+e.doc.lineSeparator()+K.charAt(K.length-1),We(d.line-1,K.length-1),d,"+transpose"))}}n.push(new Dt(d,d))}e.setSelections(n)})},newlineAndIndent:function(e){return bi(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Dr(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function uo(e,t){var n=Qe(e.doc,t),r=xi(n);return r!=n&&(t=pt(r)),Ua(!0,e,r,t,1)}function Pl(e,t){var n=Qe(e.doc,t),r=Pn(n);return r!=n&&(t=pt(r)),Ua(!0,e,n,t,-1)}function ho(e,t){var n=uo(e,t.line),r=Qe(e.doc,n.line),d=je(r,e.doc.direction);if(!d||d[0].level==0){var k=Math.max(n.ch,r.text.search(/\S/)),K=t.line==n.line&&t.ch<=k&&t.ch;return We(n.line,K?0:k,n.sticky)}return n}function ea(e,t,n){if(typeof t=="string"&&(t=xn[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,d=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),d=t(e)!=ke}finally{e.display.shift=r,e.state.suppressEdits=!1}return d}function Nl(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var d=Ur(t,e.state.keyMaps[r],n,e);if(d)return d}return e.options.extraKeys&&Ur(t,e.options.extraKeys,n,e)||Ur(t,e.options.keyMap,n,e)}var Fl=new re;function Tn(e,t,n,r){var d=e.state.keySeq;if(d){if(so(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Fl.set(50,function(){e.state.keySeq==d&&(e.state.keySeq=null,e.display.input.reset())}),co(e,d+" "+t,n,r))return!0}return co(e,t,n,r)}function co(e,t,n,r){var d=Nl(e,t,r);return d=="multi"&&(e.state.keySeq=t),d=="handled"&&ei(e,"keyHandled",e,t,n),(d=="handled"||d=="multi")&&(ie(n),xa(e)),!!d}function fo(e,t){var n=lo(t,!0);return n?t.shiftKey&&!e.state.keySeq?Tn(e,"Shift-"+n,t,function(r){return ea(e,r,!0)})||Tn(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return ea(e,r)}):Tn(e,n,t,function(r){return ea(e,r)}):!1}function Bl(e,t,n){return Tn(e,"'"+n+"'",t,function(r){return ea(e,r,!0)})}var ja=null;function po(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=F(),q(t,e))return;W&&H<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=fo(t,e);m&&(ja=r?n:null,!r&&n==88&&!Lt&&(s?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),M&&!s&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Ul(t)}function Ul(e){var t=e.display.lineDiv;U(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(S(t,"CodeMirror-crosshair"),Je(document,"keyup",n),Je(document,"mouseover",n))}Me(document,"keyup",n),Me(document,"mouseover",n)}function mo(e){e.keyCode==16&&(this.doc.sel.shift=!1),q(this,e)}function go(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Gi(t.display,e)||q(t,e)||e.ctrlKey&&!e.altKey||s&&e.metaKey)return;var n=e.keyCode,r=e.charCode;if(m&&n==ja){ja=null,ie(e);return}if(m&&(!e.which||e.which<10)&&fo(t,e))return;var d=String.fromCharCode(r==null?n:r);if(d=="\b")return;if(Bl(t,e,d))return;t.display.input.onKeyPress(e)}var jl=400,Ha=function(e,t,n){this.time=e,this.pos=t,this.button=n};Ha.prototype.compare=function(e,t,n){return this.time+jl>e&&ft(t,this.pos)==0&&n==this.button};var wn,Sn;function Hl(e,t){var n=+new Date;return Sn&&Sn.compare(n,e,t)?(wn=Sn=null,"triple"):wn&&wn.compare(n,e,t)?(Sn=new Ha(n,e,t),wn=null,"double"):(wn=new Ha(n,e,t),Sn=null,"single")}function vo(e){var t=this,n=t.display;if(q(t,e)||n.activeTouch&&n.input.supportsTouch())return;if(n.input.ensurePolled(),n.shift=e.shiftKey,Gi(n,e)){i||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(Wa(t,e))return;var r=dr(t,e),d=Oe(e),k=r?Hl(r,d):"single";if(window.focus(),d==1&&t.state.selectingText&&t.state.selectingText(e),r&&Wl(t,d,r,k,e))return;d==1?r?Kl(t,r,k,e):xe(e)==n.scroller&&ie(e):d==2?(r&&Xn(t.doc,r),setTimeout(function(){return n.input.focus()},20)):d==3&&(R?t.display.input.onContextMenu(e):vs(t))}function Wl(e,t,n,r,d){var k="Click";return r=="double"?k="Double"+k:r=="triple"&&(k="Triple"+k),k=(t==1?"Left":t==2?"Middle":"Right")+k,Tn(e,oo(k,d),d,function(K){if(typeof K=="string"&&(K=xn[K]),!K)return!1;var J=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),J=K(e,n)!=ke}finally{e.state.suppressEdits=!1}return J})}function Gl(e,t,n){var r=e.getOption("configureMouse"),d=r?r(e,t,n):{};if(d.unit==null){var k=a?n.shiftKey&&n.metaKey:n.altKey;d.unit=k?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(d.extend==null||e.doc.extend)&&(d.extend=e.doc.extend||n.shiftKey),d.addNew==null&&(d.addNew=s?n.metaKey:n.ctrlKey),d.moveOnDrag==null&&(d.moveOnDrag=!(s?n.altKey:n.ctrlKey)),d}function Kl(e,t,n,r){W?setTimeout(N(gs,e),0):e.curOp.focus=F();var d=Gl(e,n,r),k=e.doc.sel,K;e.options.dragDrop&&Pe&&!e.isReadOnly()&&n=="single"&&(K=k.contains(t))>-1&&(ft((K=k.ranges[K]).from(),t)<0||t.xRel>0)&&(ft(K.to(),t)>0||t.xRel<0)?zl(e,r,t,d):Vl(e,r,t,d)}function zl(e,t,n,r){var d=e.display,k=!1,K=Jt(e,function(ne){i&&(d.scroller.draggable=!1),e.state.draggingText=!1,Je(d.wrapper.ownerDocument,"mouseup",K),Je(d.wrapper.ownerDocument,"mousemove",J),Je(d.scroller,"dragstart",ee),Je(d.scroller,"drop",K),k||(ie(ne),r.addNew||Xn(e.doc,n,null,null,r.extend),i&&!p||W&&H==9?setTimeout(function(){d.wrapper.ownerDocument.body.focus({preventScroll:!0}),d.input.focus()},20):d.input.focus())}),J=function(ne){k=k||Math.abs(t.clientX-ne.clientX)+Math.abs(t.clientY-ne.clientY)>=10},ee=function(){return k=!0};i&&(d.scroller.draggable=!0),e.state.draggingText=K,K.copy=!r.moveOnDrag,d.scroller.dragDrop&&d.scroller.dragDrop(),Me(d.wrapper.ownerDocument,"mouseup",K),Me(d.wrapper.ownerDocument,"mousemove",J),Me(d.scroller,"dragstart",ee),Me(d.scroller,"drop",K),vs(e),setTimeout(function(){return d.input.focus()},20)}function yo(e,t,n){if(n=="char")return new Dt(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Dt(We(t.line,0),gt(e.doc,We(t.line+1,0)));var r=n(e,t);return new Dt(r.from,r.to)}function Vl(e,t,n,r){var d=e.display,k=e.doc;ie(t);var K,J,ee=k.sel,ne=ee.ranges;if(r.addNew&&!r.extend?(J=k.sel.contains(n),J>-1?K=ne[J]:K=new Dt(n,n)):(K=k.sel.primary(),J=k.sel.primIndex),r.unit=="rectangle")r.addNew||(K=new Dt(n,n)),n=dr(e,t,!0,!0),J=-1;else{var be=yo(e,n,r.unit);r.extend?K=Pa(K,be.anchor,be.head,r.extend):K=be}r.addNew?J==-1?(J=ne.length,ni(k,ki(e,ne.concat([K]),J),{scroll:!1,origin:"*mouse"})):ne.length>1&&ne[J].empty()&&r.unit=="char"&&!r.extend?(ni(k,ki(e,ne.slice(0,J).concat(ne.slice(J+1)),0),{scroll:!1,origin:"*mouse"}),ee=k.sel):Na(k,J,K,Le):(J=0,ni(k,new wi([K],0),Le),ee=k.sel);var Ee=n;function Ie($e){if(ft(Ee,$e)==0)return;if(Ee=$e,r.unit=="rectangle"){for(var nt=[],ht=e.options.tabSize,lt=Y(Qe(k,n.line).text,n.ch,ht),bt=Y(Qe(k,$e.line).text,$e.ch,ht),Nt=Math.min(lt,bt),Zt=Math.max(lt,bt),Wt=Math.min(n.line,$e.line),_i=Math.min(e.lastLine(),Math.max(n.line,$e.line));Wt<=_i;Wt++){var gi=Qe(k,Wt).text,Vt=_e(gi,Nt,ht);Nt==Zt?nt.push(new Dt(We(Wt,Vt),We(Wt,Vt))):gi.length>Vt&&nt.push(new Dt(We(Wt,Vt),We(Wt,_e(gi,Zt,ht))))}nt.length||nt.push(new Dt(n,n)),ni(k,ki(e,ee.ranges.slice(0,J).concat(nt),J),{origin:"*mouse",scroll:!1}),e.scrollIntoView($e)}else{var vi=K,ti=yo(e,$e,r.unit),$t=vi.anchor,Yt;ft(ti.anchor,$t)>0?(Yt=ti.head,$t=rr(vi.from(),ti.anchor)):(Yt=ti.anchor,$t=_r(vi.to(),ti.head));var Gt=ee.ranges.slice(0);Gt[J]=Yl(e,new Dt(gt(k,$t),Yt)),ni(k,ki(e,Gt,J),Le)}}var Re=d.wrapper.getBoundingClientRect(),Fe=0;function Ue($e){var nt=++Fe,ht=dr(e,$e,!0,r.unit=="rectangle");if(!ht)return;if(ft(ht,Ee)!=0){e.curOp.focus=F(),Ie(ht);var lt=Wn(d,k);(ht.line>=lt.to||ht.line<lt.from)&&setTimeout(Jt(e,function(){Fe==nt&&Ue($e)}),150)}else{var bt=$e.clientY<Re.top?-20:$e.clientY>Re.bottom?20:0;bt&&setTimeout(Jt(e,function(){if(Fe!=nt)return;d.scroller.scrollTop+=bt,Ue($e)}),50)}}function Ye($e){e.state.selectingText=!1,Fe=Infinity,$e&&(ie($e),d.input.focus()),Je(d.wrapper.ownerDocument,"mousemove",Xe),Je(d.wrapper.ownerDocument,"mouseup",it),k.history.lastSelOrigin=null}var Xe=Jt(e,function($e){$e.buttons===0||!Oe($e)?Ye($e):Ue($e)}),it=Jt(e,Ye);e.state.selectingText=it,Me(d.wrapper.ownerDocument,"mousemove",Xe),Me(d.wrapper.ownerDocument,"mouseup",it)}function Yl(e,t){var n=t.anchor,r=t.head,d=Qe(e.doc,n.line);if(ft(n,r)==0&&n.sticky==r.sticky)return t;var k=je(d);if(!k)return t;var K=He(k,n.ch,n.sticky),J=k[K];if(J.from!=n.ch&&J.to!=n.ch)return t;var ee=K+(J.from==n.ch==(J.level!=1)?0:1);if(ee==0||ee==k.length)return t;var ne;if(r.line!=n.line)ne=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var be=He(k,r.ch,r.sticky),Ee=be-K||(r.ch-n.ch)*(J.level==1?-1:1);be==ee-1||be==ee?ne=Ee<0:ne=Ee>0}var Ie=k[ee+(ne?-1:0)],Re=ne==(Ie.level==1),Fe=Re?Ie.from:Ie.to,Ue=Re?"after":"before";return n.ch==Fe&&n.sticky==Ue?t:new Dt(new We(n.line,Fe,Ue),r)}function bo(e,t,n,r){var d,k;if(t.touches)d=t.touches[0].clientX,k=t.touches[0].clientY;else try{d=t.clientX,k=t.clientY}catch(Ie){return!1}if(d>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ie(t);var K=e.display,J=K.lineDiv.getBoundingClientRect();if(k>J.bottom||!se(e,n))return pe(t);k-=J.top-K.viewOffset;for(var ee=0;ee<e.display.gutterSpecs.length;++ee){var ne=K.gutters.childNodes[ee];if(ne&&ne.getBoundingClientRect().right>=d){var be=wt(e.doc,k),Ee=e.display.gutterSpecs[ee];return le(e,n,e,be,Ee.className,t),pe(t)}}}function Wa(e,t){return bo(e,t,"gutterClick",!0)}function _o(e,t){if(Gi(e.display,t)||Xl(e,t))return;if(q(e,t,"contextmenu"))return;R||e.display.input.onContextMenu(t)}function Xl(e,t){return se(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-"),an(e)}var Hr={toString:function(){return"CodeMirror.Init"}},xo={},ta={};function $l(e){var t=e.optionHandlers;function n(r,d,k,K){e.defaults[r]=d,k&&(t[r]=K?function(J,ee,ne){ne!=Hr&&k(J,ee,ne)}:k)}e.defineOption=n,e.Init=Hr,n("value","",function(r,d){return r.setValue(d)},!0),n("mode",null,function(r,d){r.doc.modeOption=d,Da(r)},!0),n("indentUnit",2,Da,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){fn(r),an(r),pi(r)},!0),n("lineSeparator",null,function(r,d){if(r.doc.lineSep=d,!d)return;var k=[],K=r.doc.first;r.doc.iter(function(ee){for(var ne=0;;){var be=ee.text.indexOf(d,ne);if(be==-1)break;ne=be+d.length,k.push(We(K,be))}K++});for(var J=k.length-1;J>=0;J--)Fr(r.doc,d,k[J],We(k[J].line,k[J].ch+d.length))}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,d,k){r.state.specialChars=new RegExp(d.source+(d.test(" ")?"":"| "),"g"),k!=Hr&&r.refresh()}),n("specialCharPlaceholder",Pt,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",u?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,d){return r.getInputField().spellcheck=d},!0),n("autocorrect",!1,function(r,d){return r.getInputField().autocorrect=d},!0),n("autocapitalize",!1,function(r,d){return r.getInputField().autocapitalize=d},!0),n("rtlMoveVisually",!C),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){Eo(r),cn(r)},!0),n("keyMap","default",function(r,d,k){var K=qn(d),J=k!=Hr&&qn(k);J&&J.detach&&J.detach(r,K),K.attach&&K.attach(r,J||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ql,!0),n("gutters",[],function(r,d){r.display.gutterSpecs=La(d,r.options.lineNumbers),cn(r)},!0),n("fixedGutter",!0,function(r,d){r.display.gutters.style.left=d?_a(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return kr(r)},!0),n("scrollbarStyle","native",function(r){Ts(r),kr(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,d){r.display.gutterSpecs=La(r.options.gutters,d),cn(r)},!0),n("firstLineNumber",1,cn,!0),n("lineNumberFormatter",function(r){return r},cn,!0),n("showCursorWhenSelecting",!1,sn,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,d){d=="nocursor"&&(Ir(r),r.display.input.blur()),r.display.input.readOnlyChanged(d)}),n("screenReaderLabel",null,function(r,d){d=d===""?null:d,r.display.input.screenReaderLabelChanged(d)}),n("disableInput",!1,function(r,d){d||r.display.input.reset()},!0),n("dragDrop",!0,Jl),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,sn,!0),n("singleCursorHeightPerLine",!0,sn,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,fn,!0),n("addModeClass",!1,fn,!0),n("pollInterval",100),n("undoDepth",200,function(r,d){return r.doc.history.undoDepth=d}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,fn,!0),n("moveInputWithCursor",!0,function(r,d){d||r.display.input.resetPosition()}),n("tabindex",null,function(r,d){return r.display.input.getField().tabIndex=d||""}),n("autofocus",null),n("direction","ltr",function(r,d){return r.doc.setDirection(d)},!0),n("phrases",null)}function Jl(e,t,n){var r=n&&n!=Hr;if(!t!=!r){var d=e.display.dragFunctions,k=t?Me:Je;k(e.display.scroller,"dragstart",d.start),k(e.display.scroller,"dragenter",d.enter),k(e.display.scroller,"dragover",d.over),k(e.display.scroller,"dragleave",d.leave),k(e.display.scroller,"drop",d.drop)}}function Ql(e){e.options.lineWrapping?(U(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(S(e.display.wrapper,"CodeMirror-wrap"),Nn(e)),Ea(e),pi(e),an(e),setTimeout(function(){return kr(e)},100)}function jt(e,t){var n=this;if(!(this instanceof jt))return new jt(e,t);this.options=t=t?b(t):{},b(xo,t,!1);var r=t.value;typeof r=="string"?r=new mi(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var d=new jt.inputStyles[t.inputStyle](this),k=this.display=new hl(e,r,d,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 re,keySeq:null,specialChars:null},t.autofocus&&!u&&k.input.focus(),W&&H<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Zl(this),Rl(),mr(this),this.curOp.forceUpdate=!0,ks(this,r),t.autofocus&&!u||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Ta(n)},20):Ir(this);for(var K in ta)ta.hasOwnProperty(K)&&ta[K](this,t[K],Hr);Cs(this),t.finishInit&&t.finishInit(this);for(var J=0;J<Ga.length;++J)Ga[J](this);gr(this),i&&t.lineWrapping&&getComputedStyle(k.lineDiv).textRendering=="optimizelegibility"&&(k.lineDiv.style.textRendering="auto")}jt.defaults=xo,jt.optionHandlers=ta;function Zl(e){var t=e.display;Me(t.scroller,"mousedown",Jt(e,vo)),W&&H<11?Me(t.scroller,"dblclick",Jt(e,function(ee){if(q(e,ee))return;var ne=dr(e,ee);if(!ne||Wa(e,ee)||Gi(e.display,ee))return;ie(ee);var be=e.findWordAt(ne);Xn(e.doc,be.anchor,be.head)})):Me(t.scroller,"dblclick",function(ee){return q(e,ee)||ie(ee)}),Me(t.scroller,"contextmenu",function(ee){return _o(e,ee)}),Me(t.input.getField(),"contextmenu",function(ee){t.scroller.contains(ee.target)||_o(e,ee)});var n,r={end:0};function d(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function k(ee){if(ee.touches.length!=1)return!1;var ne=ee.touches[0];return ne.radiusX<=1&&ne.radiusY<=1}function K(ee,ne){if(ne.left==null)return!0;var be=ne.left-ee.left,Ee=ne.top-ee.top;return be*be+Ee*Ee>20*20}Me(t.scroller,"touchstart",function(ee){if(!q(e,ee)&&!k(ee)&&!Wa(e,ee)){t.input.ensurePolled(),clearTimeout(n);var ne=+new Date;t.activeTouch={start:ne,moved:!1,prev:ne-r.end<=300?r:null},ee.touches.length==1&&(t.activeTouch.left=ee.touches[0].pageX,t.activeTouch.top=ee.touches[0].pageY)}}),Me(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Me(t.scroller,"touchend",function(ee){var ne=t.activeTouch;if(ne&&!Gi(t,ee)&&ne.left!=null&&!ne.moved&&new Date-ne.start<300){var be=e.coordsChar(t.activeTouch,"page"),Ee;!ne.prev||K(ne,ne.prev)?Ee=new Dt(be,be):!ne.prev.prev||K(ne,ne.prev.prev)?Ee=e.findWordAt(be):Ee=new Dt(We(be.line,0),gt(e.doc,We(be.line+1,0))),e.setSelection(Ee.anchor,Ee.head),e.focus(),ie(ee)}d()}),Me(t.scroller,"touchcancel",d),Me(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ln(e,t.scroller.scrollTop),fr(e,t.scroller.scrollLeft,!0),le(e,"scroll",e))}),Me(t.scroller,"mousewheel",function(ee){return Rs(e,ee)}),Me(t.scroller,"DOMMouseScroll",function(ee){return Rs(e,ee)}),Me(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(ee){q(e,ee)||me(ee)},over:function(ee){q(e,ee)||(Ol(e,ee),me(ee))},start:function(ee){return Al(e,ee)},drop:Jt(e,Cl),leave:function(ee){q(e,ee)||ro(e)}};var J=t.input.getField();Me(J,"keyup",function(ee){return mo.call(e,ee)}),Me(J,"keydown",Jt(e,po)),Me(J,"keypress",Jt(e,go)),Me(J,"focus",function(ee){return Ta(e,ee)}),Me(J,"blur",function(ee){return Ir(e,ee)})}var Ga=[];jt.defineInitHook=function(e){return Ga.push(e)};function Cn(e,t,n,r){var d=e.doc,k;n==null&&(n="add"),n=="smart"&&(d.mode.indent?k=Ai(e,t).state:n="prev");var K=e.options.tabSize,J=Qe(d,t),ee=Y(J.text,null,K);J.stateAfter&&(J.stateAfter=null);var ne=J.text.match(/^\s*/)[0],be;if(!r&&!/\S/.test(J.text))be=0,n="not";else if(n=="smart"&&(be=d.mode.indent(k,J.text.slice(ne.length),J.text),be==ke||be>150)){if(!r)return;n="prev"}n=="prev"?t>d.first?be=Y(Qe(d,t-1).text,null,K):be=0:n=="add"?be=ee+e.options.indentUnit:n=="subtract"?be=ee-e.options.indentUnit:typeof n=="number"&&(be=ee+n),be=Math.max(0,be);var Ee="",Ie=0;if(e.options.indentWithTabs)for(var Re=Math.floor(be/K);Re;--Re)Ie+=K,Ee+=" ";if(Ie<be&&(Ee+=z(be-Ie)),Ee!=ne)return Fr(d,Ee,We(t,0),We(t,ne.length),"+input"),J.stateAfter=null,!0;for(var Fe=0;Fe<d.sel.ranges.length;Fe++){var Ue=d.sel.ranges[Fe];if(Ue.head.line==t&&Ue.head.ch<ne.length){var Ye=We(t,ne.length);Na(d,Fe,new Dt(Ye,Ye));break}}}var Mi=null;function ia(e){Mi=e}function Ka(e,t,n,r,d){var k=e.doc;e.display.shift=!1,r||(r=k.sel);var K=+new Date-200,J=d=="paste"||e.state.pasteIncoming>K,ee=ot(t),ne=null;if(J&&r.ranges.length>1)if(Mi&&Mi.text.join(`
|
|
`)==t){if(r.ranges.length%Mi.text.length==0){ne=[];for(var be=0;be<Mi.text.length;be++)ne.push(k.splitLines(Mi.text[be]))}}else ee.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(ne=I(ee,function(Xe){return[Xe]}));for(var Ee=e.curOp.updateInput,Ie=r.ranges.length-1;Ie>=0;Ie--){var Re=r.ranges[Ie],Fe=Re.from(),Ue=Re.to();Re.empty()&&(n&&n>0?Fe=We(Fe.line,Fe.ch-n):e.state.overwrite&&!J?Ue=We(Ue.line,Math.min(Qe(k,Ue.line).text.length,Ue.ch+D(ee).length)):J&&Mi&&Mi.lineWise&&Mi.text.join(`
|
|
`)==ee.join(`
|
|
`)&&(Fe=Ue=We(Fe.line,0)));var Ye={from:Fe,to:Ue,text:ne?ne[Ie%ne.length]:ee,origin:d||(J?"paste":e.state.cutIncoming>K?"cut":"+input")};Nr(e.doc,Ye),ei(e,"inputRead",e,Ye)}t&&!J&&wo(e,t),Dr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ee),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function To(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&bi(t,function(){return Ka(t,n,0,null,"paste")}),!0}function wo(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var d=n.ranges[r];if(d.head.ch>100||r&&n.ranges[r-1].head.line==d.head.line)continue;var k=e.getModeAt(d.head),K=!1;if(k.electricChars){for(var J=0;J<k.electricChars.length;J++)if(t.indexOf(k.electricChars.charAt(J))>-1){K=Cn(e,d.head.line,"smart");break}}else k.electricInput&&(k.electricInput.test(Qe(e.doc,d.head.line).text.slice(0,d.head.ch))&&(K=Cn(e,d.head.line,"smart")));K&&ei(e,"electricInput",e,d.head.line)}}function So(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var d=e.doc.sel.ranges[r].head.line,k={anchor:We(d,0),head:We(d+1,0)};n.push(k),t.push(e.getRange(k.anchor,k.head))}return{text:t,ranges:n}}function Co(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Ao(){var e=c("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=c("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return 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,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,d){var k=this.options,K=k[r];if(k[r]==d&&r!="mode")return;k[r]=d,t.hasOwnProperty(r)&&Jt(this,t[r])(this,d,K),le(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,d){this.state.keyMaps[d?"push":"unshift"](qn(r))},removeKeyMap:function(r){for(var d=this.state.keyMaps,k=0;k<d.length;++k)if(d[k]==r||d[k].name==r)return d.splice(k,1),!0},addOverlay:ui(function(r,d){var k=r.token?r:e.getMode(this.options,r);if(k.startState)throw new Error("Overlays may not be stateful.");V(this.state.overlays,{mode:k,modeSpec:r,opaque:d&&d.opaque,priority:d&&d.priority||0},function(K){return K.priority}),this.state.modeGen++,pi(this)}),removeOverlay:ui(function(r){for(var d=this.state.overlays,k=0;k<d.length;++k){var K=d[k].modeSpec;if(K==r||typeof r=="string"&&K.name==r){d.splice(k,1),this.state.modeGen++,pi(this);return}}}),indentLine:ui(function(r,d,k){typeof d!="string"&&typeof d!="number"&&(d==null?d=this.options.smartIndent?"smart":"prev":d=d?"add":"subtract"),ii(this.doc,r)&&Cn(this,r,d,k)}),indentSelection:ui(function(r){for(var d=this.doc.sel.ranges,k=-1,K=0;K<d.length;K++){var J=d[K];if(J.empty())J.head.line>k&&(Cn(this,J.head.line,r,!0),k=J.head.line,K==this.doc.sel.primIndex&&Dr(this));else{var ee=J.from(),ne=J.to(),be=Math.max(k,ee.line);k=Math.min(this.lastLine(),ne.line-(ne.ch?0:1))+1;for(var Ee=be;Ee<k;++Ee)Cn(this,Ee,r);var Ie=this.doc.sel.ranges;ee.ch==0&&d.length==Ie.length&&Ie[K].from().ch>0&&Na(this.doc,K,new Dt(ee,Ie[K].to()),Se)}}}),getTokenAt:function(r,d){return On(this,r,d)},getLineTokens:function(r,d){return On(this,We(r),d,!0)},getTokenTypeAt:function(r){r=gt(this.doc,r);var d=nr(this,Qe(this.doc,r.line)),k=0,K=(d.length-1)/2,J=r.ch,ee;if(J==0)ee=d[2];else for(;;){var ne=k+K>>1;if((ne?d[ne*2-1]:0)>=J)K=ne;else if(d[ne*2+1]<J)k=ne+1;else{ee=d[ne*2+2];break}}var be=ee?ee.indexOf("overlay "):-1;return be<0?ee:be==0?null:ee.slice(0,be-1)},getModeAt:function(r){var d=this.doc.mode;return d.innerMode?e.innerMode(d,this.getTokenAt(r).state).mode:d},getHelper:function(r,d){return this.getHelpers(r,d)[0]},getHelpers:function(r,d){var k=[];if(!n.hasOwnProperty(d))return k;var K=n[d],J=this.getModeAt(r);if(typeof J[d]=="string")K[J[d]]&&k.push(K[J[d]]);else if(J[d])for(var ee=0;ee<J[d].length;ee++){var ne=K[J[d][ee]];ne&&k.push(ne)}else J.helperType&&K[J.helperType]?k.push(K[J.helperType]):K[J.name]&&k.push(K[J.name]);for(var be=0;be<K._global.length;be++){var Ee=K._global[be];Ee.pred(J,this)&&fe(k,Ee.val)==-1&&k.push(Ee.val)}return k},getStateAfter:function(r,d){var k=this.doc;return r=Er(k,r==null?k.first+k.size-1:r),Ai(this,r+1,d).state},cursorCoords:function(r,d){var k,K=this.doc.sel.primary();return r==null?k=K.head:typeof r=="object"?k=gt(this.doc,r):k=r?K.from():K.to(),Di(this,k,d||"page")},charCoords:function(r,d){return ma(this,gt(this.doc,r),d||"page")},coordsChar:function(r,d){return r=ls(this,r,d||"page"),va(this,r.left,r.top)},lineAtHeight:function(r,d){return r=ls(this,{top:r,left:0},d||"page").top,wt(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,d,k){var K=!1,J;if(typeof r=="number"){var ee=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>ee&&(r=ee,K=!0),J=Qe(this.doc,r)}else J=r;return Bn(this,J,{top:0,left:0},d||"page",k||K).top+(K?this.doc.height-Ii(J):0)},defaultTextHeight:function(){return Rr(this.display)},defaultCharWidth:function(){return Lr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,d,k,K,J){var ee=this.display;r=Di(this,gt(this.doc,r));var ne=r.bottom,be=r.left;if(d.style.position="absolute",d.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(d),ee.sizer.appendChild(d),K=="over")ne=r.top;else if(K=="above"||K=="near"){var Ee=Math.max(ee.wrapper.clientHeight,this.doc.height),Ie=Math.max(ee.sizer.clientWidth,ee.lineSpace.clientWidth);(K=="above"||r.bottom+d.offsetHeight>Ee)&&r.top>d.offsetHeight?ne=r.top-d.offsetHeight:r.bottom+d.offsetHeight<=Ee&&(ne=r.bottom),be+d.offsetWidth>Ie&&(be=Ie-d.offsetWidth)}d.style.top=ne+"px",d.style.left=d.style.right="",J=="right"?(be=ee.sizer.clientWidth-d.offsetWidth,d.style.right="0px"):(J=="left"?be=0:J=="middle"&&(be=(ee.sizer.clientWidth-d.offsetWidth)/2),d.style.left=be+"px"),k&&Jo(this,{left:be,top:ne,right:be+d.offsetWidth,bottom:ne+d.offsetHeight})},triggerOnKeyDown:ui(po),triggerOnKeyPress:ui(go),triggerOnKeyUp:mo,triggerOnMouseDown:ui(vo),execCommand:function(r){if(xn.hasOwnProperty(r))return xn[r].call(null,this)},triggerElectric:ui(function(r){wo(this,r)}),findPosH:function(r,d,k,K){var J=1;d<0&&(J=-1,d=-d);for(var ee=gt(this.doc,r),ne=0;ne<d&&!(ee=za(this.doc,ee,J,k,K),ee.hitSide);++ne);return ee},moveH:ui(function(r,d){var k=this;this.extendSelectionsBy(function(K){return k.display.shift||k.doc.extend||K.empty()?za(k.doc,K.head,r,d,k.options.rtlMoveVisually):r<0?K.from():K.to()},ye)}),deleteH:ui(function(r,d){var k=this.doc.sel,K=this.doc;k.somethingSelected()?K.replaceSelection("",null,"+delete"):jr(this,function(J){var ee=za(K,J.head,r,d,!1);return r<0?{from:ee,to:J.head}:{from:J.head,to:ee}})}),findPosV:function(r,d,k,K){var J=1,ee=K;d<0&&(J=-1,d=-d);for(var ne=gt(this.doc,r),be=0;be<d;++be){var Ee=Di(this,ne,"div");if(ee==null?ee=Ee.left:Ee.left=ee,ne=Oo(this,Ee,J,k),ne.hitSide)break}return ne},moveV:ui(function(r,d){var k=this,K=this.doc,J=[],ee=!this.display.shift&&!K.extend&&K.sel.somethingSelected();if(K.extendSelectionsBy(function(be){if(ee)return r<0?be.from():be.to();var Ee=Di(k,be.head,"div");be.goalColumn!=null&&(Ee.left=be.goalColumn),J.push(Ee.left);var Ie=Oo(k,Ee,r,d);return d=="page"&&be==K.sel.primary()&&Sa(k,ma(k,Ie,"div").top-Ee.top),Ie},ye),J.length)for(var ne=0;ne<K.sel.ranges.length;ne++)K.sel.ranges[ne].goalColumn=J[ne]}),findWordAt:function(r){var d=this.doc,k=Qe(d,r.line).text,K=r.ch,J=r.ch;if(k){var ee=this.getHelper(r,"wordChars");(r.sticky=="before"||J==k.length)&&K?--K:++J;for(var ne=k.charAt(K),be=De(ne,ee)?function(Ee){return De(Ee,ee)}:/\s/.test(ne)?function(Ee){return/\s/.test(Ee)}:function(Ee){return!/\s/.test(Ee)&&!De(Ee)};K>0&&be(k.charAt(K-1));)--K;for(;J<k.length&&be(k.charAt(J));)++J}return new Dt(We(r.line,K),We(r.line,J))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?U(this.display.cursorDiv,"CodeMirror-overwrite"):S(this.display.cursorDiv,"CodeMirror-overwrite"),le(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==F()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:ui(function(r,d){on(this,r,d)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Ni(this)-this.display.barHeight,width:r.scrollWidth-Ni(this)-this.display.barWidth,clientHeight:ca(this),clientWidth:ur(this)}},scrollIntoView:ui(function(r,d){r==null?(r={from:this.doc.sel.primary().head,to:null},d==null&&(d=this.options.cursorScrollMargin)):typeof r=="number"?r={from:We(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=d||0,r.from.line!=null?Qo(this,r):bs(this,r.from,r.to,r.margin)}),setSize:ui(function(r,d){var k=this,K=function(ee){return typeof ee=="number"||/^\d+$/.test(String(ee))?ee+"px":ee};r!=null&&(this.display.wrapper.style.width=K(r)),d!=null&&(this.display.wrapper.style.height=K(d)),this.options.lineWrapping&&as(this);var J=this.display.viewFrom;this.doc.iter(J,this.display.viewTo,function(ee){if(ee.widgets){for(var ne=0;ne<ee.widgets.length;ne++)if(ee.widgets[ne].noHScroll){Xi(k,J,"widget");break}}++J}),this.curOp.forceUpdate=!0,le(this,"refresh",this)}),operation:function(r){return bi(this,r)},startOperation:function(){return mr(this)},endOperation:function(){return gr(this)},refresh:ui(function(){var r=this.display.cachedTextHeight;pi(this),this.curOp.forceUpdate=!0,an(this),on(this,this.doc.scrollLeft,this.doc.scrollTop),Oa(this.display),(r==null||Math.abs(r-Rr(this.display))>.5||this.options.lineWrapping)&&Ea(this),le(this,"refresh",this)}),swapDoc:ui(function(r){var d=this.doc;return d.cm=null,this.state.selectingText&&this.state.selectingText(),ks(this,r),an(this),this.display.input.reset(),on(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,ei(this,"swapDoc",this,d),d}),phrase:function(r){var d=this.options.phrases;return d&&Object.prototype.hasOwnProperty.call(d,r)?d[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},he(e),e.registerHelper=function(r,d,k){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][d]=k},e.registerGlobalHelper=function(r,d,k,K){e.registerHelper(r,d,K),n[r]._global.push({pred:k,val:K})}}function za(e,t,n,r,d){var k=t,K=n,J=Qe(e,t.line),ee=d&&e.direction=="rtl"?-n:n;function ne(){var it=t.line+ee;return it<e.first||it>=e.first+e.size?!1:(t=new We(it,t.ch,t.sticky),J=Qe(e,it))}function be(it){var $e;if(r=="codepoint"){var nt=J.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(nt)?$e=null:$e=new We(t.line,Math.max(0,Math.min(J.text.length,t.ch+n*(nt>=55296&&nt<56320?2:1))),-n)}else d?$e=Ml(e.cm,J,t,n):$e=Ba(J,t,n);if($e==null)if(!it&&ne())t=Ua(d,e.cm,J,t.line,ee);else return!1;else t=$e;return!0}if(r=="char"||r=="codepoint")be();else if(r=="column")be(!0);else if(r=="word"||r=="group")for(var Ee=null,Ie=r=="group",Re=e.cm&&e.cm.getHelper(t,"wordChars"),Fe=!0;!(n<0&&!be(!Fe));Fe=!1){var Ue=J.text.charAt(t.ch)||`
|
|
`,Ye=De(Ue,Re)?"w":Ie&&Ue==`
|
|
`?"n":!Ie||/\s/.test(Ue)?null:"p";if(Ie&&!Fe&&!Ye&&(Ye="s"),Ee&&Ee!=Ye){n<0&&(n=1,be(),t.sticky="after");break}if(Ye&&(Ee=Ye),n>0&&!be(!Fe))break}var Xe=Jn(e,t,k,K,!0);return ir(k,Xe)&&(Xe.hitSide=!0),Xe}function Oo(e,t,n,r){var d=e.doc,k=t.left,K;if(r=="page"){var J=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ee=Math.max(J-.5*Rr(e.display),3);K=(n>0?t.bottom:t.top)+n*ee}else r=="line"&&(K=n>0?t.bottom+3:t.top-3);for(var ne;!(ne=va(e,k,K),!ne.outside);){if(n<0?K<=0:K>=d.height){ne.hitSide=!0;break}K+=n*5}return ne}var kt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new re,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};kt.prototype.init=function(e){var t=this,n=this,r=n.cm,d=n.div=e.lineDiv;Co(d,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function k(J){for(var ee=J.target;ee;ee=ee.parentNode){if(ee==d)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ee.className))break}return!1}Me(d,"paste",function(J){if(!k(J)||q(r,J)||To(J,r))return;H<=11&&setTimeout(Jt(r,function(){return t.updateFromDOM()}),20)}),Me(d,"compositionstart",function(J){t.composing={data:J.data,done:!1}}),Me(d,"compositionupdate",function(J){t.composing||(t.composing={data:J.data,done:!1})}),Me(d,"compositionend",function(J){t.composing&&(J.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Me(d,"touchstart",function(){return n.forceCompositionEnd()}),Me(d,"input",function(){t.composing||t.readFromDOMSoon()});function K(J){if(!k(J)||q(r,J))return;if(r.somethingSelected())ia({lineWise:!1,text:r.getSelections()}),J.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var ee=So(r);ia({lineWise:!0,text:ee.text}),J.type=="cut"&&r.operation(function(){r.setSelections(ee.ranges,0,Se),r.replaceSelection("",null,"cut")})}else return;if(J.clipboardData){J.clipboardData.clearData();var ne=Mi.text.join(`
|
|
`);if(J.clipboardData.setData("Text",ne),J.clipboardData.getData("Text")==ne){J.preventDefault();return}}var be=Ao(),Ee=be.firstChild;r.display.lineSpace.insertBefore(be,r.display.lineSpace.firstChild),Ee.value=Mi.text.join(`
|
|
`);var Ie=document.activeElement;j(Ee),setTimeout(function(){r.display.lineSpace.removeChild(be),Ie.focus(),Ie==d&&n.showPrimarySelection()},50)}Me(d,"copy",K),Me(d,"cut",K)},kt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},kt.prototype.prepareSelection=function(){var e=ps(this.cm,!1);return e.focus=document.activeElement==this.div,e},kt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},kt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},kt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),d=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||d.line<t.display.viewFrom){e.removeAllRanges();return}var k=ra(t,e.anchorNode,e.anchorOffset),K=ra(t,e.focusNode,e.focusOffset);if(k&&!k.bad&&K&&!K.bad&&ft(rr(k,K),r)==0&&ft(_r(k,K),d)==0)return;var J=t.display.view,ee=r.line>=t.display.viewFrom&&Ro(t,r)||{node:J[0].measure.map[2],offset:0},ne=d.line<t.display.viewTo&&Ro(t,d);if(!ne){var be=J[J.length-1].measure,Ee=be.maps?be.maps[be.maps.length-1]:be.map;ne={node:Ee[Ee.length-1],offset:Ee[Ee.length-2]-Ee[Ee.length-3]}}if(!ee||!ne){e.removeAllRanges();return}var Ie=e.rangeCount&&e.getRangeAt(0),Re;try{Re=y(ee.node,ee.offset,ne.offset,ne.node)}catch(Fe){}Re&&(!M&&t.state.focused?(e.collapse(ee.node,ee.offset),Re.collapsed||(e.removeAllRanges(),e.addRange(Re))):(e.removeAllRanges(),e.addRange(Re)),Ie&&e.anchorNode==null?e.addRange(Ie):M&&this.startGracePeriod()),this.rememberSelection()},kt.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)},kt.prototype.showMultipleSelections=function(e){E(this.cm.display.cursorDiv,e.cursors),E(this.cm.display.selectionDiv,e.selection)},kt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},kt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return g(this.div,t)},kt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},kt.prototype.blur=function(){this.div.blur()},kt.prototype.getField=function(){return this.div},kt.prototype.supportsTouch=function(){return!0},kt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():bi(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)},kt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},kt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(o&&v&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var n=ra(t,e.anchorNode,e.anchorOffset),r=ra(t,e.focusNode,e.focusOffset);n&&r&&bi(t,function(){ni(t.doc,Ji(n,r),Se),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},kt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),d=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=We(r.line-1,Qe(e.doc,r.line-1).length)),d.ch==Qe(e.doc,d.line).text.length&&d.line<e.lastLine()&&(d=We(d.line+1,0)),r.line<t.viewFrom||d.line>t.viewTo-1)return!1;var k,K,J;r.line==t.viewFrom||(k=cr(e,r.line))==0?(K=pt(t.view[0].line),J=t.view[0].node):(K=pt(t.view[k].line),J=t.view[k-1].node.nextSibling);var ee=cr(e,d.line),ne,be;if(ee==t.view.length-1?(ne=t.viewTo-1,be=t.lineDiv.lastChild):(ne=pt(t.view[ee+1].line)-1,be=t.view[ee+1].node.previousSibling),!J)return!1;for(var Ee=e.doc.splitLines(tu(e,J,be,K,ne)),Ie=Ct(e.doc,We(K,0),We(ne,Qe(e.doc,ne).text.length));Ee.length>1&&Ie.length>1;)if(D(Ee)==D(Ie))Ee.pop(),Ie.pop(),ne--;else if(Ee[0]==Ie[0])Ee.shift(),Ie.shift(),K++;else break;for(var Re=0,Fe=0,Ue=Ee[0],Ye=Ie[0],Xe=Math.min(Ue.length,Ye.length);Re<Xe&&Ue.charCodeAt(Re)==Ye.charCodeAt(Re);)++Re;for(var it=D(Ee),$e=D(Ie),nt=Math.min(it.length-(Ee.length==1?Re:0),$e.length-(Ie.length==1?Re:0));Fe<nt&&it.charCodeAt(it.length-Fe-1)==$e.charCodeAt($e.length-Fe-1);)++Fe;if(Ee.length==1&&Ie.length==1&&K==r.line)for(;Re&&Re>r.ch&&it.charCodeAt(it.length-Fe-1)==$e.charCodeAt($e.length-Fe-1);)Re--,Fe++;Ee[Ee.length-1]=it.slice(0,it.length-Fe).replace(/^\u200b+/,""),Ee[0]=Ee[0].slice(Re).replace(/\u200b+$/,"");var ht=We(K,Re),lt=We(ne,Ie.length?D(Ie).length-Fe:0);if(Ee.length>1||Ee[0]||ft(ht,lt))return Fr(e.doc,Ee,ht,lt,"+input"),!0},kt.prototype.ensurePolled=function(){this.forceCompositionEnd()},kt.prototype.reset=function(){this.forceCompositionEnd()},kt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},kt.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)},kt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&bi(this.cm,function(){return pi(e.cm)})},kt.prototype.setUneditable=function(e){e.contentEditable="false"},kt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Jt(this.cm,Ka)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},kt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},kt.prototype.onContextMenu=function(){},kt.prototype.resetPosition=function(){},kt.prototype.needsContentAttribute=!0;function Ro(e,t){var n=fa(e,t.line);if(!n||n.hidden)return null;var r=Qe(e.doc,t.line),d=es(n,r,t.line),k=je(r,e.doc.direction),K="left";if(k){var J=He(k,t.ch);K=J%2?"right":"left"}var ee=rs(d.map,t.ch,K);return ee.offset=ee.collapse=="right"?ee.end:ee.start,ee}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Wr(e,t){return t&&(e.bad=!0),e}function tu(e,t,n,r,d){var k="",K=!1,J=e.doc.lineSeparator(),ee=!1;function ne(Re){return function(Fe){return Fe.id==Re}}function be(){K&&(k+=J,ee&&(k+=J),K=ee=!1)}function Ee(Re){Re&&(be(),k+=Re)}function Ie(Re){if(Re.nodeType==1){var Fe=Re.getAttribute("cm-text");if(Fe){Ee(Fe);return}var Ue=Re.getAttribute("cm-marker"),Ye;if(Ue){var Xe=e.findMarks(We(r,0),We(d+1,0),ne(+Ue));Xe.length&&(Ye=Xe[0].find(0))&&Ee(Ct(e.doc,Ye.from,Ye.to).join(J));return}if(Re.getAttribute("contenteditable")=="false")return;var it=/^(pre|div|p|li|table|br)$/i.test(Re.nodeName);if(!/^br$/i.test(Re.nodeName)&&Re.textContent.length==0)return;it&&be();for(var $e=0;$e<Re.childNodes.length;$e++)Ie(Re.childNodes[$e]);/^(pre|p)$/i.test(Re.nodeName)&&(ee=!0),it&&(K=!0)}else Re.nodeType==3&&Ee(Re.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ie(t),t==n);)t=t.nextSibling,ee=!1;return k}function ra(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return Wr(e.clipPos(We(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var d=0;d<e.display.view.length;d++){var k=e.display.view[d];if(k.node==r)return iu(k,t,n)}}function iu(e,t,n){var r=e.text.firstChild,d=!1;if(!t||!g(r,t))return Wr(We(pt(e.line),0),!0);if(t==r&&(d=!0,t=r.childNodes[n],n=0,!t)){var k=e.rest?D(e.rest):e.line;return Wr(We(pt(k),k.text.length),d)}var K=t.nodeType==3?t:null,J=t;for(!K&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(K=t.firstChild,n&&(n=K.nodeValue.length));J.parentNode!=r;)J=J.parentNode;var ee=e.measure,ne=ee.maps;function be(Ye,Xe,it){for(var $e=-1;$e<(ne?ne.length:0);$e++)for(var nt=$e<0?ee.map:ne[$e],ht=0;ht<nt.length;ht+=3){var lt=nt[ht+2];if(lt==Ye||lt==Xe){var bt=pt($e<0?e.line:e.rest[$e]),Nt=nt[ht]+it;return(it<0||lt!=Ye)&&(Nt=nt[ht+(it?1:0)]),We(bt,Nt)}}}var Ee=be(K,J,n);if(Ee)return Wr(Ee,d);for(var Ie=J.nextSibling,Re=K?K.nodeValue.length-n:0;Ie;Ie=Ie.nextSibling){if(Ee=be(Ie,Ie.firstChild,0),Ee)return Wr(We(Ee.line,Ee.ch-Re),d);Re+=Ie.textContent.length}for(var Fe=J.previousSibling,Ue=n;Fe;Fe=Fe.previousSibling){if(Ee=be(Fe,Fe.firstChild,-1),Ee)return Wr(We(Ee.line,Ee.ch+Ue),d);Ue+=Fe.textContent.length}}var Kt=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new re,this.hasSelection=!1,this.composing=null};Kt.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var d=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),f&&(d.style.width="0px"),Me(d,"input",function(){W&&H>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),Me(d,"paste",function(K){if(q(r,K)||To(K,r))return;r.state.pasteIncoming=+new Date,n.fastPoll()});function k(K){if(q(r,K))return;if(r.somethingSelected())ia({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var J=So(r);ia({lineWise:!0,text:J.text}),K.type=="cut"?r.setSelections(J.ranges,null,Se):(n.prevInput="",d.value=J.text.join(`
|
|
`),j(d))}else return;K.type=="cut"&&(r.state.cutIncoming=+new Date)}Me(d,"cut",k),Me(d,"copy",k),Me(e.scroller,"paste",function(K){if(Gi(e,K)||q(r,K))return;if(!d.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var J=new Event("paste");J.clipboardData=K.clipboardData,d.dispatchEvent(J)}),Me(e.lineSpace,"selectstart",function(K){Gi(e,K)||ie(K)}),Me(d,"compositionstart",function(){var K=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:K,range:r.markText(K,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Me(d,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Kt.prototype.createField=function(e){this.wrapper=Ao(),this.textarea=this.wrapper.firstChild},Kt.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Kt.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=ps(e);if(e.options.moveInputWithCursor){var d=Di(e,n.sel.primary().head,"div"),k=t.wrapper.getBoundingClientRect(),K=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,d.top+K.top-k.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,d.left+K.left-k.left))}return r},Kt.prototype.showSelection=function(e){var t=this.cm,n=t.display;E(n.cursorDiv,e.cursors),E(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Kt.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&j(this.textarea),W&&H>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",W&&H>=9&&(this.hasSelection=null))},Kt.prototype.getField=function(){return this.textarea},Kt.prototype.supportsTouch=function(){return!1},Kt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!u||F()!=this.textarea))try{this.textarea.focus()}catch(e){}},Kt.prototype.blur=function(){this.textarea.blur()},Kt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Kt.prototype.receivedFocus=function(){this.slowPoll()},Kt.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()})},Kt.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},Kt.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||at(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var d=n.value;if(d==r&&!t.somethingSelected())return!1;if(W&&H>=9&&this.hasSelection===d||s&&/[\uf700-\uf7ff]/.test(d))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var k=d.charCodeAt(0);if(k==8203&&!r&&(r="\u200B"),k==8666)return this.reset(),this.cm.execCommand("undo")}for(var K=0,J=Math.min(r.length,d.length);K<J&&r.charCodeAt(K)==d.charCodeAt(K);)++K;return bi(t,function(){Ka(t,d.slice(K),r.length-K,null,e.composing?"*compose":null),d.length>1e3||d.indexOf(`
|
|
`)>-1?n.value=e.prevInput="":e.prevInput=d,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Kt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Kt.prototype.onKeyPress=function(){W&&H>=9&&(this.hasSelection=null),this.fastPoll()},Kt.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,d=t.textarea;t.contextMenuPending&&t.contextMenuPending();var k=dr(n,e),K=r.scroller.scrollTop;if(!k||m)return;var J=n.options.resetSelectionOnContextMenu;J&&n.doc.sel.contains(k)==-1&&Jt(n,ni)(n.doc,Ji(k),Se);var ee=d.style.cssText,ne=t.wrapper.style.cssText,be=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",d.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-be.top-5)+"px; left: "+(e.clientX-be.left-5)+`px;
|
|
z-index: 1000; background: `+(W?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ee;i&&(Ee=window.scrollY),r.input.focus(),i&&window.scrollTo(null,Ee),r.input.reset(),n.somethingSelected()||(d.value=t.prevInput=" "),t.contextMenuPending=Re,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function Ie(){if(d.selectionStart!=null){var Ue=n.somethingSelected(),Ye="\u200B"+(Ue?d.value:"");d.value="\u21DA",d.value=Ye,t.prevInput=Ue?"":"\u200B",d.selectionStart=1,d.selectionEnd=Ye.length,r.selForContextMenu=n.doc.sel}}function Re(){if(t.contextMenuPending!=Re)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=ne,d.style.cssText=ee,W&&H<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=K),d.selectionStart!=null){(!W||W&&H<9)&&Ie();var Ue=0,Ye=function(){r.selForContextMenu==n.doc.sel&&d.selectionStart==0&&d.selectionEnd>0&&t.prevInput=="\u200B"?Jt(n,Vs)(n):Ue++<10?r.detectingSelectAll=setTimeout(Ye,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(Ye,200)}}if(W&&H>=9&&Ie(),R){me(e);var Fe=function(){Je(window,"mouseup",Fe),setTimeout(Re,20)};Me(window,"mouseup",Fe)}else setTimeout(Re,50)},Kt.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Kt.prototype.setUneditable=function(){},Kt.prototype.needsContentAttribute=!1;function ru(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 n=F();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=J.getValue()}var d;if(e.form&&(Me(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var k=e.form;d=k.submit;try{var K=k.submit=function(){r(),k.submit=d,k.submit(),k.submit=K}}catch(ee){}}t.finishInit=function(ee){ee.save=r,ee.getTextArea=function(){return e},ee.toTextArea=function(){ee.toTextArea=isNaN,r(),e.parentNode.removeChild(ee.getWrapperElement()),e.style.display="",e.form&&(Je(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=d))}},e.style.display="none";var J=jt(function(ee){return e.parentNode.insertBefore(ee,e.nextSibling)},t);return J}function nu(e){e.off=Je,e.on=Me,e.wheelEventPixels=dl,e.Doc=mi,e.splitLines=ot,e.countColumn=Y,e.findColumn=_e,e.isWordChar=Ce,e.Pass=ke,e.signal=le,e.Line=lr,e.changeEnd=Qi,e.scrollbarModel=xs,e.Pos=We,e.cmpPos=ft,e.modes=Ft,e.mimeModes=Tt,e.resolveMode=zt,e.getMode=di,e.modeExtensions=dt,e.extendMode=vt,e.copyState=Et,e.startState=oi,e.innerMode=Ht,e.commands=xn,e.keyMap=Ki,e.keyName=lo,e.isModifierKey=so,e.lookupKey=Ur,e.normalizeKeyMap=kl,e.StringStream=Mt,e.SharedTextMarker=bn,e.TextMarker=qi,e.LineWidget=yn,e.e_preventDefault=ie,e.e_stopPropagation=ae,e.e_stop=me,e.addClass=U,e.contains=g,e.rmClass=S,e.keyNames=er}$l(jt),ql(jt);var au="iter insert remove copy getEditor constructor".split(" ");for(var na in mi.prototype)mi.prototype.hasOwnProperty(na)&&fe(au,na)<0&&(jt.prototype[na]=function(e){return function(){return e.apply(this.doc,arguments)}}(mi.prototype[na]));return he(mi),jt.inputStyles={textarea:Kt,contenteditable:kt},jt.defineMode=function(e){!jt.defaults.mode&&e!="null"&&(jt.defaults.mode=e),si.apply(this,arguments)},jt.defineMIME=Ei,jt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),jt.defineMIME("text/plain","null"),jt.defineExtension=function(e,t){jt.prototype[e]=t},jt.defineDocExtension=function(e,t){mi.prototype[e]=t},jt.fromTextArea=ru,nu(jt),jt.version="5.58.2",jt})},Y1PL:function(Ze,Te,Z){"use strict";Z.r(Te),Z.d(Te,"ResizableTextArea",function(){return fe});var oe=Z("wx14"),$=Z("1OyB"),M=Z("vuIU"),X=Z("Ji7U"),B=Z("LK+K"),P=Z("q1tI"),W=Z("VTBJ"),H=Z("rePB"),i=Z("Zm9Q"),L=Z("Kwbf"),v=Z("c+Xe"),m=Z("m+aA"),p=Z("bdgK"),l=new Map;function h(Se){Se.forEach(function(Le){var ye,_e=Le.target;(ye=l.get(_e))===null||ye===void 0||ye.forEach(function(de){return de(_e)})})}var f=new p.default(h),o=null,u=null;function s(Se,Le){l.has(Se)||(l.set(Se,new Set),f.observe(Se)),l.get(Se).add(Le)}function a(Se,Le){l.has(Se)&&(l.get(Se).delete(Le),l.get(Se).size||(f.unobserve(Se),l.delete(Se)))}var C=function(Se){Object(X.a)(ye,Se);var Le=Object(B.a)(ye);function ye(){return Object($.a)(this,ye),Le.apply(this,arguments)}return Object(M.a)(ye,[{key:"render",value:function(){return this.props.children}}]),ye}(P.Component),_=P.createContext(null);function T(Se){var Le=Se.children,ye=Se.onBatchResize,_e=P.useRef(0),de=P.useRef([]),z=P.useContext(_),D=P.useCallback(function(I,V,Q){_e.current+=1;var G=_e.current;de.current.push({size:I,element:V,data:Q}),Promise.resolve().then(function(){G===_e.current&&(ye==null||ye(de.current),de.current=[])}),z==null||z(I,V,Q)},[ye,z]);return P.createElement(_.Provider,{value:D},Le)}function R(Se){var Le=Se.children,ye=Se.disabled,_e=P.useRef(null),de=P.useRef(null),z=P.useContext(_),D=P.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),I=P.isValidElement(Le)&&Object(v.c)(Le),V=I?Le.ref:null,Q=P.useMemo(function(){return Object(v.a)(V,_e)},[V,_e]),G=P.useRef(Se);G.current=Se;var ce=P.useCallback(function(Ce){var De=G.current,ue=De.onResize,ge=De.data,we=Ce.getBoundingClientRect(),Ae=we.width,Ne=we.height,Be=Ce.offsetWidth,Ge=Ce.offsetHeight,He=Math.floor(Ae),qe=Math.floor(Ne);if(D.current.width!==He||D.current.height!==qe||D.current.offsetWidth!==Be||D.current.offsetHeight!==Ge){var je={width:He,height:qe,offsetWidth:Be,offsetHeight:Ge};D.current=je;var Ke=Be===Math.round(Ae)?Ae:Be,Me=Ge===Math.round(Ne)?Ne:Ge,et=Object(W.a)(Object(W.a)({},je),{},{offsetWidth:Ke,offsetHeight:Me});z==null||z(et,Ce,ge),ue&&Promise.resolve().then(function(){ue(et,Ce)})}},[]);return P.useEffect(function(){var Ce=Object(m.a)(_e.current)||Object(m.a)(de.current);return Ce&&!ye&&s(Ce,ce),function(){return a(Ce,ce)}},[_e.current,ye]),P.createElement(C,{ref:de},I?P.cloneElement(Le,{ref:Q}):Le)}var O="rc-observer-key";function S(Se){var Le=Se.children,ye=Object(i.a)(Le);return ye.map(function(_e,de){var z=(_e==null?void 0:_e.key)||"".concat(O,"-").concat(de);return P.createElement(R,Object(oe.a)({},Se,{key:z}),_e)})}S.Collection=T;var w=S,E=Z("bT9E"),c=Z("TSYQ"),x=Z.n(c),y=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important
|
|
`,g=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],F={},U;function A(Se){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ye=Se.getAttribute("id")||Se.getAttribute("data-reactid")||Se.getAttribute("name");if(Le&&F[ye])return F[ye];var _e=window.getComputedStyle(Se),de=_e.getPropertyValue("box-sizing")||_e.getPropertyValue("-moz-box-sizing")||_e.getPropertyValue("-webkit-box-sizing"),z=parseFloat(_e.getPropertyValue("padding-bottom"))+parseFloat(_e.getPropertyValue("padding-top")),D=parseFloat(_e.getPropertyValue("border-bottom-width"))+parseFloat(_e.getPropertyValue("border-top-width")),I=g.map(function(Q){return"".concat(Q,":").concat(_e.getPropertyValue(Q))}).join(";"),V={sizingStyle:I,paddingSize:z,borderSize:D,boxSizing:de};return Le&&ye&&(F[ye]=V),V}function j(Se){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ye=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;U||(U=document.createElement("textarea"),U.setAttribute("tab-index","-1"),U.setAttribute("aria-hidden","true"),document.body.appendChild(U)),Se.getAttribute("wrap")?U.setAttribute("wrap",Se.getAttribute("wrap")):U.removeAttribute("wrap");var de=A(Se,Le),z=de.paddingSize,D=de.borderSize,I=de.boxSizing,V=de.sizingStyle;U.setAttribute("style","".concat(V,";").concat(y)),U.value=Se.value||Se.placeholder||"";var Q=Number.MIN_SAFE_INTEGER,G=Number.MAX_SAFE_INTEGER,ce=U.scrollHeight,Ce;if(I==="border-box"?ce+=D:I==="content-box"&&(ce-=z),ye!==null||_e!==null){U.value=" ";var De=U.scrollHeight-z;ye!==null&&(Q=De*ye,I==="border-box"&&(Q=Q+z+D),ce=Math.max(Q,ce)),_e!==null&&(G=De*_e,I==="border-box"&&(G=G+z+D),Ce=ce>G?"":"hidden",ce=Math.min(G,ce))}return{height:ce,minHeight:Q,maxHeight:G,overflowY:Ce,resize:"none"}}var N=Z("Gytx"),b=Z.n(N),Y;(function(Se){Se[Se.NONE=0]="NONE",Se[Se.RESIZING=1]="RESIZING",Se[Se.RESIZED=2]="RESIZED"})(Y||(Y={}));var re=function(Se){Object(X.a)(ye,Se);var Le=Object(B.a)(ye);function ye(_e){var de;return Object($.a)(this,ye),de=Le.call(this,_e),de.nextFrameActionId=void 0,de.resizeFrameId=void 0,de.textArea=void 0,de.saveTextArea=function(z){de.textArea=z},de.handleResize=function(z){var D=de.state.resizeStatus,I=de.props,V=I.autoSize,Q=I.onResize;if(D!==Y.NONE)return;typeof Q=="function"&&Q(z),V&&de.resizeOnNextFrame()},de.resizeOnNextFrame=function(){cancelAnimationFrame(de.nextFrameActionId),de.nextFrameActionId=requestAnimationFrame(de.resizeTextarea)},de.resizeTextarea=function(){var z=de.props.autoSize;if(!z||!de.textArea)return;var D=z.minRows,I=z.maxRows,V=j(de.textArea,!1,D,I);de.setState({textareaStyles:V,resizeStatus:Y.RESIZING},function(){cancelAnimationFrame(de.resizeFrameId),de.resizeFrameId=requestAnimationFrame(function(){de.setState({resizeStatus:Y.RESIZED},function(){de.resizeFrameId=requestAnimationFrame(function(){de.setState({resizeStatus:Y.NONE}),de.fixFirefoxAutoScroll()})})})})},de.renderTextArea=function(){var z=de.props,D=z.prefixCls,I=D===void 0?"rc-textarea":D,V=z.autoSize,Q=z.onResize,G=z.className,ce=z.disabled,Ce=de.state,De=Ce.textareaStyles,ue=Ce.resizeStatus,ge=Object(E.a)(de.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),we=x()(I,G,Object(H.a)({},"".concat(I,"-disabled"),ce));"value"in ge&&(ge.value=ge.value||"");var Ae=Object(W.a)(Object(W.a)(Object(W.a)({},de.props.style),De),ue===Y.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return P.createElement(w,{onResize:de.handleResize,disabled:!(V||Q)},P.createElement("textarea",Object(oe.a)({},ge,{className:we,style:Ae,ref:de.saveTextArea})))},de.state={textareaStyles:{},resizeStatus:Y.NONE},de}return Object(M.a)(ye,[{key:"componentDidUpdate",value:function(de){(de.value!==this.props.value||!b()(de.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 de=this.textArea.selectionStart,z=this.textArea.selectionEnd;this.textArea.setSelectionRange(de,z)}}catch(D){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ye}(P.Component),fe=re,ve=function(Se){Object(X.a)(ye,Se);var Le=Object(B.a)(ye);function ye(_e){var de;Object($.a)(this,ye),de=Le.call(this,_e),de.resizableTextArea=void 0,de.focus=function(){de.resizableTextArea.textArea.focus()},de.saveTextArea=function(D){de.resizableTextArea=D},de.handleChange=function(D){var I=de.props.onChange;de.setValue(D.target.value,function(){de.resizableTextArea.resizeTextarea()}),I&&I(D)},de.handleKeyDown=function(D){var I=de.props,V=I.onPressEnter,Q=I.onKeyDown;D.keyCode===13&&V&&V(D),Q&&Q(D)};var z=typeof _e.value=="undefined"||_e.value===null?_e.defaultValue:_e.value;return de.state={value:z},de}return Object(M.a)(ye,[{key:"setValue",value:function(de,z){"value"in this.props||this.setState({value:de},z)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return P.createElement(fe,Object(oe.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(de){return"value"in de?{value:de.value}:null}}]),ye}(P.Component),ke=Te.default=ve},ZW9T:function(Ze,Te,Z){"use strict";Z.d(Te,"a",function(){return N});var oe=Z("k1fw"),$=Z("oBTY"),M=Z("miYZ"),X=Z("tsqr"),B=Z("rAM+"),P=Z("tJVT"),W=Z("PpiC"),H=Z("q1tI"),i=Z.n(H),L=Z("bdgK"),v=Z("9og8"),m=Z("WmNS"),p=Z.n(m),l={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"]},h={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},f={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
`)},{label:"if",content:["if () {"," $0","}"].join(`
|
|
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
|
|
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
|
|
`)},{label:"include <vector>",content:["#include <vector>"].join(`
|
|
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
|
|
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
|
|
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
|
|
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
|
|
`)},{label:"include <map>",content:["#include <map>"].join(`
|
|
`)},{label:"include <string>",content:["#include <string>"].join(`
|
|
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
|
|
`)}]},o={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
|
|
`)}]},u=Z("5VLF"),s=Z.n(u),a={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},C=function(Y,re){return re.map(function(fe){return{label:fe,kind:Y.languages.CompletionItemKind.Keyword,insertText:fe}})},_=function(Y){return Object.keys(a.tables).map(function(re){return{label:re,kind:Y.languages.CompletionItemKind.Variable,insertText:re}})},T=function(Y,re){var fe=a.tables[Y];return fe?fe.map(function(ve){return{label:ve,kind:re.languages.CompletionItemKind.Field,insertText:ve}}):[]};function R(b,Y,re,fe,ve){var ke=Y.getWordUntilPosition(re),Se={startLineNumber:re.lineNumber,endLineNumber:re.lineNumber,startColumn:ke.startColumn,endColumn:ke.endColumn},Le=fe.map(function(ye){return{label:ye,kind:b.languages.CompletionItemKind.Keyword,insertText:ye,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Se}});return ve.map(function(ye){Le.push(Object(oe.a)(Object(oe.a)({},ye),{},{range:Se}))}),Le}var O=function(b){a.languages.map(function(ve){return b.languages.registerDocumentFormattingEditProvider(ve,{provideDocumentFormattingEdits:function(Se,Le,ye){return Object(v.a)(p.a.mark(function _e(){var de;return p.a.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return de=s()(Se.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}),D.abrupt("return",[{range:Se.getFullModelRange(),text:de}]);case 2:case"end":return D.stop()}},_e)}))()}}),ve});var Y=f.quickKey.map(function(ve){return{label:ve.label,kind:b.languages.CompletionItemKind.Method,insertText:ve.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),re=o.quickKey.map(function(ve){return{label:ve.label,kind:b.languages.CompletionItemKind.Method,insertText:ve.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),fe=h.quickKey.map(function(ve){return{label:ve.label,kind:b.languages.CompletionItemKind.Method,insertText:ve.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}});b.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(ke,Se){var Le=ke.getWordUntilPosition(Se),ye={startLineNumber:Se.lineNumber,endLineNumber:Se.lineNumber,startColumn:Le.startColumn,endColumn:Le.endColumn},_e=ke.getLineContent(Se.lineNumber).substring(Le.startColumn-2,Le.endColumn);return{suggestions:[].concat(Object($.a)(f.keywords.map(function(de){return{label:de,kind:b.languages.CompletionItemKind.Function,documentation:de,insertText:de,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ye}})),Object($.a)(f.quickKey.map(function(de){return{label:de.label,kind:b.languages.CompletionItemKind.Function,documentation:de.content,insertText:_e.startsWith("#")?de.content.replace(/#/,""):de.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ye}})))}}}),b.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(ke,Se){var Le=ke.getWordUntilPosition(Se),ye={startLineNumber:Se.lineNumber,endLineNumber:Se.lineNumber,startColumn:Le.startColumn,endColumn:Le.endColumn};return{suggestions:Object($.a)(l.keywords.map(function(_e){return{label:_e,kind:b.languages.CompletionItemKind.Function,documentation:_e,insertText:_e,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ye}}))}}}),b.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(ke,Se){var Le=ke.getWordUntilPosition(Se),ye={startLineNumber:Se.lineNumber,endLineNumber:Se.lineNumber,startColumn:Le.startColumn,endColumn:Le.endColumn},_e=ke.getLineContent(Se.lineNumber).substring(Le.startColumn-2,Le.endColumn);return{suggestions:[].concat(Object($.a)(h.keywords.map(function(de){return{label:de,kind:b.languages.CompletionItemKind.Function,documentation:de,insertText:de,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ye}})),Object($.a)(h.quickKey.map(function(de){return{label:de.label,kind:b.languages.CompletionItemKind.Function,documentation:de.content,insertText:_e.startsWith("#")?de.content.replace(/#/,""):de.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ye}})))}}}),b.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(ke,Se){var Le=ke.getWordUntilPosition(Se),ye={startLineNumber:Se.lineNumber,endLineNumber:Se.lineNumber,startColumn:Le.startColumn,endColumn:Le.endColumn},_e=ke.getLineContent(Se.lineNumber).substring(Le.startColumn-2,Le.endColumn);return{suggestions:[].concat(Object($.a)(o.keywords.map(function(de){return{label:de,kind:b.languages.CompletionItemKind.Function,documentation:de,insertText:de,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ye}})),Object($.a)(o.quickKey.map(function(de){return{label:de.label,kind:b.languages.CompletionItemKind.Function,documentation:de.content,insertText:_e.startsWith("#")?de.content.replace(/#/,""):de.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ye}})))}}})},S="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",w=Z("fjLI"),E=Z("LvDl"),c=Z("+ua5");function x(b){return/^\d+$/.test(b)?"".concat(b,"px"):b}function y(){}var g=!1,F={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function U(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Y=b;if(Array.isArray(b)){for(var re=0;re<b.length;re++){var fe=F[b[re]];if(fe)return fe}return Y[0]}return F[Y]||Y}var A=null,j=Te.b=function(b){var Y=b.width,re=Y===void 0?"100%":Y,fe=b.height,ve=fe===void 0?"100%":fe,ke=b.value,Se=b.language,Le=Se===void 0?"javascript":Se,ye=b.style,_e=ye===void 0?{}:ye,de=b.options,z=de===void 0?{}:de,D=b.overrideServices,I=D===void 0?{}:D,V=b.theme,Q=V===void 0?"vs-dark":V,G=b.onEditBlur,ce=b.onSave,Ce=b.autoHeight,De=Ce===void 0?!1:Ce,ue=b.forbidCopy,ge=ue===void 0?!1:ue,we=b.onChange,Ae=we===void 0?y:we,Ne=b.editorDidMount,Be=Ne===void 0?y:Ne,Ge=b.onFocus,He=Ge===void 0?y:Ge,qe=b.filename,je=qe===void 0?"educoder.txt":qe,Ke=b.errorLine,Me=b.errorContent,et=Me===void 0?"":Me,Je=Object(W.a)(b,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),le=Object(H.useRef)(),q=Object(H.useRef)({}),te=Object(H.useRef)(),se=Object(H.useRef)(),he=Object(H.useRef)(!1),ie=Object(H.useRef)(),ae=Object(H.useState)(!1),pe=Object(P.a)(ae,2),me=pe[0],xe=pe[1];function Oe(){var dt;return le.current&&(dt=new L.default(function(vt){var Et=Object(B.a)(vt),Ht;try{for(Et.s();!(Ht=Et.n()).done;){var oi=Ht.value;(oi.target.offsetHeight>0||oi.target.offsetWidth>0)&&q.current.instance.layout()}}catch(Mt){Et.e(Mt)}finally{Et.f()}}),dt.observe(le.current)),dt}function Pe(){X.b.warn(decodeURIComponent(S))}var ze=function(){var vt=q.current.instance;if(ke!=null&&vt&&me){var Et=vt.getModel();Et&&ke!==Et.getValue()&&(g=!0,Et.setValue(ke),vt.layout(),g=!1)}};Object(H.useEffect)(function(){se.current&&clearTimeout(se.current),se.current=setTimeout(function(){ze()},500)},[ke,me,q.current]),Object(H.useEffect)(function(){if(Ke&&q.current&&q.current.instance){var dt=q.current.instance;dt.changeViewZones(function(Et){var Ht=document.createElement("div");Ht.style.padding="10px 20px",Ht.style.width="calc(100% - 20px)",Ht.className="my-error-line-wrp",Ht.innerHTML=et,Et.addZone({afterLineNumber:Ke||11,heightInLines:3,domNode:Ht})});var vt={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}};dt.addOverlayWidget(vt),dt.revealPositionInCenter({lineNumber:20,column:1})}},[Ke,q.current,me]);function tt(){var dt=q.current.instance;if(dt){var vt=dt.getSelection(),Et=q.current.pastePos||{},Ht=new A.Range(Et.startLineNumber||vt.endLineNumber,Et.startColumn||vt.endColumn,Et.endLineNumber||vt.endLineNumber,Et.endColumn||vt.endColumn);setTimeout(function(){dt.executeEdits("",[{range:Ht,text:""}])},300)}}function rt(dt){(window.navigator.platform.match("Mac")?dt.metaKey:dt.ctrlKey)&&dt.keyCode==83&&(dt.preventDefault(),ce())}var yt=function(){if(De&&q.current.instance){var vt=q.current.instance.getContentHeight();zt(vt<ve?ve:vt)}else zt(ve)};function ot(dt){var vt=document.createEvent("MouseEvents");vt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),dt.dispatchEvent(vt)}function at(dt,vt){var Et=window.URL||window.webkitURL||window,Ht=new Blob([vt]),oi=document.createElementNS("http://www.w3.org/1999/xhtml","a");oi.href=Et.createObjectURL(Ht),oi.download=dt,ot(oi)}Object(H.useEffect)(function(){yt()},[yt]),Object(H.useEffect)(function(){le.current&&!me&&Promise.all([Z.e(18),Z.e(29)]).then(Z.t.bind(null,"M/lh",7)).then(function(dt){try{A=dt,q.current.instance=A.editor.create(le.current,{value:ke,language:U(Le),theme:Q,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},I);var vt=q.current.instance,Et=w.d._menuItems,Ht=Object($.a)(Et).find(function(Ot){return Ot[0]._debugName=="EditorContext"}),oi=Ht[1],Mt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Qe=function(ct,pt){var wt=ct._first;do{var ii,Ut,We=pt.includes((ii=wt.element)===null||ii===void 0||((Ut=ii.command)===null||Ut===void 0)?void 0:Ut.id);We&&ct._remove(wt)}while(wt=wt.next)};if(Be(vt,A),setTimeout(function(){yt(),q.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){at(je||"educoder.txt",vt.getValue())}}),vt.getDomNode().addEventListener("input",function(){te.current.autoFormat&&vt.getAction("editor.action.formatDocument").run()})},500),q.current.subscription=vt.onDidChangeModelContent(function(Ot){he.current?clearTimeout(ie.current):(yt(),Ae(vt.getValue(),Ot)),ie.current=setTimeout(function(){he.current=!1},500)}),window.Monaco||O(A,U(Le)),ge&&(Qe(oi,Mt),le.current.classList.add("noCopyPaste"),vt.onKeyDown(function(Ot){var ct=Ot.keyCode,pt=Ot.ctrlKey,wt=Ot.metaKey;(ct===33||ct===52)&&(wt||pt)&&(Pe(),Ot.preventDefault())})),window.Monaco=A,G&&vt.onDidBlurEditorWidget(function(){G(vt.getValue())}),He&&vt.onDidFocusEditorText(function(){He(vt.getValue())}),ge){vt.addCommand(A.KeyMod.CtrlCmd|A.KeyCode.KEY_V,function(){return Pe(),null}),vt.onDidPaste(function(Ot){q.current.pastePos=Ot});try{window.addEventListener("paste",tt)}catch(Ot){}}var Ct=Oe();return xe(!0),function(){var Ot=q.current.instance;Ot.dispose();var ct=Ot.getModel();ct&&ct.dispose(),q.current.subscription&&q.current.subscription.dispose(),ge&&window.removeEventListener("paste",tt),Ct.unobserve(le.current)}}catch(Ot){}})},[]),Object(H.useEffect)(function(){var dt=q.current.instance;if(dt&&me)return document.addEventListener("keydown",rt,!1),function(){document.removeEventListener("keydown",rt)}},[ce,me]),Object(H.useEffect)(function(){var dt=q.current.instance;if(dt&&me){var vt=U(Le);A.editor.setModelLanguage(dt.getModel(),vt),console.log("language:",Le,dt.getModel(),vt)}},[Le,me]),Object(H.useEffect)(function(){var dt=q.current.instance;dt&&me&&A.editor.setTheme(Q)},[Q,me]),Object(H.useEffect)(function(){var dt=q.current.instance;te.current=z,dt&&me&&(dt.updateOptions(Object(oe.a)({},z)),setTimeout(function(){dt.getModel().updateOptions(Object(oe.a)({},z))},200))},[JSON.stringify(z),me]),Object(H.useEffect)(function(){var dt=q.current.instance;dt&&me&&dt.layout()},[re,ve,me]);var Lt=Object(H.useState)(x(re)),_t=Object(P.a)(Lt,2),Bt=_t[0],Ft=_t[1],Tt=Object(H.useState)(x(ve)),si=Object(P.a)(Tt,2),Ei=si[0],zt=si[1],di=Object(oe.a)(Object(oe.a)({},_e),{},{width:Bt,height:Ei});return i.a.createElement("div",{className:"my-monaco-editor",ref:le,style:di})};function N(b){var Y=b.width,re=Y===void 0?"100%":Y,fe=b.height,ve=fe===void 0?"100%":fe,ke=b.original,Se=b.modified,Le=b.language,ye=b.options,_e=ye===void 0?{}:ye,de=Object(H.useRef)(),z=Object(H.useState)(null),D=Object(P.a)(z,2),I=D[0],V=D[1];function Q(De){var ue;return de.current&&(ue=new L.default(function(ge){var we=Object(B.a)(ge),Ae;try{for(we.s();!(Ae=we.n()).done;){var Ne=Ae.value;(Ne.target.offsetHeight>0||Ne.target.offsetWidth>0)&&De.layout()}}catch(Be){we.e(Be)}finally{we.f()}}),ue.observe(de.current)),ue}Object(H.useEffect)(function(){de.current&&Promise.all([Z.e(18),Z.e(29)]).then(Z.t.bind(null,"M/lh",7)).then(function(De){A=De;var ue=A.editor.createDiffEditor(de.current,Object(oe.a)(Object(oe.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},_e),{},{wordWrap:!0}));V(ue);var ge=Q(ue);return function(){ue.dispose();var we=ue.getModel();we&&we.dispose(),ge.unobserve(de.current)}})},[]),Object(H.useEffect)(function(){I&&I.setModel({original:A.editor.createModel(ke,Le),modified:A.editor.createModel(Se,Le)})},[ke,Se,Le,I]);var G=x(re),ce=x(ve),Ce={width:G,height:ce};return i.a.createElement("div",{className:"my-diff-editor",ref:de,style:Ce})}},bT9E:function(Ze,Te,Z){"use strict";Z.d(Te,"a",function(){return $});var oe=Z("VTBJ");function $(M,X){var B=Object(oe.a)({},M);return Array.isArray(X)&&X.forEach(function(P){delete B[P]}),B}},c5Ni:function(Ze,Te,Z){},dejd:function(Ze,Te,Z){},dmUQ:function(Ze,Te,Z){"use strict";var oe=Z("Ff2n"),$=Z("rePB"),M=Z("1OyB"),X=Z("vuIU"),B=Z("Ji7U"),P=Z("md7G"),W=Z("foSv"),H=Z("q1tI"),i=Z.n(H),L=Z("TSYQ"),v=Z.n(L),m=Z("4IlW");function p(E,c){var x=Object.keys(E);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(E);c&&(y=y.filter(function(g){return Object.getOwnPropertyDescriptor(E,g).enumerable})),x.push.apply(x,y)}return x}function l(E){for(var c=1;c<arguments.length;c++){var x=arguments[c]!=null?arguments[c]:{};c%2?p(Object(x),!0).forEach(function(y){Object($.a)(E,y,x[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(x)):p(Object(x)).forEach(function(y){Object.defineProperty(E,y,Object.getOwnPropertyDescriptor(x,y))})}return E}function h(E){var c=f();return function(){var y=Object(W.a)(E),g;if(c){var F=Object(W.a)(this).constructor;g=Reflect.construct(y,arguments,F)}else g=y.apply(this,arguments);return Object(P.a)(this,g)}}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(E){return!1}}function o(){}function u(E){E.preventDefault()}var s=function(c){return c.replace(/[^\w.-]+/g,"")},a=200,C=600,_=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,T=function(c){return c!=null},R=function(c,x){return x===c||typeof x=="number"&&typeof c=="number"&&isNaN(x)&&isNaN(c)},O=function(E){Object(B.a)(x,E);var c=h(x);function x(y){var g;Object(M.a)(this,x),g=c.call(this,y),g.onKeyDown=function(A){var j=g.props,N=j.onKeyDown,b=j.onPressEnter;if(A.keyCode===m.a.UP){var Y=g.getRatio(A);g.up(A,Y,null),g.stop()}else if(A.keyCode===m.a.DOWN){var re=g.getRatio(A);g.down(A,re,null),g.stop()}else A.keyCode===m.a.ENTER&&b&&b(A);if(g.recordCursorPosition(),g.lastKeyCode=A.keyCode,N){for(var fe=arguments.length,ve=new Array(fe>1?fe-1:0),ke=1;ke<fe;ke++)ve[ke-1]=arguments[ke];N.apply(void 0,[A].concat(ve))}},g.onKeyUp=function(A){var j=g.props.onKeyUp;if(g.stop(),g.recordCursorPosition(),j){for(var N=arguments.length,b=new Array(N>1?N-1:0),Y=1;Y<N;Y++)b[Y-1]=arguments[Y];j.apply(void 0,[A].concat(b))}},g.onChange=function(A){var j=g.props.onChange;g.state.focused&&(g.inputting=!0),g.rawInput=g.props.parser(g.getValueFromEvent(A)),g.setState({inputValue:g.rawInput}),j(g.toNumber(g.rawInput))},g.onMouseUp=function(){var A=g.props.onMouseUp;g.recordCursorPosition(),A&&A.apply(void 0,arguments)},g.onFocus=function(){var A;g.setState({focused:!0}),(A=g.props).onFocus.apply(A,arguments)},g.onBlur=function(){var A=g.props.onBlur;g.inputting=!1,g.setState({focused:!1});var j=g.getCurrentValidValue(g.state.inputValue),N=g.setValue(j,o);if(A){var b=g.input.value,Y=g.getInputDisplayValue({focus:!1,value:N});g.input.value=Y&&Number(Y),A.apply(void 0,arguments),g.input.value=b}},g.getRatio=function(A){var j=1;return A.metaKey||A.ctrlKey?j=.1:A.shiftKey&&(j=10),j},g.getFullNum=function(A){return isNaN(A)?A:/e/i.test(String(A))?Number(A).toFixed(18).replace(/\.?0+$/,""):A},g.getPrecision=function(A){if(T(g.props.precision))return g.props.precision;var j=String(A);if(j.indexOf("e-")>=0)return parseInt(j.slice(j.indexOf("e-")+2),10);var N=0;return j.indexOf(".")>=0&&(N=j.length-j.indexOf(".")-1),N},g.getInputDisplayValue=function(A){var j=A||g.state,N=j.focused,b=j.inputValue,Y=j.value,re;N?re=b:re=g.toPrecisionAsStep(Y),re==null&&(re="");var fe=g.formatWrapper(re);return T(g.props.decimalSeparator)&&(fe=fe.toString().replace(".",g.props.decimalSeparator)),fe},g.recordCursorPosition=function(){try{g.cursorStart=g.input.selectionStart,g.cursorEnd=g.input.selectionEnd,g.currentValue=g.input.value,g.cursorBefore=g.input.value.substring(0,g.cursorStart),g.cursorAfter=g.input.value.substring(g.cursorEnd)}catch(A){}},g.restoreByAfter=function(A){if(A===void 0)return!1;var j=g.input.value,N=j.lastIndexOf(A);if(N===-1)return!1;var b=g.cursorBefore.length;return g.lastKeyCode===m.a.DELETE&&g.cursorBefore.charAt(b-1)===A[0]?(g.fixCaret(b,b),!0):N+A.length===j.length?(g.fixCaret(N,N),!0):!1},g.partRestoreByAfter=function(A){return A===void 0?!1:Array.prototype.some.call(A,function(j,N){var b=A.substring(N);return g.restoreByAfter(b)})},g.isNotCompleteNumber=function(A){return isNaN(A)||A===""||A===null||A&&A.toString().indexOf(".")===A.toString().length-1},g.stop=function(){g.autoStepTimer&&clearTimeout(g.autoStepTimer)},g.down=function(A,j,N){g.pressingUpOrDown=!0,g.step("down",A,j,N)},g.up=function(A,j,N){g.pressingUpOrDown=!0,g.step("up",A,j,N)},g.saveInput=function(A){g.input=A};var F=y.value;F===void 0&&(F=y.defaultValue),g.state={focused:y.autoFocus};var U=g.getValidValue(g.toNumber(F));return g.state=l(l({},g.state),{},{inputValue:g.toPrecisionAsStep(U),value:U}),g}return Object(X.a)(x,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(g){var F=this.props,U=F.value,A=F.onChange,j=F.max,N=F.min,b=this.state.focused;if(g){if(!R(g.value,U)||!R(g.max,j)||!R(g.min,N)){var Y=b?U:this.getValidValue(U),re;this.pressingUpOrDown?re=Y:this.inputting?re=this.rawInput:re=this.toPrecisionAsStep(Y),this.setState({value:Y,inputValue:re})}var fe="value"in this.props?U:this.state.value;"max"in this.props&&g.max!==j&&typeof fe=="number"&&fe>j&&A&&A(j),"min"in this.props&&g.min!==N&&typeof fe=="number"&&fe<N&&A&&A(N)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ve=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===m.a.BACKSPACE?ve=this.cursorStart-1:this.lastKeyCode===m.a.DELETE&&(ve=this.cursorStart):ve=this.input.value.length,this.fixCaret(ve,ve)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case m.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case m.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(ke){}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(g){var F=g;return F===""?F="":this.isNotCompleteNumber(parseFloat(F))?F=this.state.value:F=this.getValidValue(F),this.toNumber(F)}},{key:"getValueFromEvent",value:function(g){var F=g.target.value.trim().replace(/。/g,".");return T(this.props.decimalSeparator)&&(F=F.replace(this.props.decimalSeparator,".")),F}},{key:"getValidValue",value:function(g){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,A=parseFloat(g);return isNaN(A)?g:(A<F&&(A=F),A>U&&(A=U),A)}},{key:"setValue",value:function(g,F){var U=this.props.precision,A=this.isNotCompleteNumber(parseFloat(g))?null:parseFloat(g),j=this.state.value,N=j===void 0?null:j,b=this.state.inputValue,Y=b===void 0?null:b,re=typeof A=="number"?A.toFixed(U):"".concat(A),fe=A!==N||re!=="".concat(Y);return"value"in this.props?(Y=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:Y},F)):this.setState({value:A,inputValue:this.toPrecisionAsStep(g)},F),fe&&this.props.onChange(A),A}},{key:"getMaxPrecision",value:function(g){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.props,A=U.precision,j=U.step;if(T(A))return A;var N=this.getPrecision(F),b=this.getPrecision(j),Y=this.getPrecision(g);return g?Math.max(Y,N+b):N+b}},{key:"getPrecisionFactor",value:function(g){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.getMaxPrecision(g,F);return Math.pow(10,U)}},{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(g){return this.props.formatter?this.props.formatter(g):g}},{key:"toPrecisionAsStep",value:function(g){if(this.isNotCompleteNumber(g)||g==="")return g;var F=Math.abs(this.getMaxPrecision(g));return isNaN(F)?g.toString():Number(g).toFixed(F)}},{key:"toNumber",value:function(g){var F=this.props.precision,U=this.state.focused,A=g&&g.length>16&&U;return this.isNotCompleteNumber(g)||A?g:T(F)?Math.round(g*Math.pow(10,F))/Math.pow(10,F):Number(g)}},{key:"upStep",value:function(g,F){var U=this.props.step,A=this.getPrecisionFactor(g,F),j=Math.abs(this.getMaxPrecision(g,F)),N=((A*g+A*U*F)/A).toFixed(j);return this.toNumber(N)}},{key:"downStep",value:function(g,F){var U=this.props.step,A=this.getPrecisionFactor(g,F),j=Math.abs(this.getMaxPrecision(g,F)),N=((A*g-A*U*F)/A).toFixed(j);return this.toNumber(N)}},{key:"step",value:function(g,F){var U=this,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,j=arguments.length>3?arguments[3]:void 0;this.stop(),F&&(F.persist(),F.preventDefault());var N=this.props;if(N.disabled)return;var b=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(b))return;var Y=this["".concat(g,"Step")](b,A),re=Y>N.max||Y<N.min;if(Y>N.max?Y=N.max:Y<N.min&&(Y=N.min),this.setValue(Y,null),this.setState({focused:!0},function(){U.pressingUpOrDown=!1}),re)return;this.autoStepTimer=setTimeout(function(){U[g](F,A,!0)},j?a:C)}},{key:"fixCaret",value:function(g,F){if(g===void 0||F===void 0||!this.input||!this.input.value)return;try{var U=this.input.selectionStart,A=this.input.selectionEnd;(g!==U||F!==A)&&this.input.setSelectionRange(g,F)}catch(j){}}},{key:"render",value:function(){var g,F=this.props,U=F.prefixCls,A=F.disabled,j=F.readOnly,N=F.useTouch,b=F.autoComplete,Y=F.upHandler,re=F.downHandler,fe=F.className,ve=F.max,ke=F.min,Se=F.style,Le=F.title,ye=F.onMouseEnter,_e=F.onMouseLeave,de=F.onMouseOver,z=F.onMouseOut,D=F.required,I=F.onClick,V=F.tabIndex,Q=F.type,G=F.placeholder,ce=F.id,Ce=F.inputMode,De=F.pattern,ue=F.step,ge=F.maxLength,we=F.autoFocus,Ae=F.name,Ne=F.onPaste,Be=F.onInput,Ge=Object(oe.a)(F,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),He=this.state,qe=He.value,je=He.focused,Ke=v()(U,(g={},Object($.a)(g,fe,!!fe),Object($.a)(g,"".concat(U,"-disabled"),A),Object($.a)(g,"".concat(U,"-focused"),je),g)),Me={};Object.keys(Ge).forEach(function(me){(me.substr(0,5)==="data-"||me.substr(0,5)==="aria-"||me==="role")&&(Me[me]=Ge[me])});var et=!j&&!A,Je=this.getInputDisplayValue(null),le=(qe||qe===0)&&(isNaN(qe)||Number(qe)>=ve),q=(qe||qe===0)&&(isNaN(qe)||Number(qe)<=ke),te=le||A||j,se=q||A||j,he=v()("".concat(U,"-handler"),"".concat(U,"-handler-up"),Object($.a)({},"".concat(U,"-handler-up-disabled"),te)),ie=v()("".concat(U,"-handler"),"".concat(U,"-handler-down"),Object($.a)({},"".concat(U,"-handler-down-disabled"),se)),ae=N?{onTouchStart:te?o:this.up,onTouchEnd:this.stop}:{onMouseDown:te?o:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},pe=N?{onTouchStart:se?o:this.down,onTouchEnd:this.stop}:{onMouseDown:se?o:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return i.a.createElement("div",{className:Ke,style:Se,title:Le,onMouseEnter:ye,onMouseLeave:_e,onMouseOver:de,onMouseOut:z,onFocus:function(){return null},onBlur:function(){return null}},i.a.createElement("div",{className:"".concat(U,"-handler-wrap")},i.a.createElement("span",Object.assign({unselectable:"on"},ae,{role:"button","aria-label":"Increase Value","aria-disabled":te,className:he}),Y||i.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-up-inner"),onClick:u})),i.a.createElement("span",Object.assign({unselectable:"on"},pe,{role:"button","aria-label":"Decrease Value","aria-disabled":se,className:ie}),re||i.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-down-inner"),onClick:u}))),i.a.createElement("div",{className:"".concat(U,"-input-wrap")},i.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":ke,"aria-valuemax":ve,"aria-valuenow":qe,required:D,type:Q,placeholder:G,onPaste:Ne,onClick:I,onMouseUp:this.onMouseUp,className:"".concat(U,"-input"),tabIndex:V,autoComplete:b,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:et?this.onKeyDown:o,onKeyUp:et?this.onKeyUp:o,autoFocus:we,maxLength:ge,readOnly:j,disabled:A,max:ve,min:ke,step:ue,name:Ae,title:Le,id:ce,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Je),pattern:De,inputMode:Ce,onInput:Be},Me))))}}]),x}(i.a.Component);O.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:_,min:-_,step:1,style:{},onChange:o,onKeyDown:o,onPressEnter:o,onFocus:o,onBlur:o,parser:s,required:!1,autoComplete:"off"};var S=O,w=Te.a=S},fjLI:function(Ze,Te,Z){"use strict";Z.d(Te,"f",function(){return p}),Z.d(Te,"b",function(){return l}),Z.d(Te,"a",function(){return h}),Z.d(Te,"d",function(){return f}),Z.d(Te,"e",function(){return o}),Z.d(Te,"c",function(){return u});var oe=Z("8HAY"),$=Z("Vhoy"),M=Z("MI8n"),X=Z("JYp7"),B=Z("pmY6"),P=Z("24hK"),W=Z("nnTU"),H=Z("T8No"),i=Z("Cg/j"),L=Z("t9D7"),v=function(s,a,C,_){var T=arguments.length,R=T<3?a:_===null?_=Object.getOwnPropertyDescriptor(a,C):_,O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(s,a,C,_);else for(var S=s.length-1;S>=0;S--)(O=s[S])&&(R=(T<3?O(R):T>3?O(a,C,R):O(a,C))||R);return T>3&&R&&Object.defineProperty(a,C,R),R},m=function(s,a){return function(C,_){a(C,_,s)}};function p(s){return s.command!==void 0}class l{constructor(s){this.id=l._idPool++,this._debugName=s}}l._idPool=0,l.CommandPalette=new l("CommandPalette"),l.EditorContext=new l("EditorContext"),l.SimpleEditorContext=new l("SimpleEditorContext"),l.EditorContextCopy=new l("EditorContextCopy"),l.EditorContextPeek=new l("EditorContextPeek"),l.MenubarEditMenu=new l("MenubarEditMenu"),l.MenubarCopy=new l("MenubarCopy"),l.MenubarGoMenu=new l("MenubarGoMenu"),l.MenubarSelectionMenu=new l("MenubarSelectionMenu"),l.InlineCompletionsActions=new l("InlineCompletionsActions");const h=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:s=>s===l.CommandPalette}}addCommand(s){return this.addCommands(X.a.single(s))}addCommands(s){for(const a of s)this._commands.set(a.id,a);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(B.i)(()=>{let a=!1;for(const C of s)a=this._commands.delete(C.id)||a;a&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(s){return this._commands.get(s)}getCommands(){const s=new Map;return this._commands.forEach((a,C)=>s.set(C,a)),s}appendMenuItem(s,a){return this.appendMenuItems(X.a.single({id:s,item:a}))}appendMenuItems(s){const a=new Set,C=new P.a;for(const{id:_,item:T}of s){let R=this._menuItems.get(_);R||(R=new P.a,this._menuItems.set(_,R)),C.push(R.push(T)),a.add(_)}return this._onDidChangeMenu.fire(a),Object(B.i)(()=>{if(C.size>0){for(let _ of C)_();this._onDidChangeMenu.fire(a),C.clear()}})}getMenuItems(s){let a;return this._menuItems.has(s)?a=[...this._menuItems.get(s)]:a=[],s===l.CommandPalette&&this._appendImplicitItems(a),a}_appendImplicitItems(s){const a=new Set;for(const C of s)p(C)&&(a.add(C.command.id),C.alt&&a.add(C.alt.id));this._commands.forEach((C,_)=>{a.has(_)||s.push({command:C})})}};class o extends oe.e{constructor(s,a,C,_){super(`submenuitem.${s.submenu.id}`,typeof s.title=="string"?s.title:s.title.value,[],"submenu");this.item=s,this._menuService=a,this._contextKeyService=C,this._options=_}get actions(){const s=[],a=this._menuService.createMenu(this.item.submenu,this._contextKeyService),C=a.getActions(this._options);a.dispose();for(const[,_]of C)_.length>0&&(s.push(..._),s.push(new oe.d));return s.length&&s.pop(),s}}let u=class s{constructor(a,C,_,T,R){var O,S;if(this._commandService=R,this.id=a.id,this.label=(_==null?void 0:_.renderShortTitle)&&a.shortTitle?typeof a.shortTitle=="string"?a.shortTitle:a.shortTitle.value:typeof a.title=="string"?a.title:a.title.value,this.tooltip=(S=typeof a.tooltip=="string"?a.tooltip:(O=a.tooltip)===null||O===void 0?void 0:O.value)!==null&&S!==void 0?S:"",this.enabled=!a.precondition||T.contextMatchesRules(a.precondition),this.checked=void 0,a.toggled){const w=a.toggled.condition?a.toggled:{condition:a.toggled};this.checked=T.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=a,this.alt=C?new s(C,void 0,_,T,R):void 0,this._options=_,L.d.isThemeIcon(a.icon)&&(this.class=$.a.asClassName(a.icon))}dispose(){}run(...a){var C,_;let T=[];return((C=this._options)===null||C===void 0?void 0:C.arg)&&(T=[...T,this._options.arg]),((_=this._options)===null||_===void 0?void 0:_.shouldForwardArgs)&&(T=[...T,...a]),this._commandService.executeCommand(this.id,...T)}};u=v([m(3,H.b),m(4,W.b)],u)},gJ3r:function(Ze,Te,Z){"use strict";Z.d(Te,"a",function(){return oe});var oe=[{value:"\u5317\u4EAC",label:"\u5317\u4EAC",children:[{value:"\u4E1C\u57CE",label:"\u4E1C\u57CE"},{value:"\u897F\u57CE",label:"\u897F\u57CE"},{value:"\u671D\u9633",label:"\u671D\u9633"},{value:"\u4E30\u53F0",label:"\u4E30\u53F0"},{value:"\u77F3\u666F\u5C71",label:"\u77F3\u666F\u5C71"},{value:"\u6D77\u6DC0",label:"\u6D77\u6DC0"},{value:"\u95E8\u5934\u6C9F",label:"\u95E8\u5934\u6C9F"},{value:"\u623F\u5C71",label:"\u623F\u5C71"},{value:"\u901A\u5DDE",label:"\u901A\u5DDE"},{value:"\u987A\u4E49",label:"\u987A\u4E49"},{value:"\u660C\u5E73",label:"\u660C\u5E73"},{value:"\u5927\u5174",label:"\u5927\u5174"},{value:"\u5E73\u8C37",label:"\u5E73\u8C37"},{value:"\u6000\u67D4",label:"\u6000\u67D4"},{value:"\u5BC6\u4E91",label:"\u5BC6\u4E91"},{value:"\u5EF6\u5E86",label:"\u5EF6\u5E86"}]},{value:"\u4E0A\u6D77",label:"\u4E0A\u6D77",children:[{value:"\u5D07\u660E",label:"\u5D07\u660E"},{value:"\u9EC4\u6D66",label:"\u9EC4\u6D66"},{value:"\u5362\u6E7E",label:"\u5362\u6E7E"},{value:"\u5F90\u6C47",label:"\u5F90\u6C47"},{value:"\u957F\u5B81",label:"\u957F\u5B81"},{value:"\u9759\u5B89",label:"\u9759\u5B89"},{value:"\u666E\u9640",label:"\u666E\u9640"},{value:"\u95F8\u5317",label:"\u95F8\u5317"},{value:"\u8679\u53E3",label:"\u8679\u53E3"},{value:"\u6768\u6D66",label:"\u6768\u6D66"},{value:"\u95F5\u884C",label:"\u95F5\u884C"},{value:"\u5B9D\u5C71",label:"\u5B9D\u5C71"},{value:"\u5609\u5B9A",label:"\u5609\u5B9A"},{value:"\u6D66\u4E1C",label:"\u6D66\u4E1C"},{value:"\u91D1\u5C71",label:"\u91D1\u5C71"},{value:"\u677E\u6C5F",label:"\u677E\u6C5F"},{value:"\u9752\u6D66",label:"\u9752\u6D66"},{value:"\u5357\u6C47",label:"\u5357\u6C47"},{value:"\u5949\u8D24",label:"\u5949\u8D24"}]},{value:"\u5E7F\u4E1C",label:"\u5E7F\u4E1C",children:[{value:"\u5E7F\u5DDE",label:"\u5E7F\u5DDE"},{value:"\u6DF1\u5733",label:"\u6DF1\u5733"},{value:"\u73E0\u6D77",label:"\u73E0\u6D77"},{value:"\u4E1C\u839E",label:"\u4E1C\u839E"},{value:"\u4E2D\u5C71",label:"\u4E2D\u5C71"},{value:"\u4F5B\u5C71",label:"\u4F5B\u5C71"},{value:"\u60E0\u5DDE",label:"\u60E0\u5DDE"},{value:"\u6CB3\u6E90",label:"\u6CB3\u6E90"},{value:"\u6F6E\u5DDE",label:"\u6F6E\u5DDE"},{value:"\u6C5F\u95E8",label:"\u6C5F\u95E8"},{value:"\u63ED\u9633",label:"\u63ED\u9633"},{value:"\u8302\u540D",label:"\u8302\u540D"},{value:"\u6885\u5DDE",label:"\u6885\u5DDE"},{value:"\u6E05\u8FDC",label:"\u6E05\u8FDC"},{value:"\u6C55\u5934",label:"\u6C55\u5934"},{value:"\u6C55\u5C3E",label:"\u6C55\u5C3E"},{value:"\u97F6\u5173",label:"\u97F6\u5173"},{value:"\u987A\u5FB7",label:"\u987A\u5FB7"},{value:"\u9633\u6C5F",label:"\u9633\u6C5F"},{value:"\u4E91\u6D6E",label:"\u4E91\u6D6E"},{value:"\u6E5B\u6C5F",label:"\u6E5B\u6C5F"},{value:"\u8087\u5E86",label:"\u8087\u5E86"}]},{value:"\u6C5F\u82CF",label:"\u6C5F\u82CF",children:[{value:"\u5357\u4EAC",label:"\u5357\u4EAC"},{value:"\u5E38\u719F",label:"\u5E38\u719F"},{value:"\u5E38\u5DDE",label:"\u5E38\u5DDE"},{value:"\u6D77\u95E8",label:"\u6D77\u95E8"},{value:"\u6DEE\u5B89",label:"\u6DEE\u5B89"},{value:"\u6C5F\u90FD",label:"\u6C5F\u90FD"},{value:"\u6C5F\u9634",label:"\u6C5F\u9634"},{value:"\u6606\u5C71",label:"\u6606\u5C71"},{value:"\u8FDE\u4E91\u6E2F",label:"\u8FDE\u4E91\u6E2F"},{value:"\u5357\u901A",label:"\u5357\u901A"},{value:"\u542F\u4E1C",label:"\u542F\u4E1C"},{value:"\u6CAD\u9633",label:"\u6CAD\u9633"},{value:"\u5BBF\u8FC1",label:"\u5BBF\u8FC1"},{value:"\u82CF\u5DDE",label:"\u82CF\u5DDE"},{value:"\u592A\u4ED3",label:"\u592A\u4ED3"},{value:"\u6CF0\u5DDE",label:"\u6CF0\u5DDE"},{value:"\u540C\u91CC",label:"\u540C\u91CC"},{value:"\u65E0\u9521",label:"\u65E0\u9521"},{value:"\u5F90\u5DDE",label:"\u5F90\u5DDE"},{value:"\u76D0\u57CE",label:"\u76D0\u57CE"},{value:"\u626C\u5DDE",label:"\u626C\u5DDE"},{value:"\u5B9C\u5174",label:"\u5B9C\u5174"},{value:"\u4EEA\u5F81",label:"\u4EEA\u5F81"},{value:"\u5F20\u5BB6\u6E2F",label:"\u5F20\u5BB6\u6E2F"},{value:"\u9547\u6C5F",label:"\u9547\u6C5F"}]},{value:"\u91CD\u5E86",label:"\u91CD\u5E86",children:[{value:"\u4E07\u5DDE",label:"\u4E07\u5DDE"},{value:"\u6DAA\u9675",label:"\u6DAA\u9675"},{value:"\u6E1D\u4E2D",label:"\u6E1D\u4E2D"},{value:"\u5927\u6E21\u53E3",label:"\u5927\u6E21\u53E3"},{value:"\u6C5F\u5317",label:"\u6C5F\u5317"},{value:"\u6C99\u576A\u575D",label:"\u6C99\u576A\u575D"},{value:"\u4E5D\u9F99\u5761",label:"\u4E5D\u9F99\u5761"},{value:"\u5357\u5CB8",label:"\u5357\u5CB8"},{value:"\u5317\u789A",label:"\u5317\u789A"},{value:"\u4E07\u76DB",label:"\u4E07\u76DB"},{value:"\u53CC\u6322",label:"\u53CC\u6322"},{value:"\u6E1D\u5317",label:"\u6E1D\u5317"},{value:"\u5DF4\u5357",label:"\u5DF4\u5357"},{value:"\u9ED4\u6C5F",label:"\u9ED4\u6C5F"},{value:"\u957F\u5BFF",label:"\u957F\u5BFF"},{value:"\u7DA6\u6C5F",label:"\u7DA6\u6C5F"},{value:"\u6F7C\u5357",label:"\u6F7C\u5357"},{value:"\u94DC\u6881",label:"\u94DC\u6881"},{value:"\u5927\u8DB3",label:"\u5927\u8DB3"},{value:"\u8363\u660C",label:"\u8363\u660C"},{value:"\u58C1\u5C71",label:"\u58C1\u5C71"},{value:"\u6881\u5E73",label:"\u6881\u5E73"},{value:"\u57CE\u53E3",label:"\u57CE\u53E3"},{value:"\u4E30\u90FD",label:"\u4E30\u90FD"},{value:"\u57AB\u6C5F",label:"\u57AB\u6C5F"},{value:"\u6B66\u9686",label:"\u6B66\u9686"},{value:"\u5FE0\u53BF",label:"\u5FE0\u53BF"},{value:"\u5F00\u53BF",label:"\u5F00\u53BF"},{value:"\u4E91\u9633",label:"\u4E91\u9633"},{value:"\u5949\u8282",label:"\u5949\u8282"},{value:"\u5DEB\u5C71",label:"\u5DEB\u5C71"},{value:"\u5DEB\u6EAA",label:"\u5DEB\u6EAA"},{value:"\u77F3\u67F1",label:"\u77F3\u67F1"},{value:"\u79C0\u5C71",label:"\u79C0\u5C71"},{value:"\u9149\u9633",label:"\u9149\u9633"},{value:"\u5F6D\u6C34",label:"\u5F6D\u6C34"},{value:"\u6C5F\u6D25",label:"\u6C5F\u6D25"},{value:"\u5408\u5DDD",label:"\u5408\u5DDD"},{value:"\u6C38\u5DDD",label:"\u6C38\u5DDD"},{value:"\u5357\u5DDD",label:"\u5357\u5DDD"}]},{value:"\u5B89\u5FBD",label:"\u5B89\u5FBD",children:[{value:"\u5408\u80A5",label:"\u5408\u80A5"},{value:"\u5B89\u5E86",label:"\u5B89\u5E86"},{value:"\u868C\u57E0",label:"\u868C\u57E0"},{value:"\u4EB3\u5DDE",label:"\u4EB3\u5DDE"},{value:"\u5DE2\u6E56",label:"\u5DE2\u6E56"},{value:"\u6EC1\u5DDE",label:"\u6EC1\u5DDE"},{value:"\u961C\u9633",label:"\u961C\u9633"},{value:"\u8D35\u6C60",label:"\u8D35\u6C60"},{value:"\u6DEE\u5317",label:"\u6DEE\u5317"},{value:"\u6DEE\u5316",label:"\u6DEE\u5316"},{value:"\u6DEE\u5357",label:"\u6DEE\u5357"},{value:"\u9EC4\u5C71",label:"\u9EC4\u5C71"},{value:"\u4E5D\u534E\u5C71",label:"\u4E5D\u534E\u5C71"},{value:"\u516D\u5B89",label:"\u516D\u5B89"},{value:"\u9A6C\u978D\u5C71",label:"\u9A6C\u978D\u5C71"},{value:"\u5BBF\u5DDE",label:"\u5BBF\u5DDE"},{value:"\u94DC\u9675",label:"\u94DC\u9675"},{value:"\u5C6F\u6EAA",label:"\u5C6F\u6EAA"},{value:"\u829C\u6E56",label:"\u829C\u6E56"},{value:"\u5BA3\u57CE",label:"\u5BA3\u57CE"}]},{value:"\u798F\u5EFA",label:"\u798F\u5EFA",children:[{value:"\u798F\u5DDE",label:"\u798F\u5DDE"},{value:"\u53A6\u95E8",label:"\u53A6\u95E8"},{value:"\u6CC9\u5DDE",label:"\u6CC9\u5DDE"},{value:"\u6F33\u5DDE",label:"\u6F33\u5DDE"},{value:"\u9F99\u5CA9",label:"\u9F99\u5CA9"},{value:"\u5357\u5E73",label:"\u5357\u5E73"},{value:"\u5B81\u5FB7",label:"\u5B81\u5FB7"},{value:"\u8386\u7530",label:"\u8386\u7530"},{value:"\u4E09\u660E",label:"\u4E09\u660E"}]},{value:"\u7518\u8083",label:"\u7518\u8083",children:[{value:"\u5170\u5DDE",label:"\u5170\u5DDE"},{value:"\u5609\u5CEA\u5173",label:"\u5609\u5CEA\u5173"},{value:"\u767D\u94F6",label:"\u767D\u94F6"},{value:"\u5B9A\u897F",label:"\u5B9A\u897F"},{value:"\u6566\u714C",label:"\u6566\u714C"},{value:"\u7518\u5357",label:"\u7518\u5357"},{value:"\u91D1\u660C",label:"\u91D1\u660C"},{value:"\u9152\u6CC9",label:"\u9152\u6CC9"},{value:"\u4E34\u590F",label:"\u4E34\u590F"},{value:"\u5E73\u51C9",label:"\u5E73\u51C9"},{value:"\u5929\u6C34",label:"\u5929\u6C34"},{value:"\u9647\u5357",label:"\u9647\u5357"},{value:"\u6B66\u5A01",label:"\u6B66\u5A01"},{value:"\u897F\u5CF0",label:"\u897F\u5CF0"},{value:"\u5F20\u6396",label:"\u5F20\u6396"}]},{value:"\u5E7F\u897F",label:"\u5E7F\u897F",children:[{value:"\u5357\u5B81",label:"\u5357\u5B81"},{value:"\u6765\u5BBE",label:"\u6765\u5BBE"},{value:"\u767E\u8272",label:"\u767E\u8272"},{value:"\u5317\u6D77",label:"\u5317\u6D77"},{value:"\u6842\u6797",label:"\u6842\u6797"},{value:"\u9632\u57CE\u6E2F",label:"\u9632\u57CE\u6E2F"},{value:"\u8D35\u6E2F",label:"\u8D35\u6E2F"},{value:"\u6CB3\u6C60",label:"\u6CB3\u6C60"},{value:"\u8D3A\u5DDE",label:"\u8D3A\u5DDE"},{value:"\u67F3\u5DDE",label:"\u67F3\u5DDE"},{value:"\u94A6\u5DDE",label:"\u94A6\u5DDE"},{value:"\u68A7\u5DDE",label:"\u68A7\u5DDE"},{value:"\u7389\u6797",label:"\u7389\u6797"}]},{value:"\u8D35\u5DDE",label:"\u8D35\u5DDE",children:[{value:"\u8D35\u9633",label:"\u8D35\u9633"},{value:"\u5B89\u987A",label:"\u5B89\u987A"},{value:"\u6BD5\u8282",label:"\u6BD5\u8282"},{value:"\u90FD\u5300",label:"\u90FD\u5300"},{value:"\u51EF\u91CC",label:"\u51EF\u91CC"},{value:"\u516D\u76D8\u6C34",label:"\u516D\u76D8\u6C34"},{value:"\u94DC\u4EC1",label:"\u94DC\u4EC1"},{value:"\u5174\u4E49",label:"\u5174\u4E49"},{value:"\u7389\u5C4F",label:"\u7389\u5C4F"},{value:"\u9075\u4E49",label:"\u9075\u4E49"}]},{value:"\u6D77\u5357",label:"\u6D77\u5357",children:[{value:"\u6D77\u53E3",label:"\u6D77\u53E3"},{value:"\u510B\u53BF",label:"\u510B\u53BF"},{value:"\u9675\u6C34",label:"\u9675\u6C34"},{value:"\u743C\u6D77",label:"\u743C\u6D77"},{value:"\u4E09\u4E9A",label:"\u4E09\u4E9A"},{value:"\u901A\u4EC0",label:"\u901A\u4EC0"},{value:"\u4E07\u5B81",label:"\u4E07\u5B81"}]},{value:"\u6CB3\u5317",label:"\u6CB3\u5317",children:[{value:"\u77F3\u5BB6\u5E84",label:"\u77F3\u5BB6\u5E84"},{value:"\u4FDD\u5B9A",label:"\u4FDD\u5B9A"},{value:"\u5317\u6234\u6CB3",label:"\u5317\u6234\u6CB3"},{value:"\u6CA7\u5DDE",label:"\u6CA7\u5DDE"},{value:"\u627F\u5FB7",label:"\u627F\u5FB7"},{value:"\u4E30\u6DA6",label:"\u4E30\u6DA6"},{value:"\u90AF\u90F8",label:"\u90AF\u90F8"},{value:"\u8861\u6C34",label:"\u8861\u6C34"},{value:"\u5ECA\u574A",label:"\u5ECA\u574A"},{value:"\u5357\u6234\u6CB3",label:"\u5357\u6234\u6CB3"},{value:"\u79E6\u7687\u5C9B",label:"\u79E6\u7687\u5C9B"},{value:"\u5510\u5C71",label:"\u5510\u5C71"},{value:"\u65B0\u57CE",label:"\u65B0\u57CE"},{value:"\u90A2\u53F0",label:"\u90A2\u53F0"},{value:"\u5F20\u5BB6\u53E3",label:"\u5F20\u5BB6\u53E3"}]},{value:"\u9ED1\u9F99\u6C5F",label:"\u9ED1\u9F99\u6C5F",children:[{value:"\u54C8\u5C14\u6EE8",label:"\u54C8\u5C14\u6EE8"},{value:"\u5317\u5B89",label:"\u5317\u5B89"},{value:"\u5927\u5E86",label:"\u5927\u5E86"},{value:"\u5927\u5174\u5B89\u5CAD",label:"\u5927\u5174\u5B89\u5CAD"},{value:"\u9E64\u5C97",label:"\u9E64\u5C97"},{value:"\u9ED1\u6CB3",label:"\u9ED1\u6CB3"},{value:"\u4F73\u6728\u65AF",label:"\u4F73\u6728\u65AF"},{value:"\u9E21\u897F",label:"\u9E21\u897F"},{value:"\u7261\u4E39\u6C5F",label:"\u7261\u4E39\u6C5F"},{value:"\u9F50\u9F50\u54C8\u5C14",label:"\u9F50\u9F50\u54C8\u5C14"},{value:"\u4E03\u53F0\u6CB3",label:"\u4E03\u53F0\u6CB3"},{value:"\u53CC\u9E2D\u5C71",label:"\u53CC\u9E2D\u5C71"},{value:"\u7EE5\u5316",label:"\u7EE5\u5316"},{value:"\u4F0A\u6625",label:"\u4F0A\u6625"}]},{value:"\u6CB3\u5357",label:"\u6CB3\u5357",children:[{value:"\u90D1\u5DDE",label:"\u90D1\u5DDE"},{value:"\u5B89\u9633",label:"\u5B89\u9633"},{value:"\u9E64\u58C1",label:"\u9E64\u58C1"},{value:"\u6F62\u5DDD",label:"\u6F62\u5DDD"},{value:"\u7126\u4F5C",label:"\u7126\u4F5C"},{value:"\u6D4E\u6E90",label:"\u6D4E\u6E90"},{value:"\u5F00\u5C01",label:"\u5F00\u5C01"},{value:"\u6F2F\u6CB3",label:"\u6F2F\u6CB3"},{value:"\u6D1B\u9633",label:"\u6D1B\u9633"},{value:"\u5357\u9633",label:"\u5357\u9633"},{value:"\u5E73\u9876\u5C71",label:"\u5E73\u9876\u5C71"},{value:"\u6FEE\u9633",label:"\u6FEE\u9633"},{value:"\u4E09\u95E8\u5CE1",label:"\u4E09\u95E8\u5CE1"},{value:"\u5546\u4E18",label:"\u5546\u4E18"},{value:"\u65B0\u4E61",label:"\u65B0\u4E61"},{value:"\u4FE1\u9633",label:"\u4FE1\u9633"},{value:"\u8BB8\u660C",label:"\u8BB8\u660C"},{value:"\u5468\u53E3",label:"\u5468\u53E3"},{value:"\u9A7B\u9A6C\u5E97",label:"\u9A7B\u9A6C\u5E97"}]},{value:"\u9999\u6E2F",label:"\u9999\u6E2F",children:[{value:"\u9999\u6E2F",label:"\u9999\u6E2F"},{value:"\u4E5D\u9F99",label:"\u4E5D\u9F99"},{value:"\u65B0\u754C",label:"\u65B0\u754C"}]},{value:"\u6E56\u5317",label:"\u6E56\u5317",children:[{value:"\u6B66\u6C49",label:"\u6B66\u6C49"},{value:"\u5929\u95E8",label:"\u5929\u95E8"},{value:"\u6069\u65BD",label:"\u6069\u65BD"},{value:"\u9102\u5DDE",label:"\u9102\u5DDE"},{value:"\u9EC4\u5188",label:"\u9EC4\u5188"},{value:"\u9EC4\u77F3",label:"\u9EC4\u77F3"},{value:"\u8346\u95E8",label:"\u8346\u95E8"},{value:"\u8346\u5DDE",label:"\u8346\u5DDE"},{value:"\u6F5C\u6C5F",label:"\u6F5C\u6C5F"},{value:"\u5341\u5830",label:"\u5341\u5830"},{value:"\u968F\u5DDE",label:"\u968F\u5DDE"},{value:"\u6B66\u7A74",label:"\u6B66\u7A74"},{value:"\u4ED9\u6843",label:"\u4ED9\u6843"},{value:"\u54B8\u5B81",label:"\u54B8\u5B81"},{value:"\u8944\u9633",label:"\u8944\u9633"},{value:"\u8944\u6A0A",label:"\u8944\u6A0A"},{value:"\u5B5D\u611F",label:"\u5B5D\u611F"},{value:"\u5B9C\u660C",label:"\u5B9C\u660C"}]},{value:"\u6E56\u5357",label:"\u6E56\u5357",children:[{value:"\u957F\u6C99",label:"\u957F\u6C99"},{value:"\u5E38\u5FB7",label:"\u5E38\u5FB7"},{value:"\u90F4\u5DDE",label:"\u90F4\u5DDE"},{value:"\u8861\u9633",label:"\u8861\u9633"},{value:"\u6000\u5316",label:"\u6000\u5316"},{value:"\u5409\u9996",label:"\u5409\u9996"},{value:"\u5A04\u5E95",label:"\u5A04\u5E95"},{value:"\u90B5\u9633",label:"\u90B5\u9633"},{value:"\u6E58\u6F6D",label:"\u6E58\u6F6D"},{value:"\u76CA\u9633",label:"\u76CA\u9633"},{value:"\u5CB3\u9633",label:"\u5CB3\u9633"},{value:"\u6C38\u5DDE",label:"\u6C38\u5DDE"},{value:"\u5F20\u5BB6\u754C",label:"\u5F20\u5BB6\u754C"},{value:"\u682A\u6D32",label:"\u682A\u6D32"}]},{value:"\u6C5F\u897F",label:"\u6C5F\u897F",children:[{value:"\u5357\u660C",label:"\u5357\u660C"},{value:"\u629A\u5DDE",label:"\u629A\u5DDE"},{value:"\u8D63\u5DDE",label:"\u8D63\u5DDE"},{value:"\u5409\u5B89",label:"\u5409\u5B89"},{value:"\u666F\u5FB7\u9547",label:"\u666F\u5FB7\u9547"},{value:"\u4E95\u5188\u5C71",label:"\u4E95\u5188\u5C71"},{value:"\u4E5D\u6C5F",label:"\u4E5D\u6C5F"},{value:"\u5E90\u5C71",label:"\u5E90\u5C71"},{value:"\u840D\u4E61",label:"\u840D\u4E61"},{value:"\u4E0A\u9976",label:"\u4E0A\u9976"},{value:"\u65B0\u4F59",label:"\u65B0\u4F59"},{value:"\u5B9C\u6625",label:"\u5B9C\u6625"},{value:"\u9E70\u6F6D",label:"\u9E70\u6F6D"}]},{value:"\u5409\u6797",label:"\u5409\u6797",children:[{value:"\u957F\u6625",label:"\u957F\u6625"},{value:"\u5409\u6797",label:"\u5409\u6797"},{value:"\u767D\u57CE",label:"\u767D\u57CE"},{value:"\u767D\u5C71",label:"\u767D\u5C71"},{value:"\u73F2\u6625",label:"\u73F2\u6625"},{value:"\u8FBD\u6E90",label:"\u8FBD\u6E90"},{value:"\u6885\u6CB3",label:"\u6885\u6CB3"},{value:"\u56DB\u5E73",label:"\u56DB\u5E73"},{value:"\u677E\u539F",label:"\u677E\u539F"},{value:"\u901A\u5316",label:"\u901A\u5316"},{value:"\u5EF6\u5409",label:"\u5EF6\u5409"}]},{value:"\u8FBD\u5B81",label:"\u8FBD\u5B81",children:[{value:"\u6C88\u9633",label:"\u6C88\u9633"},{value:"\u978D\u5C71",label:"\u978D\u5C71"},{value:"\u672C\u6EAA",label:"\u672C\u6EAA"},{value:"\u671D\u9633",label:"\u671D\u9633"},{value:"\u5927\u8FDE",label:"\u5927\u8FDE"},{value:"\u4E39\u4E1C",label:"\u4E39\u4E1C"},{value:"\u629A\u987A",label:"\u629A\u987A"},{value:"\u961C\u65B0",label:"\u961C\u65B0"},{value:"\u846B\u82A6\u5C9B",label:"\u846B\u82A6\u5C9B"},{value:"\u9526\u5DDE",label:"\u9526\u5DDE"},{value:"\u8FBD\u9633",label:"\u8FBD\u9633"},{value:"\u76D8\u9526",label:"\u76D8\u9526"},{value:"\u94C1\u5CAD",label:"\u94C1\u5CAD"},{value:"\u8425\u53E3",label:"\u8425\u53E3"}]},{value:"\u6FB3\u95E8",label:"\u6FB3\u95E8",children:[{value:"\u6FB3\u95E8",label:"\u6FB3\u95E8"}]},{value:"\u5185\u8499\u53E4",label:"\u5185\u8499\u53E4",children:[{value:"\u547C\u548C\u6D69\u7279",label:"\u547C\u548C\u6D69\u7279"},{value:"\u963F\u62C9\u5584\u76DF",label:"\u963F\u62C9\u5584\u76DF"},{value:"\u5305\u5934",label:"\u5305\u5934"},{value:"\u8D64\u5CF0",label:"\u8D64\u5CF0"},{value:"\u4E1C\u80DC",label:"\u4E1C\u80DC"},{value:"\u6D77\u62C9\u5C14",label:"\u6D77\u62C9\u5C14"},{value:"\u96C6\u5B81",label:"\u96C6\u5B81"},{value:"\u4E34\u6CB3",label:"\u4E34\u6CB3"},{value:"\u901A\u8FBD",label:"\u901A\u8FBD"},{value:"\u4E4C\u6D77",label:"\u4E4C\u6D77"},{value:"\u4E4C\u5170\u6D69\u7279",label:"\u4E4C\u5170\u6D69\u7279"},{value:"\u9521\u6797\u6D69\u7279",label:"\u9521\u6797\u6D69\u7279"}]},{value:"\u5B81\u590F",label:"\u5B81\u590F",children:[{value:"\u94F6\u5DDD",label:"\u94F6\u5DDD"},{value:"\u56FA\u6E90",label:"\u56FA\u6E90"},{value:"\u77F3\u5634\u5C71",label:"\u77F3\u5634\u5C71"},{value:"\u5434\u5FE0",label:"\u5434\u5FE0"}]},{value:"\u9752\u6D77",label:"\u9752\u6D77",children:[{value:"\u897F\u5B81",label:"\u897F\u5B81"},{value:"\u5FB7\u4EE4\u54C8",label:"\u5FB7\u4EE4\u54C8"},{value:"\u683C\u5C14\u6728",label:"\u683C\u5C14\u6728"},{value:"\u5171\u548C",label:"\u5171\u548C"},{value:"\u6D77\u4E1C",label:"\u6D77\u4E1C"},{value:"\u6D77\u664F",label:"\u6D77\u664F"},{value:"\u739B\u6C81",label:"\u739B\u6C81"},{value:"\u540C\u4EC1",label:"\u540C\u4EC1"},{value:"\u7389\u6811",label:"\u7389\u6811"}]},{value:"\u5C71\u4E1C",label:"\u5C71\u4E1C",children:[{value:"\u6D4E\u5357",label:"\u6D4E\u5357"},{value:"\u6EE8\u5DDE",label:"\u6EE8\u5DDE"},{value:"\u5156\u5DDE",label:"\u5156\u5DDE"},{value:"\u5FB7\u5DDE",label:"\u5FB7\u5DDE"},{value:"\u4E1C\u8425",label:"\u4E1C\u8425"},{value:"\u83CF\u6CFD",label:"\u83CF\u6CFD"},{value:"\u6D4E\u5B81",label:"\u6D4E\u5B81"},{value:"\u83B1\u829C",label:"\u83B1\u829C"},{value:"\u804A\u57CE",label:"\u804A\u57CE"},{value:"\u4E34\u6C82",label:"\u4E34\u6C82"},{value:"\u84EC\u83B1",label:"\u84EC\u83B1"},{value:"\u9752\u5C9B",label:"\u9752\u5C9B"},{value:"\u66F2\u961C",label:"\u66F2\u961C"},{value:"\u65E5\u7167",label:"\u65E5\u7167"},{value:"\u6CF0\u5B89",label:"\u6CF0\u5B89"},{value:"\u6F4D\u574A",label:"\u6F4D\u574A"},{value:"\u5A01\u6D77",label:"\u5A01\u6D77"},{value:"\u70DF\u53F0",label:"\u70DF\u53F0"},{value:"\u67A3\u5E84",label:"\u67A3\u5E84"},{value:"\u6DC4\u535A",label:"\u6DC4\u535A"}]},{value:"\u5C71\u897F",label:"\u5C71\u897F",children:[{value:"\u592A\u539F",label:"\u592A\u539F"},{value:"\u5415\u6881",label:"\u5415\u6881"},{value:"\u957F\u6CBB",label:"\u957F\u6CBB"},{value:"\u5927\u540C",label:"\u5927\u540C"},{value:"\u5019\u9A6C",label:"\u5019\u9A6C"},{value:"\u664B\u57CE",label:"\u664B\u57CE"},{value:"\u79BB\u77F3",label:"\u79BB\u77F3"},{value:"\u4E34\u6C7E",label:"\u4E34\u6C7E"},{value:"\u5B81\u6B66",label:"\u5B81\u6B66"},{value:"\u6714\u5DDE",label:"\u6714\u5DDE"},{value:"\u5FFB\u5DDE",label:"\u5FFB\u5DDE"},{value:"\u9633\u6CC9",label:"\u9633\u6CC9"},{value:"\u6986\u6B21",label:"\u6986\u6B21"},{value:"\u664B\u4E2D",label:"\u664B\u4E2D"},{value:"\u8FD0\u57CE",label:"\u8FD0\u57CE"}]},{value:"\u9655\u897F",label:"\u9655\u897F",children:[{value:"\u897F\u5B89",label:"\u897F\u5B89"},{value:"\u5B89\u5EB7",label:"\u5B89\u5EB7"},{value:"\u5B9D\u9E21",label:"\u5B9D\u9E21"},{value:"\u6C49\u4E2D",label:"\u6C49\u4E2D"},{value:"\u6E2D\u5357",label:"\u6E2D\u5357"},{value:"\u5546\u5DDE",label:"\u5546\u5DDE"},{value:"\u7EE5\u5FB7",label:"\u7EE5\u5FB7"},{value:"\u94DC\u5DDD",label:"\u94DC\u5DDD"},{value:"\u54B8\u9633",label:"\u54B8\u9633"},{value:"\u5EF6\u5B89",label:"\u5EF6\u5B89"},{value:"\u6986\u6797",label:"\u6986\u6797"}]},{value:"\u56DB\u5DDD",label:"\u56DB\u5DDD",children:[{value:"\u6210\u90FD",label:"\u6210\u90FD"},{value:"\u5DF4\u4E2D",label:"\u5DF4\u4E2D"},{value:"\u8FBE\u5DDD",label:"\u8FBE\u5DDD"},{value:"\u5FB7\u9633",label:"\u5FB7\u9633"},{value:"\u90FD\u6C5F\u5830",label:"\u90FD\u6C5F\u5830"},{value:"\u5CE8\u7709\u5C71",label:"\u5CE8\u7709\u5C71"},{value:"\u6DAA\u9675",label:"\u6DAA\u9675"},{value:"\u5E7F\u5B89",label:"\u5E7F\u5B89"},{value:"\u5E7F\u5143",label:"\u5E7F\u5143"},{value:"\u4E5D\u5BE8\u6C9F",label:"\u4E5D\u5BE8\u6C9F"},{value:"\u5EB7\u5B9A",label:"\u5EB7\u5B9A"},{value:"\u4E50\u5C71",label:"\u4E50\u5C71"},{value:"\u6CF8\u5DDE",label:"\u6CF8\u5DDE"},{value:"\u9A6C\u5C14\u5EB7",label:"\u9A6C\u5C14\u5EB7"},{value:"\u7EF5\u9633",label:"\u7EF5\u9633"},{value:"\u7709\u5C71",label:"\u7709\u5C71"},{value:"\u5357\u5145",label:"\u5357\u5145"},{value:"\u5185\u6C5F",label:"\u5185\u6C5F"},{value:"\u6500\u679D\u82B1",label:"\u6500\u679D\u82B1"},{value:"\u9042\u5B81",label:"\u9042\u5B81"},{value:"\u6C76\u5DDD",label:"\u6C76\u5DDD"},{value:"\u897F\u660C",label:"\u897F\u660C"},{value:"\u96C5\u5B89",label:"\u96C5\u5B89"},{value:"\u5B9C\u5BBE",label:"\u5B9C\u5BBE"},{value:"\u81EA\u8D21",label:"\u81EA\u8D21"},{value:"\u8D44\u9633",label:"\u8D44\u9633"}]},{value:"\u53F0\u6E7E",label:"\u53F0\u6E7E",children:[{value:"\u53F0\u5317",label:"\u53F0\u5317"},{value:"\u57FA\u9686",label:"\u57FA\u9686"},{value:"\u53F0\u5357",label:"\u53F0\u5357"},{value:"\u53F0\u4E2D",label:"\u53F0\u4E2D"},{value:"\u9AD8\u96C4",label:"\u9AD8\u96C4"},{value:"\u5C4F\u4E1C",label:"\u5C4F\u4E1C"},{value:"\u5357\u6295",label:"\u5357\u6295"},{value:"\u4E91\u6797",label:"\u4E91\u6797"},{value:"\u65B0\u7AF9",label:"\u65B0\u7AF9"},{value:"\u5F70\u5316",label:"\u5F70\u5316"},{value:"\u82D7\u6817",label:"\u82D7\u6817"},{value:"\u5609\u4E49",label:"\u5609\u4E49"},{value:"\u6843\u56ED",label:"\u6843\u56ED"},{value:"\u5B9C\u5170",label:"\u5B9C\u5170"},{value:"\u53F0\u4E1C",label:"\u53F0\u4E1C"},{value:"\u91D1\u95E8",label:"\u91D1\u95E8"},{value:"\u9A6C\u7956",label:"\u9A6C\u7956"},{value:"\u6F8E\u6E56",label:"\u6F8E\u6E56"}]},{value:"\u5929\u6D25",label:"\u5929\u6D25",children:[{value:"\u5929\u6D25",label:"\u5929\u6D25"},{value:"\u548C\u5E73",label:"\u548C\u5E73"},{value:"\u4E1C\u4E3D",label:"\u4E1C\u4E3D"},{value:"\u6CB3\u4E1C",label:"\u6CB3\u4E1C"},{value:"\u897F\u9752",label:"\u897F\u9752"},{value:"\u6CB3\u897F",label:"\u6CB3\u897F"},{value:"\u6D25\u5357",label:"\u6D25\u5357"},{value:"\u5357\u5F00",label:"\u5357\u5F00"},{value:"\u5317\u8FB0",label:"\u5317\u8FB0"},{value:"\u6CB3\u5317",label:"\u6CB3\u5317"},{value:"\u6B66\u6E05",label:"\u6B66\u6E05"},{value:"\u7EA2\u6322",label:"\u7EA2\u6322"},{value:"\u5858\u6CBD",label:"\u5858\u6CBD"},{value:"\u6C49\u6CBD",label:"\u6C49\u6CBD"},{value:"\u5927\u6E2F",label:"\u5927\u6E2F"},{value:"\u5B81\u6CB3",label:"\u5B81\u6CB3"},{value:"\u9759\u6D77",label:"\u9759\u6D77"},{value:"\u5B9D\u577B",label:"\u5B9D\u577B"},{value:"\u84DF\u53BF",label:"\u84DF\u53BF"}]},{value:"\u65B0\u7586",label:"\u65B0\u7586",children:[{value:"\u4E4C\u9C81\u6728\u9F50",label:"\u4E4C\u9C81\u6728\u9F50"},{value:"\u963F\u514B\u82CF",label:"\u963F\u514B\u82CF"},{value:"\u963F\u52D2\u6CF0",label:"\u963F\u52D2\u6CF0"},{value:"\u963F\u56FE\u4EC0",label:"\u963F\u56FE\u4EC0"},{value:"\u535A\u4E50",label:"\u535A\u4E50"},{value:"\u660C\u5409",label:"\u660C\u5409"},{value:"\u4E1C\u5C71",label:"\u4E1C\u5C71"},{value:"\u54C8\u5BC6",label:"\u54C8\u5BC6"},{value:"\u548C\u7530",label:"\u548C\u7530"},{value:"\u5580\u4EC0",label:"\u5580\u4EC0"},{value:"\u514B\u62C9\u739B\u4F9D",label:"\u514B\u62C9\u739B\u4F9D"},{value:"\u5E93\u8F66",label:"\u5E93\u8F66"},{value:"\u5E93\u5C14\u52D2",label:"\u5E93\u5C14\u52D2"},{value:"\u594E\u5C6F",label:"\u594E\u5C6F"},{value:"\u77F3\u6CB3\u5B50",label:"\u77F3\u6CB3\u5B50"},{value:"\u5854\u57CE",label:"\u5854\u57CE"},{value:"\u5410\u9C81\u756A",label:"\u5410\u9C81\u756A"},{value:"\u4F0A\u5B81",label:"\u4F0A\u5B81"}]},{value:"\u897F\u85CF",label:"\u897F\u85CF",children:[{value:"\u62C9\u8428",label:"\u62C9\u8428"},{value:"\u963F\u91CC",label:"\u963F\u91CC"},{value:"\u660C\u90FD",label:"\u660C\u90FD"},{value:"\u6797\u829D",label:"\u6797\u829D"},{value:"\u90A3\u66F2",label:"\u90A3\u66F2"},{value:"\u65E5\u5580\u5219",label:"\u65E5\u5580\u5219"},{value:"\u5C71\u5357",label:"\u5C71\u5357"}]},{value:"\u4E91\u5357",label:"\u4E91\u5357",children:[{value:"\u6606\u660E",label:"\u6606\u660E"},{value:"\u5927\u7406",label:"\u5927\u7406"},{value:"\u4FDD\u5C71",label:"\u4FDD\u5C71"},{value:"\u695A\u96C4",label:"\u695A\u96C4"},{value:"\u5927\u7406",label:"\u5927\u7406"},{value:"\u4E1C\u5DDD",label:"\u4E1C\u5DDD"},{value:"\u4E2A\u65E7",label:"\u4E2A\u65E7"},{value:"\u666F\u6D2A",label:"\u666F\u6D2A"},{value:"\u5F00\u8FDC",label:"\u5F00\u8FDC"},{value:"\u4E34\u6CA7",label:"\u4E34\u6CA7"},{value:"\u4E3D\u6C5F",label:"\u4E3D\u6C5F"},{value:"\u516D\u5E93",label:"\u516D\u5E93"},{value:"\u6F5E\u897F",label:"\u6F5E\u897F"},{value:"\u66F2\u9756",label:"\u66F2\u9756"},{value:"\u601D\u8305",label:"\u601D\u8305"},{value:"\u6587\u5C71",label:"\u6587\u5C71"},{value:"\u897F\u53CC\u7248\u7EB3",label:"\u897F\u53CC\u7248\u7EB3"},{value:"\u7389\u6EAA",label:"\u7389\u6EAA"},{value:"\u4E2D\u7538",label:"\u4E2D\u7538"},{value:"\u662D\u901A",label:"\u662D\u901A"}]},{value:"\u6D59\u6C5F",label:"\u6D59\u6C5F",children:[{value:"\u676D\u5DDE",label:"\u676D\u5DDE"},{value:"\u6E29\u5DDE",label:"\u6E29\u5DDE"},{value:"\u5B89\u5409",label:"\u5B89\u5409"},{value:"\u6148\u6EAA",label:"\u6148\u6EAA"},{value:"\u5B9A\u6D77",label:"\u5B9A\u6D77"},{value:"\u5949\u5316",label:"\u5949\u5316"},{value:"\u6D77\u76D0",label:"\u6D77\u76D0"},{value:"\u9EC4\u5CA9",label:"\u9EC4\u5CA9"},{value:"\u6E56\u5DDE",label:"\u6E56\u5DDE"},{value:"\u5609\u5174",label:"\u5609\u5174"},{value:"\u91D1\u534E",label:"\u91D1\u534E"},{value:"\u4E34\u5B89",label:"\u4E34\u5B89"},{value:"\u4E34\u6D77",label:"\u4E34\u6D77"},{value:"\u4E3D\u6C34",label:"\u4E3D\u6C34"},{value:"\u5B81\u6CE2",label:"\u5B81\u6CE2"},{value:"\u74EF\u6D77",label:"\u74EF\u6D77"},{value:"\u5E73\u6E56",label:"\u5E73\u6E56"},{value:"\u5343\u5C9B\u6E56",label:"\u5343\u5C9B\u6E56"},{value:"\u8862\u5DDE",label:"\u8862\u5DDE"},{value:"\u6C5F\u5C71",label:"\u6C5F\u5C71"},{value:"\u745E\u5B89",label:"\u745E\u5B89"},{value:"\u7ECD\u5174",label:"\u7ECD\u5174"},{value:"\u5D4A\u5DDE",label:"\u5D4A\u5DDE"},{value:"\u53F0\u5DDE",label:"\u53F0\u5DDE"},{value:"\u6E29\u5CAD",label:"\u6E29\u5CAD"},{value:"\u4F59\u59DA",label:"\u4F59\u59DA"},{value:"\u821F\u5C71",label:"\u821F\u5C71"}]},{value:"\u6D77\u5916",label:"\u6D77\u5916",children:[{value:"\u7F8E\u56FD",label:"\u7F8E\u56FD"},{value:"\u65E5\u672C",label:"\u65E5\u672C"},{value:"\u82F1\u56FD",label:"\u82F1\u56FD"},{value:"\u6CD5\u56FD",label:"\u6CD5\u56FD"},{value:"\u5FB7\u56FD",label:"\u5FB7\u56FD"},{value:"\u5176\u4ED6",label:"\u5176\u4ED6"}]}]},ic2d:function(Ze,Te,Z){"use strict";Z.d(Te,"a",function(){return X});var oe=Z("FWmy"),$=Z("746U");class M{constructor(){this.data=new Map}add(B,P){oe.a($.l(B)),oe.a($.k(P)),oe.a(!this.data.has(B),"There is already an extension with this id"),this.data.set(B,P)}as(B){return this.data.get(B)||null}}const X=new M},kSUc:function(Ze,Te,Z){},lZu9:function(Ze,Te,Z){(function(oe){oe(Z("VrN/"),Z("1eCo"),Z("8EBN"))})(function(oe){"use strict";oe.defineMode("markdown",function($,M){var X=oe.getMode($,"text/html"),B=X.name=="null";function P(N){if(oe.findModeByName){var b=oe.findModeByName(N);b&&(N=b.mime||b.mimes[0])}var Y=oe.getMode($,N);return Y.name=="null"?null:Y}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 W={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var H in W)W.hasOwnProperty(H)&&M.tokenTypeOverrides[H]&&(W[H]=M.tokenTypeOverrides[H]);var i=/^([*\-_])(?:\s*\1){2,}\s*$/,L=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,v=/^\[(x| )\](?=\s)/i,m=M.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,p=/^ {0,3}(?:\={1,}|-{2,})\s*$/,l=/^[^#!\[\]*_\\<>` "'(~:]+/,h=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,f=/^\s*\[[^\]]+?\]:.*$/,o=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,u=" ";function s(N,b,Y){return b.f=b.inline=Y,Y(N,b)}function a(N,b,Y){return b.f=b.block=Y,Y(N,b)}function C(N){return!N||!/\S/.test(N.string)}function _(N){if(N.linkTitle=!1,N.linkHref=!1,N.linkText=!1,N.em=!1,N.strong=!1,N.strikethrough=!1,N.quote=0,N.indentedCode=!1,N.f==R){var b=B;if(!b){var Y=oe.innerMode(X,N.htmlState);b=Y.mode.name=="xml"&&Y.state.tagStart===null&&!Y.state.context&&Y.state.tokenize.isInText}b&&(N.f=E,N.block=T,N.htmlState=null)}return N.trailingSpace=0,N.trailingSpaceNewLine=!1,N.prevLine=N.thisLine,N.thisLine={stream:null},null}function T(N,b){var Y=N.column()===b.indentation,re=C(b.prevLine.stream),fe=b.indentedCode,ve=b.prevLine.hr,ke=b.list!==!1,Se=(b.listStack[b.listStack.length-1]||0)+3;b.indentedCode=!1;var Le=b.indentation;if(b.indentationDiff===null&&(b.indentationDiff=b.indentation,ke)){for(b.list=null;Le<b.listStack[b.listStack.length-1];)b.listStack.pop(),b.listStack.length?b.indentation=b.listStack[b.listStack.length-1]:b.list=!1;b.list!==!1&&(b.indentationDiff=Le-b.listStack[b.listStack.length-1])}var ye=!re&&!ve&&!b.prevLine.header&&(!ke||!fe)&&!b.prevLine.fencedCodeEnd,_e=(b.list===!1||ve||re)&&b.indentation<=Se&&N.match(i),de=null;if(b.indentationDiff>=4&&(fe||b.prevLine.fencedCodeEnd||b.prevLine.header||re))return N.skipToEnd(),b.indentedCode=!0,W.code;if(N.eatSpace())return null;if(Y&&b.indentation<=Se&&(de=N.match(m))&&de[1].length<=6)return b.quote=0,b.header=de[1].length,b.thisLine.header=!0,M.highlightFormatting&&(b.formatting="header"),b.f=b.inline,S(b);if(b.indentation<=Se&&N.eat(">"))return b.quote=Y?1:b.quote+1,M.highlightFormatting&&(b.formatting="quote"),N.eatSpace(),S(b);if(!_e&&!b.setext&&Y&&b.indentation<=Se&&(de=N.match(L))){var z=de[1]?"ol":"ul";return b.indentation=Le+N.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&&N.match(v,!1)&&(b.taskList=!0),b.f=b.inline,M.highlightFormatting&&(b.formatting=["list","list-"+z]),S(b)}else{if(Y&&b.indentation<=Se&&(de=N.match(h,!0)))return b.quote=0,b.fencedEndRE=new RegExp(de[1]+"+ *$"),b.localMode=M.fencedCodeBlockHighlighting&&P(de[2]||M.fencedCodeBlockDefaultMode),b.localMode&&(b.localState=oe.startState(b.localMode)),b.f=b.block=O,M.highlightFormatting&&(b.formatting="code-block"),b.code=-1,S(b);if(b.setext||(!ye||!ke)&&!b.quote&&b.list===!1&&!b.code&&!_e&&!f.test(N.string)&&(de=N.lookAhead(1))&&(de=de.match(p)))return b.setext?(b.header=b.setext,b.setext=0,N.skipToEnd(),M.highlightFormatting&&(b.formatting="header")):(b.header=de[0].charAt(0)=="="?1:2,b.setext=b.header),b.thisLine.header=!0,b.f=b.inline,S(b);if(_e)return N.skipToEnd(),b.hr=!0,b.thisLine.hr=!0,W.hr;if(N.peek()==="[")return s(N,b,F)}return s(N,b,b.inline)}function R(N,b){var Y=X.token(N,b.htmlState);if(!B){var re=oe.innerMode(X,b.htmlState);(re.mode.name=="xml"&&re.state.tagStart===null&&!re.state.context&&re.state.tokenize.isInText||b.md_inside&&N.current().indexOf(">")>-1)&&(b.f=E,b.block=T,b.htmlState=null)}return Y}function O(N,b){var Y=b.listStack[b.listStack.length-1]||0,re=b.indentation<Y,fe=Y+3;if(b.fencedEndRE&&b.indentation<=fe&&(re||N.match(b.fencedEndRE))){M.highlightFormatting&&(b.formatting="code-block");var ve;return re||(ve=S(b)),b.localMode=b.localState=null,b.block=T,b.f=E,b.fencedEndRE=null,b.code=0,b.thisLine.fencedCodeEnd=!0,re?a(N,b,b.block):ve}else return b.localMode?b.localMode.token(N,b.localState):(N.skipToEnd(),W.code)}function S(N){var b=[];if(N.formatting){b.push(W.formatting),typeof N.formatting=="string"&&(N.formatting=[N.formatting]);for(var Y=0;Y<N.formatting.length;Y++)b.push(W.formatting+"-"+N.formatting[Y]),N.formatting[Y]==="header"&&b.push(W.formatting+"-"+N.formatting[Y]+"-"+N.header),N.formatting[Y]==="quote"&&(!M.maxBlockquoteDepth||M.maxBlockquoteDepth>=N.quote?b.push(W.formatting+"-"+N.formatting[Y]+"-"+N.quote):b.push("error"))}if(N.taskOpen)return b.push("meta"),b.length?b.join(" "):null;if(N.taskClosed)return b.push("property"),b.length?b.join(" "):null;if(N.linkHref?b.push(W.linkHref,"url"):(N.strong&&b.push(W.strong),N.em&&b.push(W.em),N.strikethrough&&b.push(W.strikethrough),N.emoji&&b.push(W.emoji),N.linkText&&b.push(W.linkText),N.code&&b.push(W.code),N.image&&b.push(W.image),N.imageAltText&&b.push(W.imageAltText,"link"),N.imageMarker&&b.push(W.imageMarker)),N.header&&b.push(W.header,W.header+"-"+N.header),N.quote&&(b.push(W.quote),!M.maxBlockquoteDepth||M.maxBlockquoteDepth>=N.quote?b.push(W.quote+"-"+N.quote):b.push(W.quote+"-"+M.maxBlockquoteDepth)),N.list!==!1){var re=(N.listStack.length-1)%3;re?re===1?b.push(W.list2):b.push(W.list3):b.push(W.list1)}return N.trailingSpaceNewLine?b.push("trailing-space-new-line"):N.trailingSpace&&b.push("trailing-space-"+(N.trailingSpace%2?"a":"b")),b.length?b.join(" "):null}function w(N,b){return N.match(l,!0)?S(b):void 0}function E(N,b){var Y=b.text(N,b);if(typeof Y!="undefined")return Y;if(b.list)return b.list=null,S(b);if(b.taskList){var re=N.match(v,!0)[1]===" ";return re?b.taskOpen=!0:b.taskClosed=!0,M.highlightFormatting&&(b.formatting="task"),b.taskList=!1,S(b)}if(b.taskOpen=!1,b.taskClosed=!1,b.header&&N.match(/^#+$/,!0))return M.highlightFormatting&&(b.formatting="header"),S(b);var fe=N.next();if(b.linkTitle){b.linkTitle=!1;var ve=fe;fe==="("&&(ve=")"),ve=(ve+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ke="^\\s*(?:[^"+ve+"\\\\]+|\\\\\\\\|\\\\.)"+ve;if(N.match(new RegExp(ke),!0))return W.linkHref}if(fe==="`"){var Se=b.formatting;M.highlightFormatting&&(b.formatting="code"),N.eatWhile("`");var Le=N.current().length;if(b.code==0&&(!b.quote||Le==1))return b.code=Le,S(b);if(Le==b.code){var ye=S(b);return b.code=0,ye}else return b.formatting=Se,S(b)}else if(b.code)return S(b);if(fe==="\\"&&(N.next(),M.highlightFormatting)){var _e=S(b),de=W.formatting+"-escape";return _e?_e+" "+de:de}if(fe==="!"&&N.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return b.imageMarker=!0,b.image=!0,M.highlightFormatting&&(b.formatting="image"),S(b);if(fe==="["&&b.imageMarker&&N.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return b.imageMarker=!1,b.imageAltText=!0,M.highlightFormatting&&(b.formatting="image"),S(b);if(fe==="]"&&b.imageAltText){M.highlightFormatting&&(b.formatting="image");var _e=S(b);return b.imageAltText=!1,b.image=!1,b.inline=b.f=x,_e}if(fe==="["&&!b.image)return b.linkText&&N.match(/^.*?\]/)||(b.linkText=!0,M.highlightFormatting&&(b.formatting="link")),S(b);if(fe==="]"&&b.linkText){M.highlightFormatting&&(b.formatting="link");var _e=S(b);return b.linkText=!1,b.inline=b.f=N.match(/\(.*?\)| ?\[.*?\]/,!1)?x:E,_e}if(fe==="<"&&N.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=c,M.highlightFormatting&&(b.formatting="link");var _e=S(b);return _e?_e+=" ":_e="",_e+W.linkInline}if(fe==="<"&&N.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=c,M.highlightFormatting&&(b.formatting="link");var _e=S(b);return _e?_e+=" ":_e="",_e+W.linkEmail}if(M.xml&&fe==="<"&&N.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var z=N.string.indexOf(">",N.pos);if(z!=-1){var D=N.string.substring(N.start,z);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(D)&&(b.md_inside=!0)}return N.backUp(1),b.htmlState=oe.startState(X),a(N,b,R)}if(M.xml&&fe==="<"&&N.match(/^\/\w*?>/))return b.md_inside=!1,"tag";if(fe==="*"||fe==="_"){for(var I=1,V=N.pos==1?" ":N.string.charAt(N.pos-2);I<3&&N.eat(fe);)I++;var Q=N.peek()||" ",G=!/\s/.test(Q)&&(!o.test(Q)||/\s/.test(V)||o.test(V)),ce=!/\s/.test(V)&&(!o.test(V)||/\s/.test(Q)||o.test(Q)),Ce=null,De=null;if(I%2&&(!b.em&&G&&(fe==="*"||!ce||o.test(V))?Ce=!0:b.em==fe&&ce&&(fe==="*"||!G||o.test(Q))&&(Ce=!1)),I>1&&(!b.strong&&G&&(fe==="*"||!ce||o.test(V))?De=!0:b.strong==fe&&ce&&(fe==="*"||!G||o.test(Q))&&(De=!1)),De!=null||Ce!=null){M.highlightFormatting&&(b.formatting=Ce==null?"strong":De==null?"em":"strong em"),Ce===!0&&(b.em=fe),De===!0&&(b.strong=fe);var ye=S(b);return Ce===!1&&(b.em=!1),De===!1&&(b.strong=!1),ye}}else if(fe===" "&&(N.eat("*")||N.eat("_"))){if(N.peek()===" ")return S(b);N.backUp(1)}if(M.strikethrough){if(fe==="~"&&N.eatWhile(fe)){if(b.strikethrough){M.highlightFormatting&&(b.formatting="strikethrough");var ye=S(b);return b.strikethrough=!1,ye}else if(N.match(/^[^\s]/,!1))return b.strikethrough=!0,M.highlightFormatting&&(b.formatting="strikethrough"),S(b)}else if(fe===" "&&N.match(/^~~/,!0)){if(N.peek()===" ")return S(b);N.backUp(2)}}if(M.emoji&&fe===":"&&N.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){b.emoji=!0,M.highlightFormatting&&(b.formatting="emoji");var ue=S(b);return b.emoji=!1,ue}return fe===" "&&(N.match(/^ +$/,!1)?b.trailingSpace++:b.trailingSpace&&(b.trailingSpaceNewLine=!0)),S(b)}function c(N,b){var Y=N.next();if(Y===">"){b.f=b.inline=E,M.highlightFormatting&&(b.formatting="link");var re=S(b);return re?re+=" ":re="",re+W.linkInline}return N.match(/^[^>]+/,!0),W.linkInline}function x(N,b){if(N.eatSpace())return null;var Y=N.next();return Y==="("||Y==="["?(b.f=b.inline=g(Y==="("?")":"]"),M.highlightFormatting&&(b.formatting="link-string"),b.linkHref=!0,S(b)):"error"}var y={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function g(N){return function(b,Y){var re=b.next();if(re===N){Y.f=Y.inline=E,M.highlightFormatting&&(Y.formatting="link-string");var fe=S(Y);return Y.linkHref=!1,fe}return b.match(y[N]),Y.linkHref=!0,S(Y)}}function F(N,b){return N.match(/^([^\]\\]|\\.)*\]:/,!1)?(b.f=U,N.next(),M.highlightFormatting&&(b.formatting="link"),b.linkText=!0,S(b)):s(N,b,E)}function U(N,b){if(N.match(/^\]:/,!0)){b.f=b.inline=A,M.highlightFormatting&&(b.formatting="link");var Y=S(b);return b.linkText=!1,Y}return N.match(/^([^\]\\]|\\.)+/,!0),W.linkText}function A(N,b){return N.eatSpace()?null:(N.match(/^[^\s]+/,!0),N.peek()===void 0?b.linkTitle=!0:N.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),b.f=b.inline=E,W.linkHref+" url")}var j={startState:function(){return{f:T,prevLine:{stream:null},thisLine:{stream:null},block:T,htmlState:null,indentation:0,inline:E,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(N){return{f:N.f,prevLine:N.prevLine,thisLine:N.thisLine,block:N.block,htmlState:N.htmlState&&oe.copyState(X,N.htmlState),indentation:N.indentation,localMode:N.localMode,localState:N.localMode?oe.copyState(N.localMode,N.localState):null,inline:N.inline,text:N.text,formatting:!1,linkText:N.linkText,linkTitle:N.linkTitle,linkHref:N.linkHref,code:N.code,em:N.em,strong:N.strong,strikethrough:N.strikethrough,emoji:N.emoji,header:N.header,setext:N.setext,hr:N.hr,taskList:N.taskList,list:N.list,listStack:N.listStack.slice(0),quote:N.quote,indentedCode:N.indentedCode,trailingSpace:N.trailingSpace,trailingSpaceNewLine:N.trailingSpaceNewLine,md_inside:N.md_inside,fencedEndRE:N.fencedEndRE}},token:function(N,b){if(b.formatting=!1,N!=b.thisLine.stream){if(b.header=0,b.hr=!1,N.match(/^\s*$/,!0))return _(b),null;if(b.prevLine=b.thisLine,b.thisLine={stream:N},b.taskList=!1,b.trailingSpace=0,b.trailingSpaceNewLine=!1,!b.localState&&(b.f=b.block,b.f!=R)){var Y=N.match(/^\s*/,!0)[0].replace(/\t/g,u).length;if(b.indentation=Y,b.indentationDiff=null,Y>0)return null}}return b.f(N,b)},innerMode:function(N){return N.block==R?{state:N.htmlState,mode:X}:N.localState?{state:N.localState,mode:N.localMode}:{state:N,mode:j}},indent:function(N,b,Y){return N.block==R&&X.indent?X.indent(N.htmlState,b,Y):N.localState&&N.localMode.indent?N.localMode.indent(N.localState,b,Y):oe.Pass},blankLine:_,getType:S,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return j},"xml"),oe.defineMIME("text/markdown","markdown"),oe.defineMIME("text/x-markdown","markdown")})},m7e3:function(Ze,Te,Z){Ze.exports={flex_box_center:"flex_box_center___cDhGq",flex_space_between:"flex_space_between___3OXHk",flex_box_vertical_center:"flex_box_vertical_center___3g3vC",flex_box_center_end:"flex_box_center_end___2QmKm",flex_box_column:"flex_box_column___2Id0h",bg:"bg___1JEmc",title:"title___3bVR_",titleLeft:"titleLeft___2rmGK",titleRight:"titleRight___1YZFf",btns:"btns___2IVL7"}},nEHx:function(Ze,Te,Z){"use strict";Z.d(Te,"a",function(){return oe});var oe;(function($){$.DARK="dark",$.LIGHT="light",$.HIGH_CONTRAST="hc"})(oe||(oe={}))},nnTU:function(Ze,Te,Z){"use strict";Z.d(Te,"b",function(){return W}),Z.d(Te,"a",function(){return H});var oe=Z("MI8n"),$=Z("JYp7"),M=Z("pmY6"),X=Z("24hK"),B=Z("746U"),P=Z("Cg/j");const W=Object(P.c)("commandService"),H=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new oe.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(i,L){if(!i)throw new Error("invalid command");if(typeof i=="string"){if(!L)throw new Error("invalid command");return this.registerCommand({id:i,handler:L})}if(i.description){const h=[];for(let o of i.description.args)h.push(o.constraint);const f=i.handler;i.handler=function(o,...u){return Object(B.o)(u,h),f(o,...u)}}const{id:v}=i;let m=this._commands.get(v);m||(m=new X.a,this._commands.set(v,m));let p=m.unshift(i),l=Object(M.i)(()=>{p();const h=this._commands.get(v);(h==null?void 0:h.isEmpty())&&this._commands.delete(v)});return this._onDidRegisterCommand.fire(v),l}registerCommandAlias(i,L){return H.registerCommand(i,(v,...m)=>v.get(W).executeCommand(L,...m))}getCommand(i){const L=this._commands.get(i);return!L||L.isEmpty()?void 0:$.a.first(L)}getCommands(){const i=new Map;for(const L of this._commands.keys()){const v=this.getCommand(L);v&&i.set(L,v)}return i}};H.registerCommand("noop",()=>{})},osHv:function(Ze,Te,Z){(function(oe){oe(Z("VrN/"))})(function(oe){"use strict";var $=oe.Pos;function M(o,u){return o.line-u.line||o.ch-u.ch}var X="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",B=X+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",P=new RegExp("<(/?)(["+X+"]["+B+"]*)","g");function W(o,u,s,a){this.line=u,this.ch=s,this.cm=o,this.text=o.getLine(u),this.min=a?Math.max(a.from,o.firstLine()):o.firstLine(),this.max=a?Math.min(a.to-1,o.lastLine()):o.lastLine()}function H(o,u){var s=o.cm.getTokenTypeAt($(o.line,u));return s&&/\btag\b/.test(s)}function i(o){return o.line>=o.max?void 0:(o.ch=0,o.text=o.cm.getLine(++o.line),!0)}function L(o){return o.line<=o.min?void 0:(o.text=o.cm.getLine(--o.line),o.ch=o.text.length,!0)}function v(o){for(;;){var u=o.text.indexOf(">",o.ch);if(u==-1){if(i(o))continue;return}if(!H(o,u+1)){o.ch=u+1;continue}var s=o.text.lastIndexOf("/",u),a=s>-1&&!/\S/.test(o.text.slice(s+1,u));return o.ch=u+1,a?"selfClose":"regular"}}function m(o){for(;;){var u=o.ch?o.text.lastIndexOf("<",o.ch-1):-1;if(u==-1){if(L(o))continue;return}if(!H(o,u+1)){o.ch=u;continue}P.lastIndex=u,o.ch=u;var s=P.exec(o.text);if(s&&s.index==u)return s}}function p(o){for(;;){P.lastIndex=o.ch;var u=P.exec(o.text);if(!u){if(i(o))continue;return}if(!H(o,u.index+1)){o.ch=u.index+1;continue}return o.ch=u.index+u[0].length,u}}function l(o){for(;;){var u=o.ch?o.text.lastIndexOf(">",o.ch-1):-1;if(u==-1){if(L(o))continue;return}if(!H(o,u+1)){o.ch=u;continue}var s=o.text.lastIndexOf("/",u),a=s>-1&&!/\S/.test(o.text.slice(s+1,u));return o.ch=u+1,a?"selfClose":"regular"}}function h(o,u){for(var s=[];;){var a=p(o),C,_=o.line,T=o.ch-(a?a[0].length:0);if(!a||!(C=v(o)))return;if(C=="selfClose")continue;if(a[1]){for(var R=s.length-1;R>=0;--R)if(s[R]==a[2]){s.length=R;break}if(R<0&&(!u||u==a[2]))return{tag:a[2],from:$(_,T),to:$(o.line,o.ch)}}else s.push(a[2])}}function f(o,u){for(var s=[];;){var a=l(o);if(!a)return;if(a=="selfClose"){m(o);continue}var C=o.line,_=o.ch,T=m(o);if(!T)return;if(T[1])s.push(T[2]);else{for(var R=s.length-1;R>=0;--R)if(s[R]==T[2]){s.length=R;break}if(R<0&&(!u||u==T[2]))return{tag:T[2],from:$(o.line,o.ch),to:$(C,_)}}}}oe.registerHelper("fold","xml",function(o,u){for(var s=new W(o,u.line,0);;){var a=p(s);if(!a||s.line!=u.line)return;var C=v(s);if(!C)return;if(!a[1]&&C!="selfClose"){var _=$(s.line,s.ch),T=h(s,a[2]);return T&&M(T.from,_)>0?{from:_,to:T.from}:null}}}),oe.findMatchingTag=function(o,u,s){var a=new W(o,u.line,u.ch,s);if(a.text.indexOf(">")==-1&&a.text.indexOf("<")==-1)return;var C=v(a),_=C&&$(a.line,a.ch),T=C&&m(a);if(!C||!T||M(a,u)>0)return;var R={from:$(a.line,a.ch),to:_,tag:T[2]};return C=="selfClose"?{open:R,close:null,at:"open"}:T[1]?{open:f(a,T[2]),close:R,at:"close"}:(a=new W(o,_.line,_.ch,s),{open:R,close:h(a,T[2]),at:"open"})},oe.findEnclosingTag=function(o,u,s,a){for(var C=new W(o,u.line,u.ch,s);;){var _=f(C,a);if(!_)break;var T=new W(o,u.line,u.ch,s),R=h(T,_.tag);if(R)return{open:_,close:R}}},oe.scanForClosingTag=function(o,u,s,a){var C=new W(o,u.line,u.ch,a?{from:0,to:a}:null);return h(C,s)}})},p5ED:function(Ze,Te,Z){"use strict";var oe=Z("+L6B"),$=Z("2/Rp"),M=Z("5Dmo"),X=Z("3S7+"),B=Z("k1fw"),P=Z("9og8"),W=Z("tJVT"),H=Z("WmNS"),i=Z.n(H),L=Z("q1tI"),v=Z.n(L),m=Z("vHTk"),p=Z.n(m),l=Z("yEEn"),h=Z("ZW9T"),f=Z("1vsH"),o=Z("V0Rq"),u=Z("m3rI");Te.a=function(s){var a,C,_,T,R,O,S,w=s.editOffice,E=w===void 0?"view":w,c=s.data,x=s.theme,y=s.type,g=s.filename,F=s.monacoEditor,U=s.className,A=s.style,j=s.close,N=s.onClose,b=s.hasMask,Y=s.disabledDownload,re=Object(L.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),fe=Object(W.a)(re,2),ve=fe[0],ke=fe[1],Se=Object(L.useState)(""),Le=Object(W.a)(Se,2),ye=Le[0],_e=Le[1],de=Object(L.useState)(),z=Object(W.a)(de,2),D=z[0],I=z[1],V=window.ENV==="build"?"/react/build":"",Q=u.a.PROXY_SERVER||location.origin,G,ce=1024*1024,Ce=10*ce,De=Object(L.useRef)();(a=c)!==null&&a!==void 0&&a.startsWith("/api")&&y!=="txt"&&(c=(u.a.API_SERVER||location.origin)+c),y==="office"&&(G=Object(f.T)(c).filesize,G>Ce&&(y="other")),g&&F&&(F.filename=g),Object(L.useEffect)(function(){var Ae,Ne,Be=(Ae=document.cookie)===null||Ae===void 0||((Ne=Ae.replace(/\s/g,""))===null||Ne===void 0)?void 0:Ne.split(";");Be==null||Be.map(function(Ge){var He=Ge.split("=");He[0]==="_educoder_session"&&_e(He[1])})},[]),Object(L.useEffect)(function(){y==="office"&&ue()},[y,c]);var ue=function(){var Ae=Object(P.a)(i.a.mark(function Ne(){var Be,Ge,He;return i.a.wrap(function(je){for(;;)switch(je.prev=je.next){case 0:return console.log("data:",c),Be=c,c.startsWith("http")||(Be=location.origin+Be),Ge=new URL(Be).pathname.split("/").pop(),je.next=6,Object(o.V)({attachment_id:Ge});case 6:He=je.sent,I(He);case 8:case"end":return je.stop()}},Ne)}));return function(){return Ae.apply(this,arguments)}}(),ge=function(){if(c.startsWith("http")||c.startsWith("blob:")){we();return}Object(f.z)(g||"educoder",c,g)},we=function(){Object(f.x)(g||"educoder",decodeURIComponent(c))};return v.a.createElement("div",{style:Object(B.a)({},A||{}),className:"".concat(b&&p.a.bgBlack," ").concat(y?p.a.wrp:"hide")},j&&v.a.createElement("div",{className:p.a.close,ref:De},!Y&&v.a.createElement(X.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return De.current}},v.a.createElement("span",{onClick:we},v.a.createElement("i",{className:"icon-quxiaozhiding"}))),v.a.createElement(X.a,{title:"\u5173\u95ED",getPopupContainer:function(){return De.current}},v.a.createElement("span",{className:"",onClick:N},v.a.createElement("i",{className:"icon-guanbi1"})))),v.a.createElement("div",{className:"".concat(p.a[U]," ").concat(U," ").concat(p.a.monaco," ").concat(y==="txt"?"show":"hide")},y==="txt"&&v.a.createElement(h.b,F)),y==="audio"&&v.a.createElement("audio",{src:"".concat(((C=c)===null||C===void 0?void 0:C.indexOf("http://"))>-1||((_=c)===null||_===void 0?void 0:_.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(c),autoPlay:!0}),y==="video"&&v.a.createElement(v.a.Fragment,null,((T=c)===null||T===void 0?void 0:T.indexOf("http"))>-1?v.a.createElement("video",{controls:!0,src:"".concat(c),autoPlay:!0}):v.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(c),autoPlay:!0})),y==="office"&&D&&v.a.createElement("iframe",{src:"".concat(V,"/office.html?key=").concat(D.key,"&url=").concat(Q+D.url,"&callbackUrl=").concat(Q+D.callbackUrl,"&fileType=").concat(D.fileType,"&title=").concat(D.title,"&model=").concat(E,"&officeServer=").concat(u.a.OFFICE_SERVER,"&disabledDownload=").concat(!!Y)}),y==="html"&&v.a.createElement("iframe",{src:c+"&disposition=inline"}),y==="pdf"&&v.a.createElement("iframe",{src:"".concat(V,"/js/pdfview/index.html?url=").concat(c,"&disabledDownload=").concat(!!Y)}),y==="image"&&v.a.createElement("img",{src:"".concat(((R=c)===null||R===void 0?void 0:R.indexOf("http://"))>-1||((O=c)===null||O===void 0?void 0:O.indexOf("https://"))>-1||(S=c)!==null&&S!==void 0&&S.startsWith("/api")?"":"data:image/png;base64,").concat(c)}),y==="other"&&v.a.createElement("div",null,v.a.createElement($.a,{type:"primary",size:"large",onClick:ge},v.a.createElement(l.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),y==="download"&&v.a.createElement($.a,{type:"primary",size:"large",onClick:ge},v.a.createElement(l.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Ze,Te,Z){},pmY6:function(Ze,Te,Z){"use strict";Z.d(Te,"h",function(){return L}),Z.d(Te,"g",function(){return m}),Z.d(Te,"f",function(){return p}),Z.d(Te,"e",function(){return l}),Z.d(Te,"i",function(){return h}),Z.d(Te,"b",function(){return f}),Z.d(Te,"a",function(){return o}),Z.d(Te,"d",function(){return u}),Z.d(Te,"c",function(){return s});var oe=Z("C/vA"),$=Z("JYp7");const M=!1;let X=null;function B(a){X=a}if(M){const a="__is_disposable_tracked__";B(new class{trackDisposable(C){const _=new Error("Potentially leaked disposable").stack;setTimeout(()=>{C[a]||console.log(_)},3e3)}setParent(C,_){if(C&&C!==o.None)try{C[a]=!0}catch(T){}}markAsDisposed(C){if(C&&C!==o.None)try{C[a]=!0}catch(_){}}markAsSingleton(C){}})}function P(a){return X==null||X.trackDisposable(a),a}function W(a){X==null||X.markAsDisposed(a)}function H(a,C){X==null||X.setParent(a,C)}function i(a,C){if(!X)return;for(const _ of a)X.setParent(_,C)}function L(a){return X==null||X.markAsSingleton(a),a}class v extends Error{constructor(a){super(`Encountered errors while disposing of store. Errors: [${a.join(", ")}]`);this.errors=a}}function m(a){return typeof a.dispose=="function"&&a.dispose.length===0}function p(a){if($.a.is(a)){let C=[];for(const _ of a)if(_)try{_.dispose()}catch(T){C.push(T)}if(C.length===1)throw C[0];if(C.length>1)throw new v(C);return Array.isArray(a)?[]:a}else if(a)return a.dispose(),a}function l(...a){const C=h(()=>p(a));return i(a,C),C}function h(a){const C=P({dispose:Object(oe.a)(()=>{W(C),a()})});return C}class f{constructor(){this._toDispose=new Set,this._isDisposed=!1,P(this)}dispose(){if(this._isDisposed)return;W(this),this._isDisposed=!0,this.clear()}clear(){try{p(this._toDispose.values())}finally{this._toDispose.clear()}}add(a){if(!a)return a;if(a===this)throw new Error("Cannot register a disposable on itself!");return H(a,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(a),a}}f.DISABLE_DISPOSED_WARNING=!1;class o{constructor(){this._store=new f,P(this),H(this._store,this)}dispose(){W(this),this._store.dispose()}_register(a){if(a===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(a)}}o.None=Object.freeze({dispose(){}});class u{constructor(){this._isDisposed=!1,P(this)}get value(){return this._isDisposed?void 0:this._value}set value(a){var C;if(this._isDisposed||a===this._value)return;(C=this._value)===null||C===void 0||C.dispose(),a&&H(a,this),this._value=a}clear(){this.value=void 0}dispose(){var a;this._isDisposed=!0,W(this),(a=this._value)===null||a===void 0||a.dispose(),this._value=void 0}clearAndLeak(){const a=this._value;return this._value=void 0,a&&H(a,null),a}}class s{constructor(a){this.object=a}dispose(){}}},psGv:function(Ze,Te,Z){var oe,$;(function(){var M;(function(){"use strict";var W=[,,function(v){function m(h){this.__parent=h,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}m.prototype.clone_empty=function(){var h=new m(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},m.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},m.prototype.has_match=function(h){for(var f=this.__items.length-1;f>=0;f--)if(this.__items[f].match(h))return!0;return!1},m.prototype.set_indent=function(h,f){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=f||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},m.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var h=this.__parent.current_line;return h.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),h.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),h.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,h.__items[0]===" "&&(h.__items.splice(0,1),h.__character_count-=1),!0}return!1},m.prototype.is_empty=function(){return this.__items.length===0},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(h){this.__items.push(h);var f=h.lastIndexOf(`
|
|
`);f!==-1?this.__character_count=h.length-f:this.__character_count+=h.length},m.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var h="";return this.is_empty()?this.__parent.indent_empty_lines&&(h=this.__parent.get_indent_string(this.__indent_count)):(h=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),h+=this.__items.join("")),h};function p(h,f){this.__cache=[""],this.__indent_size=h.indent_size,this.__indent_string=h.indent_char,h.indent_with_tabs||(this.__indent_string=new Array(h.indent_size+1).join(h.indent_char)),f=f||"",h.indent_level>0&&(f=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=f,this.__base_string_length=f.length}p.prototype.get_indent_size=function(h,f){var o=this.__base_string_length;return f=f||0,h<0&&(o=0),o+=h*this.__indent_size,o+=f,o},p.prototype.get_indent_string=function(h,f){var o=this.__base_string;return f=f||0,h<0&&(h=0,o=""),f+=h*this.__indent_size,this.__ensure_cache(f),o+=this.__cache[f],o},p.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var h=this.__cache.length,f=0,o="";this.__indent_size&&h>=this.__indent_size&&(f=Math.floor(h/this.__indent_size),h-=f*this.__indent_size,o=new Array(f+1).join(this.__indent_string)),h&&(o+=new Array(h+1).join(" ")),this.__cache.push(o)};function l(h,f){this.__indent_cache=new p(h,f),this.raw=!1,this._end_with_newline=h.end_with_newline,this.indent_size=h.indent_size,this.wrap_line_length=h.wrap_line_length,this.indent_empty_lines=h.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new m(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}l.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},l.prototype.get_line_number=function(){return this.__lines.length},l.prototype.get_indent_string=function(h,f){return this.__indent_cache.get_indent_string(h,f)},l.prototype.get_indent_size=function(h,f){return this.__indent_cache.get_indent_size(h,f)},l.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},l.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},l.prototype.get_code=function(h){this.trim(!0);var f=this.current_line.pop();f&&(f[f.length-1]===`
|
|
`&&(f=f.replace(/\n+$/g,"")),this.current_line.push(f)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
|
|
`);return h!==`
|
|
`&&(o=o.replace(/[\n]/g,h)),o},l.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},l.prototype.set_indent=function(h,f){return h=h||0,f=f||0,this.next_line.set_indent(h,f),this.__lines.length>1?(this.current_line.set_indent(h,f),!0):(this.current_line.set_indent(),!1)},l.prototype.add_raw_token=function(h){for(var f=0;f<h.newlines;f++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(h.whitespace_before),this.current_line.push(h.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},l.prototype.add_token=function(h){this.__add_space_before_token(),this.current_line.push(h),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},l.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(" "))},l.prototype.remove_indent=function(h){for(var f=this.__lines.length;h<f;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},l.prototype.trim=function(h){for(h=h===void 0?!1:h,this.current_line.trim();h&&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},l.prototype.just_added_newline=function(){return this.current_line.is_empty()},l.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},l.prototype.ensure_empty_line_above=function(h,f){for(var o=this.__lines.length-2;o>=0;){var u=this.__lines[o];if(u.is_empty())break;if(u.item(0).indexOf(h)!==0&&u.item(-1)!==f){this.__lines.splice(o+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},v.exports.Output=l},function(v){function m(p,l,h,f){this.type=p,this.text=l,this.comments_before=null,this.newlines=h||0,this.whitespace_before=f||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}v.exports.Token=m},,,function(v){function m(h,f){this.raw_options=p(h,f),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}m.prototype._get_array=function(h,f){var o=this.raw_options[h],u=f||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(u=o.concat()):typeof o=="string"&&(u=o.split(/[^a-zA-Z0-9_\/\-]+/)),u},m.prototype._get_boolean=function(h,f){var o=this.raw_options[h],u=o===void 0?!!f:!!o;return u},m.prototype._get_characters=function(h,f){var o=this.raw_options[h],u=f||"";return typeof o=="string"&&(u=o.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),u},m.prototype._get_number=function(h,f){var o=this.raw_options[h];f=parseInt(f,10),isNaN(f)&&(f=0);var u=parseInt(o,10);return isNaN(u)&&(u=f),u},m.prototype._get_selection=function(h,f,o){var u=this._get_selection_list(h,f,o);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
|
|
`+f+`
|
|
You passed in: '`+this.raw_options[h]+"'");return u[0]},m.prototype._get_selection_list=function(h,f,o){if(!f||f.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[f[0]],!this._is_valid_selection(o,f))throw new Error("Invalid Default Value!");var u=this._get_array(h,o);if(!this._is_valid_selection(u,f))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
|
|
`+f+`
|
|
You passed in: '`+this.raw_options[h]+"'");return u},m.prototype._is_valid_selection=function(h,f){return h.length&&f.length&&!h.some(function(o){return f.indexOf(o)===-1})};function p(h,f){var o={};h=l(h);var u;for(u in h)u!==f&&(o[u]=h[u]);if(f&&h[f])for(u in h[f])o[u]=h[f][u];return o}function l(h){var f={},o;for(o in h){var u=o.replace(/-/g,"_");f[u]=h[o]}return f}v.exports.Options=m,v.exports.normalizeOpts=l,v.exports.mergeOpts=p},,function(v){var m=RegExp.prototype.hasOwnProperty("sticky");function p(l){this.__input=l||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var l=null;return this.hasNext()&&(l=this.__input.charAt(this.__position),this.__position+=1),l},p.prototype.peek=function(l){var h=null;return l=l||0,l+=this.__position,l>=0&&l<this.__input_length&&(h=this.__input.charAt(l)),h},p.prototype.__match=function(l,h){l.lastIndex=h;var f=l.exec(this.__input);return f&&!(m&&l.sticky)&&(f.index!==h&&(f=null)),f},p.prototype.test=function(l,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(l,h):!1},p.prototype.testChar=function(l,h){var f=this.peek(h);return l.lastIndex=0,f!==null&&l.test(f)},p.prototype.match=function(l){var h=this.__match(l,this.__position);return h?this.__position+=h[0].length:h=null,h},p.prototype.read=function(l,h,f){var o="",u;return l&&(u=this.match(l),u&&(o+=u[0])),h&&(u||!l)&&(o+=this.readUntil(h,f)),o},p.prototype.readUntil=function(l,h){var f="",o=this.__position;l.lastIndex=this.__position;var u=l.exec(this.__input);return u?(o=u.index,h&&(o+=u[0].length)):o=this.__input_length,f=this.__input.substring(this.__position,o),this.__position=o,f},p.prototype.readUntilAfter=function(l){return this.readUntil(l,!0)},p.prototype.get_regexp=function(l,h){var f=null,o="g";return h&&m&&(o="y"),typeof l=="string"&&l!==""?f=new RegExp(l,o):l&&(f=new RegExp(l.source,o)),f},p.prototype.get_literal_regexp=function(l){return RegExp(l.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(l){var h=this.__position,f=this.readUntilAfter(l);return this.__position=h,f},p.prototype.lookBack=function(l){var h=this.__position-1;return h>=l.length&&this.__input.substring(h-l.length,h).toLowerCase()===l},v.exports.InputScanner=p},function(v,m,p){var l=p(8).InputScanner,h=p(3).Token,f=p(10).TokenStream,o=p(11).WhitespacePattern,u={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(a,C){this._input=new l(a),this._options=C||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new f,this._reset();for(var a,C=new h(u.START,""),_=null,T=[],R=new f;C.type!==u.EOF;){for(a=this._get_next_token(C,_);this._is_comment(a);)R.add(a),a=this._get_next_token(C,_);R.isEmpty()||(a.comments_before=R,R=new f),a.parent=_,this._is_opening(a)?(T.push(_),_=a):_&&this._is_closing(a,_)&&(a.opened=_,_.closed=a,_=T.pop(),a.parent=_),a.previous=C,C.next=a,this.__tokens.add(a),C=a}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(a,C){this._readWhitespace();var _=this._input.read(/.+/g);return _?this._create_token(u.RAW,_):this._create_token(u.EOF,"")},s.prototype._is_comment=function(a){return!1},s.prototype._is_opening=function(a){return!1},s.prototype._is_closing=function(a,C){return!1},s.prototype._create_token=function(a,C){var _=new h(a,C,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return _},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},v.exports.Tokenizer=s,v.exports.TOKEN=u},function(v){function m(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position<this.__tokens_length},m.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__tokens[this.__position],this.__position+=1),p},m.prototype.peek=function(p){var l=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(l=this.__tokens[p]),l},m.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},v.exports.TokenStream=m},function(v,m,p){var l=p(12).Pattern;function h(f,o){l.call(this,f,o),o?this._line_regexp=this._input.get_regexp(o._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}h.prototype=new l,h.prototype.__set_whitespace_patterns=function(f,o){f+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+f+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},h.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var f=this._input.read(this._match_pattern);if(f===" ")this.whitespace_before_token=" ";else if(f){var o=this.__split(this._newline_regexp,f);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return f},h.prototype.matching=function(f,o){var u=this._create();return u.__set_whitespace_patterns(f,o),u._update(),u},h.prototype._create=function(){return new h(this._input,this)},h.prototype.__split=function(f,o){f.lastIndex=0;for(var u=0,s=[],a=f.exec(o);a;)s.push(o.substring(u,a.index)),u=a.index+a[0].length,a=f.exec(o);return u<o.length?s.push(o.substring(u,o.length)):s.push(""),s},v.exports.WhitespacePattern=h},function(v){function m(p,l){this._input=p,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,l&&(this._starting_pattern=this._input.get_regexp(l._starting_pattern,!0),this._match_pattern=this._input.get_regexp(l._match_pattern,!0),this._until_pattern=this._input.get_regexp(l._until_pattern),this._until_after=l._until_after)}m.prototype.read=function(){var p=this._input.read(this._starting_pattern);return(!this._starting_pattern||p)&&(p+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),p},m.prototype.read_match=function(){return this._input.match(this._match_pattern)},m.prototype.until_after=function(p){var l=this._create();return l._until_after=!0,l._until_pattern=this._input.get_regexp(p),l._update(),l},m.prototype.until=function(p){var l=this._create();return l._until_after=!1,l._until_pattern=this._input.get_regexp(p),l._update(),l},m.prototype.starting_with=function(p){var l=this._create();return l._starting_pattern=this._input.get_regexp(p,!0),l._update(),l},m.prototype.matching=function(p){var l=this._create();return l._match_pattern=this._input.get_regexp(p,!0),l._update(),l},m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){},v.exports.Pattern=m},function(v){function m(p,l){p=typeof p=="string"?p:p.source,l=typeof l=="string"?l:l.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+l,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+l,"g")}m.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var l={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(p);h;)l[h[1]]=h[2],h=this.__directive_pattern.exec(p);return l},m.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},v.exports.Directives=m},function(v,m,p){var l=p(12).Pattern,h={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function f(o,u){l.call(this,o,u),this.__template_pattern=null,this._disabled=Object.assign({},h),this._excluded=Object.assign({},h),u&&(this.__template_pattern=this._input.get_regexp(u.__template_pattern),this._excluded=Object.assign(this._excluded,u._excluded),this._disabled=Object.assign(this._disabled,u._disabled));var s=new l(o);this.__patterns={handlebars_comment:s.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:s.starting_with(/{{{/).until_after(/}}}/),handlebars:s.starting_with(/{{/).until_after(/}}/),php:s.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:s.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:s.starting_with(/{%/).until_after(/%}/),django_value:s.starting_with(/{{/).until_after(/}}/),django_comment:s.starting_with(/{#/).until_after(/#}/),smarty:s.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:s.starting_with(/{\*/).until_after(/\*}/),smarty_literal:s.starting_with(/{literal}/).until_after(/{\/literal}/)}}f.prototype=new l,f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){this.__set_templated_pattern()},f.prototype.disable=function(o){var u=this._create();return u._disabled[o]=!0,u._update(),u},f.prototype.read_options=function(o){var u=this._create();for(var s in h)u._disabled[s]=o.templating.indexOf(s)===-1;return u._update(),u},f.prototype.exclude=function(o){var u=this._create();return u._excluded[o]=!0,u._update(),u},f.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=this._input.read(this._starting_pattern,this.__template_pattern);for(var u=this._read_template();u;)this._match_pattern?u+=this._input.read(this._match_pattern):u+=this._input.readUntil(this.__template_pattern),o+=u,u=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},f.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},f.prototype._read_template=function(){var o="",u=this._input.peek();if(u==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(o=o||this.__patterns.erb.read())}else u==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},v.exports.TemplatablePattern=f},,,,function(v,m,p){var l=p(19).Beautifier,h=p(20).Options;function f(o,u,s,a){var C=new l(o,u,s,a);return C.beautify()}v.exports=f,v.exports.defaultOptions=function(){return new h}},function(v,m,p){var l=p(20).Options,h=p(2).Output,f=p(21).Tokenizer,o=p(21).TOKEN,u=/\r\n|[\r\n]/,s=/\r\n|[\r\n]/g,a=function(x,y){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=x.max_preserve_newlines,this.preserve_newlines=x.preserve_newlines,this._output=new h(x,y)};a.prototype.current_line_has_match=function(x){return this._output.current_line.has_match(x)},a.prototype.set_space_before_token=function(x,y){this._output.space_before_token=x,this._output.non_breaking_space=y},a.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},a.prototype.add_raw_token=function(x){this._output.add_raw_token(x)},a.prototype.print_preserved_newlines=function(x){var y=0;x.type!==o.TEXT&&x.previous.type!==o.TEXT&&(y=x.newlines?1:0),this.preserve_newlines&&(y=x.newlines<this.max_preserve_newlines+1?x.newlines:this.max_preserve_newlines+1);for(var g=0;g<y;g++)this.print_newline(g>0);return y!==0},a.prototype.traverse_whitespace=function(x){return x.whitespace_before||x.newlines?(this.print_preserved_newlines(x)||(this._output.space_before_token=!0),!0):!1},a.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},a.prototype.print_newline=function(x){this._output.add_new_line(x)},a.prototype.print_token=function(x){x.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(x.text))},a.prototype.indent=function(){this.indent_level++},a.prototype.get_full_indent=function(x){return x=this.indent_level+(x||0),x<1?"":this._output.get_indent_string(x)};var C=function(x){for(var y=null,g=x.next;g.type!==o.EOF&&x.closed!==g;){if(g.type===o.ATTRIBUTE&&g.text==="type"){g.next&&g.next.type===o.EQUALS&&g.next.next&&g.next.next.type===o.VALUE&&(y=g.next.next.text);break}g=g.next}return y},_=function(x,y){var g=null,F=null;return y.closed?(x==="script"?g="text/javascript":x==="style"&&(g="text/css"),g=C(y)||g,g.search("text/css")>-1?F="css":g.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?F="javascript":g.search(/(text|application|dojo)\/(x-)?(html)/)>-1?F="html":g.search(/test\/null/)>-1&&(F="null"),F):null};function T(x,y){return y.indexOf(x)!==-1}function R(x,y,g){this.parent=x||null,this.tag=y?y.tag_name:"",this.indent_level=g||0,this.parser_token=y||null}function O(x){this._printer=x,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(x){var y=new R(this._current_frame,x,this._printer.indent_level);this._current_frame=y},O.prototype._try_pop_frame=function(x){var y=null;return x&&(y=x.parser_token,this._printer.indent_level=x.indent_level,this._current_frame=x.parent),y},O.prototype._get_frame=function(x,y){for(var g=this._current_frame;g&&!(x.indexOf(g.tag)!==-1);){if(y&&y.indexOf(g.tag)!==-1){g=null;break}g=g.parent}return g},O.prototype.try_pop=function(x,y){var g=this._get_frame([x],y);return this._try_pop_frame(g)},O.prototype.indent_to_tag=function(x){var y=this._get_frame(x);y&&(this._printer.indent_level=y.indent_level)};function S(x,y,g,F){this._source_text=x||"",y=y||{},this._js_beautify=g,this._css_beautify=F,this._tag_stack=null;var U=new l(y,"html");this._options=U,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}S.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var x=this._source_text,y=this._options.eol;this._options.eol==="auto"&&(y=`
|
|
`,x&&u.test(x)&&(y=x.match(u)[0])),x=x.replace(s,`
|
|
`);var g=x.match(/^[\t ]*/)[0],F={text:"",type:""},U=new w,A=new a(this._options,g),j=new f(x,this._options).tokenize();this._tag_stack=new O(A);for(var N=null,b=j.next();b.type!==o.EOF;)b.type===o.TAG_OPEN||b.type===o.COMMENT?(N=this._handle_tag_open(A,b,U,F),U=N):b.type===o.ATTRIBUTE||b.type===o.EQUALS||b.type===o.VALUE||b.type===o.TEXT&&!U.tag_complete?N=this._handle_inside_tag(A,b,U,j):b.type===o.TAG_CLOSE?N=this._handle_tag_close(A,b,U):b.type===o.TEXT?N=this._handle_text(A,b,U):A.add_raw_token(b),F=N,b=j.next();var Y=A._output.get_code(y);return Y},S.prototype._handle_tag_close=function(x,y,g){var F={text:y.text,type:y.type};return x.alignment_size=0,g.tag_complete=!0,x.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),g.is_unformatted?x.add_raw_token(y):(g.tag_start_char==="<"&&(x.set_space_before_token(y.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&g.has_wrapped_attrs&&x.print_newline(!1)),x.print_token(y)),g.indent_content&&!(g.is_unformatted||g.is_content_unformatted)&&(x.indent(),g.indent_content=!1),!g.is_inline_element&&!(g.is_unformatted||g.is_content_unformatted)&&x.set_wrap_point(),F},S.prototype._handle_inside_tag=function(x,y,g,F){var U=g.has_wrapped_attrs,A={text:y.text,type:y.type};if(x.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),g.is_unformatted)x.add_raw_token(y);else if(g.tag_start_char==="{"&&y.type===o.TEXT)x.print_preserved_newlines(y)?(y.newlines=0,x.add_raw_token(y)):x.print_token(y);else{if(y.type===o.ATTRIBUTE?(x.set_space_before_token(!0),g.attr_count+=1):(y.type===o.EQUALS||y.type===o.VALUE&&y.previous.type===o.EQUALS)&&x.set_space_before_token(!1),y.type===o.ATTRIBUTE&&g.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(x.traverse_whitespace(y),U=U||y.newlines!==0),this._is_wrap_attributes_force)){var j=g.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&g.attr_count===1){var N=!0,b=0,Y;do{if(Y=F.peek(b),Y.type===o.ATTRIBUTE){N=!1;break}b+=1}while(b<4&&Y.type!==o.EOF&&Y.type!==o.TAG_CLOSE);j=!N}j&&(x.print_newline(!1),U=!0)}x.print_token(y),U=U||x.previous_token_wrapped(),g.has_wrapped_attrs=U}return A},S.prototype._handle_text=function(x,y,g){var F={text:y.text,type:"TK_CONTENT"};return g.custom_beautifier_name?this._print_custom_beatifier_text(x,y,g):g.is_unformatted||g.is_content_unformatted?x.add_raw_token(y):(x.traverse_whitespace(y),x.print_token(y)),F},S.prototype._print_custom_beatifier_text=function(x,y,g){var F=this;if(y.text!==""){var U=y.text,A,j=1,N="",b="";g.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?A=this._js_beautify:g.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?A=this._css_beautify:g.custom_beautifier_name==="html"&&(A=function(Se,Le){var ye=new S(Se,Le,F._js_beautify,F._css_beautify);return ye.beautify()}),this._options.indent_scripts==="keep"?j=0:this._options.indent_scripts==="separate"&&(j=-x.indent_level);var Y=x.get_full_indent(j);if(U=U.replace(/\n[ \t]*$/,""),g.custom_beautifier_name!=="html"&&U[0]==="<"&&U.match(/^(<!--|<!\[CDATA\[)/)){var re=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(U);if(!re){x.add_raw_token(y);return}N=Y+re[1]+`
|
|
`,U=re[4],re[5]&&(b=Y+re[5]),U=U.replace(/\n[ \t]*$/,""),(re[2]||re[3].indexOf(`
|
|
`)!==-1)&&(re=re[3].match(/[ \t]+$/),re&&(y.whitespace_before=re[0]))}if(U)if(A){var fe=function(){this.eol=`
|
|
`};fe.prototype=this._options.raw_options;var ve=new fe;U=A(Y+U,ve)}else{var ke=y.whitespace_before;ke&&(U=U.replace(new RegExp(`
|
|
(`+ke+")?","g"),`
|
|
`)),U=Y+U.replace(/\n/g,`
|
|
`+Y)}N&&(U?U=N+U+`
|
|
`+b:U=N+b),x.print_newline(!1),U&&(y.text=U,y.whitespace_before="",y.newlines=0,x.add_raw_token(y),x.print_newline(!0))}},S.prototype._handle_tag_open=function(x,y,g,F){var U=this._get_tag_open_token(y);return(g.is_unformatted||g.is_content_unformatted)&&!g.is_empty_element&&y.type===o.TAG_OPEN&&y.text.indexOf("</")===0?(x.add_raw_token(y),U.start_tag_token=this._tag_stack.try_pop(U.tag_name)):(x.traverse_whitespace(y),this._set_tag_position(x,y,U,g,F),U.is_inline_element||x.set_wrap_point(),x.print_token(y)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(U.alignment_size=y.text.length+1),!U.tag_complete&&!U.is_unformatted&&(x.alignment_size=U.alignment_size),U};var w=function(x,y){if(this.parent=x||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!y)this.tag_complete=!0;else{var g;this.tag_start_char=y.text[0],this.text=y.text,this.tag_start_char==="<"?(g=y.text.match(/^<([^\s>]*)/),this.tag_check=g?g[1]:""):(g=y.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=g?g[1]:"",(y.text.startsWith("{{#>")||y.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&y.next!==null?this.tag_check=y.next.text.split(" ")[0]:this.tag_check=y.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),y.type===o.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||y.closed&&y.closed.text==="/>";var F=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(F=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(F)))}};S.prototype._get_tag_open_token=function(x){var y=new w(this._tag_stack.get_parser_token(),x);return y.alignment_size=this._options.wrap_attributes_indent_size,y.is_end_tag=y.is_end_tag||T(y.tag_check,this._options.void_elements),y.is_empty_element=y.tag_complete||y.is_start_tag&&y.is_end_tag,y.is_unformatted=!y.tag_complete&&T(y.tag_check,this._options.unformatted),y.is_content_unformatted=!y.is_empty_element&&T(y.tag_check,this._options.content_unformatted),y.is_inline_element=T(y.tag_name,this._options.inline)||y.tag_name.includes("-")||y.tag_start_char==="{",y},S.prototype._set_tag_position=function(x,y,g,F,U){if(g.is_empty_element||(g.is_end_tag?g.start_tag_token=this._tag_stack.try_pop(g.tag_name):(this._do_optional_end_element(g)&&(g.is_inline_element||x.print_newline(!1)),this._tag_stack.record_tag(g),(g.tag_name==="script"||g.tag_name==="style")&&!(g.is_unformatted||g.is_content_unformatted)&&(g.custom_beautifier_name=_(g.tag_check,y)))),T(g.tag_check,this._options.extra_liners)&&(x.print_newline(!1),x._output.just_added_blankline()||x.print_newline(!0)),g.is_empty_element){if(g.tag_start_char==="{"&&g.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),g.indent_content=!0;var A=x.current_line_has_match(/{{#if/);A||x.print_newline(!1)}g.tag_name==="!--"&&U.type===o.TAG_CLOSE&&F.is_end_tag&&g.text.indexOf(`
|
|
`)===-1||(g.is_inline_element||g.is_unformatted||x.print_newline(!1),this._calcluate_parent_multiline(x,g))}else if(g.is_end_tag){var j=!1;j=g.start_tag_token&&g.start_tag_token.multiline_content,j=j||!g.is_inline_element&&!(F.is_inline_element||F.is_unformatted)&&!(U.type===o.TAG_CLOSE&&g.start_tag_token===F)&&U.type!=="TK_CONTENT",(g.is_content_unformatted||g.is_unformatted)&&(j=!1),j&&x.print_newline(!1)}else g.indent_content=!g.custom_beautifier_name,g.tag_start_char==="<"&&(g.tag_name==="html"?g.indent_content=this._options.indent_inner_html:g.tag_name==="head"?g.indent_content=this._options.indent_head_inner_html:g.tag_name==="body"&&(g.indent_content=this._options.indent_body_inner_html)),!(g.is_inline_element||g.is_unformatted)&&(U.type!=="TK_CONTENT"||g.is_content_unformatted)&&x.print_newline(!1),this._calcluate_parent_multiline(x,g)},S.prototype._calcluate_parent_multiline=function(x,y){y.parent&&x._output.just_added_newline()&&!((y.is_inline_element||y.is_unformatted)&&y.parent.is_inline_element)&&(y.parent.multiline_content=!0)};var E=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],c=["a","audio","del","ins","map","noscript","video"];S.prototype._do_optional_end_element=function(x){var y=null;if(x.is_empty_element||!x.is_start_tag||!x.parent)return;if(x.tag_name==="body")y=y||this._tag_stack.try_pop("head");else if(x.tag_name==="li")y=y||this._tag_stack.try_pop("li",["ol","ul"]);else if(x.tag_name==="dd"||x.tag_name==="dt")y=y||this._tag_stack.try_pop("dt",["dl"]),y=y||this._tag_stack.try_pop("dd",["dl"]);else if(x.parent.tag_name==="p"&&E.indexOf(x.tag_name)!==-1){var g=x.parent.parent;(!g||c.indexOf(g.tag_name)===-1)&&(y=y||this._tag_stack.try_pop("p"))}else x.tag_name==="rp"||x.tag_name==="rt"?(y=y||this._tag_stack.try_pop("rt",["ruby","rtc"]),y=y||this._tag_stack.try_pop("rp",["ruby","rtc"])):x.tag_name==="optgroup"?y=y||this._tag_stack.try_pop("optgroup",["select"]):x.tag_name==="option"?y=y||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):x.tag_name==="colgroup"?y=y||this._tag_stack.try_pop("caption",["table"]):x.tag_name==="thead"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"])):x.tag_name==="tbody"||x.tag_name==="tfoot"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("thead",["table"]),y=y||this._tag_stack.try_pop("tbody",["table"])):x.tag_name==="tr"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(x.tag_name==="th"||x.tag_name==="td")&&(y=y||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),y=y||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return x.parent=this._tag_stack.get_parser_token(),y},v.exports.Beautifier=S},function(v,m,p){var l=p(6).Options;function h(f){l.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"])}h.prototype=new l,v.exports.Options=h},function(v,m,p){var l=p(9).Tokenizer,h=p(9).TOKEN,f=p(13).Directives,o=p(14).TemplatablePattern,u=p(12).Pattern,s={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:h.START,RAW:h.RAW,EOF:h.EOF},a=new f(/<\!--/,/-->/),C=function(_,T){l.call(this,_,T),this._current_tag_name="";var R=new o(this._input).read_options(this._options),O=new u(this._input);if(this.__patterns={word:R.until(/[\n\r\t <]/),single_quote:R.until_after(/'/),double_quote:R.until_after(/"/),attribute:R.until(/[\n\r\t =>]|\/>/),element_name:R.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 S=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=O.matching(S).until_after(S)}};C.prototype=new l,C.prototype._is_comment=function(_){return!1},C.prototype._is_opening=function(_){return _.type===s.TAG_OPEN},C.prototype._is_closing=function(_,T){return _.type===s.TAG_CLOSE&&T&&((_.text===">"||_.text==="/>")&&T.text[0]==="<"||_.text==="}}"&&T.text[0]==="{"&&T.text[1]==="{")},C.prototype._reset=function(){this._current_tag_name=""},C.prototype._get_next_token=function(_,T){var R=null;this._readWhitespace();var O=this._input.peek();return O===null?this._create_token(s.EOF,""):(R=R||this._read_open_handlebars(O,T),R=R||this._read_attribute(O,_,T),R=R||this._read_close(O,T),R=R||this._read_raw_content(O,_,T),R=R||this._read_content_word(O),R=R||this._read_comment_or_cdata(O),R=R||this._read_processing(O),R=R||this._read_open(O,T),R=R||this._create_token(s.UNKNOWN,this._input.next()),R)},C.prototype._read_comment_or_cdata=function(_){var T=null,R=null,O=null;if(_==="<"){var S=this._input.peek(1);S==="!"&&(R=this.__patterns.comment.read(),R?(O=a.get_directives(R),O&&O.ignore==="start"&&(R+=a.readIgnored(this._input))):R=this.__patterns.cdata.read()),R&&(T=this._create_token(s.COMMENT,R),T.directives=O)}return T},C.prototype._read_processing=function(_){var T=null,R=null,O=null;if(_==="<"){var S=this._input.peek(1);(S==="!"||S==="?")&&(R=this.__patterns.conditional_comment.read(),R=R||this.__patterns.processing.read()),R&&(T=this._create_token(s.COMMENT,R),T.directives=O)}return T},C.prototype._read_open=function(_,T){var R=null,O=null;return T||_==="<"&&(R=this._input.next(),this._input.peek()==="/"&&(R+=this._input.next()),R+=this.__patterns.element_name.read(),O=this._create_token(s.TAG_OPEN,R)),O},C.prototype._read_open_handlebars=function(_,T){var R=null,O=null;return T||this._options.indent_handlebars&&_==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(R=this.__patterns.handlebars_comment.read(),R=R||this.__patterns.handlebars.read(),O=this._create_token(s.COMMENT,R)):(R=this.__patterns.handlebars_open.read(),O=this._create_token(s.TAG_OPEN,R))),O},C.prototype._read_close=function(_,T){var R=null,O=null;return T&&(T.text[0]==="<"&&(_===">"||_==="/"&&this._input.peek(1)===">")?(R=this._input.next(),_==="/"&&(R+=this._input.next()),O=this._create_token(s.TAG_CLOSE,R)):T.text[0]==="{"&&_==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),O=this._create_token(s.TAG_CLOSE,"}}"))),O},C.prototype._read_attribute=function(_,T,R){var O=null,S="";if(R&&R.text[0]==="<")if(_==="=")O=this._create_token(s.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(s.VALUE,w)}else S=this.__patterns.attribute.read(),S&&(T.type===s.EQUALS?O=this._create_token(s.VALUE,S):O=this._create_token(s.ATTRIBUTE,S));return O},C.prototype._is_content_unformatted=function(_){return this._options.void_elements.indexOf(_)===-1&&(this._options.content_unformatted.indexOf(_)!==-1||this._options.unformatted.indexOf(_)!==-1)},C.prototype._read_raw_content=function(_,T,R){var O="";if(R&&R.text[0]==="{")O=this.__patterns.handlebars_raw_close.read();else if(T.type===s.TAG_CLOSE&&T.opened.text[0]==="<"&&T.text[0]!=="/"){var S=T.opened.text.substr(1).toLowerCase();if(S==="script"||S==="style"){var w=this._read_comment_or_cdata(_);if(w)return w.type=s.TEXT,w;O=this._input.readUntil(new RegExp("</"+S+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(S)&&(O=this._input.readUntil(new RegExp("</"+S+"[\\n\\r\\t ]*?>","ig")))}return O?this._create_token(s.TEXT,O):null},C.prototype._read_content_word=function(_){var T="";if(this._options.unformatted_content_delimiter&&(_===this._options.unformatted_content_delimiter[0]&&(T=this.__patterns.unformatted_content_delimiter.read())),T||(T=this.__patterns.word.read()),T)return this._create_token(s.TEXT,T)},v.exports.Tokenizer=C,v.exports.TOKEN=s}],H={};function i(v){var m=H[v];if(m!==void 0)return m.exports;var p=H[v]={exports:{}};return W[v](p,p.exports,i),p.exports}var L=i(18);M=L})();var X=M;if(!0)!(oe=[Z,Z("6UM0"),Z("TXwP")],$=function(W){var H=Z("6UM0"),i=Z("TXwP");return{html_beautify:function(L,v){return X(L,v,H.js_beautify,i.css_beautify)}}}.apply(Te,oe),$!==void 0&&(Ze.exports=$));else var B,P})()},"rAM+":function(Ze,Te,Z){"use strict";Z.d(Te,"a",function(){return $});var oe=Z("Qw5x");function $(M,X){var B;if(typeof Symbol=="undefined"||M[Symbol.iterator]==null){if(Array.isArray(M)||(B=Object(oe.a)(M))||X&&M&&typeof M.length=="number"){B&&(M=B);var P=0,W=function(){};return{s:W,n:function(){return P>=M.length?{done:!0}:{done:!1,value:M[P++]}},e:function(m){throw m},f:W}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var H=!0,i=!1,L;return{s:function(){B=M[Symbol.iterator]()},n:function(){var m=B.next();return H=m.done,m},e:function(m){i=!0,L=m},f:function(){try{!H&&B.return!=null&&B.return()}finally{if(i)throw L}}}}},rUJ1:function(Ze,Te){const Z=/[&<>"']/,oe=/[&<>"']/g,$=/[<>"']|&(?!#?\w+;)/,M=/[<>"']|&(?!#?\w+;)/g,X={"&":"&","<":"<",">":">",'"':""","'":"'"},B=O=>X[O];function P(O,S){if(S){if(Z.test(O))return O.replace(oe,B)}else if($.test(O))return O.replace(M,B);return O}const W=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function H(O){return O.replace(W,(S,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 L(O,S){O=O.source||O,S=S||"";const w={replace:(E,c)=>(c=c.source||c,c=c.replace(i,"$1"),O=O.replace(E,c),w),getRegex:()=>new RegExp(O,S)};return w}const v=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(O,S,w){if(O){let E;try{E=decodeURIComponent(H(w)).replace(v,"").toLowerCase()}catch(c){return null}if(E.indexOf("javascript:")===0||E.indexOf("vbscript:")===0||E.indexOf("data:")===0)return null}S&&!m.test(w)&&(w=u(S,w));try{w=encodeURI(w).replace(/%25/g,"%")}catch(E){return null}return w}const l={},h=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,o=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(O,S){l[" "+O]||(h.test(O)?l[" "+O]=O+"/":l[" "+O]=_(O,"/",!0)),O=l[" "+O];const w=O.indexOf(":")===-1;return S.substring(0,2)==="//"?w?S:O.replace(f,"$1")+S:S.charAt(0)==="/"?w?S:O.replace(o,"$1")+S:O+S}const s={exec:function(){}};function a(O){let S=1,w,E;for(;S<arguments.length;S++){w=arguments[S];for(E in w)Object.prototype.hasOwnProperty.call(w,E)&&(O[E]=w[E])}return O}function C(O,S){const w=O.replace(/\|/g,(x,y,g)=>{let F=!1,U=y;for(;--U>=0&&g[U]==="\\";)F=!F;return F?"|":" |"}),E=w.split(/ \|/);let c=0;if(E.length>S)E.splice(S);else for(;E.length<S;)E.push("");for(;c<E.length;c++)E[c]=E[c].trim().replace(/\\\|/g,"|");return E}function _(O,S,w){const E=O.length;if(E===0)return"";let c=0;for(;c<E;){const x=O.charAt(E-c-1);if(x===S&&!w)c++;else if(x!==S&&w)c++;else break}return O.substr(0,E-c)}function T(O,S){if(O.indexOf(S[1])===-1)return-1;const w=O.length;let E=0,c=0;for(;c<w;c++)if(O[c]==="\\")c++;else if(O[c]===S[0])E++;else if(O[c]===S[1]&&(E--,E<0))return c;return-1}function R(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")}Ze.exports={escape:P,unescape:H,edit:L,cleanUrl:p,resolveUrl:u,noopTest:s,merge:a,splitCells:C,rtrim:_,findClosingBracket:T,checkSanitizeDeprecation:R}},t9D7:function(Ze,Te,Z){"use strict";Z.d(Te,"b",function(){return W}),Z.d(Te,"g",function(){return i}),Z.d(Te,"d",function(){return L}),Z.d(Te,"e",function(){return v}),Z.d(Te,"a",function(){return m}),Z.d(Te,"f",function(){return h}),Z.d(Te,"c",function(){return f});var oe=Z("Vhoy"),$=Z("MI8n"),M=Z("pmY6"),X=Z("Cg/j"),B=Z("ic2d"),P=Z("nEHx");const W=Object(X.c)("themeService");var H;(function(o){function u(s){return s&&typeof s=="object"&&typeof s.id=="string"}o.isThemeColor=u})(H||(H={}));function i(o){return{id:o}}var L;(function(o){function u(R){return R&&typeof R=="object"&&typeof R.id=="string"&&(typeof R.color=="undefined"||H.isThemeColor(R.color))}o.isThemeIcon=u;const s=new RegExp(`^\\$\\((${oe.a.iconNameExpression}(?:${oe.a.iconModifierExpression})?)\\)$`);function a(R){const O=s.exec(R);if(!O)return;let[,S]=O;return{id:S}}o.fromString=a;function C(R,O){let S=R.id;const w=S.lastIndexOf("~");return w!==-1&&(S=S.substring(0,w)),O&&(S=`${S}~${O}`),{id:S}}o.modify=C;function _(R,O){var S,w;return R.id===O.id&&((S=R.color)===null||S===void 0?void 0:S.id)===((w=O.color)===null||w===void 0?void 0:w.id)}o.isEqual=_;function T(R,O){return{id:R.id,color:O?i(O):void 0}}o.asThemeIcon=T,o.asClassNameArray=oe.a.asClassNameArray,o.asClassName=oe.a.asClassName,o.asCSSSelector=oe.a.asCSSSelector})(L||(L={}));function v(o){switch(o){case P.a.DARK:return"vs-dark";case P.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const m={ThemingContribution:"base.contributions.theming"};class p{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new $.b}onColorThemeChange(o){return this.themingParticipants.push(o),this.onThemingParticipantAddedEmitter.fire(o),Object(M.i)(()=>{const u=this.themingParticipants.indexOf(o);this.themingParticipants.splice(u,1)})}getThemingParticipants(){return this.themingParticipants}}let l=new p;B.a.add(m.ThemingContribution,l);function h(o){return l.onColorThemeChange(o)}class f extends M.a{constructor(o){super();this.themeService=o,this.theme=o.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(u=>this.onThemeChange(u)))}onThemeChange(o){this.theme=o,this.updateStyles()}updateStyles(){}}},uK0f:function(Ze,Te,Z){(function(oe,$){Ze.exports=$()})(this,function(){"use strict";function oe($,M,X){X=X||{},X.childrenKeyName=X.childrenKeyName||"children";var B=$||[],P=[],W=0;do{var H=B.filter(function(i){return M(i,W)})[0];if(!H)break;P.push(H),B=H[X.childrenKeyName]||[],W+=1}while(B.length>0);return P}return oe})},ulZh:function(Ze,Te,Z){typeof window!="undefined"&&function($,M){Ze.exports=M()}(this,function(){return function(oe){var $={};function M(X){if($[X])return $[X].exports;var B=$[X]={i:X,l:!1,exports:{}};return oe[X].call(B.exports,B,B.exports,M),B.l=!0,B.exports}return M.m=oe,M.c=$,M.d=function(X,B,P){M.o(X,B)||Object.defineProperty(X,B,{enumerable:!0,get:P})},M.r=function(X){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(X,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(X,"__esModule",{value:!0})},M.t=function(X,B){if(B&1&&(X=M(X)),B&8)return X;if(B&4&&typeof X=="object"&&X&&X.__esModule)return X;var P=Object.create(null);if(M.r(P),Object.defineProperty(P,"default",{enumerable:!0,value:X}),B&2&&typeof X!="string")for(var W in X)M.d(P,W,function(H){return X[H]}.bind(null,W));return P},M.n=function(X){var B=X&&X.__esModule?function(){return X.default}:function(){return X};return M.d(B,"a",B),B},M.o=function(X,B){return Object.prototype.hasOwnProperty.call(X,B)},M.p="/dist/",M(M.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(oe,$,M){"use strict";var X=Object.prototype.hasOwnProperty,B="~";function P(){}Object.create&&(P.prototype=Object.create(null),new P().__proto__||(B=!1));function W(v,m,p){this.fn=v,this.context=m,this.once=p||!1}function H(v,m,p,l,h){if(typeof p!="function")throw new TypeError("The listener must be a function");var f=new W(p,l||v,h),o=B?B+m:m;return v._events[o]?v._events[o].fn?v._events[o]=[v._events[o],f]:v._events[o].push(f):(v._events[o]=f,v._eventsCount++),v}function i(v,m){--v._eventsCount===0?v._events=new P:delete v._events[m]}function L(){this._events=new P,this._eventsCount=0}L.prototype.eventNames=function(){var m=[],p,l;if(this._eventsCount===0)return m;for(l in p=this._events)X.call(p,l)&&m.push(B?l.slice(1):l);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(p)):m},L.prototype.listeners=function(m){var p=B?B+m:m,l=this._events[p];if(!l)return[];if(l.fn)return[l.fn];for(var h=0,f=l.length,o=new Array(f);h<f;h++)o[h]=l[h].fn;return o},L.prototype.listenerCount=function(m){var p=B?B+m:m,l=this._events[p];return l?l.fn?1:l.length:0},L.prototype.emit=function(m,p,l,h,f,o){var u=B?B+m:m;if(!this._events[u])return!1;var s=this._events[u],a=arguments.length,C,_;if(s.fn){s.once&&this.removeListener(m,s.fn,void 0,!0);switch(a){case 1:return s.fn.call(s.context),!0;case 2:return s.fn.call(s.context,p),!0;case 3:return s.fn.call(s.context,p,l),!0;case 4:return s.fn.call(s.context,p,l,h),!0;case 5:return s.fn.call(s.context,p,l,h,f),!0;case 6:return s.fn.call(s.context,p,l,h,f,o),!0}for(_=1,C=new Array(a-1);_<a;_++)C[_-1]=arguments[_];s.fn.apply(s.context,C)}else{var T=s.length,R;for(_=0;_<T;_++){s[_].once&&this.removeListener(m,s[_].fn,void 0,!0);switch(a){case 1:s[_].fn.call(s[_].context);break;case 2:s[_].fn.call(s[_].context,p);break;case 3:s[_].fn.call(s[_].context,p,l);break;case 4:s[_].fn.call(s[_].context,p,l,h);break;default:if(!C)for(R=1,C=new Array(a-1);R<a;R++)C[R-1]=arguments[R];s[_].fn.apply(s[_].context,C)}}}return!0},L.prototype.on=function(m,p,l){return H(this,m,p,l,!1)},L.prototype.once=function(m,p,l){return H(this,m,p,l,!0)},L.prototype.removeListener=function(m,p,l,h){var f=B?B+m:m;if(!this._events[f])return this;if(!p)return i(this,f),this;var o=this._events[f];if(o.fn)o.fn===p&&(!h||o.once)&&(!l||o.context===l)&&i(this,f);else{for(var u=0,s=[],a=o.length;u<a;u++)(o[u].fn!==p||h&&!o[u].once||l&&o[u].context!==l)&&s.push(o[u]);s.length?this._events[f]=s.length===1?s[0]:s:i(this,f)}return this},L.prototype.removeAllListeners=function(m){var p;return m?(p=B?B+m:m,this._events[p]&&i(this,p)):(this._events=new P,this._eventsCount=0),this},L.prototype.off=L.prototype.removeListener,L.prototype.addListener=L.prototype.on,L.prefixed=B,L.EventEmitter=L,oe.exports=L},"./node_modules/url-toolkit/src/url-toolkit.js":function(oe,$,M){(function(X){var B=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,P=/^([^\/?#]*)([^]*)$/,W=/(?:\/|^)\.(?=\/)/g,H=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,i={buildAbsoluteURL:function(L,v,m){if(m=m||{},L=L.trim(),v=v.trim(),!v){if(!m.alwaysNormalize)return L;var p=i.parseURL(L);if(!p)throw new Error("Error trying to parse base URL.");return p.path=i.normalizePath(p.path),i.buildURLFromParts(p)}var l=i.parseURL(v);if(!l)throw new Error("Error trying to parse relative URL.");if(l.scheme)return m.alwaysNormalize?(l.path=i.normalizePath(l.path),i.buildURLFromParts(l)):v;var h=i.parseURL(L);if(!h)throw new Error("Error trying to parse base URL.");if(!h.netLoc&&h.path&&h.path[0]!=="/"){var f=P.exec(h.path);h.netLoc=f[1],h.path=f[2]}h.netLoc&&!h.path&&(h.path="/");var o={scheme:h.scheme,netLoc:l.netLoc,path:null,params:l.params,query:l.query,fragment:l.fragment};if(!l.netLoc&&(o.netLoc=h.netLoc,l.path[0]!=="/"))if(!l.path)o.path=h.path,l.params||(o.params=h.params,l.query||(o.query=h.query));else{var u=h.path,s=u.substring(0,u.lastIndexOf("/")+1)+l.path;o.path=i.normalizePath(s)}return o.path===null&&(o.path=m.alwaysNormalize?i.normalizePath(l.path):l.path),i.buildURLFromParts(o)},parseURL:function(L){var v=B.exec(L);return v?{scheme:v[1]||"",netLoc:v[2]||"",path:v[3]||"",params:v[4]||"",query:v[5]||"",fragment:v[6]||""}:null},normalizePath:function(L){for(L=L.split("").reverse().join("").replace(W,"");L.length!==(L=L.replace(H,"")).length;);return L.split("").reverse().join("")},buildURLFromParts:function(L){return L.scheme+L.netLoc+L.path+L.params+L.query+L.fragment}};oe.exports=i})(this)},"./node_modules/webworkify-webpack/index.js":function(oe,$,M){function X(m){var p={};function l(f){if(p[f])return p[f].exports;var o=p[f]={i:f,l:!1,exports:{}};return m[f].call(o.exports,o,o.exports,l),o.l=!0,o.exports}l.m=m,l.c=p,l.i=function(f){return f},l.d=function(f,o,u){l.o(f,o)||Object.defineProperty(f,o,{configurable:!1,enumerable:!0,get:u})},l.r=function(f){Object.defineProperty(f,"__esModule",{value:!0})},l.n=function(f){var o=f&&f.__esModule?function(){return f.default}:function(){return f};return l.d(o,"a",o),o},l.o=function(f,o){return Object.prototype.hasOwnProperty.call(f,o)},l.p="/",l.oe=function(f){throw console.error(f),f};var h=l(l.s=ENTRY_MODULE);return h.default||h}var B="[\\.|\\-|\\+|\\w|/|@]+",P="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+B+").*?\\)";function W(m){return(m+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function H(m){return!isNaN(1*m)}function i(m,p,l){var h={};h[l]=[];var f=p.toString(),o=f.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!o)return h;for(var u=o[1],s=new RegExp("(\\\\n|\\W)"+W(u)+P,"g"),a;a=s.exec(f);){if(a[3]==="dll-reference")continue;h[l].push(a[3])}for(s=new RegExp("\\("+W(u)+'\\("(dll-reference\\s('+B+'))"\\)\\)'+P,"g");a=s.exec(f);)m[a[2]]||(h[l].push(a[1]),m[a[2]]=M(a[1]).m),h[a[2]]=h[a[2]]||[],h[a[2]].push(a[4]);for(var C=Object.keys(h),_=0;_<C.length;_++)for(var T=0;T<h[C[_]].length;T++)H(h[C[_]][T])&&(h[C[_]][T]=1*h[C[_]][T]);return h}function L(m){var p=Object.keys(m);return p.reduce(function(l,h){return l||m[h].length>0},!1)}function v(m,p){for(var l={main:[p]},h={main:[]},f={main:{}};L(l);)for(var o=Object.keys(l),u=0;u<o.length;u++){var s=o[u],a=l[s],C=a.pop();if(f[s]=f[s]||{},f[s][C]||!m[s][C])continue;f[s][C]=!0,h[s]=h[s]||[],h[s].push(C);for(var _=i(m,m[s][C],s),T=Object.keys(_),R=0;R<T.length;R++)l[T[R]]=l[T[R]]||[],l[T[R]]=l[T[R]].concat(_[T[R]])}return h}oe.exports=function(m,p){p=p||{};var l={main:M.m},h=p.all?{main:Object.keys(l.main)}:v(l,m),f="";Object.keys(h).filter(function(C){return C!=="main"}).forEach(function(C){for(var _=0;h[C][_];)_++;h[C].push(_),l[C][_]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",f=f+"var "+C+" = ("+X.toString().replace("ENTRY_MODULE",JSON.stringify(_))+")({"+h[C].map(function(T){return""+JSON.stringify(T)+": "+l[C][T].toString()}).join(",")+`});
|
|
`}),f=f+"new (("+X.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+h.main.map(function(C){return""+JSON.stringify(C)+": "+l.main[C].toString()}).join(",")+"}))(self);";var o=new window.Blob([f],{type:"text/javascript"});if(p.bare)return o;var u=window.URL||window.webkitURL||window.mozURL||window.msURL,s=u.createObjectURL(o),a=new window.Worker(s);return a.objectURL=s,a}},"./src/config.ts":function(oe,$,M){"use strict";M.r($),M.d($,"hlsDefaultConfig",function(){return R}),M.d($,"mergeConfig",function(){return S}),M.d($,"enableStreamingMode",function(){return w});var X=M("./src/controller/abr-controller.ts"),B=M("./src/controller/audio-stream-controller.ts"),P=M("./src/controller/audio-track-controller.ts"),W=M("./src/controller/subtitle-stream-controller.ts"),H=M("./src/controller/subtitle-track-controller.ts"),i=M("./src/controller/buffer-controller.ts"),L=M("./src/controller/timeline-controller.ts"),v=M("./src/controller/cap-level-controller.ts"),m=M("./src/controller/fps-controller.ts"),p=M("./src/controller/eme-controller.ts"),l=M("./src/controller/cmcd-controller.ts"),h=M("./src/utils/xhr-loader.ts"),f=M("./src/utils/fetch-loader.ts"),o=M("./src/utils/cues.ts"),u=M("./src/utils/mediakeys-helper.ts"),s=M("./src/utils/logger.ts");function a(){return a=Object.assign||function(E){for(var c=1;c<arguments.length;c++){var x=arguments[c];for(var y in x)Object.prototype.hasOwnProperty.call(x,y)&&(E[y]=x[y])}return E},a.apply(this,arguments)}function C(E,c){var x=Object.keys(E);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(E);c&&(y=y.filter(function(g){return Object.getOwnPropertyDescriptor(E,g).enumerable})),x.push.apply(x,y)}return x}function _(E){for(var c=1;c<arguments.length;c++){var x=arguments[c]!=null?arguments[c]:{};c%2?C(Object(x),!0).forEach(function(y){T(E,y,x[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(x)):C(Object(x)).forEach(function(y){Object.defineProperty(E,y,Object.getOwnPropertyDescriptor(x,y))})}return E}function T(E,c,x){return c in E?Object.defineProperty(E,c,{value:x,enumerable:!0,configurable:!0,writable:!0}):E[c]=x,E}var R=_(_({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:h.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:X.default,bufferController:i.default,capLevelController:v.default,fpsController:m.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:u.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},O()),{},{subtitleStreamController:W.SubtitleStreamController,subtitleTrackController:H.default,timelineController:L.TimelineController,audioStreamController:B.default,audioTrackController:P.default,emeController:p.default,cmcdController:l.default});function O(){return{cueHandler:o.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function S(E,c){if((c.liveSyncDurationCount||c.liveMaxLatencyDurationCount)&&(c.liveSyncDuration||c.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(c.liveMaxLatencyDurationCount!==void 0&&(c.liveSyncDurationCount===void 0||c.liveMaxLatencyDurationCount<=c.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(c.liveMaxLatencyDuration!==void 0&&(c.liveSyncDuration===void 0||c.liveMaxLatencyDuration<=c.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return a({},E,c)}function w(E){var c=E.loader;if(c!==f.default&&c!==h.default)s.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),E.progressive=!1;else{var x=Object(f.fetchSupported)();x&&(E.loader=f.default,E.progressive=!0,E.enableSoftwareAES=!0,s.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(oe,$,M){"use strict";M.r($);var X=M("./src/polyfills/number.ts"),B=M("./src/utils/ewma-bandwidth-estimator.ts"),P=M("./src/events.ts"),W=M("./src/utils/buffer-helper.ts"),H=M("./src/errors.ts"),i=M("./src/types/loader.ts"),L=M("./src/utils/logger.ts");function v(l,h){for(var f=0;f<h.length;f++){var o=h[f];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(l,o.key,o)}}function m(l,h,f){return h&&v(l.prototype,h),f&&v(l,f),l}var p=function(){function l(f){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=f;var o=f.config;this.bwEstimator=new B.default(o.abrEwmaSlowVoD,o.abrEwmaFastVoD,o.abrEwmaDefaultEstimate),this.registerListeners()}var h=l.prototype;return h.registerListeners=function(){var o=this.hls;o.on(P.Events.FRAG_LOADING,this.onFragLoading,this),o.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(P.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.on(P.Events.ERROR,this.onError,this)},h.unregisterListeners=function(){var o=this.hls;o.off(P.Events.FRAG_LOADING,this.onFragLoading,this),o.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),o.off(P.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.off(P.Events.ERROR,this.onError,this)},h.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},h.onFragLoading=function(o,u){var s=u.frag;if(s.type===i.PlaylistLevelType.MAIN&&!this.timer){var a;this.fragCurrent=s,this.partCurrent=(a=u.part)!=null?a:null,this.timer=self.setInterval(this.onCheck,100)}},h.onLevelLoaded=function(o,u){var s=this.hls.config;u.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)},h._abandonRulesCheck=function(){var o=this.fragCurrent,u=this.partCurrent,s=this.hls,a=s.autoLevelEnabled,C=s.config,_=s.media;if(!o||!_)return;var T=u?u.stats:o.stats,R=u?u.duration:o.duration;if(T.aborted){L.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!a||_.paused||!_.playbackRate||!_.readyState)return;var O=performance.now()-T.loading.start,S=Math.abs(_.playbackRate);if(O<=500*R/S)return;var w=s.levels,E=s.minAutoLevel,c=w[o.level],x=T.total||Math.max(T.loaded,Math.round(R*c.maxBitrate/8)),y=Math.max(1,T.bwEstimate?T.bwEstimate/8:T.loaded*1e3/O),g=(x-T.loaded)/y,F=_.currentTime,U=(W.BufferHelper.bufferInfo(_,F,C.maxBufferHole).end-F)/S;if(U>=2*R/S||g<=U)return;var A=Number.POSITIVE_INFINITY,j;for(j=o.level-1;j>E;j--){var N=w[j].maxBitrate;if(A=R*N/(8*.8*y),A<U)break}if(A>=g)return;var b=this.bwEstimator.getEstimate();L.logger.warn("Fragment "+o.sn+(u?" part "+u.index:"")+" of level "+o.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+j+`
|
|
Current BW estimate: `+(Object(X.isFiniteNumber)(b)?(b/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+g.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+A.toFixed(3)+` s
|
|
Time to underbuffer: `+U.toFixed(3)+" s"),s.nextLoadLevel=j,this.bwEstimator.sample(O,T.loaded),this.clearTimer(),o.loader&&(this.fragCurrent=this.partCurrent=null,o.loader.abort()),s.trigger(P.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:o,part:u,stats:T})},h.onFragLoaded=function(o,u){var s=u.frag,a=u.part;if(s.type===i.PlaylistLevelType.MAIN&&Object(X.isFiniteNumber)(s.sn)){var C=a?a.stats:s.stats,_=a?a.duration:s.duration;if(this.clearTimer(),this.lastLoadedFragLevel=s.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var T=this.hls.levels[s.level],R=(T.loaded?T.loaded.bytes:0)+C.loaded,O=(T.loaded?T.loaded.duration:0)+_;T.loaded={bytes:R,duration:O},T.realBitrate=Math.round(8*R/O)}if(s.bitrateTest){var S={stats:C,frag:s,part:a,id:s.type};this.onFragBuffered(P.Events.FRAG_BUFFERED,S),s.bitrateTest=!1}}},h.onFragBuffered=function(o,u){var s=u.frag,a=u.part,C=a?a.stats:s.stats;if(C.aborted)return;if(s.type!==i.PlaylistLevelType.MAIN||s.sn==="initSegment")return;var _=C.parsing.end-C.loading.start;this.bwEstimator.sample(_,C.loaded),C.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=_/1e3:this.bitrateTestDelay=0},h.onError=function(o,u){switch(u.details){case H.ErrorDetails.FRAG_LOAD_ERROR:case H.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},h.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},h.getNextABRAutoLevel=function(){var o=this.fragCurrent,u=this.partCurrent,s=this.hls,a=s.maxAutoLevel,C=s.config,_=s.minAutoLevel,T=s.media,R=u?u.duration:o?o.duration:0,O=T?T.currentTime:0,S=T&&T.playbackRate!==0?Math.abs(T.playbackRate):1,w=this.bwEstimator?this.bwEstimator.getEstimate():C.abrEwmaDefaultEstimate,E=(W.BufferHelper.bufferInfo(T,O,C.maxBufferHole).end-O)/S,c=this.findBestLevel(w,_,a,E,C.abrBandWidthFactor,C.abrBandWidthUpFactor);if(c>=0)return c;L.logger.trace((E?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var x=R?Math.min(R,C.maxStarvationDelay):C.maxStarvationDelay,y=C.abrBandWidthFactor,g=C.abrBandWidthUpFactor;if(!E){var F=this.bitrateTestDelay;if(F){var U=R?Math.min(R,C.maxLoadingDelay):C.maxLoadingDelay;x=U-F,L.logger.trace("bitrate test took "+Math.round(1e3*F)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*x)+" ms"),y=g=1}}return c=this.findBestLevel(w,_,a,E+x,y,g),Math.max(c,0)},h.findBestLevel=function(o,u,s,a,C,_){for(var T,R=this.fragCurrent,O=this.partCurrent,S=this.lastLoadedFragLevel,w=this.hls.levels,E=w[S],c=!!(E!=null&&(T=E.details)!==null&&T!==void 0&&T.live),x=E==null?void 0:E.codecSet,y=O?O.duration:R?R.duration:0,g=s;g>=u;g--){var F=w[g];if(!F||x&&F.codecSet!==x)continue;var U=F.details,A=(O?U==null?void 0:U.partTarget:U==null?void 0:U.averagetargetduration)||y,j=void 0;g<=S?j=C*o:j=_*o;var N=w[g].maxBitrate,b=N*A/j;if(L.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+g+"/"+Math.round(j)+"/"+N+"/"+A+"/"+a+"/"+b),j>N&&(!b||c&&!this.bitrateTestDelay||b<a))return g}return-1},m(l,[{key:"nextAutoLevel",get:function(){var o=this._nextAutoLevel,u=this.bwEstimator;if(o!==-1&&(!u||!u.canEstimate()))return o;var s=this.getNextABRAutoLevel();return o!==-1&&(s=Math.min(o,s)),s},set:function(o){this._nextAutoLevel=o}}]),l}();$.default=p},"./src/controller/audio-stream-controller.ts":function(oe,$,M){"use strict";M.r($);var X=M("./src/polyfills/number.ts"),B=M("./src/controller/base-stream-controller.ts"),P=M("./src/events.ts"),W=M("./src/utils/buffer-helper.ts"),H=M("./src/controller/fragment-tracker.ts"),i=M("./src/types/level.ts"),L=M("./src/types/loader.ts"),v=M("./src/loader/fragment.ts"),m=M("./src/demux/chunk-cache.ts"),p=M("./src/demux/transmuxer-interface.ts"),l=M("./src/types/transmuxer.ts"),h=M("./src/controller/fragment-finders.ts"),f=M("./src/utils/discontinuities.ts"),o=M("./src/errors.ts"),u=M("./src/utils/logger.ts");function s(){return s=Object.assign||function(R){for(var O=1;O<arguments.length;O++){var S=arguments[O];for(var w in S)Object.prototype.hasOwnProperty.call(S,w)&&(R[w]=S[w])}return R},s.apply(this,arguments)}function a(R,O){R.prototype=Object.create(O.prototype),R.prototype.constructor=R,C(R,O)}function C(R,O){return C=Object.setPrototypeOf||function(w,E){return w.__proto__=E,w},C(R,O)}var _=100,T=function(R){a(O,R);function O(w,E){var c;return c=R.call(this,w,E,"[audio-stream-controller]")||this,c.videoBuffer=null,c.videoTrackCC=-1,c.waitingVideoCC=-1,c.audioSwitch=!1,c.trackId=-1,c.waitingData=null,c.mainDetails=null,c.bufferFlushed=!1,c._registerListeners(),c}var S=O.prototype;return S.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},S._registerListeners=function(){var E=this.hls;E.on(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(P.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),E.on(P.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.on(P.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),E.on(P.Events.ERROR,this.onError,this),E.on(P.Events.BUFFER_RESET,this.onBufferReset,this),E.on(P.Events.BUFFER_CREATED,this.onBufferCreated,this),E.on(P.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.on(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),E.on(P.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S._unregisterListeners=function(){var E=this.hls;E.off(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(P.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),E.off(P.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.off(P.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),E.off(P.Events.ERROR,this.onError,this),E.off(P.Events.BUFFER_RESET,this.onBufferReset,this),E.off(P.Events.BUFFER_CREATED,this.onBufferCreated,this),E.off(P.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.off(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),E.off(P.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S.onInitPtsFound=function(E,c){var x=c.frag,y=c.id,g=c.initPTS;if(y==="main"){var F=x.cc;this.initPTS[x.cc]=g,this.log("InitPTS for cc: "+F+" found from main: "+g),this.videoTrackCC=F,this.state===B.State.WAITING_INIT_PTS&&this.tick()}},S.startLoad=function(E){if(!this.levels){this.startPosition=E,this.state=B.State.STOPPED;return}var c=this.lastCurrentTime;this.stopLoad(),this.setInterval(_),this.fragLoadError=0,c>0&&E===-1?(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),this.state=B.State.IDLE):(this.loadedmetadata=!1,this.state=B.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=E,this.tick()},S.doTick=function(){switch(this.state){case B.State.IDLE:this.doTickIdle();break;case B.State.WAITING_TRACK:{var E,c=this.levels,x=this.trackId,y=c==null||((E=c[x])===null||E===void 0)?void 0:E.details;if(y){if(this.waitForCdnTuneIn(y))break;this.state=B.State.WAITING_INIT_PTS}break}case B.State.FRAG_LOADING_WAITING_RETRY:{var g,F=performance.now(),U=this.retryDate;(!U||F>=U||(g=this.media)!==null&&g!==void 0&&g.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=B.State.IDLE);break}case B.State.WAITING_INIT_PTS:{var A=this.waitingData;if(A){var j=A.frag,N=A.part,b=A.cache,Y=A.complete;if(this.initPTS[j.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=B.State.FRAG_LOADING;var re=b.flush(),fe={frag:j,part:N,payload:re,networkDetails:null};this._handleFragmentLoadProgress(fe),Y&&R.prototype._handleFragmentLoadComplete.call(this,fe)}else if(this.videoTrackCC!==this.waitingVideoCC)u.logger.log("Waiting fragment cc ("+j.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ve=this.getLoadPosition(),ke=W.BufferHelper.bufferInfo(this.mediaBuffer,ve,this.config.maxBufferHole),Se=Object(h.fragmentWithinToleranceTest)(ke.end,this.config.maxFragLookUpTolerance,j);Se<0&&(u.logger.log("Waiting fragment cc ("+j.cc+") @ "+j.start+" cancelled because another fragment at "+ke.end+" is needed"),this.clearWaitingFragment())}}else this.state=B.State.IDLE}}this.onTickEnd()},S.clearWaitingFragment=function(){var E=this.waitingData;E&&(this.fragmentTracker.removeFragment(E.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=B.State.IDLE)},S.onTickEnd=function(){var E=this.media;if(!E||!E.readyState)return;var c=this.mediaBuffer?this.mediaBuffer:E,x=c.buffered;!this.loadedmetadata&&x.length&&(this.loadedmetadata=!0),this.lastCurrentTime=E.currentTime},S.doTickIdle=function(){var E,c,x=this.hls,y=this.levels,g=this.media,F=this.trackId,U=x.config;if(!y||!y[F])return;if(!g&&(this.startFragRequested||!U.startFragPrefetch))return;var A=y[F],j=A.details;if(!j||j.live&&this.levelLastLoaded!==F||this.waitForCdnTuneIn(j)){this.state=B.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,v.ElementaryStreamTypes.AUDIO,L.PlaylistLevelType.AUDIO));var N=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,L.PlaylistLevelType.AUDIO);if(N===null)return;var b=N.len,Y=this.getMaxBufferLength(),re=this.audioSwitch;if(b>=Y&&!re)return;if(!re&&this._streamEnded(N,j)){x.trigger(P.Events.BUFFER_EOS,{type:"audio"}),this.state=B.State.ENDED;return}var fe=j.fragments,ve=fe[0].start,ke=N.end;if(re){var Se=this.getLoadPosition();ke=Se,j.PTSKnown&&Se<ve&&((N.end>ve||N.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),g.currentTime=ve+.05))}var Le=this.getNextFragment(ke,j);if(!Le){this.bufferFlushed=!0;return}((E=Le.decryptdata)===null||E===void 0?void 0:E.keyFormat)==="identity"&&!((c=Le.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(Le,j):this.loadFragment(Le,j,ke)},S.getMaxBufferLength=function(){var E=R.prototype.getMaxBufferLength.call(this),c=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,L.PlaylistLevelType.MAIN);return c===null?E:Math.max(E,c.len)},S.onMediaDetaching=function(){this.videoBuffer=null,R.prototype.onMediaDetaching.call(this)},S.onAudioTracksUpdated=function(E,c){var x=c.audioTracks;this.resetTransmuxer(),this.levels=x.map(function(y){return new i.Level(y)})},S.onAudioTrackSwitching=function(E,c){var x=!!c.url;this.trackId=c.id;var y=this.fragCurrent;y!=null&&y.loader&&y.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),x?this.setInterval(_):this.resetTransmuxer(),x?(this.audioSwitch=!0,this.state=B.State.IDLE):this.state=B.State.STOPPED,this.tick()},S.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},S.onLevelLoaded=function(E,c){this.mainDetails=c.details},S.onAudioTrackLoaded=function(E,c){var x,y=this.levels,g=c.details,F=c.id;if(!y){this.warn("Audio tracks were reset while loading level "+F);return}this.log("Track "+F+" loaded ["+g.startSN+","+g.endSN+"],duration:"+g.totalduration);var U=y[F],A=0;if(g.live||(x=U.details)!==null&&x!==void 0&&x.live){var j=this.mainDetails;if(g.fragments[0]||(g.deltaUpdateFailed=!0),g.deltaUpdateFailed||!j)return;!U.details&&g.hasProgramDateTime&&j.hasProgramDateTime?(Object(f.alignMediaPlaylistByPDT)(g,j),A=g.fragments[0].start):A=this.alignPlaylists(g,U.details)}U.details=g,this.levelLastLoaded=F,!this.startFragRequested&&(this.mainDetails||!g.live)&&this.setStartPosition(U.details,A),this.state===B.State.WAITING_TRACK&&!this.waitForCdnTuneIn(g)&&(this.state=B.State.IDLE),this.tick()},S._handleFragmentLoadProgress=function(E){var c,x=E.frag,y=E.part,g=E.payload,F=this.config,U=this.trackId,A=this.levels;if(!A){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+x.sn+" of level "+x.level+" will not be buffered");return}var j=A[U];console.assert(j,"Audio track is defined on fragment load progress");var N=j.details;console.assert(N,"Audio track details are defined on fragment load progress");var b=F.defaultAudioCodec||j.audioCodec||"mp4a.40.2",Y=this.transmuxer;Y||(Y=this.transmuxer=new p.default(this.hls,L.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var re=this.initPTS[x.cc],fe=(c=x.initSegment)===null||c===void 0?void 0:c.data;if(re!==void 0){var ve=!1,ke=y?y.index:-1,Se=ke!==-1,Le=new l.ChunkMetadata(x.level,x.sn,x.stats.chunkCount,g.byteLength,ke,Se);Y.push(g,fe,b,"",x,y,N.totalduration,ve,Le,re)}else{u.logger.log("Unknown video PTS for cc "+x.cc+", waiting for video PTS before demuxing audio frag "+x.sn+" of ["+N.startSN+" ,"+N.endSN+"],track "+U);var ye=this.waitingData=this.waitingData||{frag:x,part:y,cache:new m.default,complete:!1},_e=ye.cache;_e.push(new Uint8Array(g)),this.waitingVideoCC=this.videoTrackCC,this.state=B.State.WAITING_INIT_PTS}},S._handleFragmentLoadComplete=function(E){if(this.waitingData){this.waitingData.complete=!0;return}R.prototype._handleFragmentLoadComplete.call(this,E)},S.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},S.onBufferCreated=function(E,c){var x=c.tracks.audio;x&&(this.mediaBuffer=x.buffer),c.tracks.video&&(this.videoBuffer=c.tracks.video.buffer)},S.onFragBuffered=function(E,c){var x=c.frag,y=c.part;if(x.type!==L.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(x)){this.warn("Fragment "+x.sn+(y?" p: "+y.index:"")+" of level "+x.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}x.sn!=="initSegment"&&(this.fragPrevious=x,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(P.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(x,y)},S.onError=function(E,c){switch(c.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.AUDIO,c);break;case o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==B.State.ERROR&&this.state!==B.State.STOPPED&&(this.state=c.fatal?B.State.ERROR:B.State.IDLE,this.warn(c.details+" while loading frag, switching to "+this.state+" state"));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="audio"&&(this.state===B.State.PARSING||this.state===B.State.PARSED)){var x=!0,y=this.getFwdBufferInfo(this.mediaBuffer,L.PlaylistLevelType.AUDIO);y&&y.len>.5&&(x=!this.reduceMaxBufferLength(y.len)),x&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},S.onBufferFlushed=function(E,c){var x=c.type;x===v.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},S._handleTransmuxComplete=function(E){var c,x="audio",y=this.hls,g=E.remuxResult,F=E.chunkMeta,U=this.getCurrentContext(F);if(!U){this.warn("The loading context changed while buffering fragment "+F.sn+" of level "+F.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(F.level);return}var A=U.frag,j=U.part,N=g.audio,b=g.text,Y=g.id3,re=g.initSegment;if(this.fragContextChanged(A))return;if(this.state=B.State.PARSING,this.audioSwitch&&N&&this.completeAudioSwitch(),re!=null&&re.tracks&&(this._bufferInitSegment(re.tracks,A,F),y.trigger(P.Events.FRAG_PARSING_INIT_SEGMENT,{frag:A,id:x,tracks:re.tracks})),N){var fe=N.startPTS,ve=N.endPTS,ke=N.startDTS,Se=N.endDTS;j&&(j.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:fe,endPTS:ve,startDTS:ke,endDTS:Se}),A.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,fe,ve,ke,Se),this.bufferFragmentData(N,A,j,F)}if(Y!=null&&(c=Y.samples)!==null&&c!==void 0&&c.length){var Le=s({frag:A,id:x},Y);y.trigger(P.Events.FRAG_PARSING_METADATA,Le)}if(b){var ye=s({frag:A,id:x},b);y.trigger(P.Events.FRAG_PARSING_USERDATA,ye)}},S._bufferInitSegment=function(E,c,x){if(this.state!==B.State.PARSING)return;E.video&&delete E.video;var y=E.audio;if(!y)return;y.levelCodec=y.codec,y.id="audio",this.log("Init audio buffer, container:"+y.container+", codecs[parsed]=["+y.codec+"]"),this.hls.trigger(P.Events.BUFFER_CODECS,E);var g=y.initSegment;if(g!=null&&g.byteLength){var F={type:"audio",frag:c,part:null,chunkMeta:x,parent:c.type,data:g};this.hls.trigger(P.Events.BUFFER_APPENDING,F)}this.tick()},S.loadFragment=function(E,c,x){var y=this.fragmentTracker.getState(E);this.fragCurrent=E,(this.audioSwitch||y===H.FragmentState.NOT_LOADED||y===H.FragmentState.PARTIAL)&&(E.sn==="initSegment"?this._loadInitSegment(E):c.live&&!Object(X.isFiniteNumber)(this.initPTS[E.cc])?(this.log("Waiting for video PTS in continuity counter "+E.cc+" of live stream before loading audio fragment "+E.sn+" of level "+this.trackId),this.state=B.State.WAITING_INIT_PTS):(this.startFragRequested=!0,R.prototype.loadFragment.call(this,E,c,x)))},S.completeAudioSwitch=function(){var E=this.hls,c=this.media,x=this.trackId;c&&(this.log("Switching audio track : flushing all audio"),R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,E.trigger(P.Events.AUDIO_TRACK_SWITCHED,{id:x})},O}(B.default);$.default=T},"./src/controller/audio-track-controller.ts":function(oe,$,M){"use strict";M.r($);var X=M("./src/events.ts"),B=M("./src/errors.ts"),P=M("./src/controller/base-playlist-controller.ts"),W=M("./src/types/loader.ts");function H(p,l){for(var h=0;h<l.length;h++){var f=l[h];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(p,f.key,f)}}function i(p,l,h){return l&&H(p.prototype,l),h&&H(p,h),p}function L(p,l){p.prototype=Object.create(l.prototype),p.prototype.constructor=p,v(p,l)}function v(p,l){return v=Object.setPrototypeOf||function(f,o){return f.__proto__=o,f},v(p,l)}var m=function(p){L(l,p);function l(f){var o;return o=p.call(this,f,"[audio-track-controller]")||this,o.tracks=[],o.groupId=null,o.tracksInGroup=[],o.trackId=-1,o.trackName="",o.selectDefaultTrack=!0,o.registerListeners(),o}var h=l.prototype;return h.registerListeners=function(){var o=this.hls;o.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(X.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.on(X.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.on(X.Events.ERROR,this.onError,this)},h.unregisterListeners=function(){var o=this.hls;o.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(X.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.off(X.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.off(X.Events.ERROR,this.onError,this)},h.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,p.prototype.destroy.call(this)},h.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},h.onManifestParsed=function(o,u){this.tracks=u.audioTracks||[]},h.onAudioTrackLoaded=function(o,u){var s=u.id,a=u.details,C=this.tracksInGroup[s];if(!C){this.warn("Invalid audio track id "+s);return}var _=C.details;C.details=u.details,this.log("audioTrack "+s+" loaded ["+a.startSN+"-"+a.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,u,_))},h.onLevelLoading=function(o,u){this.switchLevel(u.level)},h.onLevelSwitching=function(o,u){this.switchLevel(u.level)},h.switchLevel=function(o){var u=this.hls.levels[o];if(!(u!=null&&u.audioGroupIds))return;var s=u.audioGroupIds[u.urlId];if(this.groupId!==s){this.groupId=s;var a=this.tracks.filter(function(_){return!s||_.groupId===s});this.selectDefaultTrack&&!a.some(function(_){return _.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=a;var C={audioTracks:a};this.log("Updating audio tracks, "+a.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(X.Events.AUDIO_TRACKS_UPDATED,C),this.selectInitialTrack()}},h.onError=function(o,u){if(p.prototype.onError.call(this,o,u),u.fatal||!u.context)return;u.context.type===W.PlaylistContextType.AUDIO_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},h.setAudioTrack=function(o){var u=this.tracksInGroup;if(o<0||o>=u.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var s=u[this.trackId];this.log("Now switching to audio-track index "+o);var a=u[o],C=a.id,_=a.groupId,T=_===void 0?"":_,R=a.name,O=a.type,S=a.url;if(this.trackId=o,this.trackName=R,this.selectDefaultTrack=!1,this.hls.trigger(X.Events.AUDIO_TRACK_SWITCHING,{id:C,groupId:T,name:R,type:O,url:S}),a.details&&!a.details.live)return;var w=this.switchParams(a.url,s==null?void 0:s.details);this.loadPlaylist(w)},h.selectInitialTrack=function(){var o=this.tracksInGroup;console.assert(o.length,"Initial audio track should be selected when tracks are known");var u=this.trackName,s=this.findTrackId(u)||this.findTrackId();s!==-1?this.setAudioTrack(s):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(X.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},h.findTrackId=function(o){for(var u=this.tracksInGroup,s=0;s<u.length;s++){var a=u[s];if((!this.selectDefaultTrack||a.default)&&(!o||o===a.name))return a.id}return-1},h.loadPlaylist=function(o){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var s=u.id,a=u.groupId,C=u.url;if(o)try{C=o.addDirectives(C)}catch(_){this.warn("Could not construct new URL with HLS Delivery Directives: "+_)}this.log("loading audio-track playlist for id: "+s),this.clearTimer(),this.hls.trigger(X.Events.AUDIO_TRACK_LOADING,{url:C,id:s,groupId:a,deliveryDirectives:o||null})}},i(l,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(o){this.selectDefaultTrack=!1,this.setAudioTrack(o)}}]),l}(P.default);$.default=m},"./src/controller/base-playlist-controller.ts":function(oe,$,M){"use strict";M.r($),M.d($,"default",function(){return i});var X=M("./src/polyfills/number.ts"),B=M("./src/types/level.ts"),P=M("./src/controller/level-helper.ts"),W=M("./src/utils/logger.ts"),H=M("./src/errors.ts"),i=function(){function L(m,p){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=W.logger.log.bind(W.logger,p+":"),this.warn=W.logger.warn.bind(W.logger,p+":"),this.hls=m}var v=L.prototype;return v.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},v.onError=function(p,l){l.fatal&&l.type===H.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},v.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},v.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},v.stopLoad=function(){this.canLoad=!1,this.clearTimer()},v.switchParams=function(p,l){var h=l==null?void 0:l.renditionReports;if(h)for(var f=0;f<h.length;f++){var o=h[f],u=""+o.URI;if(u===p.substr(-u.length)){var s=parseInt(o["LAST-MSN"]),a=parseInt(o["LAST-PART"]);if(l&&this.hls.config.lowLatencyMode){var C=Math.min(l.age-l.partTarget,l.targetduration);a!==void 0&&C>l.partTarget&&(a+=1)}if(Object(X.isFiniteNumber)(s))return new B.HlsUrlParameters(s,Object(X.isFiniteNumber)(a)?a:void 0,B.HlsSkip.No)}}},v.loadPlaylist=function(p){},v.shouldLoadTrack=function(p){return this.canLoad&&p&&!!p.url&&(!p.details||p.details.live)},v.playlistLoaded=function(p,l,h){var f=this,o=l.details,u=l.stats,s=u.loading.end?Math.max(0,self.performance.now()-u.loading.end):0;if(o.advancedDateTime=Date.now()-s,o.live||h!=null&&h.live){if(o.reloaded(h),h&&this.log("live playlist "+p+" "+(o.advanced?"REFRESHED "+o.lastPartSn+"-"+o.lastPartIndex:"MISSED")),h&&o.fragments.length>0&&Object(P.mergeDetails)(h,o),!this.canLoad||!o.live)return;var a,C=void 0,_=void 0;if(o.canBlockReload&&o.endSN&&o.advanced){var T=this.hls.config.lowLatencyMode,R=o.lastPartSn,O=o.endSN,S=o.lastPartIndex,w=S!==-1,E=R===O,c=T?0:S;w?(C=E?O+1:R,_=E?c:S+1):C=O+1;var x=o.age,y=x+o.ageHeader,g=Math.min(y-o.partTarget,o.targetduration*1.5);if(g>0){if(h&&g>h.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+h.tuneInGoal+" to: "+g+" with playlist age: "+o.age),g=0;else{var F=Math.floor(g/o.targetduration);if(C+=F,_!==void 0){var U=Math.round(g%o.targetduration/o.partTarget);_+=U}this.log("CDN Tune-in age: "+o.ageHeader+"s last advanced "+x.toFixed(2)+"s goal: "+g+" skip sn "+F+" to part "+_)}o.tuneInGoal=g}if(a=this.getDeliveryDirectives(o,l.deliveryDirectives,C,_),T||!E){this.loadPlaylist(a);return}}else a=this.getDeliveryDirectives(o,l.deliveryDirectives,C,_);var A=Object(P.computeReloadInterval)(o,u);C!==void 0&&o.canBlockReload&&(A-=o.partTarget||1),this.log("reload live playlist "+p+" in "+Math.round(A)+" ms"),this.timer=self.setTimeout(function(){return f.loadPlaylist(a)},A)}else this.clearTimer()},v.getDeliveryDirectives=function(p,l,h,f){var o=Object(B.getSkipValue)(p,h);return l!=null&&l.skip&&p.deltaUpdateFailed&&(h=l.msn,f=l.part,o=B.HlsSkip.No),new B.HlsUrlParameters(h,f,o)},v.retryLoadingOrFail=function(p){var l=this,h=this.hls.config,f=this.retryCount<h.levelLoadingMaxRetry;if(f){var o;if(this.retryCount++,p.details.indexOf("LoadTimeOut")>-1&&(o=p.context)!==null&&o!==void 0&&o.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+p.details+'"'),this.loadPlaylist();else{var u=Math.min(Math.pow(2,this.retryCount)*h.levelLoadingRetryDelay,h.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return l.loadPlaylist()},u),this.warn("retry playlist loading #"+this.retryCount+" in "+u+' ms after "'+p.details+'"')}}else this.warn('cannot recover from error "'+p.details+'"'),this.clearTimer(),p.fatal=!0;return f},L}()},"./src/controller/base-stream-controller.ts":function(oe,$,M){"use strict";M.r($),M.d($,"State",function(){return O}),M.d($,"default",function(){return S});var X=M("./src/polyfills/number.ts"),B=M("./src/task-loop.ts"),P=M("./src/controller/fragment-tracker.ts"),W=M("./src/utils/buffer-helper.ts"),H=M("./src/utils/logger.ts"),i=M("./src/events.ts"),L=M("./src/errors.ts"),v=M("./src/types/transmuxer.ts"),m=M("./src/utils/mp4-tools.ts"),p=M("./src/utils/discontinuities.ts"),l=M("./src/controller/fragment-finders.ts"),h=M("./src/controller/level-helper.ts"),f=M("./src/loader/fragment-loader.ts"),o=M("./src/crypt/decrypter.ts"),u=M("./src/utils/time-ranges.ts"),s=M("./src/types/loader.ts");function a(w,E){for(var c=0;c<E.length;c++){var x=E[c];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(w,x.key,x)}}function C(w,E,c){return E&&a(w.prototype,E),c&&a(w,c),w}function _(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w}function T(w,E){w.prototype=Object.create(E.prototype),w.prototype.constructor=w,R(w,E)}function R(w,E){return R=Object.setPrototypeOf||function(x,y){return x.__proto__=y,x},R(w,E)}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"},S=function(w){T(E,w);function E(x,y,g){var F;return F=w.call(this)||this,F.hls=void 0,F.fragPrevious=null,F.fragCurrent=null,F.fragmentTracker=void 0,F.transmuxer=null,F._state=O.STOPPED,F.media=void 0,F.mediaBuffer=void 0,F.config=void 0,F.bitrateTest=!1,F.lastCurrentTime=0,F.nextLoadPosition=0,F.startPosition=0,F.loadedmetadata=!1,F.fragLoadError=0,F.retryDate=0,F.levels=null,F.fragmentLoader=void 0,F.levelLastLoaded=null,F.startFragRequested=!1,F.decrypter=void 0,F.initPTS=[],F.onvseeking=null,F.onvended=null,F.logPrefix="",F.log=void 0,F.warn=void 0,F.logPrefix=g,F.log=H.logger.log.bind(H.logger,g+":"),F.warn=H.logger.warn.bind(H.logger,g+":"),F.hls=x,F.fragmentLoader=new f.default(x.config),F.fragmentTracker=y,F.config=x.config,F.decrypter=new o.default(x,x.config),x.on(i.Events.KEY_LOADED,F.onKeyLoaded,_(F)),F}var c=E.prototype;return c.doTick=function(){this.onTickEnd()},c.onTickEnd=function(){},c.startLoad=function(y){},c.stopLoad=function(){this.fragmentLoader.abort();var y=this.fragCurrent;y&&this.fragmentTracker.removeFragment(y),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=O.STOPPED},c._streamEnded=function(y,g){var F=this.fragCurrent,U=this.fragmentTracker;if(!g.live&&F&&F.sn===g.endSN&&!y.nextStart){var A=U.getState(F);return A===P.FragmentState.PARTIAL||A===P.FragmentState.OK}return!1},c.onMediaAttached=function(y,g){var F=this.media=this.mediaBuffer=g.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),F.addEventListener("seeking",this.onvseeking),F.addEventListener("ended",this.onvended);var U=this.config;this.levels&&U.autoStartLoad&&this.state===O.STOPPED&&this.startLoad(U.startPosition)},c.onMediaDetaching=function(){var y=this.media;y!=null&&y.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),y&&(y.removeEventListener("seeking",this.onvseeking),y.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},c.onMediaSeeking=function(){var y=this.config,g=this.fragCurrent,F=this.media,U=this.mediaBuffer,A=this.state,j=F?F.currentTime:0,N=W.BufferHelper.bufferInfo(U||F,j,y.maxBufferHole);if(this.log("media seeking to "+(Object(X.isFiniteNumber)(j)?j.toFixed(3):j)+", state: "+A),A===O.ENDED)this.resetLoadingState();else if(g&&!N.len){var b=y.maxFragLookUpTolerance,Y=g.start-b,re=g.start+g.duration+b,fe=j>re;(j<Y||fe)&&(fe&&g.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),g.loader.abort()),this.resetLoadingState())}F&&(this.lastCurrentTime=j),!this.loadedmetadata&&!N.len&&(this.nextLoadPosition=this.startPosition=j),this.tickImmediate()},c.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},c.onKeyLoaded=function(y,g){if(this.state!==O.KEY_LOADING||g.frag!==this.fragCurrent||!this.levels)return;this.state=O.IDLE;var F=this.levels[g.frag.level].details;F&&this.loadFragment(g.frag,F,g.frag.start)},c.onHandlerDestroying=function(){this.stopLoad(),w.prototype.onHandlerDestroying.call(this)},c.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)},c.loadKey=function(y,g){this.log("Loading key for "+y.sn+" of ["+g.startSN+"-"+g.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level),this.state=O.KEY_LOADING,this.fragCurrent=y,this.hls.trigger(i.Events.KEY_LOADING,{frag:y})},c.loadFragment=function(y,g,F){this._loadFragForPlayback(y,g,F)},c._loadFragForPlayback=function(y,g,F){var U=this,A=function(N){if(U.fragContextChanged(y)){U.warn("Fragment "+y.sn+(N.part?" p: "+N.part.index:"")+" of level "+y.level+" was dropped during download."),U.fragmentTracker.removeFragment(y);return}y.stats.chunkCount++,U._handleFragmentLoadProgress(N)};this._doFragLoad(y,g,F,A).then(function(j){if(!j)return;U.fragLoadError=0;var N=U.state;if(U.fragContextChanged(y)){(N===O.FRAG_LOADING||N===O.BACKTRACKING||!U.fragCurrent&&N===O.PARSING)&&(U.fragmentTracker.removeFragment(y),U.state=O.IDLE);return}if("payload"in j&&(U.log("Loaded fragment "+y.sn+" of level "+y.level),U.hls.trigger(i.Events.FRAG_LOADED,j),U.state===O.BACKTRACKING)){U.fragmentTracker.backtrack(y,j),U.resetFragmentLoading(y);return}U._handleFragmentLoadComplete(j)}).catch(function(j){U.warn(j),U.resetFragmentLoading(y)})},c.flushMainBuffer=function(y,g,F){if(F===void 0&&(F=null),!(y-g))return;var U={startOffset:y,endOffset:g,type:F};this.fragLoadError=0,this.hls.trigger(i.Events.BUFFER_FLUSHING,U)},c._loadInitSegment=function(y){var g=this;this._doFragLoad(y).then(function(F){if(!F||g.fragContextChanged(y)||!g.levels)throw new Error("init load aborted");return F}).then(function(F){var U=g.hls,A=F.payload,j=y.decryptdata;if(A&&A.byteLength>0&&j&&j.key&&j.iv&&j.method==="AES-128"){var N=self.performance.now();return g.decrypter.webCryptoDecrypt(new Uint8Array(A),j.key.buffer,j.iv.buffer).then(function(b){var Y=self.performance.now();return U.trigger(i.Events.FRAG_DECRYPTED,{frag:y,payload:b,stats:{tstart:N,tdecrypt:Y}}),F.payload=b,F})}return F}).then(function(F){var U=g.fragCurrent,A=g.hls,j=g.levels;if(!j)throw new Error("init load aborted, missing levels");var N=j[y.level].details;console.assert(N,"Level details are defined when init segment is loaded");var b=y.stats;g.state=O.IDLE,g.fragLoadError=0,y.data=new Uint8Array(F.payload),b.parsing.start=b.buffering.start=self.performance.now(),b.parsing.end=b.buffering.end=self.performance.now(),F.frag===U&&A.trigger(i.Events.FRAG_BUFFERED,{stats:b,frag:U,part:null,id:y.type}),g.tick()}).catch(function(F){g.warn(F),g.resetFragmentLoading(y)})},c.fragContextChanged=function(y){var g=this.fragCurrent;return!y||!g||y.level!==g.level||y.sn!==g.sn||y.urlId!==g.urlId},c.fragBufferedComplete=function(y,g){var F=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+y.type+" sn: "+y.sn+(g?" part: "+g.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level+" "+u.default.toString(W.BufferHelper.getBuffered(F))),this.state=O.IDLE,this.tick()},c._handleFragmentLoadComplete=function(y){var g=this.transmuxer;if(!g)return;var F=y.frag,U=y.part,A=y.partsLoaded,j=!A||A.length===0||A.some(function(b){return!b}),N=new v.ChunkMetadata(F.level,F.sn,F.stats.chunkCount+1,0,U?U.index:-1,!j);g.flush(N)},c._handleFragmentLoadProgress=function(y){},c._doFragLoad=function(y,g,F,U){var A=this;if(F===void 0&&(F=null),!this.levels)throw new Error("frag load aborted, missing levels");if(F=Math.max(y.start,F||0),this.config.lowLatencyMode&&g){var j=g.partList;if(j&&U){F>y.end&&g.fragmentHint&&(y=g.fragmentHint);var N=this.getNextPart(j,y,F);if(N>-1){var b=j[N];return this.log("Loading part sn: "+y.sn+" p: "+b.index+" cc: "+y.cc+" of playlist ["+g.startSN+"-"+g.endSN+"] parts [0-"+N+"-"+(j.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(F.toFixed(3))),this.nextLoadPosition=b.start+b.duration,this.state=O.FRAG_LOADING,this.hls.trigger(i.Events.FRAG_LOADING,{frag:y,part:j[N],targetBufferTime:F}),this.doFragPartsLoad(y,j,N,U).catch(function(Y){return A.handleFragLoadError(Y)})}else if(!y.url||this.loadedEndOfParts(j,F))return Promise.resolve(null)}}return this.log("Loading fragment "+y.sn+" cc: "+y.cc+" "+(g?"of ["+g.startSN+"-"+g.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(F.toFixed(3))),Object(X.isFiniteNumber)(y.sn)&&!this.bitrateTest&&(this.nextLoadPosition=y.start+y.duration),this.state=O.FRAG_LOADING,this.hls.trigger(i.Events.FRAG_LOADING,{frag:y,targetBufferTime:F}),this.fragmentLoader.load(y,U).catch(function(Y){return A.handleFragLoadError(Y)})},c.doFragPartsLoad=function(y,g,F,U){var A=this;return new Promise(function(j,N){var b=[],Y=function re(fe){var ve=g[fe];A.fragmentLoader.loadPart(y,ve,U).then(function(ke){b[ve.index]=ke;var Se=ke.part;A.hls.trigger(i.Events.FRAG_LOADED,ke);var Le=g[fe+1];if(Le&&Le.fragment===y)re(fe+1);else return j({frag:y,part:Se,partsLoaded:b})}).catch(N)};Y(F)})},c.handleFragLoadError=function(y){var g=y.data;return g&&g.details===L.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(g.frag,g.part):this.hls.trigger(i.Events.ERROR,g),null},c._handleTransmuxerFlush=function(y){var g=this.getCurrentContext(y);if(!g||this.state!==O.PARSING){this.fragCurrent||(this.state=O.IDLE);return}var F=g.frag,U=g.part,A=g.level,j=self.performance.now();F.stats.parsing.end=j,U&&(U.stats.parsing.end=j),this.updateLevelTiming(F,U,A,y.partial)},c.getCurrentContext=function(y){var g=this.levels,F=y.level,U=y.sn,A=y.part;if(!g||!g[F])return this.warn("Levels object was unset while buffering fragment "+U+" of level "+F+". The current chunk will not be buffered."),null;var j=g[F],N=A>-1?Object(h.getPartWith)(j,U,A):null,b=N?N.fragment:Object(h.getFragmentWithSN)(j,U,this.fragCurrent);return b?{frag:b,part:N,level:j}:null},c.bufferFragmentData=function(y,g,F,U){if(!y||this.state!==O.PARSING)return;var A=y.data1,j=y.data2,N=A;if(A&&j&&(N=Object(m.appendUint8Array)(A,j)),!N||!N.length)return;var b={type:y.type,frag:g,part:F,chunkMeta:U,parent:g.type,data:N};this.hls.trigger(i.Events.BUFFER_APPENDING,b),y.dropped&&y.independent&&!F&&this.flushBufferGap(g)},c.flushBufferGap=function(y){var g=this.media;if(!g)return;if(!W.BufferHelper.isBuffered(g,g.currentTime)){this.flushMainBuffer(0,y.start);return}var F=g.currentTime,U=W.BufferHelper.bufferInfo(g,F,0),A=y.duration,j=Math.min(this.config.maxFragLookUpTolerance*2,A*.25),N=Math.max(Math.min(y.start-j,U.end-j),F+j);y.start-N>j&&this.flushMainBuffer(N,y.start)},c.getFwdBufferInfo=function(y,g){var F=this.config,U=this.getLoadPosition();if(!Object(X.isFiniteNumber)(U))return null;var A=W.BufferHelper.bufferInfo(y,U,F.maxBufferHole);if(A.len===0&&A.nextStart!==void 0){var j=this.fragmentTracker.getBufferedFrag(U,g);if(j&&A.nextStart<j.end)return W.BufferHelper.bufferInfo(y,U,Math.max(A.nextStart,F.maxBufferHole))}return A},c.getMaxBufferLength=function(y){var g=this.config,F;return y?F=Math.max(8*g.maxBufferSize/y,g.maxBufferLength):F=g.maxBufferLength,Math.min(F,g.maxMaxBufferLength)},c.reduceMaxBufferLength=function(y){var g=this.config,F=y||g.maxBufferLength;return g.maxMaxBufferLength>=F?(g.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+g.maxMaxBufferLength+"s"),!0):!1},c.getNextFragment=function(y,g){var F,U,A=g.fragments,j=A.length;if(!j)return null;var N=this.config,b=A[0].start,Y;if(g.live){var re=N.initialLiveManifestSize;if(j<re)return this.warn("Not enough fragments to start playback (have: "+j+", need: "+re+")"),null;!g.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(Y=this.getInitialLiveFragment(g,A),this.startPosition=Y?this.hls.liveSyncPosition||Y.start:y)}else y<=b&&(Y=A[0]);if(!Y){var fe=N.lowLatencyMode?g.partEnd:g.fragmentEnd;Y=this.getFragmentAtPosition(y,fe,g)}return(F=Y)!==null&&F!==void 0&&F.initSegment&&!((U=Y)!==null&&U!==void 0&&U.initSegment.data)&&!this.bitrateTest&&(Y=Y.initSegment),Y},c.getNextPart=function(y,g,F){for(var U=-1,A=!1,j=!0,N=0,b=y.length;N<b;N++){var Y=y[N];if(j=j&&!Y.independent,U>-1&&F<Y.start)break;var re=Y.loaded;!re&&(A||Y.independent||j)&&Y.fragment===g&&(U=N),A=re}return U},c.loadedEndOfParts=function(y,g){var F=y[y.length-1];return F&&g>F.start&&F.loaded},c.getInitialLiveFragment=function(y,g){var F=this.fragPrevious,U=null;if(F){if(y.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+F.programDateTime),U=Object(l.findFragmentByPDT)(g,F.endProgramDateTime,this.config.maxFragLookUpTolerance)),!U){var A=F.sn+1;if(A>=y.startSN&&A<=y.endSN){var j=g[A-y.startSN];F.cc===j.cc&&(U=j,this.log("Live playlist, switching playlist, load frag with next SN: "+U.sn))}U||(U=Object(l.findFragWithCC)(g,F.cc),U&&this.log("Live playlist, switching playlist, load frag with same CC: "+U.sn))}}else{var N=this.hls.liveSyncPosition;N!==null&&(U=this.getFragmentAtPosition(N,this.bitrateTest?y.fragmentEnd:y.edge,y))}return U},c.getFragmentAtPosition=function(y,g,F){var U=this.config,A=this.fragPrevious,j=F.fragments,N=F.endSN,b=F.fragmentHint,Y=U.maxFragLookUpTolerance,re=!!(U.lowLatencyMode&&F.partList&&b);re&&b&&!this.bitrateTest&&(j=j.concat(b),N=b.sn);var fe;if(y<g){var ve=y>g-Y?0:Y;fe=Object(l.findFragmentByPTS)(A,j,y,ve)}else fe=j[j.length-1];if(fe){var ke=fe.sn-F.startSN,Se=A&&fe.level===A.level,Le=j[ke+1],ye=this.fragmentTracker.getState(fe);if(ye===P.FragmentState.BACKTRACKED){fe=null;for(var _e=ke;j[_e]&&this.fragmentTracker.getState(j[_e])===P.FragmentState.BACKTRACKED;)A?fe=j[_e--]:fe=j[--_e];fe||(fe=Le)}else A&&fe.sn===A.sn&&!re&&(Se&&(fe.sn<N&&this.fragmentTracker.getState(Le)!==P.FragmentState.OK?(this.log("SN "+fe.sn+" just loaded, load next one: "+Le.sn),fe=Le):fe=null))}return fe},c.synchronizeToLiveEdge=function(y){var g=this.config,F=this.media;if(!F)return;var U=this.hls.liveSyncPosition,A=F.currentTime,j=y.fragments[0].start,N=y.edge,b=A>=j-g.maxFragLookUpTolerance&&A<=N;if(U!==null&&F.duration>U&&(A<U||!b)){var Y=g.liveMaxLatencyDuration!==void 0?g.liveMaxLatencyDuration:g.liveMaxLatencyDurationCount*y.targetduration;(!b&&F.readyState<4||A<N-Y)&&(this.loadedmetadata||(this.nextLoadPosition=U),F.readyState&&(this.warn("Playback: "+A.toFixed(3)+" is located too far from the end of live sliding playlist: "+N+", reset currentTime to : "+U.toFixed(3)),F.currentTime=U))}},c.alignPlaylists=function(y,g){var F=this.levels,U=this.levelLastLoaded,A=this.fragPrevious,j=U!==null?F[U]:null,N=y.fragments.length;if(!N)return this.warn("No fragments in live playlist"),0;var b=y.fragments[0].start,Y=!g,re=y.alignedSliding&&Object(X.isFiniteNumber)(b);if(Y||!re&&!b){Object(p.alignStream)(A,j,y);var fe=y.fragments[0].start;return this.log("Live playlist sliding: "+fe.toFixed(2)+" start-sn: "+(g?g.startSN:"na")+"->"+y.startSN+" prev-sn: "+(A?A.sn:"na")+" fragments: "+N),fe}return b},c.waitForCdnTuneIn=function(y){var g=3;return y.live&&y.canBlockReload&&y.tuneInGoal>Math.max(y.partHoldBack,y.partTarget*g)},c.setStartPosition=function(y,g){var F=this.startPosition;if(F<g&&(F=-1),F===-1||this.lastCurrentTime===-1){var U=y.startTimeOffset;Object(X.isFiniteNumber)(U)?(F=g+U,U<0&&(F+=y.totalduration),F=Math.min(Math.max(g,F),g+y.totalduration),this.log("Start time offset "+U+" found in playlist, adjust startPosition to "+F),this.startPosition=F):y.live?F=this.hls.liveSyncPosition||g:this.startPosition=F=0,this.lastCurrentTime=F}this.nextLoadPosition=F},c.getLoadPosition=function(){var y=this.media,g=0;return this.loadedmetadata&&y?g=y.currentTime:this.nextLoadPosition&&(g=this.nextLoadPosition),g},c.handleFragLoadAborted=function(y,g){this.transmuxer&&y.sn!=="initSegment"&&y.stats.aborted&&(this.warn("Fragment "+y.sn+(g?" part"+g.index:"")+" of level "+y.level+" was aborted"),this.resetFragmentLoading(y))},c.resetFragmentLoading=function(y){(!this.fragCurrent||!this.fragContextChanged(y))&&(this.state=O.IDLE)},c.onFragmentOrKeyLoadError=function(y,g){if(g.fatal)return;var F=g.frag;if(!F||F.type!==y)return;var U=this.fragCurrent;console.assert(U&&F.sn===U.sn&&F.level===U.level&&F.urlId===U.urlId,"Frag load error must match current frag to retry");var A=this.config;if(this.fragLoadError+1<=A.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(F.level))return;var j=Math.min(Math.pow(2,this.fragLoadError)*A.fragLoadingRetryDelay,A.fragLoadingMaxRetryTimeout);this.warn("Fragment "+F.sn+" of "+y+" "+F.level+" failed to load, retrying in "+j+"ms"),this.retryDate=self.performance.now()+j,this.fragLoadError++,this.state=O.FRAG_LOADING_WAITING_RETRY}else g.levelRetry?(y===s.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=O.IDLE):(H.logger.error(g.details+" reaches max retry, redispatch as fatal ..."),g.fatal=!0,this.hls.stopLoad(),this.state=O.ERROR)},c.afterBufferFlushed=function(y,g,F){if(!y)return;var U=W.BufferHelper.getBuffered(y);this.fragmentTracker.detectEvictedFragments(g,U,F),this.state===O.ENDED&&this.resetLoadingState()},c.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=O.IDLE},c.resetLiveStartWhenNotLoaded=function(y){if(!this.loadedmetadata){this.startFragRequested=!1;var g=this.levels?this.levels[y].details:null;if(g!=null&&g.live)return this.startPosition=-1,this.setStartPosition(g,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},c.updateLevelTiming=function(y,g,F,U){var A=this,j=F.details;console.assert(!!j,"level.details must be defined");var N=Object.keys(y.elementaryStreams).reduce(function(b,Y){var re=y.elementaryStreams[Y];if(re){var fe=re.endPTS-re.startPTS;if(fe<=0)return A.warn("Could not parse fragment "+y.sn+" "+Y+" duration reliably ("+fe+") resetting transmuxer to fallback to playlist timing"),A.resetTransmuxer(),b||!1;var ve=U?0:Object(h.updateFragPTSDTS)(j,y,re.startPTS,re.endPTS,re.startDTS,re.endDTS);return A.hls.trigger(i.Events.LEVEL_PTS_UPDATED,{details:j,level:F,drift:ve,type:Y,frag:y,start:re.startPTS,end:re.endPTS}),!0}return b},!1);N?(this.state=O.PARSED,this.hls.trigger(i.Events.FRAG_PARSED,{frag:y,part:g})):this.resetLoadingState()},c.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},C(E,[{key:"state",get:function(){return this._state},set:function(y){var g=this._state;g!==y&&(this._state=y,this.log(g+"->"+y))}}]),E}(B.default)},"./src/controller/buffer-controller.ts":function(oe,$,M){"use strict";M.r($),M.d($,"default",function(){return l});var X=M("./src/polyfills/number.ts"),B=M("./src/events.ts"),P=M("./src/utils/logger.ts"),W=M("./src/errors.ts"),H=M("./src/utils/buffer-helper.ts"),i=M("./src/utils/mediasource-helper.ts"),L=M("./src/loader/fragment.ts"),v=M("./src/controller/buffer-operation-queue.ts"),m=Object(i.getMediaSource)(),p=/([ha]vc.)(?:\.[^.,]+)+/,l=function(){function h(o){var u=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var s=u.hls,a=u.media,C=u.mediaSource;P.logger.log("[buffer-controller]: Media source opened"),a&&(u.updateMediaElementDuration(),s.trigger(B.Events.MEDIA_ATTACHED,{media:a})),C&&C.removeEventListener("sourceopen",u._onMediaSourceOpen),u.checkPendingTracks()},this._onMediaSourceClose=function(){P.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){P.logger.log("[buffer-controller]: Media source ended")},this.hls=o,this._initSourceBuffer(),this.registerListeners()}var f=h.prototype;return f.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},f.destroy=function(){this.unregisterListeners(),this.details=null},f.registerListeners=function(){var u=this.hls;u.on(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(B.Events.BUFFER_RESET,this.onBufferReset,this),u.on(B.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.on(B.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.on(B.Events.BUFFER_EOS,this.onBufferEos,this),u.on(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.on(B.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.on(B.Events.FRAG_PARSED,this.onFragParsed,this),u.on(B.Events.FRAG_CHANGED,this.onFragChanged,this)},f.unregisterListeners=function(){var u=this.hls;u.off(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(B.Events.BUFFER_RESET,this.onBufferReset,this),u.off(B.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.off(B.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.off(B.Events.BUFFER_EOS,this.onBufferEos,this),u.off(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.off(B.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.off(B.Events.FRAG_PARSED,this.onFragParsed,this),u.off(B.Events.FRAG_CHANGED,this.onFragChanged,this)},f._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new v.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},f.onManifestParsed=function(u,s){var a=2;(s.audio&&!s.video||!s.altAudio)&&(a=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=a,this.details=null,P.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},f.onMediaAttaching=function(u,s){var a=this.media=s.media;if(a&&m){var C=this.mediaSource=new m;C.addEventListener("sourceopen",this._onMediaSourceOpen),C.addEventListener("sourceended",this._onMediaSourceEnded),C.addEventListener("sourceclose",this._onMediaSourceClose),a.src=self.URL.createObjectURL(C),this._objectUrl=a.src}},f.onMediaDetaching=function(){var u=this.media,s=this.mediaSource,a=this._objectUrl;if(s){if(P.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(C){P.logger.warn("[buffer-controller]: onMediaDetaching: "+C.message+" while calling endOfStream")}this.onBufferReset(),s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),u&&(a&&self.URL.revokeObjectURL(a),u.src===a?(u.removeAttribute("src"),u.load()):P.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(B.Events.MEDIA_DETACHED,void 0)},f.onBufferReset=function(){var u=this;this.getSourceBufferTypes().forEach(function(s){var a=u.sourceBuffer[s];try{a&&(u.removeBufferListeners(s),u.mediaSource&&u.mediaSource.removeSourceBuffer(a),u.sourceBuffer[s]=void 0)}catch(C){P.logger.warn("[buffer-controller]: Failed to reset the "+s+" buffer",C)}}),this._initSourceBuffer()},f.onBufferCodecs=function(u,s){var a=this,C=this.getSourceBufferTypes().length;if(Object.keys(s).forEach(function(_){if(C){var T=a.tracks[_];if(T&&typeof T.buffer.changeType=="function"){var R=s[_],O=R.codec,S=R.levelCodec,w=R.container,E=(T.levelCodec||T.codec).replace(p,"$1"),c=(S||O).replace(p,"$1");if(E!==c){var x=w+";codecs="+(S||O);a.appendChangeType(_,x)}}}else a.pendingTracks[_]=s[_]}),C)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},f.appendChangeType=function(u,s){var a=this,C=this.operationQueue,_={execute:function(){var R=a.sourceBuffer[u];R&&(P.logger.log("[buffer-controller]: changing "+u+" sourceBuffer type to "+s),R.changeType(s)),C.shiftAndExecuteNext(u)},onStart:function(){},onComplete:function(){},onError:function(R){P.logger.warn("[buffer-controller]: Failed to change "+u+" SourceBuffer type",R)}};C.append(_,u)},f.onBufferAppending=function(u,s){var a=this,C=this.hls,_=this.operationQueue,T=this.tracks,R=s.data,O=s.type,S=s.frag,w=s.part,E=s.chunkMeta,c=E.buffering[O],x=self.performance.now();c.start=x;var y=S.stats.buffering,g=w?w.stats.buffering:null;y.start===0&&(y.start=x),g&&g.start===0&&(g.start=x);var F=T.audio,U=O==="audio"&&E.id===1&&(F==null?void 0:F.container)==="audio/mpeg",A={execute:function(){if(c.executeStart=self.performance.now(),U){var N=a.sourceBuffer[O];if(N){var b=S.start-N.timestampOffset;Math.abs(b)>=.1&&(P.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+S.start+" (delta: "+b+") sn: "+S.sn+")"),N.timestampOffset=S.start)}}a.appendExecutor(R,O)},onStart:function(){},onComplete:function(){var N=self.performance.now();c.executeEnd=c.end=N,y.first===0&&(y.first=N),g&&g.first===0&&(g.first=N);var b=a.sourceBuffer,Y={};for(var re in b)Y[re]=H.BufferHelper.getBuffered(b[re]);a.appendError=0,a.hls.trigger(B.Events.BUFFER_APPENDED,{type:O,frag:S,part:w,chunkMeta:E,parent:S.type,timeRanges:Y})},onError:function(N){P.logger.error("[buffer-controller]: Error encountered while trying to append to the "+O+" SourceBuffer",N);var b={type:W.ErrorTypes.MEDIA_ERROR,parent:S.type,details:W.ErrorDetails.BUFFER_APPEND_ERROR,err:N,fatal:!1};N.code===DOMException.QUOTA_EXCEEDED_ERR?b.details=W.ErrorDetails.BUFFER_FULL_ERROR:(a.appendError++,b.details=W.ErrorDetails.BUFFER_APPEND_ERROR,a.appendError>C.config.appendErrorMaxRetry&&(P.logger.error("[buffer-controller]: Failed "+C.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),b.fatal=!0)),C.trigger(B.Events.ERROR,b)}};_.append(A,O)},f.onBufferFlushing=function(u,s){var a=this,C=this.operationQueue,_=function(R){return{execute:a.removeExecutor.bind(a,R,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){a.hls.trigger(B.Events.BUFFER_FLUSHED,{type:R})},onError:function(S){P.logger.warn("[buffer-controller]: Failed to remove from "+R+" SourceBuffer",S)}}};s.type?C.append(_(s.type),s.type):this.getSourceBufferTypes().forEach(function(T){C.append(_(T),T)})},f.onFragParsed=function(u,s){var a=this,C=s.frag,_=s.part,T=[],R=_?_.elementaryStreams:C.elementaryStreams;R[L.ElementaryStreamTypes.AUDIOVIDEO]?T.push("audiovideo"):(R[L.ElementaryStreamTypes.AUDIO]&&T.push("audio"),R[L.ElementaryStreamTypes.VIDEO]&&T.push("video"));var O=function(){var w=self.performance.now();C.stats.buffering.end=w,_&&(_.stats.buffering.end=w);var E=_?_.stats:C.stats;a.hls.trigger(B.Events.FRAG_BUFFERED,{frag:C,part:_,stats:E,id:C.type})};T.length===0&&P.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+C.type+" level: "+C.level+" sn: "+C.sn),this.blockBuffers(O,T)},f.onFragChanged=function(u,s){this.flushBackBuffer()},f.onBufferEos=function(u,s){var a=this,C=this.getSourceBufferTypes().reduce(function(_,T){var R=a.sourceBuffer[T];return(!s.type||s.type===T)&&(R&&!R.ended&&(R.ended=!0,P.logger.log("[buffer-controller]: "+T+" sourceBuffer now EOS"))),_&&!!(!R||R.ended)},!0);C&&this.blockBuffers(function(){var _=a.mediaSource;if(!_||_.readyState!=="open")return;_.endOfStream()})},f.onLevelUpdated=function(u,s){var a=s.details;if(!a.fragments.length)return;this.details=a,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},f.flushBackBuffer=function(){var u=this.hls,s=this.details,a=this.media,C=this.sourceBuffer;if(!a||s===null)return;var _=this.getSourceBufferTypes();if(!_.length)return;var T=s.live&&u.config.liveBackBufferLength!==null?u.config.liveBackBufferLength:u.config.backBufferLength;if(!Object(X.isFiniteNumber)(T)||T<0)return;var R=a.currentTime,O=s.levelTargetDuration,S=Math.max(T,O),w=Math.floor(R/O)*O-S;_.forEach(function(E){var c=C[E];if(c){var x=H.BufferHelper.getBuffered(c);x.length>0&&w>x.start(0)&&(u.trigger(B.Events.BACK_BUFFER_REACHED,{bufferEnd:w}),s.live&&u.trigger(B.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:w}),u.trigger(B.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:w,type:E}))}})},f.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var u=this.details,s=this.hls,a=this.media,C=this.mediaSource,_=u.fragments[0].start+u.totalduration,T=a.duration,R=Object(X.isFiniteNumber)(C.duration)?C.duration:0;u.live&&s.config.liveDurationInfinity?(P.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),C.duration=Infinity,this.updateSeekableRange(u)):(_>R&&_>T||!Object(X.isFiniteNumber)(T))&&(P.logger.log("[buffer-controller]: Updating Media Source duration to "+_.toFixed(3)),C.duration=_)},f.updateSeekableRange=function(u){var s=this.mediaSource,a=u.fragments,C=a.length;if(C&&u.live&&s!==null&&s!==void 0&&s.setLiveSeekableRange){var _=Math.max(0,a[0].start),T=Math.max(_,_+u.totalduration);s.setLiveSeekableRange(_,T)}},f.checkPendingTracks=function(){var u=this.bufferCodecEventsExpected,s=this.operationQueue,a=this.pendingTracks,C=Object.keys(a).length;if(C&&!u||C===2){this.createSourceBuffers(a),this.pendingTracks={};var _=this.getSourceBufferTypes();if(_.length===0){this.hls.trigger(B.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}_.forEach(function(T){s.executeNext(T)})}},f.createSourceBuffers=function(u){var s=this.sourceBuffer,a=this.mediaSource;if(!a)throw Error("createSourceBuffers called when mediaSource was null");var C=0;for(var _ in u)if(!s[_]){var T=u[_];if(!T)throw Error("source buffer exists for track "+_+", however track does not");var R=T.levelCodec||T.codec,O=T.container+";codecs="+R;P.logger.log("[buffer-controller]: creating sourceBuffer("+O+")");try{var S=s[_]=a.addSourceBuffer(O),w=_;this.addBufferListener(w,"updatestart",this._onSBUpdateStart),this.addBufferListener(w,"updateend",this._onSBUpdateEnd),this.addBufferListener(w,"error",this._onSBUpdateError),this.tracks[_]={buffer:S,codec:R,container:T.container,levelCodec:T.levelCodec,id:T.id},C++}catch(E){P.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+E.message),this.hls.trigger(B.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:E,mimeType:O})}}C&&this.hls.trigger(B.Events.BUFFER_CREATED,{tracks:this.tracks})},f._onSBUpdateStart=function(u){var s=this.operationQueue,a=s.current(u);a.onStart()},f._onSBUpdateEnd=function(u){var s=this.operationQueue,a=s.current(u);a.onComplete(),s.shiftAndExecuteNext(u)},f._onSBUpdateError=function(u,s){P.logger.error("[buffer-controller]: "+u+" SourceBuffer error",s),this.hls.trigger(B.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var a=this.operationQueue.current(u);a&&a.onError(s)},f.removeExecutor=function(u,s,a){var C=this.media,_=this.mediaSource,T=this.operationQueue,R=this.sourceBuffer,O=R[u];if(!C||!_||!O){P.logger.warn("[buffer-controller]: Attempting to remove from the "+u+" SourceBuffer, but it does not exist"),T.shiftAndExecuteNext(u);return}var S=Object(X.isFiniteNumber)(C.duration)?C.duration:Infinity,w=Object(X.isFiniteNumber)(_.duration)?_.duration:Infinity,E=Math.max(0,s),c=Math.min(a,S,w);c>E?(P.logger.log("[buffer-controller]: Removing ["+E+","+c+"] from the "+u+" SourceBuffer"),console.assert(!O.updating,u+" sourceBuffer must not be updating"),O.remove(E,c)):T.shiftAndExecuteNext(u)},f.appendExecutor=function(u,s){var a=this.operationQueue,C=this.sourceBuffer,_=C[s];if(!_){P.logger.warn("[buffer-controller]: Attempting to append to the "+s+" SourceBuffer, but it does not exist"),a.shiftAndExecuteNext(s);return}_.ended=!1,console.assert(!_.updating,s+" sourceBuffer must not be updating"),_.appendBuffer(u)},f.blockBuffers=function(u,s){var a=this;if(s===void 0&&(s=this.getSourceBufferTypes()),!s.length){P.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(u);return}var C=this.operationQueue,_=s.map(function(T){return C.appendBlocker(T)});Promise.all(_).then(function(){u(),s.forEach(function(T){var R=a.sourceBuffer[T];(!R||!R.updating)&&C.shiftAndExecuteNext(T)})})},f.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},f.addBufferListener=function(u,s,a){var C=this.sourceBuffer[u];if(!C)return;var _=a.bind(this,u);this.listeners[u].push({event:s,listener:_}),C.addEventListener(s,_)},f.removeBufferListeners=function(u){var s=this.sourceBuffer[u];if(!s)return;this.listeners[u].forEach(function(a){s.removeEventListener(a.event,a.listener)})},h}()},"./src/controller/buffer-operation-queue.ts":function(oe,$,M){"use strict";M.r($),M.d($,"default",function(){return B});var X=M("./src/utils/logger.ts"),B=function(){function P(H){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=H}var W=P.prototype;return W.append=function(i,L){var v=this.queues[L];v.push(i),v.length===1&&this.buffers[L]&&this.executeNext(L)},W.insertAbort=function(i,L){var v=this.queues[L];v.unshift(i),this.executeNext(L)},W.appendBlocker=function(i){var L,v=new Promise(function(p){L=p}),m={execute:L,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(m,i),v},W.executeNext=function(i){var L=this.buffers,v=this.queues,m=L[i],p=v[i];if(p.length){var l=p[0];try{l.execute()}catch(h){X.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),l.onError(h),(!m||!m.updating)&&(p.shift(),this.executeNext(i))}}},W.shiftAndExecuteNext=function(i){this.queues[i].shift(),this.executeNext(i)},W.current=function(i){return this.queues[i][0]},P}()},"./src/controller/cap-level-controller.ts":function(oe,$,M){"use strict";M.r($);var X=M("./src/events.ts");function B(H,i){for(var L=0;L<i.length;L++){var v=i[L];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(H,v.key,v)}}function P(H,i,L){return i&&B(H.prototype,i),L&&B(H,L),H}var W=function(){function H(L){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=L,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var i=H.prototype;return i.setStreamController=function(v){this.streamController=v},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 v=this.hls;v.on(X.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.on(X.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},i.unregisterListener=function(){var v=this.hls;v.off(X.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.off(X.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},i.onFpsDropLevelCapping=function(v,m){H.isLevelAllowed(m.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(m.droppedLevel)},i.onMediaAttaching=function(v,m){this.media=m.media instanceof HTMLVideoElement?m.media:null},i.onManifestParsed=function(v,m){var p=this.hls;this.restrictedLevels=[],this.firstLevel=m.firstLevel,p.config.capLevelToPlayerSize&&m.video&&this.startCapping()},i.onBufferCodecs=function(v,m){var p=this.hls;p.config.capLevelToPlayerSize&&m.video&&this.startCapping()},i.onMediaDetaching=function(){this.stopCapping()},i.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var v=this.hls.levels;if(v.length){var m=this.hls;m.autoLevelCapping=this.getMaxLevel(v.length-1),m.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=m.autoLevelCapping}}},i.getMaxLevel=function(v){var m=this,p=this.hls.levels;if(!p.length)return-1;var l=p.filter(function(h,f){return H.isLevelAllowed(f,m.restrictedLevels)&&f<=v});return this.clientRect=null,H.getMaxLevelByMediaSize(l,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 v=this.media,m={width:0,height:0};if(v){var p=v.getBoundingClientRect();m.width=p.width,m.height=p.height,!m.width&&!m.height&&(m.width=p.right-p.left||v.width||0,m.height=p.bottom-p.top||v.height||0)}return this.clientRect=m,m},H.isLevelAllowed=function(v,m){return m===void 0&&(m=[]),m.indexOf(v)===-1},H.getMaxLevelByMediaSize=function(v,m,p){if(!v||!v.length)return-1;for(var l=function(s,a){return a?s.width!==a.width||s.height!==a.height:!0},h=v.length-1,f=0;f<v.length;f+=1){var o=v[f];if((o.width>=m||o.height>=p)&&l(o,v[f+1])){h=f;break}}return h},P(H,[{key:"mediaWidth",get:function(){return this.getDimensions().width*H.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*H.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var v=1;try{v=self.devicePixelRatio}catch(m){}return v}}]),H}();$.default=W},"./src/controller/cmcd-controller.ts":function(oe,$,M){"use strict";M.r($),M.d($,"default",function(){return l});var X=M("./src/events.ts"),B=M("./src/types/cmcd.ts"),P=M("./src/utils/buffer-helper.ts"),W=M("./src/utils/logger.ts");function H(h,f){for(var o=0;o<f.length;o++){var u=f[o];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(h,u.key,u)}}function i(h,f,o){return f&&H(h.prototype,f),o&&H(h,o),h}function L(h,f){var o=typeof Symbol!="undefined"&&h[Symbol.iterator]||h["@@iterator"];if(o)return(o=o.call(h)).next.bind(o);if(Array.isArray(h)||(o=v(h))||f&&h&&typeof h.length=="number"){o&&(h=o);var u=0;return function(){return u>=h.length?{done:!0}:{done:!1,value:h[u++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v(h,f){if(!h)return;if(typeof h=="string")return m(h,f);var o=Object.prototype.toString.call(h).slice(8,-1);if(o==="Object"&&h.constructor&&(o=h.constructor.name),o==="Map"||o==="Set")return Array.from(h);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return m(h,f)}function m(h,f){(f==null||f>h.length)&&(f=h.length);for(var o=0,u=new Array(f);o<f;o++)u[o]=h[o];return u}function p(){return p=Object.assign||function(h){for(var f=1;f<arguments.length;f++){var o=arguments[f];for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&(h[u]=o[u])}return h},p.apply(this,arguments)}var l=function(){function h(o){var u=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){u.initialized&&(u.starved=!0),u.buffering=!0},this.onPlaying=function(){u.initialized||(u.initialized=!0),u.buffering=!1},this.applyPlaylistData=function(C){try{u.apply(C,{ot:B.CMCDObjectType.MANIFEST,su:!u.initialized})}catch(_){W.logger.warn("Could not generate manifest CMCD data.",_)}},this.applyFragmentData=function(C){try{var _=C.frag,T=u.hls.levels[_.level],R=u.getObjectType(_),O={d:_.duration*1e3,ot:R};(R===B.CMCDObjectType.VIDEO||R===B.CMCDObjectType.AUDIO||R==B.CMCDObjectType.MUXED)&&(O.br=T.bitrate/1e3,O.tb=u.getTopBandwidth(R),O.bl=u.getBufferLength(R)),u.apply(C,O)}catch(S){W.logger.warn("Could not generate segment CMCD data.",S)}},this.hls=o;var s=this.config=o.config,a=s.cmcd;a!=null&&(s.pLoader=this.createPlaylistLoader(),s.fLoader=this.createFragmentLoader(),this.sid=a.sessionId||h.uuid(),this.cid=a.contentId,this.useHeaders=a.useHeaders===!0,this.registerListeners())}var f=h.prototype;return f.registerListeners=function(){var u=this.hls;u.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.on(X.Events.BUFFER_CREATED,this.onBufferCreated,this)},f.unregisterListeners=function(){var u=this.hls;u.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.off(X.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},f.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},f.onMediaAttached=function(u,s){this.media=s.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},f.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},f.onBufferCreated=function(u,s){var a,C;this.audioBuffer=(a=s.tracks.audio)===null||a===void 0?void 0:a.buffer,this.videoBuffer=(C=s.tracks.video)===null||C===void 0?void 0:C.buffer},f.createData=function(){var u;return{v:B.CMCDVersion,sf:B.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(u=this.media)===null||u===void 0?void 0:u.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},f.apply=function(u,s){s===void 0&&(s={}),p(s,this.createData());var a=s.ot===B.CMCDObjectType.INIT||s.ot===B.CMCDObjectType.VIDEO||s.ot===B.CMCDObjectType.MUXED;if(this.starved&&a&&(s.bs=!0,s.su=!0,this.starved=!1),s.su==null&&(s.su=this.buffering),this.useHeaders){var C=h.toHeaders(s);if(!Object.keys(C).length)return;u.headers||(u.headers={}),p(u.headers,C)}else{var _=h.toQuery(s);if(!_)return;u.url=h.appendQueryToUri(u.url,_)}},f.getObjectType=function(u){var s=u.type;return s==="subtitle"?B.CMCDObjectType.TIMED_TEXT:u.sn==="initSegment"?B.CMCDObjectType.INIT:s==="audio"?B.CMCDObjectType.AUDIO:s==="main"?this.hls.audioTracks.length?B.CMCDObjectType.VIDEO:B.CMCDObjectType.MUXED:void 0},f.getTopBandwidth=function(u){for(var s=0,a=u===B.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,C=L(a),_;!(_=C()).done;){var T=_.value;T.bitrate>s&&(s=T.bitrate)}return s>0?s:NaN},f.getBufferLength=function(u){var s=this.hls.media,a=u===B.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!a||!s)return NaN;var C=P.BufferHelper.bufferInfo(a,s.currentTime,this.config.maxBufferHole);return C.len*1e3},f.createPlaylistLoader=function(){var u=this.config.pLoader,s=this.applyPlaylistData,a=u||this.config.loader;return function(){function C(T){this.loader=void 0,this.loader=new a(T)}var _=C.prototype;return _.destroy=function(){this.loader.destroy()},_.abort=function(){this.loader.abort()},_.load=function(R,O,S){s(R),this.loader.load(R,O,S)},i(C,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),C}()},f.createFragmentLoader=function(){var u=this.config.fLoader,s=this.applyFragmentData,a=u||this.config.loader;return function(){function C(T){this.loader=void 0,this.loader=new a(T)}var _=C.prototype;return _.destroy=function(){this.loader.destroy()},_.abort=function(){this.loader.abort()},_.load=function(R,O,S){s(R),this.loader.load(R,O,S)},i(C,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),C}()},h.uuid=function(){var u=URL.createObjectURL(new Blob),s=u.toString();return URL.revokeObjectURL(u),s.substr(s.lastIndexOf("/")+1)},h.serialize=function(u){for(var s=[],a=function(U){return!Number.isNaN(U)&&U!=null&&U!==""&&U!==!1},C=function(U){return Math.round(U)},_=function(U){return C(U/100)*100},T=function(U){return encodeURIComponent(U)},R={br:C,d:C,bl:_,dl:_,mtp:_,nor:T,rtp:_,tb:C},O=Object.keys(u||{}).sort(),S=L(O),w;!(w=S()).done;){var E=w.value,c=u[E];if(!a(c))continue;if(E==="v"&&c===1)continue;if(E=="pr"&&c===1)continue;var x=R[E];x&&(c=x(c));var y=typeof c,g=void 0;E==="ot"||E==="sf"||E==="st"?g=E+"="+c:y==="boolean"?g=E:y==="number"?g=E+"="+c:g=E+"="+JSON.stringify(c),s.push(g)}return s.join(",")},h.toHeaders=function(u){for(var s=Object.keys(u),a={},C=["Object","Request","Session","Status"],_=[{},{},{},{}],T={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},R=0,O=s;R<O.length;R++){var S=O[R],w=T[S]!=null?T[S]:1;_[w][S]=u[S]}for(var E=0;E<_.length;E++){var c=h.serialize(_[E]);c&&(a["CMCD-"+C[E]]=c)}return a},h.toQuery=function(u){return"CMCD="+encodeURIComponent(h.serialize(u))},h.appendQueryToUri=function(u,s){if(!s)return u;var a=u.includes("?")?"&":"?";return""+u+a+s},h}()},"./src/controller/eme-controller.ts":function(oe,$,M){"use strict";M.r($);var X=M("./src/events.ts"),B=M("./src/errors.ts"),P=M("./src/utils/logger.ts"),W=M("./src/utils/mediakeys-helper.ts");function H(l,h){for(var f=0;f<h.length;f++){var o=h[f];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(l,o.key,o)}}function i(l,h,f){return h&&H(l.prototype,h),f&&H(l,f),l}var L=3,v=function(h,f,o){var u={audioCapabilities:[],videoCapabilities:[]};return h.forEach(function(s){u.audioCapabilities.push({contentType:'audio/mp4; codecs="'+s+'"',robustness:o.audioRobustness||""})}),f.forEach(function(s){u.videoCapabilities.push({contentType:'video/mp4; codecs="'+s+'"',robustness:o.videoRobustness||""})}),[u]},m=function(h,f,o,u){switch(h){case W.KeySystems.WIDEVINE:return v(f,o,u);default:throw new Error("Unknown key-system: "+h)}},p=function(){function l(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 h=l.prototype;return h.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},h._registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this)},h._unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this)},h.getLicenseServerUrl=function(o){switch(o){case W.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+o+'"')},h._attemptKeySystemAccess=function(o,u,s){var a=this,C=m(o,u,s,this._drmSystemOptions);P.logger.log("Requesting encrypted media key-system access");var _=this.requestMediaKeySystemAccess(o,C);this.mediaKeysPromise=_.then(function(T){return a._onMediaKeySystemAccessObtained(o,T)}),_.catch(function(T){P.logger.error('Failed to obtain key-system "'+o+'" access:',T)})},h._onMediaKeySystemAccessObtained=function(o,u){var s=this;P.logger.log('Access for key-system "'+o+'" obtained');var a={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:u,mediaKeySystemDomain:o};this._mediaKeysList.push(a);var C=Promise.resolve().then(function(){return u.createMediaKeys()}).then(function(_){return a.mediaKeys=_,P.logger.log('Media-keys created for key-system "'+o+'"'),s._onMediaKeysCreated(),_});return C.catch(function(_){P.logger.error("Failed to create media-keys:",_)}),C},h._onMediaKeysCreated=function(){var o=this;this._mediaKeysList.forEach(function(u){u.mediaKeysSession||(u.mediaKeysSession=u.mediaKeys.createSession(),o._onNewMediaKeySession(u.mediaKeysSession))})},h._onNewMediaKeySession=function(o){var u=this;P.logger.log("New key-system session "+o.sessionId),o.addEventListener("message",function(s){u._onKeySessionMessage(o,s.message)},!1)},h._onKeySessionMessage=function(o,u){P.logger.log("Got EME message event, creating license request"),this._requestLicense(u,function(s){P.logger.log("Received license data (length: "+(s&&s.byteLength)+"), updating key-session"),o.update(s)})},h.onMediaEncrypted=function(o){var u=this;if(P.logger.log('Media is encrypted using "'+o.initDataType+'" init data type'),!this.mediaKeysPromise){P.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(X.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var s=function(C){if(!u._media)return;u._attemptSetMediaKeys(C),u._generateRequestWithPreferredKeySession(o.initDataType,o.initData)};this.mediaKeysPromise.then(s).catch(s)},h._attemptSetMediaKeys=function(o){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var u=this._mediaKeysList[0];if(!u||!u.mediaKeys){P.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}P.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(u.mediaKeys),this._hasSetMediaKeys=!0}},h._generateRequestWithPreferredKeySession=function(o,u){var s=this,a=this._mediaKeysList[0];if(!a){P.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(a.mediaKeysSessionInitialized){P.logger.warn("Key-Session already initialized but requested again");return}var C=a.mediaKeysSession;if(!C){P.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(X.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!u){P.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(X.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}P.logger.log('Generating key-session request for "'+o+'" init data type'),a.mediaKeysSessionInitialized=!0,C.generateRequest(o,u).then(function(){P.logger.debug("Key-session generation succeeded")}).catch(function(_){P.logger.error("Error generating key-session request:",_),s.hls.trigger(X.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},h._createLicenseXhr=function(o,u,s){var a=new XMLHttpRequest;a.responseType="arraybuffer",a.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,a,o,u,s);var C=this._licenseXhrSetup;if(C)try{C.call(this.hls,a,o),C=void 0}catch(_){P.logger.error(_)}try{a.readyState||a.open("POST",o,!0),C&&C.call(this.hls,a,o)}catch(_){throw new Error("issue setting up KeySystem license XHR "+_)}return a},h._onLicenseRequestReadyStageChange=function(o,u,s,a){switch(o.readyState){case 4:if(o.status===200){this._requestLicenseFailureCount=0,P.logger.log("License request succeeded");var C=o.response,_=this._licenseResponseCallback;if(_)try{C=_.call(this.hls,o,u)}catch(R){P.logger.error(R)}a(C)}else{if(P.logger.error("License Request XHR failed ("+u+"). Status: "+o.status+" ("+o.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>L){this.hls.trigger(X.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var T=L-this._requestLicenseFailureCount+1;P.logger.warn("Retrying license request, "+T+" attempts left"),this._requestLicense(s,a)}break}},h._generateLicenseRequestChallenge=function(o,u){switch(o.mediaKeySystemDomain){case W.KeySystems.WIDEVINE:return u}throw new Error("unsupported key-system: "+o.mediaKeySystemDomain)},h._requestLicense=function(o,u){P.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){P.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var a=this.getLicenseServerUrl(s.mediaKeySystemDomain),C=this._createLicenseXhr(a,o,u);P.logger.log("Sending license request to URL: "+a);var _=this._generateLicenseRequestChallenge(s,o);C.send(_)}catch(T){P.logger.error("Failure requesting DRM license: "+T),this.hls.trigger(X.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},h.onMediaAttached=function(o,u){if(!this._emeEnabled)return;var s=u.media;this._media=s,s.addEventListener("encrypted",this._onMediaEncrypted)},h.onMediaDetached=function(){var o=this._media,u=this._mediaKeysList;if(!o)return;o.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(u.map(function(s){if(s.mediaKeysSession)return s.mediaKeysSession.close().catch(function(){})})).then(function(){return o.setMediaKeys(null)}).catch(function(){})},h.onManifestParsed=function(o,u){if(!this._emeEnabled)return;var s=u.levels.map(function(C){return C.audioCodec}).filter(function(C){return!!C}),a=u.levels.map(function(C){return C.videoCodec}).filter(function(C){return!!C});this._attemptKeySystemAccess(W.KeySystems.WIDEVINE,s,a)},i(l,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),l}();$.default=p},"./src/controller/fps-controller.ts":function(oe,$,M){"use strict";M.r($);var X=M("./src/events.ts"),B=M("./src/utils/logger.ts"),P=function(){function W(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 H=W.prototype;return H.setStreamController=function(L){this.streamController=L},H.registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},H.unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching)},H.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},H.onMediaAttaching=function(L,v){var m=this.hls.config;if(m.capLevelOnFPSDrop){var p=v.media instanceof self.HTMLVideoElement?v.media:null;this.media=p,p&&typeof p.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),m.fpsDroppedMonitoringPeriod)}},H.checkFPS=function(L,v,m){var p=performance.now();if(v){if(this.lastTime){var l=p-this.lastTime,h=m-this.lastDroppedFrames,f=v-this.lastDecodedFrames,o=1e3*h/l,u=this.hls;if(u.trigger(X.Events.FPS_DROP,{currentDropped:h,currentDecoded:f,totalDroppedFrames:m}),o>0&&h>u.config.fpsDroppedMonitoringThreshold*f){var s=u.currentLevel;B.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=s)&&(s=s-1,u.trigger(X.Events.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:u.currentLevel}),u.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=p,this.lastDroppedFrames=m,this.lastDecodedFrames=v}},H.checkFPSInterval=function(){var L=this.media;if(L)if(this.isVideoPlaybackQualityAvailable){var v=L.getVideoPlaybackQuality();this.checkFPS(L,v.totalVideoFrames,v.droppedVideoFrames)}else this.checkFPS(L,L.webkitDecodedFrameCount,L.webkitDroppedFrameCount)},W}();$.default=P},"./src/controller/fragment-finders.ts":function(oe,$,M){"use strict";M.r($),M.d($,"findFragmentByPDT",function(){return P}),M.d($,"findFragmentByPTS",function(){return W}),M.d($,"fragmentWithinToleranceTest",function(){return H}),M.d($,"pdtWithinToleranceTest",function(){return i}),M.d($,"findFragWithCC",function(){return L});var X=M("./src/polyfills/number.ts"),B=M("./src/utils/binary-search.ts");function P(v,m,p){if(m===null||!Array.isArray(v)||!v.length||!Object(X.isFiniteNumber)(m))return null;var l=v[0].programDateTime;if(m<(l||0))return null;var h=v[v.length-1].endProgramDateTime;if(m>=(h||0))return null;p=p||0;for(var f=0;f<v.length;++f){var o=v[f];if(i(m,p,o))return o}return null}function W(v,m,p,l){p===void 0&&(p=0),l===void 0&&(l=0);var h=null;if(v?h=m[v.sn-m[0].sn+1]||null:p===0&&m[0].start===0&&(h=m[0]),h&&H(p,l,h)===0)return h;var f=B.default.search(m,H.bind(null,p,l));return f||h}function H(v,m,p){v===void 0&&(v=0),m===void 0&&(m=0);var l=Math.min(m,p.duration+(p.deltaPTS?p.deltaPTS:0));return p.start+p.duration-l<=v?1:p.start-l>v&&p.start?-1:0}function i(v,m,p){var l=Math.min(m,p.duration+(p.deltaPTS?p.deltaPTS:0))*1e3,h=p.endProgramDateTime||0;return h-l>v}function L(v,m){return B.default.search(v,function(p){return p.cc<m?1:p.cc>m?-1:0})}},"./src/controller/fragment-tracker.ts":function(oe,$,M){"use strict";M.r($),M.d($,"FragmentState",function(){return P}),M.d($,"FragmentTracker",function(){return W});var X=M("./src/events.ts"),B=M("./src/types/loader.ts"),P;(function(L){L.NOT_LOADED="NOT_LOADED",L.BACKTRACKED="BACKTRACKED",L.APPENDING="APPENDING",L.PARTIAL="PARTIAL",L.OK="OK"})(P||(P={}));var W=function(){function L(m){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=m,this._registerListeners()}var v=L.prototype;return v._registerListeners=function(){var p=this.hls;p.on(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.on(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.on(X.Events.FRAG_LOADED,this.onFragLoaded,this)},v._unregisterListeners=function(){var p=this.hls;p.off(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.off(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.off(X.Events.FRAG_LOADED,this.onFragLoaded,this)},v.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},v.getAppendedFrag=function(p,l){if(l===B.PlaylistLevelType.MAIN){var h=this.activeFragment,f=this.activeParts;if(!h)return null;if(f)for(var o=f.length;o--;){var u=f[o],s=u?u.end:h.appendedPTS;if(u.start<=p&&s!==void 0&&p<=s)return o>9&&(this.activeParts=f.slice(o-9)),u}else if(h.start<=p&&h.appendedPTS!==void 0&&p<=h.appendedPTS)return h}return this.getBufferedFrag(p,l)},v.getBufferedFrag=function(p,l){for(var h=this.fragments,f=Object.keys(h),o=f.length;o--;){var u=h[f[o]];if((u==null?void 0:u.body.type)===l&&u.buffered){var s=u.body;if(s.start<=p&&p<=s.end)return s}}return null},v.detectEvictedFragments=function(p,l,h){var f=this;Object.keys(this.fragments).forEach(function(o){var u=f.fragments[o];if(!u)return;if(!u.buffered){u.body.type===h&&f.removeFragment(u.body);return}var s=u.range[p];if(!s)return;s.time.some(function(a){var C=!f.isTimeBuffered(a.startPTS,a.endPTS,l);return C&&f.removeFragment(u.body),C})})},v.detectPartialFragments=function(p){var l=this,h=this.timeRanges,f=p.frag,o=p.part;if(!h||f.sn==="initSegment")return;var u=i(f),s=this.fragments[u];if(!s)return;Object.keys(h).forEach(function(a){var C=f.elementaryStreams[a];if(!C)return;var _=h[a],T=o!==null||C.partial===!0;s.range[a]=l.getBufferedTimes(f,o,T,_)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},v.fragBuffered=function(p){var l=i(p),h=this.fragments[l];h&&(h.backtrack=h.loaded=null,h.buffered=!0)},v.getBufferedTimes=function(p,l,h,f){for(var o={time:[],partial:h},u=l?l.start:p.start,s=l?l.end:p.end,a=p.minEndPTS||s,C=p.maxStartPTS||u,_=0;_<f.length;_++){var T=f.start(_)-this.bufferPadding,R=f.end(_)+this.bufferPadding;if(C>=T&&a<=R){o.time.push({startPTS:Math.max(u,f.start(_)),endPTS:Math.min(s,f.end(_))});break}else if(u<R&&s>T)o.partial=!0,o.time.push({startPTS:Math.max(u,f.start(_)),endPTS:Math.min(s,f.end(_))});else if(s<=T)break}return o},v.getPartialFragment=function(p){var l=null,h,f,o,u=0,s=this.bufferPadding,a=this.fragments;return Object.keys(a).forEach(function(C){var _=a[C];if(!_)return;H(_)&&(f=_.body.start-s,o=_.body.end+s,p>=f&&p<=o&&(h=Math.min(p-f,o-p),u<=h&&(l=_.body,u=h)))}),l},v.getState=function(p){var l=i(p),h=this.fragments[l];return h?h.buffered?H(h)?P.PARTIAL:P.OK:h.backtrack?P.BACKTRACKED:P.APPENDING:P.NOT_LOADED},v.backtrack=function(p,l){var h=i(p),f=this.fragments[h];if(!f||f.backtrack)return null;var o=f.backtrack=l||f.loaded;return f.loaded=null,o},v.getBacktrackData=function(p){var l=i(p),h=this.fragments[l];if(h){var f,o=h.backtrack;if(o!=null&&(f=o.payload)!==null&&f!==void 0&&f.byteLength)return o;this.removeFragment(p)}return null},v.isTimeBuffered=function(p,l,h){for(var f,o,u=0;u<h.length;u++){if(f=h.start(u)-this.bufferPadding,o=h.end(u)+this.bufferPadding,p>=f&&l<=o)return!0;if(l<=f)return!1}return!1},v.onFragLoaded=function(p,l){var h=l.frag,f=l.part;if(h.sn==="initSegment"||h.bitrateTest||f)return;var o=i(h);this.fragments[o]={body:h,loaded:l,backtrack:null,buffered:!1,range:Object.create(null)}},v.onBufferAppended=function(p,l){var h=this,f=l.frag,o=l.part,u=l.timeRanges;if(f.type===B.PlaylistLevelType.MAIN)if(this.activeFragment=f,o){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(o)}else this.activeParts=null;this.timeRanges=u,Object.keys(u).forEach(function(a){var C=u[a];if(h.detectEvictedFragments(a,C),!o)for(var _=0;_<C.length;_++)f.appendedPTS=Math.max(C.end(_),f.appendedPTS||0)})},v.onFragBuffered=function(p,l){this.detectPartialFragments(l)},v.hasFragment=function(p){var l=i(p);return!!this.fragments[l]},v.removeFragmentsInRange=function(p,l,h){var f=this;Object.keys(this.fragments).forEach(function(o){var u=f.fragments[o];if(!u)return;if(u.buffered){var s=u.body;s.type===h&&s.start<l&&s.end>p&&f.removeFragment(s)}})},v.removeFragment=function(p){var l=i(p);p.stats.loaded=0,p.clearElementaryStreamInfo(),delete this.fragments[l]},v.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},L}();function H(L){var v,m;return L.buffered&&(((v=L.range.video)===null||v===void 0?void 0:v.partial)||((m=L.range.audio)===null||m===void 0?void 0:m.partial))}function i(L){return L.type+"_"+L.level+"_"+L.urlId+"_"+L.sn}},"./src/controller/gap-controller.ts":function(oe,$,M){"use strict";M.r($),M.d($,"STALL_MINIMUM_DURATION_MS",function(){return H}),M.d($,"MAX_START_GAP_JUMP",function(){return i}),M.d($,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return L}),M.d($,"SKIP_BUFFER_RANGE_START",function(){return v}),M.d($,"default",function(){return m});var X=M("./src/utils/buffer-helper.ts"),B=M("./src/errors.ts"),P=M("./src/events.ts"),W=M("./src/utils/logger.ts"),H=250,i=2,L=.1,v=.05,m=function(){function p(h,f,o,u){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=h,this.media=f,this.fragmentTracker=o,this.hls=u}var l=p.prototype;return l.destroy=function(){this.hls=this.fragmentTracker=this.media=null},l.poll=function(f){var o=this.config,u=this.media,s=this.stalled,a=u.currentTime,C=u.seeking,_=this.seeking&&!C,T=!this.seeking&&C;if(this.seeking=C,a!==f){if(this.moved=!0,s!==null){if(this.stallReported){var R=self.performance.now()-s;W.logger.warn("playback not stuck anymore @"+a+", after "+Math.round(R)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((T||_)&&(this.stalled=null),u.paused||u.ended||u.playbackRate===0||!X.BufferHelper.getBuffered(u).length)return;var O=X.BufferHelper.bufferInfo(u,a,0),S=O.len>0,w=O.nextStart||0;if(!S&&!w)return;if(C){var E=O.len>i,c=!w||w-a>i&&!this.fragmentTracker.getPartialFragment(a);if(E||c)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var x,y=Math.max(w,O.start||0)-a,g=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,F=g==null||((x=g.details)===null||x===void 0)?void 0:x.live,U=F?g.details.targetduration*2:i;if(y>0&&y<=U){this._trySkipBufferHole(null);return}}var A=self.performance.now();if(s===null){this.stalled=A;return}var j=A-s;!C&&j>=H&&this._reportStall(O.len);var N=X.BufferHelper.bufferInfo(u,a,o.maxBufferHole);this._tryFixBufferStall(N,j)},l._tryFixBufferStall=function(f,o){var u=this.config,s=this.fragmentTracker,a=this.media,C=a.currentTime,_=s.getPartialFragment(C);if(_){var T=this._trySkipBufferHole(_);if(T)return}f.len>u.maxBufferHole&&o>u.highBufferWatchdogPeriod*1e3&&(W.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},l._reportStall=function(f){var o=this.hls,u=this.media,s=this.stallReported;s||(this.stallReported=!0,W.logger.warn("Playback stalling at @"+u.currentTime+" due to low buffer (buffer="+f+")"),o.trigger(P.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:f}))},l._trySkipBufferHole=function(f){for(var o=this.config,u=this.hls,s=this.media,a=s.currentTime,C=0,_=X.BufferHelper.getBuffered(s),T=0;T<_.length;T++){var R=_.start(T);if(a+o.maxBufferHole>=C&&a<R){var O=Math.max(R+v,s.currentTime+L);return W.logger.warn("skipping hole, adjusting currentTime from "+a+" to "+O),this.moved=!0,this.stalled=null,s.currentTime=O,f&&u.trigger(P.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+a+" to "+O,frag:f}),O}C=_.end(T)}return 0},l._tryNudgeBuffer=function(){var f=this.config,o=this.hls,u=this.media,s=u.currentTime,a=(this.nudgeRetry||0)+1;if(this.nudgeRetry=a,a<f.nudgeMaxRetry){var C=s+a*f.nudgeOffset;W.logger.warn("Nudging 'currentTime' from "+s+" to "+C),u.currentTime=C,o.trigger(P.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else W.logger.error("Playhead still not moving while enough data buffered @"+s+" after "+f.nudgeMaxRetry+" nudges"),o.trigger(P.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},p}()},"./src/controller/id3-track-controller.ts":function(oe,$,M){"use strict";M.r($);var X=M("./src/events.ts"),B=M("./src/utils/texttrack-utils.ts"),P=M("./src/demux/id3.ts"),W=.25,H=function(){function i(v){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=v,this._registerListeners()}var L=i.prototype;return L.destroy=function(){this._unregisterListeners()},L._registerListeners=function(){var m=this.hls;m.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(X.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.on(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},L._unregisterListeners=function(){var m=this.hls;m.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(X.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.off(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},L.onMediaAttached=function(m,p){this.media=p.media},L.onMediaDetaching=function(){if(!this.id3Track)return;Object(B.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},L.getID3Track=function(m){if(!this.media)return;for(var p=0;p<m.length;p++){var l=m[p];if(l.kind==="metadata"&&l.label==="id3")return Object(B.sendAddTrackEvent)(l,this.media),l}return this.media.addTextTrack("metadata","id3")},L.onFragParsingMetadata=function(m,p){if(!this.media)return;var l=p.frag,h=p.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var f=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,o=0;o<h.length;o++){var u=P.getID3Frames(h[o].data);if(u){var s=h[o].pts,a=o<h.length-1?h[o+1].pts:l.end,C=a-s;C<=0&&(a=s+W);for(var _=0;_<u.length;_++){var T=u[_];if(!P.isTimeStampFrame(T)){var R=new f(s,a,"");R.value=T,this.id3Track.addCue(R)}}}}},L.onBufferFlushing=function(m,p){var l=p.startOffset,h=p.endOffset,f=p.type;if(!f||f==="audio"){var o=this.id3Track;o&&Object(B.removeCuesInRange)(o,l,h)}},i}();$.default=H},"./src/controller/latency-controller.ts":function(oe,$,M){"use strict";M.r($),M.d($,"default",function(){return i});var X=M("./src/errors.ts"),B=M("./src/events.ts"),P=M("./src/utils/logger.ts");function W(L,v){for(var m=0;m<v.length;m++){var p=v[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(L,p.key,p)}}function H(L,v,m){return v&&W(L.prototype,v),m&&W(L,m),L}var i=function(){function L(m){var p=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return p.timeupdate()},this.hls=m,this.config=m.config,this.registerListeners()}var v=L.prototype;return v.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},v.registerListeners=function(){this.hls.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(B.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(B.Events.ERROR,this.onError,this)},v.unregisterListeners=function(){this.hls.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(B.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(B.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(B.Events.ERROR,this.onError)},v.onMediaAttached=function(p,l){this.media=l.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},v.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},v.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},v.onLevelUpdated=function(p,l){var h=l.details;this.levelDetails=h,h.advanced&&this.timeupdate(),!h.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},v.onError=function(p,l){if(l.details!==X.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,P.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},v.timeupdate=function(){var p=this.media,l=this.levelDetails;if(!p||!l)return;this.currentTime=p.currentTime;var h=this.computeLatency();if(h===null)return;this._latency=h;var f=this.config,o=f.lowLatencyMode,u=f.maxLiveSyncPlaybackRate;if(!o||u===1)return;var s=this.targetLatency;if(s===null)return;var a=h-s,C=Math.min(this.maxLatency,s+l.targetduration),_=a<C;if(l.live&&_&&a>.05&&this.forwardBufferLength>1){var T=Math.min(2,Math.max(1,u)),R=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;p.playbackRate=Math.min(T,Math.max(1,R))}else p.playbackRate!==1&&p.playbackRate!==0&&(p.playbackRate=1)},v.estimateLiveEdge=function(){var p=this.levelDetails;return p===null?null:p.edge+p.age},v.computeLatency=function(){var p=this.estimateLiveEdge();return p===null?null:p-this.currentTime},H(L,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var p=this.config,l=this.levelDetails;return p.liveMaxLatencyDuration!==void 0?p.liveMaxLatencyDuration:l?p.liveMaxLatencyDurationCount*l.targetduration:0}},{key:"targetLatency",get:function(){var p=this.levelDetails;if(p===null)return null;var l=p.holdBack,h=p.partHoldBack,f=p.targetduration,o=this.config,u=o.liveSyncDuration,s=o.liveSyncDurationCount,a=o.lowLatencyMode,C=this.hls.userConfig,_=a&&h||l;(C.liveSyncDuration||C.liveSyncDurationCount||_===0)&&(_=u!==void 0?u:s*f);var T=f,R=1;return _+Math.min(this.stallCount*R,T)}},{key:"liveSyncPosition",get:function(){var p=this.estimateLiveEdge(),l=this.targetLatency,h=this.levelDetails;if(p===null||l===null||h===null)return null;var f=h.edge,o=p-l-this.edgeStalled,u=f-h.totalduration,s=f-(this.config.lowLatencyMode&&h.partTarget||h.targetduration);return Math.min(Math.max(u,o),s)}},{key:"drift",get:function(){var p=this.levelDetails;return p===null?1:p.drift}},{key:"edgeStalled",get:function(){var p=this.levelDetails;if(p===null)return 0;var l=(this.config.lowLatencyMode&&p.partTarget||p.targetduration)*3;return Math.max(p.age-l,0)}},{key:"forwardBufferLength",get:function(){var p=this.media,l=this.levelDetails;if(!p||!l)return 0;var h=p.buffered.length;return h?p.buffered.end(h-1):l.edge-this.currentTime}}]),L}()},"./src/controller/level-controller.ts":function(oe,$,M){"use strict";M.r($),M.d($,"default",function(){return o});var X=M("./src/types/level.ts"),B=M("./src/events.ts"),P=M("./src/errors.ts"),W=M("./src/utils/codecs.ts"),H=M("./src/controller/level-helper.ts"),i=M("./src/controller/base-playlist-controller.ts"),L=M("./src/types/loader.ts");function v(){return v=Object.assign||function(u){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var C in a)Object.prototype.hasOwnProperty.call(a,C)&&(u[C]=a[C])}return u},v.apply(this,arguments)}function m(u,s){for(var a=0;a<s.length;a++){var C=s[a];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(u,C.key,C)}}function p(u,s,a){return s&&m(u.prototype,s),a&&m(u,a),u}function l(u,s){u.prototype=Object.create(s.prototype),u.prototype.constructor=u,h(u,s)}function h(u,s){return h=Object.setPrototypeOf||function(C,_){return C.__proto__=_,C},h(u,s)}var f=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),o=function(u){l(s,u);function s(C){var _;return _=u.call(this,C,"[level-controller]")||this,_._levels=[],_._firstLevel=-1,_._startLevel=void 0,_.currentLevelIndex=-1,_.manualLevelIndex=-1,_.onParsedComplete=void 0,_._registerListeners(),_}var a=s.prototype;return a._registerListeners=function(){var _=this.hls;_.on(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),_.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.on(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.on(B.Events.FRAG_LOADED,this.onFragLoaded,this),_.on(B.Events.ERROR,this.onError,this)},a._unregisterListeners=function(){var _=this.hls;_.off(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),_.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.off(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.off(B.Events.FRAG_LOADED,this.onFragLoaded,this),_.off(B.Events.ERROR,this.onError,this)},a.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,u.prototype.destroy.call(this)},a.startLoad=function(){var _=this._levels;_.forEach(function(T){T.loadError=0}),u.prototype.startLoad.call(this)},a.onManifestLoaded=function(_,T){var R=[],O=[],S=[],w,E={},c,x=!1,y=!1,g=!1;if(T.levels.forEach(function(j){var N=j.attrs;x=x||!!(j.width&&j.height),y=y||!!j.videoCodec,g=g||!!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;c=E[b],c?c.url.push(j.url):(c=new X.Level(j),E[b]=c,R.push(c)),N&&(N.AUDIO&&Object(H.addGroupId)(c,"audio",N.AUDIO),N.SUBTITLES&&Object(H.addGroupId)(c,"text",N.SUBTITLES))}),(x||y)&&g&&(R=R.filter(function(j){var N=j.videoCodec,b=j.width,Y=j.height;return!!N||!!(b&&Y)})),R=R.filter(function(j){var N=j.audioCodec,b=j.videoCodec;return(!N||Object(W.isCodecSupportedInMp4)(N,"audio"))&&(!b||Object(W.isCodecSupportedInMp4)(b,"video"))}),T.audioTracks&&(O=T.audioTracks.filter(function(j){return!j.audioCodec||Object(W.isCodecSupportedInMp4)(j.audioCodec,"audio")}),Object(H.assignTrackIdsByGroup)(O)),T.subtitles&&(S=T.subtitles,Object(H.assignTrackIdsByGroup)(S)),R.length>0){w=R[0].bitrate,R.sort(function(j,N){return j.bitrate-N.bitrate}),this._levels=R;for(var F=0;F<R.length;F++)if(R[F].bitrate===w){this._firstLevel=F,this.log("manifest loaded, "+R.length+" level(s) found, first bitrate: "+w);break}var U=g&&!y,A={levels:R,audioTracks:O,subtitleTracks:S,firstLevel:this._firstLevel,stats:T.stats,audio:g,video:y,altAudio:!U&&O.some(function(j){return!!j.url})};this.hls.trigger(B.Events.MANIFEST_PARSED,A),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(B.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:T.url,reason:"no level with compatible codecs found in manifest"})},a.onError=function(_,T){if(u.prototype.onError.call(this,_,T),T.fatal)return;var R=T.context,O=this._levels[this.currentLevelIndex];if(R&&(R.type===L.PlaylistContextType.AUDIO_TRACK&&O.audioGroupIds&&R.groupId===O.audioGroupIds[O.urlId]||R.type===L.PlaylistContextType.SUBTITLE_TRACK&&O.textGroupIds&&R.groupId===O.textGroupIds[O.urlId])){this.redundantFailover(this.currentLevelIndex);return}var S=!1,w=!0,E;switch(T.details){case P.ErrorDetails.FRAG_LOAD_ERROR:case P.ErrorDetails.FRAG_LOAD_TIMEOUT:case P.ErrorDetails.KEY_LOAD_ERROR:case P.ErrorDetails.KEY_LOAD_TIMEOUT:if(T.frag){var c=this._levels[T.frag.level];c?(c.fragmentError++,c.fragmentError>this.hls.config.fragLoadingMaxRetry&&(E=T.frag.level)):E=T.frag.level}break;case P.ErrorDetails.LEVEL_LOAD_ERROR:case P.ErrorDetails.LEVEL_LOAD_TIMEOUT:R&&(R.deliveryDirectives&&(w=!1),E=R.level),S=!0;break;case P.ErrorDetails.REMUX_ALLOC_ERROR:E=T.level,S=!0;break}E!==void 0&&this.recoverLevel(T,E,S,w)},a.recoverLevel=function(_,T,R,O){var S=_.details,w=this._levels[T];if(w.loadError++,R){var E=this.retryLoadingOrFail(_);if(E)_.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(O){var c=w.url.length;if(c>1&&w.loadError<c)_.levelRetry=!0,this.redundantFailover(T);else if(this.manualLevelIndex===-1){var x=T===0?this._levels.length-1:T-1;this.currentLevelIndex!==x&&this._levels[x].loadError===0&&(this.warn(S+": switch to "+x),_.levelRetry=!0,this.hls.nextAutoLevel=x)}}},a.redundantFailover=function(_){var T=this._levels[_],R=T.url.length;if(R>1){var O=(T.urlId+1)%R;this.warn("Switching to redundant URL-id "+O),this._levels.forEach(function(S){S.urlId=O}),this.level=_}},a.onFragLoaded=function(_,T){var R=T.frag;if(R!==void 0&&R.type===L.PlaylistLevelType.MAIN){var O=this._levels[R.level];O!==void 0&&(O.fragmentError=0,O.loadError=0)}},a.onLevelLoaded=function(_,T){var R,O=T.level,S=T.details,w=this._levels[O];if(!w){var E;this.warn("Invalid level index "+O),(E=T.deliveryDirectives)!==null&&E!==void 0&&E.skip&&(S.deltaUpdateFailed=!0);return}O===this.currentLevelIndex?(w.fragmentError===0&&(w.loadError=0,this.retryCount=0),this.playlistLoaded(O,T,w.details)):(R=T.deliveryDirectives)!==null&&R!==void 0&&R.skip&&(S.deltaUpdateFailed=!0)},a.onAudioTrackSwitched=function(_,T){var R=this.hls.levels[this.currentLevelIndex];if(!R)return;if(R.audioGroupIds){for(var O=-1,S=this.hls.audioTracks[T.id].groupId,w=0;w<R.audioGroupIds.length;w++)if(R.audioGroupIds[w]===S){O=w;break}O!==R.urlId&&(R.urlId=O,this.startLoad())}},a.loadPlaylist=function(_){var T=this.currentLevelIndex,R=this._levels[T];if(this.canLoad&&R&&R.url.length>0){var O=R.urlId,S=R.url[O];if(_)try{S=_.addDirectives(S)}catch(w){this.warn("Could not construct new URL with HLS Delivery Directives: "+w)}this.log("Attempt loading level index "+T+(_?" at sn "+_.msn+" part "+_.part:"")+" with URL-id "+O+" "+S),this.clearTimer(),this.hls.trigger(B.Events.LEVEL_LOADING,{url:S,level:T,id:O,deliveryDirectives:_||null})}},a.removeLevel=function(_,T){var R=function(w,E){return E!==T},O=this._levels.filter(function(S,w){return w!==_?!0:S.url.length>1&&T!==void 0?(S.url=S.url.filter(R),S.audioGroupIds&&(S.audioGroupIds=S.audioGroupIds.filter(R)),S.textGroupIds&&(S.textGroupIds=S.textGroupIds.filter(R)),S.urlId=0,!0):!1}).map(function(S,w){var E=S.details;return E!=null&&E.fragments&&E.fragments.forEach(function(c){c.level=w}),S});this._levels=O,this.hls.trigger(B.Events.LEVELS_UPDATED,{levels:O})},p(s,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(_){var T,R=this._levels;if(R.length===0)return;if(this.currentLevelIndex===_&&(T=R[_])!==null&&T!==void 0&&T.details)return;if(_<0||_>=R.length){var O=_<0;if(this.hls.trigger(B.Events.ERROR,{type:P.ErrorTypes.OTHER_ERROR,details:P.ErrorDetails.LEVEL_SWITCH_ERROR,level:_,fatal:O,reason:"invalid level idx"}),O)return;_=Math.min(_,R.length-1)}this.clearTimer();var S=this.currentLevelIndex,w=R[S],E=R[_];this.log("switching to level "+_+" from "+S),this.currentLevelIndex=_;var c=v({},E,{level:_,maxBitrate:E.maxBitrate,uri:E.uri,urlId:E.urlId});delete c._urlId,this.hls.trigger(B.Events.LEVEL_SWITCHING,c);var x=E.details;if(!x||x.live){var y=this.switchParams(E.uri,w==null?void 0:w.details);this.loadPlaylist(y)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(_){this.manualLevelIndex=_,this._startLevel===void 0&&(this._startLevel=_),_!==-1&&(this.level=_)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(_){this._firstLevel=_}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var _=this.hls.config.startLevel;return _!==void 0?_:this._firstLevel}else return this._startLevel},set:function(_){this._startLevel=_}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(_){this.level=_,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=_)}}]),s}(i.default)},"./src/controller/level-helper.ts":function(oe,$,M){"use strict";M.r($),M.d($,"addGroupId",function(){return P}),M.d($,"assignTrackIdsByGroup",function(){return W}),M.d($,"updatePTS",function(){return H}),M.d($,"updateFragPTSDTS",function(){return L}),M.d($,"mergeDetails",function(){return v}),M.d($,"mapPartIntersection",function(){return m}),M.d($,"mapFragmentIntersection",function(){return p}),M.d($,"adjustSliding",function(){return l}),M.d($,"addSliding",function(){return h}),M.d($,"computeReloadInterval",function(){return f}),M.d($,"getFragmentWithSN",function(){return o}),M.d($,"getPartWith",function(){return u});var X=M("./src/polyfills/number.ts"),B=M("./src/utils/logger.ts");function P(s,a,C){switch(a){case"audio":s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds.push(C);break;case"text":s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds.push(C);break}}function W(s){var a={};s.forEach(function(C){var _=C.groupId||"";C.id=a[_]=a[_]||0,a[_]++})}function H(s,a,C){var _=s[a],T=s[C];i(_,T)}function i(s,a){var C=a.startPTS;if(Object(X.isFiniteNumber)(C)){var _=0,T;a.sn>s.sn?(_=C-s.start,T=s):(_=s.start-C,T=a),T.duration!==_&&(T.duration=_)}else if(a.sn>s.sn){var R=s.cc===a.cc;R&&s.minEndPTS?a.start=s.start+(s.minEndPTS-s.start):a.start=s.start+s.duration}else a.start=Math.max(s.start-a.duration,0)}function L(s,a,C,_,T,R){var O=_-C;O<=0&&(B.logger.warn("Fragment should have a positive duration",a),_=C+a.duration,R=T+a.duration);var S=C,w=_,E=a.startPTS,c=a.endPTS;if(Object(X.isFiniteNumber)(E)){var x=Math.abs(E-C);Object(X.isFiniteNumber)(a.deltaPTS)?a.deltaPTS=Math.max(x,a.deltaPTS):a.deltaPTS=x,S=Math.max(C,E),C=Math.min(C,E),T=Math.min(T,a.startDTS),w=Math.min(_,c),_=Math.max(_,c),R=Math.max(R,a.endDTS)}a.duration=_-C;var y=C-a.start;a.appendedPTS=_,a.start=a.startPTS=C,a.maxStartPTS=S,a.startDTS=T,a.endPTS=_,a.minEndPTS=w,a.endDTS=R;var g=a.sn;if(!s||g<s.startSN||g>s.endSN)return 0;var F,U=g-s.startSN,A=s.fragments;for(A[U]=a,F=U;F>0;F--)i(A[F],A[F-1]);for(F=U;F<A.length-1;F++)i(A[F],A[F+1]);return s.fragmentHint&&i(A[A.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,y}function v(s,a){for(var C=null,_=s.fragments,T=_.length-1;T>=0;T--){var R=_[T].initSegment;if(R){C=R;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var O=0,S;if(p(s,a,function(F,U){F.relurl&&(O=F.cc-U.cc),Object(X.isFiniteNumber)(F.startPTS)&&Object(X.isFiniteNumber)(F.endPTS)&&(U.start=U.startPTS=F.startPTS,U.startDTS=F.startDTS,U.appendedPTS=F.appendedPTS,U.maxStartPTS=F.maxStartPTS,U.endPTS=F.endPTS,U.endDTS=F.endDTS,U.minEndPTS=F.minEndPTS,U.duration=F.endPTS-F.startPTS,U.duration&&(S=U),a.PTSKnown=a.alignedSliding=!0),U.elementaryStreams=F.elementaryStreams,U.loader=F.loader,U.stats=F.stats,U.urlId=F.urlId,F.initSegment&&(U.initSegment=F.initSegment,C=F.initSegment)}),C){var w=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;w.forEach(function(F){var U;(!F.initSegment||F.initSegment.relurl===((U=C)===null||U===void 0?void 0:U.relurl))&&(F.initSegment=C)})}if(a.skippedSegments&&(a.deltaUpdateFailed=a.fragments.some(function(F){return!F}),a.deltaUpdateFailed)){B.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var E=a.skippedSegments;E--;)a.fragments.shift();a.startSN=a.fragments[0].sn,a.startCC=a.fragments[0].cc}var c=a.fragments;if(O){B.logger.warn("discontinuity sliding from playlist, take drift into account");for(var x=0;x<c.length;x++)c[x].cc+=O}a.skippedSegments&&(a.startCC=a.fragments[0].cc),m(s.partList,a.partList,function(F,U){U.elementaryStreams=F.elementaryStreams,U.stats=F.stats}),S?L(a,S,S.startPTS,S.endPTS,S.startDTS,S.endDTS):l(s,a),c.length&&(a.totalduration=a.edge-c[0].start),a.driftStartTime=s.driftStartTime,a.driftStart=s.driftStart;var y=a.advancedDateTime;if(a.advanced&&y){var g=a.edge;a.driftStart||(a.driftStartTime=y,a.driftStart=g),a.driftEndTime=y,a.driftEnd=g}else a.driftEndTime=s.driftEndTime,a.driftEnd=s.driftEnd,a.advancedDateTime=s.advancedDateTime}function m(s,a,C){if(s&&a)for(var _=0,T=0,R=s.length;T<=R;T++){var O=s[T],S=a[T+_];O&&S&&O.index===S.index&&O.fragment.sn===S.fragment.sn?C(O,S):_--}}function p(s,a,C){for(var _=a.skippedSegments,T=Math.max(s.startSN,a.startSN)-a.startSN,R=(s.fragmentHint?1:0)+(_?a.endSN:Math.min(s.endSN,a.endSN))-a.startSN,O=a.startSN-s.startSN,S=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments,w=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,E=T;E<=R;E++){var c=w[O+E],x=S[E];_&&!x&&E<_&&(x=a.fragments[E]=c),c&&x&&C(c,x)}}function l(s,a){var C=a.startSN+a.skippedSegments-s.startSN,_=s.fragments;if(C<0||C>=_.length)return;h(a,_[C].start)}function h(s,a){if(a){for(var C=s.fragments,_=s.skippedSegments;_<C.length;_++)C[_].start+=a;s.fragmentHint&&(s.fragmentHint.start+=a)}}function f(s,a){var C=1e3*s.levelTargetDuration,_=C/2,T=s.age,R=T>0&&T<C*3,O=a.loading.end-a.loading.start,S,w=s.availabilityDelay;if(s.updated===!1)if(R){var E=333*s.misses;S=Math.max(Math.min(_,O*2),E),s.availabilityDelay=(s.availabilityDelay||0)+S}else S=_;else R?(w=Math.min(w||C/2,T),s.availabilityDelay=w,S=w+C-T):S=C-O;return Math.round(S)}function o(s,a,C){if(!s||!s.details)return null;var _=s.details,T=_.fragments[a-_.startSN];return T||(T=_.fragmentHint,T&&T.sn===a?T:a<_.startSN&&C&&C.sn===a?C:null)}function u(s,a,C){if(!s||!s.details)return null;var _=s.details.partList;if(_)for(var T=_.length;T--;){var R=_[T];if(R.index===C&&R.fragment.sn===a)return R}return null}},"./src/controller/stream-controller.ts":function(oe,$,M){"use strict";M.r($),M.d($,"default",function(){return _});var X=M("./src/polyfills/number.ts"),B=M("./src/controller/base-stream-controller.ts"),P=M("./src/is-supported.ts"),W=M("./src/events.ts"),H=M("./src/utils/buffer-helper.ts"),i=M("./src/controller/fragment-tracker.ts"),L=M("./src/types/loader.ts"),v=M("./src/loader/fragment.ts"),m=M("./src/demux/transmuxer-interface.ts"),p=M("./src/types/transmuxer.ts"),l=M("./src/controller/gap-controller.ts"),h=M("./src/errors.ts"),f=M("./src/utils/logger.ts");function o(T,R){for(var O=0;O<R.length;O++){var S=R[O];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(T,S.key,S)}}function u(T,R,O){return R&&o(T.prototype,R),O&&o(T,O),T}function s(T,R){T.prototype=Object.create(R.prototype),T.prototype.constructor=T,a(T,R)}function a(T,R){return a=Object.setPrototypeOf||function(S,w){return S.__proto__=w,S},a(T,R)}var C=100,_=function(T){s(R,T);function R(S,w){var E;return E=T.call(this,S,w,"[stream-controller]")||this,E.audioCodecSwap=!1,E.gapController=null,E.level=-1,E._forceStartLoad=!1,E.altAudio=!1,E.audioOnly=!1,E.fragPlaying=null,E.onvplaying=null,E.onvseeked=null,E.fragLastKbps=0,E.stalled=!1,E.couldBacktrack=!1,E.audioCodecSwitch=!1,E.videoBuffer=null,E._registerListeners(),E}var O=R.prototype;return O._registerListeners=function(){var w=this.hls;w.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),w.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),w.on(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(W.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),w.on(W.Events.ERROR,this.onError,this),w.on(W.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),w.on(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.on(W.Events.BUFFER_CREATED,this.onBufferCreated,this),w.on(W.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),w.on(W.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),w.on(W.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O._unregisterListeners=function(){var w=this.hls;w.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),w.off(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(W.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),w.off(W.Events.ERROR,this.onError,this),w.off(W.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),w.off(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.off(W.Events.BUFFER_CREATED,this.onBufferCreated,this),w.off(W.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),w.off(W.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),w.off(W.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},O.startLoad=function(w){if(this.levels){var E=this.lastCurrentTime,c=this.hls;if(this.stopLoad(),this.setInterval(C),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var x=c.startLevel;x===-1&&(c.config.testBandwidth?(x=0,this.bitrateTest=!0):x=c.nextAutoLevel),this.level=c.nextLoadLevel=x,this.loadedmetadata=!1}E>0&&w===-1&&(this.log("Override startPosition with lastCurrentTime @"+E.toFixed(3)),w=E),this.state=B.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=w,this.tick()}else this._forceStartLoad=!0,this.state=B.State.STOPPED},O.stopLoad=function(){this._forceStartLoad=!1,T.prototype.stopLoad.call(this)},O.doTick=function(){switch(this.state){case B.State.IDLE:this.doTickIdle();break;case B.State.WAITING_LEVEL:{var w,E=this.levels,c=this.level,x=E==null||((w=E[c])===null||w===void 0)?void 0:w.details;if(x&&(!x.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(x))break;this.state=B.State.IDLE;break}break}case B.State.FRAG_LOADING_WAITING_RETRY:{var y,g=self.performance.now(),F=this.retryDate;(!F||g>=F||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=B.State.IDLE)}break;default:break}this.onTickEnd()},O.onTickEnd=function(){T.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},O.doTickIdle=function(){var w,E,c=this.hls,x=this.levelLastLoaded,y=this.levels,g=this.media,F=c.config,U=c.nextLoadLevel;if(x===null||!g&&(this.startFragRequested||!F.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!y||!y[U])return;var A=y[U];this.level=c.nextLoadLevel=U;var j=A.details;if(!j||this.state===B.State.WAITING_LEVEL||j.live&&this.levelLastLoaded!==U){this.state=B.State.WAITING_LEVEL;return}var N=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:g,L.PlaylistLevelType.MAIN);if(N===null)return;var b=N.len,Y=this.getMaxBufferLength(A.maxBitrate);if(b>=Y)return;if(this._streamEnded(N,j)){var re={};this.altAudio&&(re.type="video"),this.hls.trigger(W.Events.BUFFER_EOS,re),this.state=B.State.ENDED;return}var fe=N.end,ve=this.getNextFragment(fe,j);if(this.couldBacktrack&&!this.fragPrevious&&ve&&ve.sn!=="initSegment"){var ke=ve.sn-j.startSN;ke>1&&(ve=j.fragments[ke-1],this.fragmentTracker.removeFragment(ve))}if(ve&&this.fragmentTracker.getState(ve)===i.FragmentState.OK&&this.nextLoadPosition>fe){var Se=this.audioOnly&&!this.altAudio?v.ElementaryStreamTypes.AUDIO:v.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(g,Se,L.PlaylistLevelType.MAIN),ve=this.getNextFragment(this.nextLoadPosition,j)}if(!ve)return;ve.initSegment&&!ve.initSegment.data&&!this.bitrateTest&&(ve=ve.initSegment),((w=ve.decryptdata)===null||w===void 0?void 0:w.keyFormat)==="identity"&&!((E=ve.decryptdata)!==null&&E!==void 0&&E.key)?this.loadKey(ve,j):this.loadFragment(ve,j,fe)},O.loadFragment=function(w,E,c){var x,y=this.fragmentTracker.getState(w);if(this.fragCurrent=w,y===i.FragmentState.BACKTRACKED){var g=this.fragmentTracker.getBacktrackData(w);if(g){this._handleFragmentLoadProgress(g),this._handleFragmentLoadComplete(g);return}else y=i.FragmentState.NOT_LOADED}y===i.FragmentState.NOT_LOADED||y===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,T.prototype.loadFragment.call(this,w,E,c)):y===i.FragmentState.APPENDING?this.reduceMaxBufferLength(w.duration)&&this.fragmentTracker.removeFragment(w):((x=this.media)===null||x===void 0?void 0:x.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},O.getAppendedFrag=function(w){var E=this.fragmentTracker.getAppendedFrag(w,L.PlaylistLevelType.MAIN);return E&&"fragment"in E?E.fragment:E},O.getBufferedFrag=function(w){return this.fragmentTracker.getBufferedFrag(w,L.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,E=this.media;if(E!=null&&E.readyState){var c,x=this.getAppendedFrag(E.currentTime);if(x&&x.start>1&&this.flushMainBuffer(0,x.start-1),!E.paused&&w){var y=this.hls.nextLoadLevel,g=w[y],F=this.fragLastKbps;F&&this.fragCurrent?c=this.fragCurrent.duration*g.maxBitrate/(1e3*F)+1:c=0}else c=0;var U=this.getBufferedFrag(E.currentTime+c);if(U){var A=this.followingBufferedFrag(U);if(A){this.abortCurrentFrag();var j=A.maxStartPTS?A.maxStartPTS:A.start,N=A.duration,b=Math.max(U.end,j+Math.min(Math.max(N-this.config.maxFragLookUpTolerance,N*.5),N*.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===B.State.KEY_LOADING&&(this.state=B.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},O.flushMainBuffer=function(w,E){T.prototype.flushMainBuffer.call(this,w,E,this.altAudio?"video":null)},O.onMediaAttached=function(w,E){T.prototype.onMediaAttached.call(this,w,E);var c=E.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),c.addEventListener("playing",this.onvplaying),c.addEventListener("seeked",this.onvseeked),this.gapController=new l.default(this.config,c,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),T.prototype.onMediaDetaching.call(this)},O.onMediaPlaying=function(){this.tick()},O.onMediaSeeked=function(){var w=this.media,E=w?w.currentTime:null;Object(X.isFiniteNumber)(E)&&this.log("Media seeked to "+E.toFixed(3)),this.tick()},O.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(W.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},O.onManifestParsed=function(w,E){var c=!1,x=!1,y;E.levels.forEach(function(g){y=g.audioCodec,y&&(y.indexOf("mp4a.40.2")!==-1&&(c=!0),y.indexOf("mp4a.40.5")!==-1&&(x=!0))}),this.audioCodecSwitch=c&&x&&!Object(P.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=E.levels,this.startFragRequested=!1},O.onLevelLoading=function(w,E){var c=this.levels;if(!c||this.state!==B.State.IDLE)return;var x=c[E.level];(!x.details||x.details.live&&this.levelLastLoaded!==E.level||this.waitForCdnTuneIn(x.details))&&(this.state=B.State.WAITING_LEVEL)},O.onLevelLoaded=function(w,E){var c,x=this.levels,y=E.level,g=E.details,F=g.totalduration;if(!x){this.warn("Levels were reset while loading level "+y);return}this.log("Level "+y+" loaded ["+g.startSN+","+g.endSN+"], cc ["+g.startCC+", "+g.endCC+"] duration:"+F);var U=this.fragCurrent;U&&(this.state===B.State.FRAG_LOADING||this.state===B.State.FRAG_LOADING_WAITING_RETRY)&&(U.level!==E.level&&U.loader&&(this.state=B.State.IDLE,U.loader.abort()));var A=x[y],j=0;if(g.live||(c=A.details)!==null&&c!==void 0&&c.live){if(g.fragments[0]||(g.deltaUpdateFailed=!0),g.deltaUpdateFailed)return;j=this.alignPlaylists(g,A.details)}if(A.details=g,this.levelLastLoaded=y,this.hls.trigger(W.Events.LEVEL_UPDATED,{details:g,level:y}),this.state===B.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(g))return;this.state=B.State.IDLE}this.startFragRequested?g.live&&this.synchronizeToLiveEdge(g):this.setStartPosition(g,j),this.tick()},O._handleFragmentLoadProgress=function(w){var E,c=w.frag,x=w.part,y=w.payload,g=this.levels;if(!g){this.warn("Levels were reset while fragment load was in progress. Fragment "+c.sn+" of level "+c.level+" will not be buffered");return}var F=g[c.level],U=F.details;if(!U){this.warn("Dropping fragment "+c.sn+" of level "+c.level+" after level details were reset");return}var A=F.videoCodec,j=U.PTSKnown||!U.live,N=(E=c.initSegment)===null||E===void 0?void 0:E.data,b=this._getAudioCodec(F),Y=this.transmuxer=this.transmuxer||new m.default(this.hls,L.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),re=x?x.index:-1,fe=re!==-1,ve=new p.ChunkMetadata(c.level,c.sn,c.stats.chunkCount,y.byteLength,re,fe),ke=this.initPTS[c.cc];Y.push(y,N,b,A,c,x,U.totalduration,j,ve,ke)},O.onAudioTrackSwitching=function(w,E){var c=this.altAudio,x=!!E.url,y=E.id;if(!x){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var g=this.fragCurrent;g!=null&&g.loader&&(this.log("Switching to main audio track, cancel main fragment load"),g.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var F=this.hls;c&&F.trigger(W.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),F.trigger(W.Events.AUDIO_TRACK_SWITCHED,{id:y})}},O.onAudioTrackSwitched=function(w,E){var c=E.id,x=!!this.hls.audioTracks[c].url;if(x){var y=this.videoBuffer;y&&this.mediaBuffer!==y&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=y)}this.altAudio=x,this.tick()},O.onBufferCreated=function(w,E){var c=E.tracks,x,y,g=!1;for(var F in c){var U=c[F];if(U.id==="main"){if(y=F,x=U,F==="video"){var A=c[F];A&&(this.videoBuffer=A.buffer)}}else g=!0}g&&x?(this.log("Alternate track found, use "+y+".buffered to schedule main fragment loading"),this.mediaBuffer=x.buffer):this.mediaBuffer=this.media},O.onFragBuffered=function(w,E){var c=E.frag,x=E.part;if(c&&c.type!==L.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(c)){this.warn("Fragment "+c.sn+(x?" p: "+x.index:"")+" of level "+c.level+" finished buffering, but was aborted. state: "+this.state),this.state===B.State.PARSED&&(this.state=B.State.IDLE);return}var y=x?x.stats:c.stats;this.fragLastKbps=Math.round(8*y.total/(y.buffering.end-y.loading.first)),c.sn!=="initSegment"&&(this.fragPrevious=c),this.fragBufferedComplete(c,x)},O.onError=function(w,E){switch(E.details){case h.ErrorDetails.FRAG_LOAD_ERROR:case h.ErrorDetails.FRAG_LOAD_TIMEOUT:case h.ErrorDetails.KEY_LOAD_ERROR:case h.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.MAIN,E);break;case h.ErrorDetails.LEVEL_LOAD_ERROR:case h.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==B.State.ERROR&&(E.fatal?(this.warn(""+E.details),this.state=B.State.ERROR):!E.levelRetry&&this.state===B.State.WAITING_LEVEL&&(this.state=B.State.IDLE));break;case h.ErrorDetails.BUFFER_FULL_ERROR:if(E.parent==="main"&&(this.state===B.State.PARSING||this.state===B.State.PARSED)){var c=!0,x=this.getFwdBufferInfo(this.media,L.PlaylistLevelType.MAIN);x&&x.len>.5&&(c=!this.reduceMaxBufferLength(x.len)),c&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},O.checkBuffer=function(){var w=this.media,E=this.gapController;if(!w||!E||!w.readyState)return;var c=H.BufferHelper.getBuffered(w);!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this.seekToStartPos()):E.poll(this.lastCurrentTime),this.lastCurrentTime=w.currentTime},O.onFragLoadEmergencyAborted=function(){this.state=B.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},O.onBufferFlushed=function(w,E){var c=E.type;if(c!==v.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var x=(c===v.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(x,c,L.PlaylistLevelType.MAIN)}},O.onLevelsUpdated=function(w,E){this.levels=E.levels},O.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},O.seekToStartPos=function(){var w=this.media,E=w.currentTime,c=this.startPosition;if(c>=0&&E<c){if(w.seeking){f.logger.log("could not seek to "+c+", already seeking at "+E);return}var x=H.BufferHelper.getBuffered(w),y=x.length?x.start(0):0,g=y-c;g>0&&(g<this.config.maxBufferHole||g<this.config.maxFragLookUpTolerance)&&(f.logger.log("adjusting start position by "+g+" to match buffer start"),c+=g,this.startPosition=c),this.log("seek to target start position "+c+" from current time "+E),w.currentTime=c}},O._getAudioCodec=function(w){var E=this.config.defaultAudioCodec||w.audioCodec;return this.audioCodecSwap&&E&&(this.log("Swapping audio codec"),E.indexOf("mp4a.40.5")!==-1?E="mp4a.40.2":E="mp4a.40.5"),E},O._loadBitrateTestFrag=function(w){var E=this;this._doFragLoad(w).then(function(c){var x=E.hls;if(!c||x.nextLoadLevel||E.fragContextChanged(w))return;E.fragLoadError=0,E.state=B.State.IDLE,E.startFragRequested=!1,E.bitrateTest=!1;var y=w.stats;y.parsing.start=y.parsing.end=y.buffering.start=y.buffering.end=self.performance.now(),x.trigger(W.Events.FRAG_LOADED,c)})},O._handleTransmuxComplete=function(w){var E,c="main",x=this.hls,y=w.remuxResult,g=w.chunkMeta,F=this.getCurrentContext(g);if(!F){this.warn("The loading context changed while buffering fragment "+g.sn+" of level "+g.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(g.level);return}var U=F.frag,A=F.part,j=F.level,N=y.video,b=y.text,Y=y.id3,re=y.initSegment,fe=this.altAudio?void 0:y.audio;if(this.fragContextChanged(U))return;if(this.state=B.State.PARSING,re){re.tracks&&(this._bufferInitSegment(j,re.tracks,U,g),x.trigger(W.Events.FRAG_PARSING_INIT_SEGMENT,{frag:U,id:c,tracks:re.tracks}));var ve=re.initPTS,ke=re.timescale;Object(X.isFiniteNumber)(ve)&&(this.initPTS[U.cc]=ve,x.trigger(W.Events.INIT_PTS_FOUND,{frag:U,id:c,initPTS:ve,timescale:ke}))}if(N&&y.independent!==!1){if(j.details){var Se=N.startPTS,Le=N.endPTS,ye=N.startDTS,_e=N.endDTS;if(A)A.elementaryStreams[N.type]={startPTS:Se,endPTS:Le,startDTS:ye,endDTS:_e};else if(N.firstKeyFrame&&N.independent&&(this.couldBacktrack=!0),N.dropped&&N.independent){var de=this.getLoadPosition()+this.config.maxBufferHole;if(de<Se){this.backtrack(U);return}U.setElementaryStreamInfo(N.type,U.start,Le,U.start,_e,!0)}U.setElementaryStreamInfo(N.type,Se,Le,ye,_e),this.bufferFragmentData(N,U,A,g)}}else if(y.independent===!1){this.backtrack(U);return}if(fe){var z=fe.startPTS,D=fe.endPTS,I=fe.startDTS,V=fe.endDTS;A&&(A.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:z,endPTS:D,startDTS:I,endDTS:V}),U.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,z,D,I,V),this.bufferFragmentData(fe,U,A,g)}if(Y!=null&&(E=Y.samples)!==null&&E!==void 0&&E.length){var Q={frag:U,id:c,samples:Y.samples};x.trigger(W.Events.FRAG_PARSING_METADATA,Q)}if(b){var G={frag:U,id:c,samples:b.samples};x.trigger(W.Events.FRAG_PARSING_USERDATA,G)}},O._bufferInitSegment=function(w,E,c,x){var y=this;if(this.state!==B.State.PARSING)return;this.audioOnly=!!E.audio&&!E.video,this.altAudio&&!this.audioOnly&&delete E.audio;var g=E.audio,F=E.video,U=E.audiovideo;if(g){var A=w.audioCodec,j=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(A&&(A.indexOf("mp4a.40.5")!==-1?A="mp4a.40.2":A="mp4a.40.5"),g.metadata.channelCount!==1&&j.indexOf("firefox")===-1&&(A="mp4a.40.5")),j.indexOf("android")!==-1&&g.container!=="audio/mpeg"&&(A="mp4a.40.2",this.log("Android: force audio codec to "+A)),w.audioCodec&&w.audioCodec!==A&&this.log('Swapping manifest audio codec "'+w.audioCodec+'" for "'+A+'"'),g.levelCodec=A,g.id="main",this.log("Init audio buffer, container:"+g.container+", codecs[selected/level/parsed]=["+(A||"")+"/"+(w.audioCodec||"")+"/"+g.codec+"]")}F&&(F.levelCodec=w.videoCodec,F.id="main",this.log("Init video buffer, container:"+F.container+", codecs[level/parsed]=["+(w.videoCodec||"")+"/"+F.codec+"]")),U&&this.log("Init audiovideo buffer, container:"+U.container+", codecs[level/parsed]=["+(w.attrs.CODECS||"")+"/"+U.codec+"]"),this.hls.trigger(W.Events.BUFFER_CODECS,E),Object.keys(E).forEach(function(N){var b=E[N],Y=b.initSegment;Y!=null&&Y.byteLength&&y.hls.trigger(W.Events.BUFFER_APPENDING,{type:N,data:Y,frag:c,part:null,chunkMeta:x,parent:c.type})}),this.tick()},O.backtrack=function(w){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(w);var E=this.fragmentTracker.backtrack(w);this.fragPrevious=null,this.nextLoadPosition=w.start,E?this.resetFragmentLoading(w):this.state=B.State.BACKTRACKING},O.checkFragmentChanged=function(){var w=this.media,E=null;if(w&&w.readyState>1&&w.seeking===!1){var c=w.currentTime;if(H.BufferHelper.isBuffered(w,c)?E=this.getAppendedFrag(c):H.BufferHelper.isBuffered(w,c+.1)&&(E=this.getAppendedFrag(c+.1)),E){var x=this.fragPlaying,y=E.level;(!x||E.sn!==x.sn||x.level!==y||E.urlId!==x.urlId)&&(this.hls.trigger(W.Events.FRAG_CHANGED,{frag:E}),(!x||x.level!==y)&&this.hls.trigger(W.Events.LEVEL_SWITCHED,{level:y}),this.fragPlaying=E)}}},u(R,[{key:"nextLevel",get:function(){var w=this.nextBufferedFrag;return w?w.level:-1}},{key:"currentLevel",get:function(){var w=this.media;if(w){var E=this.getAppendedFrag(w.currentTime);if(E)return E.level}return-1}},{key:"nextBufferedFrag",get:function(){var w=this.media;if(w){var E=this.getAppendedFrag(w.currentTime);return this.followingBufferedFrag(E)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),R}(B.default)},"./src/controller/subtitle-stream-controller.ts":function(oe,$,M){"use strict";M.r($),M.d($,"SubtitleStreamController",function(){return s});var X=M("./src/events.ts"),B=M("./src/utils/logger.ts"),P=M("./src/utils/buffer-helper.ts"),W=M("./src/controller/fragment-finders.ts"),H=M("./src/utils/discontinuities.ts"),i=M("./src/controller/level-helper.ts"),L=M("./src/controller/fragment-tracker.ts"),v=M("./src/controller/base-stream-controller.ts"),m=M("./src/types/loader.ts"),p=M("./src/types/level.ts");function l(a,C){for(var _=0;_<C.length;_++){var T=C[_];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(a,T.key,T)}}function h(a,C,_){return C&&l(a.prototype,C),_&&l(a,_),a}function f(a,C){a.prototype=Object.create(C.prototype),a.prototype.constructor=a,o(a,C)}function o(a,C){return o=Object.setPrototypeOf||function(T,R){return T.__proto__=R,T},o(a,C)}var u=500,s=function(a){f(C,a);function C(T,R){var O;return O=a.call(this,T,R,"[subtitle-stream-controller]")||this,O.levels=[],O.currentTrackId=-1,O.tracksBuffered=[],O.mainDetails=null,O._registerListeners(),O}var _=C.prototype;return _.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},_._registerListeners=function(){var R=this.hls;R.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.on(X.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.on(X.Events.ERROR,this.onError,this),R.on(X.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.on(X.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.on(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.on(X.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.on(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},_._unregisterListeners=function(){var R=this.hls;R.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.off(X.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.off(X.Events.ERROR,this.onError,this),R.off(X.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.off(X.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.off(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.off(X.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.off(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},_.startLoad=function(){this.stopLoad(),this.state=v.State.IDLE,this.setInterval(u),this.tick()},_.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},_.onLevelLoaded=function(R,O){this.mainDetails=O.details},_.onSubtitleFragProcessed=function(R,O){var S=O.frag,w=O.success;if(this.fragPrevious=S,this.state=v.State.IDLE,!w)return;var E=this.tracksBuffered[this.currentTrackId];if(!E)return;for(var c,x=S.start,y=0;y<E.length;y++)if(x>=E[y].start&&x<=E[y].end){c=E[y];break}var g=S.start+S.duration;c?c.end=g:(c={start:x,end:g},E.push(c)),this.fragmentTracker.fragBuffered(S)},_.onBufferFlushing=function(R,O){var S=O.startOffset,w=O.endOffset;if(S===0&&w!==Number.POSITIVE_INFINITY){var E=this.currentTrackId,c=this.levels;if(!c.length||!c[E]||!c[E].details)return;var x=c[E].details,y=x.targetduration,g=w-y;if(g<=0)return;O.endOffsetSubtitles=Math.max(0,g),this.tracksBuffered.forEach(function(F){for(var U=0;U<F.length;){if(F[U].end<=g){F.shift();continue}else if(F[U].start<g)F[U].start=g;else break;U++}}),this.fragmentTracker.removeFragmentsInRange(S,g,m.PlaylistLevelType.SUBTITLE)}},_.onError=function(R,O){var S,w=O.frag;if(!w||w.type!==m.PlaylistLevelType.SUBTITLE)return;(S=this.fragCurrent)!==null&&S!==void 0&&S.loader&&this.fragCurrent.loader.abort(),this.state=v.State.IDLE},_.onSubtitleTracksUpdated=function(R,O){var S=this,w=O.subtitleTracks;this.tracksBuffered=[],this.levels=w.map(function(E){return new p.Level(E)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(E){S.tracksBuffered[E.id]=[]}),this.mediaBuffer=null},_.onSubtitleTrackSwitch=function(R,O){if(this.currentTrackId=O.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var S=this.levels[this.currentTrackId];S!=null&&S.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,S&&this.setInterval(u)},_.onSubtitleTrackLoaded=function(R,O){var S,w=O.details,E=O.id,c=this.currentTrackId,x=this.levels;if(!x.length)return;var y=x[c];if(E>=x.length||E!==c||!y)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,w.live||(S=y.details)!==null&&S!==void 0&&S.live){var g=this.mainDetails;if(w.deltaUpdateFailed||!g)return;var F=g.fragments[0];if(!y.details)w.hasProgramDateTime&&g.hasProgramDateTime?Object(H.alignMediaPlaylistByPDT)(w,g):F&&Object(i.addSliding)(w,F.start);else{var U=this.alignPlaylists(w,y.details);U===0&&F&&Object(i.addSliding)(w,F.start)}}if(y.details=w,this.levelLastLoaded=E,this.tick(),w.live&&!this.fragCurrent&&this.media&&this.state===v.State.IDLE){var A=Object(W.findFragmentByPTS)(null,w.fragments,this.media.currentTime,0);A||(this.warn("Subtitle playlist not aligned with playback"),y.details=void 0)}},_._handleFragmentLoadComplete=function(R){var O=R.frag,S=R.payload,w=O.decryptdata,E=this.hls;if(this.fragContextChanged(O))return;if(S&&S.byteLength>0&&w&&w.key&&w.iv&&w.method==="AES-128"){var c=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(S),w.key.buffer,w.iv.buffer).then(function(x){var y=performance.now();E.trigger(X.Events.FRAG_DECRYPTED,{frag:O,payload:x,stats:{tstart:c,tdecrypt:y}})})}},_.doTick=function(){if(!this.media){this.state=v.State.IDLE;return}if(this.state===v.State.IDLE){var R,O=this.currentTrackId,S=this.levels;if(!S.length||!S[O]||!S[O].details)return;var w=S[O].details,E=w.targetduration,c=this.config,x=this.media,y=P.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,x.currentTime-E,c.maxBufferHole),g=y.end,F=y.len,U=this.getMaxBufferLength()+E;if(F>U)return;console.assert(w,"Subtitle track details are defined on idle subtitle stream controller tick");var A=w.fragments,j=A.length,N=w.edge,b,Y=this.fragPrevious;if(g<N){var re=c.maxFragLookUpTolerance;Y&&w.hasProgramDateTime&&(b=Object(W.findFragmentByPDT)(A,Y.endProgramDateTime,re)),b||(b=Object(W.findFragmentByPTS)(Y,A,g,re),!b&&Y&&Y.start<A[0].start&&(b=A[0]))}else b=A[j-1];(R=b)!==null&&R!==void 0&&R.encrypted?(B.logger.log("Loading key for "+b.sn),this.state=v.State.KEY_LOADING,this.hls.trigger(X.Events.KEY_LOADING,{frag:b})):b&&this.fragmentTracker.getState(b)===L.FragmentState.NOT_LOADED&&this.loadFragment(b,w,g)}},_.loadFragment=function(R,O,S){this.fragCurrent=R,a.prototype.loadFragment.call(this,R,O,S)},h(C,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),C}(v.default)},"./src/controller/subtitle-track-controller.ts":function(oe,$,M){"use strict";M.r($);var X=M("./src/events.ts"),B=M("./src/utils/texttrack-utils.ts"),P=M("./src/controller/base-playlist-controller.ts"),W=M("./src/types/loader.ts");function H(l,h){for(var f=0;f<h.length;f++){var o=h[f];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(l,o.key,o)}}function i(l,h,f){return h&&H(l.prototype,h),f&&H(l,f),l}function L(l,h){l.prototype=Object.create(h.prototype),l.prototype.constructor=l,v(l,h)}function v(l,h){return v=Object.setPrototypeOf||function(o,u){return o.__proto__=u,o},v(l,h)}var m=function(l){L(h,l);function h(o){var u;return u=l.call(this,o,"[subtitle-track-controller]")||this,u.media=null,u.tracks=[],u.groupId=null,u.tracksInGroup=[],u.trackId=-1,u.selectDefaultTrack=!0,u.queuedDefaultTrack=-1,u.trackChangeListener=function(){return u.onTextTracksChanged()},u.asyncPollTrackChange=function(){return u.pollTrackChange(0)},u.useTextTrackPolling=!1,u.subtitlePollingInterval=-1,u.subtitleDisplay=!0,u.registerListeners(),u}var f=h.prototype;return f.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,l.prototype.destroy.call(this)},f.registerListeners=function(){var u=this.hls;u.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(X.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.on(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.on(X.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var u=this.hls;u.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(X.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.off(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.off(X.Events.ERROR,this.onError,this)},f.onMediaAttached=function(u,s){if(this.media=s.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},f.pollTrackChange=function(u){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,u)},f.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var u=p(this.media.textTracks);u.forEach(function(s){Object(B.clearCurrentCues)(s)}),this.subtitleTrack=-1,this.media=null},f.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},f.onManifestParsed=function(u,s){this.tracks=s.subtitleTracks},f.onSubtitleTrackLoaded=function(u,s){var a=s.id,C=s.details,_=this.trackId,T=this.tracksInGroup[_];if(!T){this.warn("Invalid subtitle track id "+a);return}var R=T.details;T.details=s.details,this.log("subtitle track "+a+" loaded ["+C.startSN+"-"+C.endSN+"]"),a===this.trackId&&(this.retryCount=0,this.playlistLoaded(a,s,R))},f.onLevelLoading=function(u,s){this.switchLevel(s.level)},f.onLevelSwitching=function(u,s){this.switchLevel(s.level)},f.switchLevel=function(u){var s=this.hls.levels[u];if(!(s!=null&&s.textGroupIds))return;var a=s.textGroupIds[s.urlId];if(this.groupId!==a){var C=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,_=this.tracks.filter(function(O){return!a||O.groupId===a});this.tracksInGroup=_;var T=this.findTrackId(C==null?void 0:C.name)||this.findTrackId();this.groupId=a;var R={subtitleTracks:_};this.log("Updating subtitle tracks, "+_.length+' track(s) found in "'+a+'" group-id'),this.hls.trigger(X.Events.SUBTITLE_TRACKS_UPDATED,R),T!==-1&&this.setSubtitleTrack(T,C)}},f.findTrackId=function(u){for(var s=this.tracksInGroup,a=0;a<s.length;a++){var C=s[a];if((!this.selectDefaultTrack||C.default)&&(!u||u===C.name))return C.id}return-1},f.onError=function(u,s){if(l.prototype.onError.call(this,u,s),s.fatal||!s.context)return;s.context.type===W.PlaylistContextType.SUBTITLE_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},f.loadPlaylist=function(u){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var a=s.id,C=s.groupId,_=s.url;if(u)try{_=u.addDirectives(_)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("Loading subtitle playlist for id "+a),this.hls.trigger(X.Events.SUBTITLE_TRACK_LOADING,{url:_,id:a,groupId:C,deliveryDirectives:u||null})}},f.toggleTrackModes=function(u){var s=this,a=this.media,C=this.subtitleDisplay,_=this.trackId;if(!a)return;var T=p(a.textTracks),R=T.filter(function(w){return w.groupId===s.groupId});if(u===-1)[].slice.call(T).forEach(function(w){w.mode="disabled"});else{var O=R[_];O&&(O.mode="disabled")}var S=R[u];S&&(S.mode=C?"showing":"hidden")},f.setSubtitleTrack=function(u,s){var a,C=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=u;return}if(this.trackId!==u&&this.toggleTrackModes(u),this.trackId===u&&(u===-1||(a=C[u])!==null&&a!==void 0&&a.details)||u<-1||u>=C.length)return;this.clearTimer();var _=C[u];if(this.log("Switching to subtitle track "+u),this.trackId=u,_){var T=_.id,R=_.groupId,O=R===void 0?"":R,S=_.name,w=_.type,E=_.url;this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:T,groupId:O,name:S,type:w,url:E});var c=this.switchParams(_.url,s==null?void 0:s.details);this.loadPlaylist(c)}else this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:u})},f.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var u=-1,s=p(this.media.textTracks),a=0;a<s.length;a++)if(s[a].mode==="hidden")u=a;else if(s[a].mode==="showing"){u=a;break}this.subtitleTrack!==u&&(this.subtitleTrack=u)},i(h,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(u){this.selectDefaultTrack=!1;var s=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(u,s)}}]),h}(P.default);function p(l){for(var h=[],f=0;f<l.length;f++){var o=l[f];o.kind==="subtitles"&&o.label&&h.push(l[f])}return h}$.default=m},"./src/controller/timeline-controller.ts":function(oe,$,M){"use strict";M.r($),M.d($,"TimelineController",function(){return p});var X=M("./src/polyfills/number.ts"),B=M("./src/events.ts"),P=M("./src/utils/cea-608-parser.ts"),W=M("./src/utils/output-filter.ts"),H=M("./src/utils/webvtt-parser.ts"),i=M("./src/utils/texttrack-utils.ts"),L=M("./src/utils/imsc1-ttml-parser.ts"),v=M("./src/types/loader.ts"),m=M("./src/utils/logger.ts"),p=function(){function o(s){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=s,this.config=s.config,this.Cues=s.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 a=new W.default(this,"textTrack1"),C=new W.default(this,"textTrack2"),_=new W.default(this,"textTrack3"),T=new W.default(this,"textTrack4");this.cea608Parser1=new P.default(1,a,C),this.cea608Parser2=new P.default(3,_,T)}s.on(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.on(B.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.on(B.Events.FRAG_LOADING,this.onFragLoading,this),s.on(B.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(B.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.on(B.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.on(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(B.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.on(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var u=o.prototype;return u.destroy=function(){var a=this.hls;a.off(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),a.off(B.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),a.off(B.Events.FRAG_LOADING,this.onFragLoading,this),a.off(B.Events.FRAG_LOADED,this.onFragLoaded,this),a.off(B.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),a.off(B.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),a.off(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.off(B.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),a.off(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},u.addCues=function(a,C,_,T,R){for(var O=!1,S=R.length;S--;){var w=R[S],E=h(w[0],w[1],C,_);if(E>=0&&(w[0]=Math.min(w[0],C),w[1]=Math.max(w[1],_),O=!0,E/(_-C)>.5))return}if(O||R.push([C,_]),this.config.renderTextTracksNatively){var c=this.captionsTracks[a];this.Cues.newCue(c,C,_,T)}else{var x=this.Cues.newCue(null,C,_,T);this.hls.trigger(B.Events.CUES_PARSED,{type:"captions",cues:x,track:a})}},u.onInitPtsFound=function(a,C){var _=this,T=C.frag,R=C.id,O=C.initPTS,S=C.timescale,w=this.unparsedVttFrags;R==="main"&&(this.initPTS[T.cc]=O,this.timescale[T.cc]=S),w.length&&(this.unparsedVttFrags=[],w.forEach(function(E){_.onFragLoaded(B.Events.FRAG_LOADED,E)}))},u.getExistingTrack=function(a){var C=this.media;if(C)for(var _=0;_<C.textTracks.length;_++){var T=C.textTracks[_];if(T[a])return T}return null},u.createCaptionsTrack=function(a){this.config.renderTextTracksNatively?this.createNativeTrack(a):this.createNonNativeTrack(a)},u.createNativeTrack=function(a){if(this.captionsTracks[a])return;var C=this.captionsProperties,_=this.captionsTracks,T=this.media,R=C[a],O=R.label,S=R.languageCode,w=this.getExistingTrack(a);if(w)_[a]=w,Object(i.clearCurrentCues)(_[a]),Object(i.sendAddTrackEvent)(_[a],T);else{var E=this.createTextTrack("captions",O,S);E&&(E[a]=!0,_[a]=E)}},u.createNonNativeTrack=function(a){if(this.nonNativeCaptionsTracks[a])return;var C=this.captionsProperties[a];if(!C)return;var _=C.label,T={_id:a,label:_,kind:"captions",default:C.media?!!C.media.default:!1,closedCaptions:C.media};this.nonNativeCaptionsTracks[a]=T,this.hls.trigger(B.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[T]})},u.createTextTrack=function(a,C,_){var T=this.media;return T?T.addTextTrack(a,C,_):void 0},u.onMediaAttaching=function(a,C){this.media=C.media,this._cleanTracks()},u.onMediaDetaching=function(){var a=this.captionsTracks;Object.keys(a).forEach(function(C){Object(i.clearCurrentCues)(a[C]),delete a[C]}),this.nonNativeCaptionsTracks={}},u.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=f(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},u._cleanTracks=function(){var a=this.media;if(!a)return;var C=a.textTracks;if(C)for(var _=0;_<C.length;_++)Object(i.clearCurrentCues)(C[_])},u.onSubtitleTracksUpdated=function(a,C){var _=this;this.textTracks=[];var T=C.subtitleTracks||[],R=T.some(function(E){return E.textCodec===L.IMSC1_CODEC});if(this.config.enableWebVTT||R&&this.config.enableIMSC1){var O=this.tracks&&T&&this.tracks.length===T.length;if(this.tracks=T||[],this.config.renderTextTracksNatively){var S=this.media?this.media.textTracks:[];this.tracks.forEach(function(E,c){var x;if(c<S.length){for(var y=null,g=0;g<S.length;g++)if(l(S[g],E)){y=S[g];break}y&&(x=y)}x?Object(i.clearCurrentCues)(x):(x=_.createTextTrack("subtitles",E.name,E.lang),x&&(x.mode="disabled")),x&&(x.groupId=E.groupId,_.textTracks.push(x))})}else if(!O&&this.tracks&&this.tracks.length){var w=this.tracks.map(function(E){return{label:E.name,kind:E.type.toLowerCase(),default:E.default,subtitleTrack:E}});this.hls.trigger(B.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:w})}}},u.onManifestLoaded=function(a,C){var _=this;this.config.enableCEA708Captions&&C.captions&&C.captions.forEach(function(T){var R=/(?:CC|SERVICE)([1-4])/.exec(T.instreamId);if(!R)return;var O="textTrack"+R[1],S=_.captionsProperties[O];if(!S)return;S.label=T.name,T.lang&&(S.languageCode=T.lang),S.media=T})},u.onFragLoading=function(a,C){var _=this.cea608Parser1,T=this.cea608Parser2,R=this.lastSn,O=this.lastPartIndex;if(!this.enabled||!(_&&T))return;if(C.frag.type===v.PlaylistLevelType.MAIN){var S,w,E=C.frag.sn,c=(S=C==null||((w=C.part)===null||w===void 0)?void 0:w.index)!=null?S:-1;E===R+1||E===R&&c===O+1||(_.reset(),T.reset()),this.lastSn=E,this.lastPartIndex=c}},u.onFragLoaded=function(a,C){var _=C.frag,T=C.payload,R=this.initPTS,O=this.unparsedVttFrags;if(_.type===v.PlaylistLevelType.SUBTITLE)if(T.byteLength){if(!Object(X.isFiniteNumber)(R[_.cc])){O.push(C),R.length&&this.hls.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:_,error:new Error("Missing initial subtitle PTS")});return}var S=_.decryptdata;if(S==null||S.key==null||S.method!=="AES-128"){var w=this.tracks[_.level],E=this.vttCCs;E[_.cc]||(E[_.cc]={start:_.start,prevCC:this.prevCC,new:!0},this.prevCC=_.cc),w&&w.textCodec===L.IMSC1_CODEC?this._parseIMSC1(_,T):this._parseVTTs(_,T,E)}}else this.hls.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:_,error:new Error("Empty subtitle payload")})},u._parseIMSC1=function(a,C){var _=this,T=this.hls;Object(L.parseIMSC1)(C,this.initPTS[a.cc],this.timescale[a.cc],function(R){_._appendCues(R,a.level),T.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:a})},function(R){m.logger.log("Failed to parse IMSC1: "+R),T.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:R})})},u._parseVTTs=function(a,C,_){var T=this,R=this.hls;Object(H.parseWebVTT)(C,this.initPTS[a.cc],this.timescale[a.cc],_,a.cc,a.start,function(O){T._appendCues(O,a.level),R.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:a})},function(O){T._fallbackToIMSC1(a,C),m.logger.log("Failed to parse VTT cue: "+O),R.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:O})})},u._fallbackToIMSC1=function(a,C){var _=this,T=this.tracks[a.level];T.textCodec||Object(L.parseIMSC1)(C,this.initPTS[a.cc],this.timescale[a.cc],function(){T.textCodec=L.IMSC1_CODEC,_._parseIMSC1(a,C)},function(){T.textCodec="wvtt"})},u._appendCues=function(a,C){var _=this.hls;if(this.config.renderTextTracksNatively){var T=this.textTracks[C];if(T.mode==="disabled")return;a.forEach(function(S){return Object(i.addCueToTrack)(T,S)})}else{var R=this.tracks[C],O=R.default?"default":"subtitles"+C;_.trigger(B.Events.CUES_PARSED,{type:"subtitles",cues:a,track:O})}},u.onFragDecrypted=function(a,C){var _=C.frag;if(_.type===v.PlaylistLevelType.SUBTITLE){if(!Object(X.isFiniteNumber)(this.initPTS[_.cc])){this.unparsedVttFrags.push(C);return}this.onFragLoaded(B.Events.FRAG_LOADED,C)}},u.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},u.onFragParsingUserdata=function(a,C){var _=this.cea608Parser1,T=this.cea608Parser2;if(!this.enabled||!(_&&T))return;for(var R=0;R<C.samples.length;R++){var O=C.samples[R].bytes;if(O){var S=this.extractCea608Data(O);_.addData(C.samples[R].pts,S[0]),T.addData(C.samples[R].pts,S[1])}}},u.onBufferFlushing=function(a,C){var _=C.startOffset,T=C.endOffset,R=C.endOffsetSubtitles,O=C.type,S=this.media;if(!S||S.currentTime<T)return;if(!O||O==="video"){var w=this.captionsTracks;Object.keys(w).forEach(function(c){return Object(i.removeCuesInRange)(w[c],_,T)})}if(this.config.renderTextTracksNatively&&(_===0&&R!==void 0)){var E=this.textTracks;Object.keys(E).forEach(function(c){return Object(i.removeCuesInRange)(E[c],_,R)})}},u.extractCea608Data=function(a){for(var C=a[0]&31,_=2,T=[[],[]],R=0;R<C;R++){var O=a[_++],S=127&a[_++],w=127&a[_++],E=(4&O)!==0,c=3&O;if(S===0&&w===0)continue;E&&((c===0||c===1)&&(T[c].push(S),T[c].push(w)))}return T},o}();function l(o,u){return o&&o.label===u.name&&!(o.textTrack1||o.textTrack2)}function h(o,u,s,a){return Math.min(u,a)-Math.max(o,s)}function f(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(oe,$,M){"use strict";M.r($),M.d($,"default",function(){return X});var X=function(){function B(W,H){this.subtle=void 0,this.aesIV=void 0,this.subtle=W,this.aesIV=H}var P=B.prototype;return P.decrypt=function(H,i){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},i,H)},B}()},"./src/crypt/aes-decryptor.ts":function(oe,$,M){"use strict";M.r($),M.d($,"removePadding",function(){return B}),M.d($,"default",function(){return P});var X=M("./src/utils/typed-array.ts");function B(W){var H=W.byteLength,i=H&&new DataView(W.buffer).getUint8(H-1);return i?Object(X.sliceUint8)(W,0,H-i):W}var P=function(){function W(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var H=W.prototype;return H.uint8ArrayToUint32Array_=function(L){for(var v=new DataView(L),m=new Uint32Array(4),p=0;p<4;p++)m[p]=v.getUint32(p*4);return m},H.initTable=function(){var L=this.sBox,v=this.invSBox,m=this.subMix,p=m[0],l=m[1],h=m[2],f=m[3],o=this.invSubMix,u=o[0],s=o[1],a=o[2],C=o[3],_=new Uint32Array(256),T=0,R=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 S=R^R<<1^R<<2^R<<3^R<<4;S=S>>>8^S&255^99,L[T]=S,v[S]=T;var w=_[T],E=_[w],c=_[E],x=_[S]*257^S*16843008;p[T]=x<<24|x>>>8,l[T]=x<<16|x>>>16,h[T]=x<<8|x>>>24,f[T]=x,x=c*16843009^E*65537^w*257^T*16843008,u[S]=x<<24|x>>>8,s[S]=x<<16|x>>>16,a[S]=x<<8|x>>>24,C[S]=x,T?(T=w^_[_[_[c^w]]],R^=_[_[R]]):T=R=1}},H.expandKey=function(L){for(var v=this.uint8ArrayToUint32Array_(L),m=!0,p=0;p<v.length&&m;)m=v[p]===this.key[p],p++;if(m)return;this.key=v;var l=this.keySize=v.length;if(l!==4&&l!==6&&l!==8)throw new Error("Invalid aes key size="+l);var h=this.ksRows=(l+6+1)*4,f,o,u=this.keySchedule=new Uint32Array(h),s=this.invKeySchedule=new Uint32Array(h),a=this.sBox,C=this.rcon,_=this.invSubMix,T=_[0],R=_[1],O=_[2],S=_[3],w,E;for(f=0;f<h;f++){if(f<l){w=u[f]=v[f];continue}E=w,f%l===0?(E=E<<8|E>>>24,E=a[E>>>24]<<24|a[E>>>16&255]<<16|a[E>>>8&255]<<8|a[E&255],E^=C[f/l|0]<<24):l>6&&f%l===4&&(E=a[E>>>24]<<24|a[E>>>16&255]<<16|a[E>>>8&255]<<8|a[E&255]),u[f]=w=(u[f-l]^E)>>>0}for(o=0;o<h;o++)f=h-o,o&3?E=u[f]:E=u[f-4],o<4||f<=4?s[o]=E:s[o]=T[a[E>>>24]]^R[a[E>>>16&255]]^O[a[E>>>8&255]]^S[a[E&255]],s[o]=s[o]>>>0},H.networkToHostOrderSwap=function(L){return L<<24|(L&65280)<<8|(L&16711680)>>8|L>>>24},H.decrypt=function(L,v,m){for(var p=this.keySize+6,l=this.invKeySchedule,h=this.invSBox,f=this.invSubMix,o=f[0],u=f[1],s=f[2],a=f[3],C=this.uint8ArrayToUint32Array_(m),_=C[0],T=C[1],R=C[2],O=C[3],S=new Int32Array(L),w=new Int32Array(S.length),E,c,x,y,g,F,U,A,j,N,b,Y,re,fe,ve=this.networkToHostOrderSwap;v<S.length;){for(j=ve(S[v]),N=ve(S[v+1]),b=ve(S[v+2]),Y=ve(S[v+3]),g=j^l[0],F=Y^l[1],U=b^l[2],A=N^l[3],re=4,fe=1;fe<p;fe++)E=o[g>>>24]^u[F>>16&255]^s[U>>8&255]^a[A&255]^l[re],c=o[F>>>24]^u[U>>16&255]^s[A>>8&255]^a[g&255]^l[re+1],x=o[U>>>24]^u[A>>16&255]^s[g>>8&255]^a[F&255]^l[re+2],y=o[A>>>24]^u[g>>16&255]^s[F>>8&255]^a[U&255]^l[re+3],g=E,F=c,U=x,A=y,re=re+4;E=h[g>>>24]<<24^h[F>>16&255]<<16^h[U>>8&255]<<8^h[A&255]^l[re],c=h[F>>>24]<<24^h[U>>16&255]<<16^h[A>>8&255]<<8^h[g&255]^l[re+1],x=h[U>>>24]<<24^h[A>>16&255]<<16^h[g>>8&255]<<8^h[F&255]^l[re+2],y=h[A>>>24]<<24^h[g>>16&255]<<16^h[F>>8&255]<<8^h[U&255]^l[re+3],w[v]=ve(E^_),w[v+1]=ve(y^T),w[v+2]=ve(x^R),w[v+3]=ve(c^O),_=j,T=N,R=b,O=Y,v=v+4}return w.buffer},W}()},"./src/crypt/decrypter.ts":function(oe,$,M){"use strict";M.r($),M.d($,"default",function(){return v});var X=M("./src/crypt/aes-crypto.ts"),B=M("./src/crypt/fast-aes-key.ts"),P=M("./src/crypt/aes-decryptor.ts"),W=M("./src/utils/logger.ts"),H=M("./src/utils/mp4-tools.ts"),i=M("./src/utils/typed-array.ts"),L=16,v=function(){function m(l,h,f){var o=f===void 0?{}:f,u=o.removePKCS7Padding,s=u===void 0?!0:u;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=l,this.config=h,this.removePKCS7Padding=s,s)try{var a=self.crypto;a&&(this.subtle=a.subtle||a.webkitSubtle)}catch(C){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var p=m.prototype;return p.destroy=function(){this.observer=null},p.isSync=function(){return this.config.enableSoftwareAES},p.flush=function(){var h=this.currentResult;if(!h){this.reset();return}var f=new Uint8Array(h);return this.reset(),this.removePKCS7Padding?Object(P.removePadding)(f):f},p.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},p.decrypt=function(h,f,o,u){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(h),f,o);var s=this.flush();s&&u(s.buffer)}else this.webCryptoDecrypt(new Uint8Array(h),f,o).then(u)},p.softwareDecrypt=function(h,f,o){var u=this.currentIV,s=this.currentResult,a=this.remainderData;this.logOnce("JS AES decrypt"),a&&(h=Object(H.appendUint8Array)(a,h),this.remainderData=null);var C=this.getValidChunk(h);if(!C.length)return null;u&&(o=u);var _=this.softwareDecrypter;_||(_=this.softwareDecrypter=new P.default),_.expandKey(f);var T=s;return this.currentResult=_.decrypt(C.buffer,0,o),this.currentIV=Object(i.sliceUint8)(C,-16).buffer,T||null},p.webCryptoDecrypt=function(h,f,o){var u=this,s=this.subtle;return(this.key!==f||!this.fastAesKey)&&(this.key=f,this.fastAesKey=new B.default(s,f)),this.fastAesKey.expandKey().then(function(a){if(!s)return Promise.reject(new Error("web crypto not initialized"));var C=new X.default(s,o);return C.decrypt(h.buffer,a)}).catch(function(a){return u.onWebCryptoError(a,h,f,o)})},p.onWebCryptoError=function(h,f,o,u){return W.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",h),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(f,o,u)},p.getValidChunk=function(h){var f=h,o=h.length-h.length%L;return o!==h.length&&(f=Object(i.sliceUint8)(h,0,o),this.remainderData=Object(i.sliceUint8)(h,o)),f},p.logOnce=function(h){if(!this.logEnabled)return;W.logger.log("[decrypter.ts]: "+h),this.logEnabled=!1},m}()},"./src/crypt/fast-aes-key.ts":function(oe,$,M){"use strict";M.r($),M.d($,"default",function(){return X});var X=function(){function B(W,H){this.subtle=void 0,this.key=void 0,this.subtle=W,this.key=H}var P=B.prototype;return P.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},B}()},"./src/demux/aacdemuxer.ts":function(oe,$,M){"use strict";M.r($);var X=M("./src/demux/base-audio-demuxer.ts"),B=M("./src/demux/adts.ts"),P=M("./src/utils/logger.ts"),W=M("./src/demux/id3.ts");function H(v,m){v.prototype=Object.create(m.prototype),v.prototype.constructor=v,i(v,m)}function i(v,m){return i=Object.setPrototypeOf||function(l,h){return l.__proto__=h,l},i(v,m)}var L=function(v){H(m,v);function m(l,h){var f;return f=v.call(this)||this,f.observer=void 0,f.config=void 0,f.observer=l,f.config=h,f}var p=m.prototype;return p.resetInitSegment=function(h,f,o){v.prototype.resetInitSegment.call(this,h,f,o),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:h,duration:o,inputTimeScale:9e4,dropped:0}},m.probe=function(h){if(!h)return!1;for(var f=W.getID3Data(h,0)||[],o=f.length,u=h.length;o<u;o++)if(B.probe(h,o))return P.logger.log("ADTS sync word found !"),!0;return!1},p.canParse=function(h,f){return B.canParse(h,f)},p.appendFrame=function(h,f,o){B.initTrackConfig(h,this.observer,f,o,h.manifestCodec);var u=B.appendFrame(h,f,o,this.initPTS,this.frameIndex);if(u&&u.missing===0)return u},m}(X.default);L.minProbeByteLength=9,$.default=L},"./src/demux/adts.ts":function(oe,$,M){"use strict";M.r($),M.d($,"getAudioConfig",function(){return W}),M.d($,"isHeaderPattern",function(){return H}),M.d($,"getHeaderLength",function(){return i}),M.d($,"getFullFrameLength",function(){return L}),M.d($,"canGetFrameLength",function(){return v}),M.d($,"isHeader",function(){return m}),M.d($,"canParse",function(){return p}),M.d($,"probe",function(){return l}),M.d($,"initTrackConfig",function(){return h}),M.d($,"getFrameDuration",function(){return f}),M.d($,"parseFrameHeader",function(){return o}),M.d($,"appendFrame",function(){return u});var X=M("./src/utils/logger.ts"),B=M("./src/errors.ts"),P=M("./src/events.ts");function W(s,a,C,_){var T,R,O,S,w=navigator.userAgent.toLowerCase(),E=_,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];T=((a[C+2]&192)>>>6)+1;var x=(a[C+2]&60)>>>2;if(x>c.length-1){s.trigger(P.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+x});return}return O=(a[C+2]&1)<<2,O|=(a[C+3]&192)>>>6,X.logger.log("manifest codec:"+_+", ADTS type:"+T+", samplingIndex:"+x),/firefox/i.test(w)?x>=6?(T=5,S=new Array(4),R=x-3):(T=2,S=new Array(2),R=x):w.indexOf("android")!==-1?(T=2,S=new Array(2),R=x):(T=5,S=new Array(4),_&&(_.indexOf("mp4a.40.29")!==-1||_.indexOf("mp4a.40.5")!==-1)||!_&&x>=6?R=x-3:((_&&_.indexOf("mp4a.40.2")!==-1&&(x>=6&&O===1||/vivaldi/i.test(w))||!_&&O===1)&&(T=2,S=new Array(2)),R=x)),S[0]=T<<3,S[0]|=(x&14)>>1,S[1]|=(x&1)<<7,S[1]|=O<<3,T===5&&(S[1]|=(R&14)>>1,S[2]=(R&1)<<7,S[2]|=2<<2,S[3]=0),{config:S,samplerate:c[x],channelCount:O,codec:"mp4a.40."+T,manifestCodec:E}}function H(s,a){return s[a]===255&&(s[a+1]&246)===240}function i(s,a){return s[a+1]&1?7:9}function L(s,a){return(s[a+3]&3)<<11|s[a+4]<<3|(s[a+5]&224)>>>5}function v(s,a){return a+5<s.length}function m(s,a){return a+1<s.length&&H(s,a)}function p(s,a){return v(s,a)&&H(s,a)&&L(s,a)<=s.length-a}function l(s,a){if(m(s,a)){var C=i(s,a);if(a+C>=s.length)return!1;var _=L(s,a);if(_<=C)return!1;var T=a+_;return T===s.length||m(s,T)}return!1}function h(s,a,C,_,T){if(!s.samplerate){var R=W(a,C,_,T);if(!R)return;s.config=R.config,s.samplerate=R.samplerate,s.channelCount=R.channelCount,s.codec=R.codec,s.manifestCodec=R.manifestCodec,X.logger.log("parsed codec:"+s.codec+", rate:"+R.samplerate+", channels:"+R.channelCount)}}function f(s){return 1024*9e4/s}function o(s,a,C,_,T){var R=i(s,a),O=L(s,a);if(O-=R,O>0){var S=C+_*T;return{headerLength:R,frameLength:O,stamp:S}}}function u(s,a,C,_,T){var R=f(s.samplerate),O=o(a,C,_,T,R);if(O){var S=O.frameLength,w=O.headerLength,E=O.stamp,c=w+S,x=Math.max(0,C+c-a.length),y;x?(y=new Uint8Array(c-w),y.set(a.subarray(C+w,a.length),0)):y=a.subarray(C+w,C+c);var g={unit:y,pts:E};return x||s.samples.push(g),{sample:g,length:c,missing:x}}}},"./src/demux/base-audio-demuxer.ts":function(oe,$,M){"use strict";M.r($),M.d($,"initPTSFn",function(){return L});var X=M("./src/polyfills/number.ts"),B=M("./src/demux/id3.ts"),P=M("./src/demux/dummy-demuxed-track.ts"),W=M("./src/utils/mp4-tools.ts"),H=M("./src/utils/typed-array.ts"),i=function(){function v(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var m=v.prototype;return m.resetInitSegment=function(l,h,f){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},m.resetTimeStamp=function(){},m.resetContiguity=function(){},m.canParse=function(l,h){return!1},m.appendFrame=function(l,h,f){},m.demux=function(l,h){this.cachedData&&(l=Object(W.appendUint8Array)(this.cachedData,l),this.cachedData=null);var f=B.getID3Data(l,0),o=f?f.length:0,u,s,a=this._audioTrack,C=this._id3Track,_=f?B.getTimeStamp(f):void 0,T=l.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=L(_,h)),f&&f.length>0&&C.samples.push({pts:this.initPTS,dts:this.initPTS,data:f}),s=this.initPTS;o<T;){if(this.canParse(l,o)){var R=this.appendFrame(a,l,o);R?(this.frameIndex++,s=R.sample.pts,o+=R.length,u=o):o=T}else B.canParse(l,o)?(f=B.getID3Data(l,o),C.samples.push({pts:s,dts:s,data:f}),o+=f.length,u=o):o++;if(o===T&&u!==T){var O=Object(H.sliceUint8)(l,u);this.cachedData?this.cachedData=Object(W.appendUint8Array)(this.cachedData,O):this.cachedData=O}}return{audioTrack:a,avcTrack:Object(P.dummyTrack)(),id3Track:C,textTrack:Object(P.dummyTrack)()}},m.demuxSampleAes=function(l,h,f){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},m.flush=function(l){var h=this.cachedData;return h&&(this.cachedData=null,this.demux(h,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(P.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(P.dummyTrack)()}},m.destroy=function(){},v}(),L=function(m,p){return Object(X.isFiniteNumber)(m)?m*90:p*9e4};$.default=i},"./src/demux/chunk-cache.ts":function(oe,$,M){"use strict";M.r($),M.d($,"default",function(){return X});var X=function(){function P(){this.chunks=[],this.dataLength=0}var W=P.prototype;return W.push=function(i){this.chunks.push(i),this.dataLength+=i.length},W.flush=function(){var i=this.chunks,L=this.dataLength,v;if(i.length)i.length===1?v=i[0]:v=B(i,L);else return new Uint8Array(0);return this.reset(),v},W.reset=function(){this.chunks.length=0,this.dataLength=0},P}();function B(P,W){for(var H=new Uint8Array(W),i=0,L=0;L<P.length;L++){var v=P[L];H.set(v,i),i+=v.length}return H}},"./src/demux/dummy-demuxed-track.ts":function(oe,$,M){"use strict";M.r($),M.d($,"dummyTrack",function(){return X});function X(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(oe,$,M){"use strict";M.r($);var X=M("./src/utils/logger.ts"),B=function(){function P(H){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=H,this.bytesAvailable=H.byteLength,this.word=0,this.bitsAvailable=0}var W=P.prototype;return W.loadWord=function(){var i=this.data,L=this.bytesAvailable,v=i.byteLength-L,m=new Uint8Array(4),p=Math.min(4,L);if(p===0)throw new Error("no bytes available");m.set(i.subarray(v,v+p)),this.word=new DataView(m.buffer).getUint32(0),this.bitsAvailable=p*8,this.bytesAvailable-=p},W.skipBits=function(i){var L;this.bitsAvailable>i?(this.word<<=i,this.bitsAvailable-=i):(i-=this.bitsAvailable,L=i>>3,i-=L>>3,this.bytesAvailable-=L,this.loadWord(),this.word<<=i,this.bitsAvailable-=i)},W.readBits=function(i){var L=Math.min(this.bitsAvailable,i),v=this.word>>>32-L;return i>32&&X.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=L,this.bitsAvailable>0?this.word<<=L:this.bytesAvailable>0&&this.loadWord(),L=i-L,L>0&&this.bitsAvailable?v<<L|this.readBits(L):v},W.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()},W.skipUEG=function(){this.skipBits(1+this.skipLZ())},W.skipEG=function(){this.skipBits(1+this.skipLZ())},W.readUEG=function(){var i=this.skipLZ();return this.readBits(i+1)-1},W.readEG=function(){var i=this.readUEG();return 1&i?1+i>>>1:-1*(i>>>1)},W.readBoolean=function(){return this.readBits(1)===1},W.readUByte=function(){return this.readBits(8)},W.readUShort=function(){return this.readBits(16)},W.readUInt=function(){return this.readBits(32)},W.skipScalingList=function(i){for(var L=8,v=8,m,p=0;p<i;p++)v!==0&&(m=this.readEG(),v=(L+m+256)%256),L=v===0?L:v},W.readSPS=function(){var i=0,L=0,v=0,m=0,p,l,h,f=this.readUByte.bind(this),o=this.readBits.bind(this),u=this.readUEG.bind(this),s=this.readBoolean.bind(this),a=this.skipBits.bind(this),C=this.skipEG.bind(this),_=this.skipUEG.bind(this),T=this.skipScalingList.bind(this);f();var R=f();if(o(5),a(3),f(),_(),R===100||R===110||R===122||R===244||R===44||R===83||R===86||R===118||R===128){var O=u();if(O===3&&a(1),_(),_(),a(1),s())for(l=O!==3?8:12,h=0;h<l;h++)s()&&(h<6?T(16):T(64))}_();var S=u();if(S===0)u();else if(S===1)for(a(1),C(),C(),p=u(),h=0;h<p;h++)C();_(),a(1);var w=u(),E=u(),c=o(1);c===0&&a(1),a(1),s()&&(i=u(),L=u(),v=u(),m=u());var x=[1,1];if(s()&&s()){var y=f();switch(y){case 1:x=[1,1];break;case 2:x=[12,11];break;case 3:x=[10,11];break;case 4:x=[16,11];break;case 5:x=[40,33];break;case 6:x=[24,11];break;case 7:x=[20,11];break;case 8:x=[32,11];break;case 9:x=[80,33];break;case 10:x=[18,11];break;case 11:x=[15,11];break;case 12:x=[64,33];break;case 13:x=[160,99];break;case 14:x=[4,3];break;case 15:x=[3,2];break;case 16:x=[2,1];break;case 255:{x=[f()<<8|f(),f()<<8|f()];break}}}return{width:Math.ceil((w+1)*16-i*2-L*2),height:(2-c)*(E+1)*16-(c?2:4)*(v+m),pixelRatio:x}},W.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},P}();$.default=B},"./src/demux/id3.ts":function(oe,$,M){"use strict";M.r($),M.d($,"isHeader",function(){return X}),M.d($,"isFooter",function(){return B}),M.d($,"getID3Data",function(){return P}),M.d($,"canParse",function(){return H}),M.d($,"getTimeStamp",function(){return i}),M.d($,"isTimeStampFrame",function(){return L}),M.d($,"getID3Frames",function(){return m}),M.d($,"decodeFrame",function(){return p}),M.d($,"utf8ArrayToStr",function(){return u}),M.d($,"testables",function(){return s});var X=function(T,R){return R+10<=T.length&&(T[R]===73&&T[R+1]===68&&T[R+2]===51&&(T[R+3]<255&&T[R+4]<255&&(T[R+6]<128&&T[R+7]<128&&T[R+8]<128&&T[R+9]<128)))},B=function(T,R){return R+10<=T.length&&(T[R]===51&&T[R+1]===68&&T[R+2]===73&&(T[R+3]<255&&T[R+4]<255&&(T[R+6]<128&&T[R+7]<128&&T[R+8]<128&&T[R+9]<128)))},P=function(T,R){for(var O=R,S=0;X(T,R);){S+=10;var w=W(T,R+6);S+=w,B(T,R+10)&&(S+=10),R+=S}return S>0?T.subarray(O,O+S):void 0},W=function(T,R){var O=0;return O=(T[R]&127)<<21,O|=(T[R+1]&127)<<14,O|=(T[R+2]&127)<<7,O|=T[R+3]&127,O},H=function(T,R){return X(T,R)&&W(T,R+6)+10<=T.length-R},i=function(T){for(var R=m(T),O=0;O<R.length;O++){var S=R[O];if(L(S))return o(S)}return},L=function(T){return T&&T.key==="PRIV"&&T.info==="com.apple.streaming.transportStreamTimestamp"},v=function(T){var R=String.fromCharCode(T[0],T[1],T[2],T[3]),O=W(T,4),S=10;return{type:R,size:O,data:T.subarray(S,S+O)}},m=function(T){for(var R=0,O=[];X(T,R);){var S=W(T,R+6);R+=10;for(var w=R+S;R+8<w;){var E=v(T.subarray(R)),c=p(E);c&&O.push(c),R+=E.size+10}B(T,R)&&(R+=10)}return O},p=function(T){return T.type==="PRIV"?l(T):T.type[0]==="W"?f(T):h(T)},l=function(T){if(T.size<2)return;var R=u(T.data,!0),O=new Uint8Array(T.data.subarray(R.length+1));return{key:T.type,info:R,data:O.buffer}},h=function(T){if(T.size<2)return;if(T.type==="TXXX"){var R=1,O=u(T.data.subarray(R),!0);R+=O.length+1;var S=u(T.data.subarray(R));return{key:T.type,info:O,data:S}}var w=u(T.data.subarray(1));return{key:T.type,data:w}},f=function(T){if(T.type==="WXXX"){if(T.size<2)return;var R=1,O=u(T.data.subarray(R),!0);R+=O.length+1;var S=u(T.data.subarray(R));return{key:T.type,info:O,data:S}}var w=u(T.data);return{key:T.type,data:w}},o=function(T){if(T.data.byteLength===8){var R=new Uint8Array(T.data),O=R[3]&1,S=(R[4]<<23)+(R[5]<<15)+(R[6]<<7)+R[7];return S/=45,O&&(S+=4772185884e-2),Math.round(S)}return},u=function(T,R){R===void 0&&(R=!1);var O=C();if(O){var S=O.decode(T);if(R){var w=S.indexOf("\0");return w!==-1?S.substring(0,w):S}return S.replace(/\0/g,"")}for(var E=T.length,c,x,y,g="",F=0;F<E;){if(c=T[F++],c===0&&R)return g;if(c===0||c===3)continue;switch(c>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:g+=String.fromCharCode(c);break;case 12:case 13:x=T[F++],g+=String.fromCharCode((c&31)<<6|x&63);break;case 14:x=T[F++],y=T[F++],g+=String.fromCharCode((c&15)<<12|(x&63)<<6|(y&63)<<0);break;default:}}return g},s={decodeTextFrame:h},a;function C(){return!a&&typeof self.TextDecoder!="undefined"&&(a=new self.TextDecoder("utf-8")),a}},"./src/demux/mp3demuxer.ts":function(oe,$,M){"use strict";M.r($);var X=M("./src/demux/base-audio-demuxer.ts"),B=M("./src/demux/id3.ts"),P=M("./src/utils/logger.ts"),W=M("./src/demux/mpegaudio.ts");function H(v,m){v.prototype=Object.create(m.prototype),v.prototype.constructor=v,i(v,m)}function i(v,m){return i=Object.setPrototypeOf||function(l,h){return l.__proto__=h,l},i(v,m)}var L=function(v){H(m,v);function m(){return v.apply(this,arguments)||this}var p=m.prototype;return p.resetInitSegment=function(h,f,o){v.prototype.resetInitSegment.call(this,h,f,o),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:h,duration:o,inputTimeScale:9e4,dropped:0}},m.probe=function(h){if(!h)return!1;for(var f=B.getID3Data(h,0)||[],o=f.length,u=h.length;o<u;o++)if(W.probe(h,o))return P.logger.log("MPEG Audio sync word found !"),!0;return!1},p.canParse=function(h,f){return W.canParse(h,f)},p.appendFrame=function(h,f,o){return this.initPTS===null?void 0:W.appendFrame(h,f,o,this.initPTS,this.frameIndex)},m}(X.default);L.minProbeByteLength=4,$.default=L},"./src/demux/mp4demuxer.ts":function(oe,$,M){"use strict";M.r($);var X=M("./src/utils/mp4-tools.ts"),B=M("./src/demux/dummy-demuxed-track.ts"),P=function(){function W(i,L){this.remainderData=null,this.config=void 0,this.config=L}var H=W.prototype;return H.resetTimeStamp=function(){},H.resetInitSegment=function(){},H.resetContiguity=function(){},W.probe=function(L){return Object(X.findBox)({data:L,start:0,end:Math.min(L.length,16384)},["moof"]).length>0},H.demux=function(L){var v=L,m=Object(B.dummyTrack)();if(this.config.progressive){this.remainderData&&(v=Object(X.appendUint8Array)(this.remainderData,L));var p=Object(X.segmentValidRange)(v);this.remainderData=p.remainder,m.samples=p.valid||new Uint8Array}else m.samples=v;return{audioTrack:Object(B.dummyTrack)(),avcTrack:m,id3Track:Object(B.dummyTrack)(),textTrack:Object(B.dummyTrack)()}},H.flush=function(){var L=Object(B.dummyTrack)();return L.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(B.dummyTrack)(),avcTrack:L,id3Track:Object(B.dummyTrack)(),textTrack:Object(B.dummyTrack)()}},H.demuxSampleAes=function(L,v,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},H.destroy=function(){},W}();P.minProbeByteLength=1024,$.default=P},"./src/demux/mpegaudio.ts":function(oe,$,M){"use strict";M.r($),M.d($,"appendFrame",function(){return i}),M.d($,"parseHeader",function(){return L}),M.d($,"isHeaderPattern",function(){return v}),M.d($,"isHeader",function(){return m}),M.d($,"canParse",function(){return p}),M.d($,"probe",function(){return l});var X=null,B=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],P=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],W=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],H=[0,1,1,4];function i(h,f,o,u,s){if(o+24>f.length)return;var a=L(f,o);if(a&&o+a.frameLength<=f.length){var C=a.samplesPerFrame*9e4/a.sampleRate,_=u+s*C,T={unit:f.subarray(o,o+a.frameLength),pts:_,dts:_};return h.config=[],h.channelCount=a.channelCount,h.samplerate=a.sampleRate,h.samples.push(T),{sample:T,length:a.frameLength,missing:0}}}function L(h,f){var o=h[f+1]>>3&3,u=h[f+1]>>1&3,s=h[f+2]>>4&15,a=h[f+2]>>2&3;if(o!==1&&s!==0&&s!==15&&a!==3){var C=h[f+2]>>1&1,_=h[f+3]>>6,T=o===3?3-u:u===3?3:4,R=B[T*14+s-1]*1e3,O=o===3?0:o===2?1:2,S=P[O*3+a],w=_===3?1:2,E=W[o][u],c=H[u],x=E*8*c,y=Math.floor(E*R/S+C)*c;if(X===null){var g=navigator.userAgent||"",F=g.match(/Chrome\/(\d+)/i);X=F?parseInt(F[1]):0}var U=!!X&&X<=87;return U&&u===2&&R>=224e3&&_===0&&(h[f+3]=h[f+3]|128),{sampleRate:S,channelCount:w,frameLength:y,samplesPerFrame:x}}}function v(h,f){return h[f]===255&&(h[f+1]&224)===224&&(h[f+1]&6)!==0}function m(h,f){return f+1<h.length&&v(h,f)}function p(h,f){var o=4;return v(h,f)&&o<=h.length-f}function l(h,f){if(f+1<h.length&&v(h,f)){var o=4,u=L(h,f),s=o;u!=null&&u.frameLength&&(s=u.frameLength);var a=f+s;return a===h.length||m(h,a)}return!1}},"./src/demux/sample-aes.ts":function(oe,$,M){"use strict";M.r($);var X=M("./src/crypt/decrypter.ts"),B=M("./src/demux/tsdemuxer.ts"),P=function(){function W(i,L,v){this.keyData=void 0,this.decrypter=void 0,this.keyData=v,this.decrypter=new X.default(i,L,{removePKCS7Padding:!1})}var H=W.prototype;return H.decryptBuffer=function(L,v){this.decrypter.decrypt(L,this.keyData.key.buffer,this.keyData.iv.buffer,v)},H.decryptAacSample=function(L,v,m,p){var l=L[v].unit,h=l.subarray(16,l.length-l.length%16),f=h.buffer.slice(h.byteOffset,h.byteOffset+h.length),o=this;this.decryptBuffer(f,function(u){var s=new Uint8Array(u);l.set(s,16),p||o.decryptAacSamples(L,v+1,m)})},H.decryptAacSamples=function(L,v,m){for(;;v++){if(v>=L.length){m();return}if(L[v].unit.length<32)continue;var p=this.decrypter.isSync();if(this.decryptAacSample(L,v,m,p),!p)return}},H.getAvcEncryptedData=function(L){for(var v=Math.floor((L.length-48)/160)*16+16,m=new Int8Array(v),p=0,l=32;l<=L.length-16;l+=160,p+=16)m.set(L.subarray(l,l+16),p);return m},H.getAvcDecryptedUnit=function(L,v){for(var m=new Uint8Array(v),p=0,l=32;l<=L.length-16;l+=160,p+=16)L.set(m.subarray(p,p+16),l);return L},H.decryptAvcSample=function(L,v,m,p,l,h){var f=Object(B.discardEPB)(l.data),o=this.getAvcEncryptedData(f),u=this;this.decryptBuffer(o.buffer,function(s){l.data=u.getAvcDecryptedUnit(f,s),h||u.decryptAvcSamples(L,v,m+1,p)})},H.decryptAvcSamples=function(L,v,m,p){if(L instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;v++,m=0){if(v>=L.length){p();return}for(var l=L[v].units;!(m>=l.length);m++){var h=l[m];if(h.data.length<=48||h.type!==1&&h.type!==5)continue;var f=this.decrypter.isSync();if(this.decryptAvcSample(L,v,m,p,h,f),!f)return}}},W}();$.default=P},"./src/demux/transmuxer-interface.ts":function(oe,$,M){"use strict";M.r($),M.d($,"default",function(){return l});var X=M("./node_modules/webworkify-webpack/index.js"),B=M.n(X),P=M("./src/events.ts"),W=M("./src/demux/transmuxer.ts"),H=M("./src/utils/logger.ts"),i=M("./src/errors.ts"),L=M("./src/utils/mediasource-helper.ts"),v=M("./node_modules/eventemitter3/index.js"),m=M.n(v),p=Object(L.getMediaSource)()||{isTypeSupported:function(){return!1}},l=function(){function h(o,u,s,a){var C=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=o,this.id=u,this.onTransmuxComplete=s,this.onFlush=a;var _=o.config,T=function(E,c){c=c||{},c.frag=C.frag,c.id=C.id,o.trigger(E,c)};this.observer=new v.EventEmitter,this.observer.on(P.Events.FRAG_DECRYPTED,T),this.observer.on(P.Events.ERROR,T);var R={mp4:p.isTypeSupported("video/mp4"),mpeg:p.isTypeSupported("audio/mpeg"),mp3:p.isTypeSupported('audio/mp4; codecs="mp3"')},O=navigator.vendor;if(_.enableWorker&&typeof Worker!="undefined"){H.logger.log("demuxing in webworker");var S;try{S=this.worker=X("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),S.addEventListener("message",this.onwmsg),S.onerror=function(w){o.trigger(P.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+")")})},S.postMessage({cmd:"init",typeSupported:R,vendor:O,id:u,config:JSON.stringify(_)})}catch(w){H.logger.warn("Error in worker:",w),H.logger.error("Error while initializing DemuxerWorker, fallback to inline"),S&&self.URL.revokeObjectURL(S.objectURL),this.transmuxer=new W.default(this.observer,R,_,O,u),this.worker=null}}else this.transmuxer=new W.default(this.observer,R,_,O,u)}var f=h.prototype;return f.destroy=function(){var u=this.worker;if(u)u.removeEventListener("message",this.onwmsg),u.terminate(),this.worker=null;else{var s=this.transmuxer;s&&(s.destroy(),this.transmuxer=null)}var a=this.observer;a&&a.removeAllListeners(),this.observer=null},f.push=function(u,s,a,C,_,T,R,O,S,w){var E=this;S.transmuxing.start=self.performance.now();var c=this.transmuxer,x=this.worker,y=T?T.start:_.start,g=_.decryptdata,F=this.frag,U=!(F&&_.cc===F.cc),A=!(F&&S.level===F.level),j=F?S.sn-F.sn:-1,N=this.part?S.part-this.part.index:1,b=!A&&(j===1||j===0&&N===1),Y=self.performance.now();(A||j||_.stats.parsing.start===0)&&(_.stats.parsing.start=Y),T&&(N||!b)&&(T.stats.parsing.start=Y);var re=new W.TransmuxState(U,b,O,A,y);if(!b||U){H.logger.log("[transmuxer-interface, "+_.type+"]: Starting new transmux session for sn: "+S.sn+" p: "+S.part+" level: "+S.level+" id: "+S.id+`
|
|
discontinuity: `+U+`
|
|
trackSwitch: `+A+`
|
|
contiguous: `+b+`
|
|
accurateTimeOffset: `+O+`
|
|
timeOffset: `+y);var fe=new W.TransmuxConfig(a,C,s,R,w);this.configureTransmuxer(fe)}if(this.frag=_,this.part=T,x)x.postMessage({cmd:"demux",data:u,decryptdata:g,chunkMeta:S,state:re},u instanceof ArrayBuffer?[u]:[]);else if(c){var ve=c.push(u,g,S,re);Object(W.isPromise)(ve)?ve.then(function(ke){E.handleTransmuxComplete(ke)}):this.handleTransmuxComplete(ve)}},f.flush=function(u){var s=this;u.transmuxing.start=self.performance.now();var a=this.transmuxer,C=this.worker;if(C)C.postMessage({cmd:"flush",chunkMeta:u});else if(a){var _=a.flush(u);Object(W.isPromise)(_)?_.then(function(T){s.handleFlushResult(T,u)}):this.handleFlushResult(_,u)}},f.handleFlushResult=function(u,s){var a=this;u.forEach(function(C){a.handleTransmuxComplete(C)}),this.onFlush(s)},f.onWorkerMessage=function(u){var s=u.data,a=this.hls;switch(s.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(s.data);break}case"flush":{this.onFlush(s.data);break}default:{s.data=s.data||{},s.data.frag=this.frag,s.data.id=this.id,a.trigger(s.event,s.data);break}}},f.configureTransmuxer=function(u){var s=this.worker,a=this.transmuxer;s?s.postMessage({cmd:"configure",config:u}):a&&a.configure(u)},f.handleTransmuxComplete=function(u){u.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(u)},h}()},"./src/demux/transmuxer-worker.ts":function(oe,$,M){"use strict";M.r($),M.d($,"default",function(){return i});var X=M("./src/demux/transmuxer.ts"),B=M("./src/events.ts"),P=M("./src/utils/logger.ts"),W=M("./node_modules/eventemitter3/index.js"),H=M.n(W);function i(l){var h=new W.EventEmitter,f=function(u,s){l.postMessage({event:u,data:s})};h.on(B.Events.FRAG_DECRYPTED,f),h.on(B.Events.ERROR,f),l.addEventListener("message",function(o){var u=o.data;switch(u.cmd){case"init":{var s=JSON.parse(u.config);l.transmuxer=new X.default(h,u.typeSupported,s,u.vendor,u.id),Object(P.enableLogs)(s.debug),f("init",null);break}case"configure":{l.transmuxer.configure(u.config);break}case"demux":{var a=l.transmuxer.push(u.data,u.decryptdata,u.chunkMeta,u.state);Object(X.isPromise)(a)?a.then(function(T){L(l,T)}):L(l,a);break}case"flush":{var C=u.chunkMeta,_=l.transmuxer.flush(C);Object(X.isPromise)(_)?_.then(function(T){m(l,T,C)}):m(l,_,C);break}default:break}})}function L(l,h){if(p(h.remuxResult))return;var f=[],o=h.remuxResult,u=o.audio,s=o.video;u&&v(f,u),s&&v(f,s),l.postMessage({event:"transmuxComplete",data:h},f)}function v(l,h){h.data1&&l.push(h.data1.buffer),h.data2&&l.push(h.data2.buffer)}function m(l,h,f){h.forEach(function(o){L(l,o)}),l.postMessage({event:"flush",data:f})}function p(l){return!l.audio&&!l.video&&!l.text&&!l.id3&&!l.initSegment}},"./src/demux/transmuxer.ts":function(oe,$,M){"use strict";M.r($),M.d($,"default",function(){return s}),M.d($,"isPromise",function(){return _}),M.d($,"TransmuxConfig",function(){return T}),M.d($,"TransmuxState",function(){return R});var X=M("./src/events.ts"),B=M("./src/errors.ts"),P=M("./src/crypt/decrypter.ts"),W=M("./src/demux/aacdemuxer.ts"),H=M("./src/demux/mp4demuxer.ts"),i=M("./src/demux/tsdemuxer.ts"),L=M("./src/demux/mp3demuxer.ts"),v=M("./src/remux/mp4-remuxer.ts"),m=M("./src/remux/passthrough-remuxer.ts"),p=M("./src/demux/chunk-cache.ts"),l=M("./src/utils/mp4-tools.ts"),h=M("./src/utils/logger.ts"),f;try{f=self.performance.now.bind(self.performance)}catch(O){h.logger.debug("Unable to use Performance API on this environment"),f=self.Date.now}var o=[{demux:i.default,remux:v.default},{demux:H.default,remux:m.default},{demux:W.default,remux:v.default},{demux:L.default,remux:v.default}],u=1024;o.forEach(function(O){var S=O.demux;u=Math.max(u,S.minProbeByteLength)});var s=function(){function O(w,E,c,x,y){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new p.default,this.observer=w,this.typeSupported=E,this.config=c,this.vendor=x,this.id=y}var S=O.prototype;return S.configure=function(E){this.transmuxConfig=E,this.decrypter&&this.decrypter.reset()},S.push=function(E,c,x,y){var g=this,F=x.transmuxing;F.executeStart=f();var U=new Uint8Array(E),A=this.cache,j=this.config,N=this.currentTransmuxState,b=this.transmuxConfig;y&&(this.currentTransmuxState=y);var Y=a(U,c);if(Y&&Y.method==="AES-128"){var re=this.getDecrypter();if(j.enableSoftwareAES){var fe=re.softwareDecrypt(U,Y.key.buffer,Y.iv.buffer);if(!fe)return F.executeEnd=f(),C(x);U=new Uint8Array(fe)}else return this.decryptionPromise=re.webCryptoDecrypt(U,Y.key.buffer,Y.iv.buffer).then(function(Ce){var De=g.push(Ce,null,x);return g.decryptionPromise=null,De}),this.decryptionPromise}var ve=y||N,ke=ve.contiguous,Se=ve.discontinuity,Le=ve.trackSwitch,ye=ve.accurateTimeOffset,_e=ve.timeOffset,de=b.audioCodec,z=b.videoCodec,D=b.defaultInitPts,I=b.duration,V=b.initSegmentData;if((Se||Le)&&this.resetInitSegment(V,de,z,I),Se&&this.resetInitialTimestamp(D),ke||this.resetContiguity(),this.needsProbing(U,Se,Le)){if(A.dataLength){var Q=A.flush();U=Object(l.appendUint8Array)(Q,U)}this.configureTransmuxer(U,b)}var G=this.transmux(U,Y,_e,ye,x),ce=this.currentTransmuxState;return ce.contiguous=!0,ce.discontinuity=!1,ce.trackSwitch=!1,F.executeEnd=f(),G},S.flush=function(E){var c=this,x=E.transmuxing;x.executeStart=f();var y=this.decrypter,g=this.cache,F=this.currentTransmuxState,U=this.decryptionPromise;if(U)return U.then(function(){return c.flush(E)});var A=[],j=F.timeOffset;if(y){var N=y.flush();N&&A.push(this.push(N,null,E))}var b=g.dataLength;g.reset();var Y=this.demuxer,re=this.remuxer;if(!Y||!re)return b>=u&&this.observer.emit(X.Events.ERROR,X.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),x.executeEnd=f(),[C(E)];var fe=Y.flush(j);return _(fe)?fe.then(function(ve){return c.flushRemux(A,ve,E),A}):(this.flushRemux(A,fe,E),A)},S.flushRemux=function(E,c,x){var y=c.audioTrack,g=c.avcTrack,F=c.id3Track,U=c.textTrack,A=this.currentTransmuxState,j=A.accurateTimeOffset,N=A.timeOffset;h.logger.log("[transmuxer.ts]: Flushed fragment "+x.sn+(x.part>-1?" p: "+x.part:"")+" of level "+x.level);var b=this.remuxer.remux(y,g,F,U,N,j,!0,this.id);E.push({remuxResult:b,chunkMeta:x}),x.transmuxing.executeEnd=f()},S.resetInitialTimestamp=function(E){var c=this.demuxer,x=this.remuxer;if(!c||!x)return;c.resetTimeStamp(E),x.resetTimeStamp(E)},S.resetContiguity=function(){var E=this.demuxer,c=this.remuxer;if(!E||!c)return;E.resetContiguity(),c.resetNextTimestamp()},S.resetInitSegment=function(E,c,x,y){var g=this.demuxer,F=this.remuxer;if(!g||!F)return;g.resetInitSegment(c,x,y),F.resetInitSegment(E,c,x)},S.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},S.transmux=function(E,c,x,y,g){var F;return c&&c.method==="SAMPLE-AES"?F=this.transmuxSampleAes(E,c,x,y,g):F=this.transmuxUnencrypted(E,x,y,g),F},S.transmuxUnencrypted=function(E,c,x,y){var g=this.demuxer.demux(E,c,!1,!this.config.progressive),F=g.audioTrack,U=g.avcTrack,A=g.id3Track,j=g.textTrack,N=this.remuxer.remux(F,U,A,j,c,x,!1,this.id);return{remuxResult:N,chunkMeta:y}},S.transmuxSampleAes=function(E,c,x,y,g){var F=this;return this.demuxer.demuxSampleAes(E,c,x).then(function(U){var A=F.remuxer.remux(U.audioTrack,U.avcTrack,U.id3Track,U.textTrack,x,y,!1,F.id);return{remuxResult:A,chunkMeta:g}})},S.configureTransmuxer=function(E,c){for(var x=this.config,y=this.observer,g=this.typeSupported,F=this.vendor,U=c.audioCodec,A=c.defaultInitPts,j=c.duration,N=c.initSegmentData,b=c.videoCodec,Y,re=0,fe=o.length;re<fe;re++)if(o[re].demux.probe(E)){Y=o[re];break}Y||(h.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),Y={demux:H.default,remux:m.default});var ve=this.demuxer,ke=this.remuxer,Se=Y.remux,Le=Y.demux;(!ke||!(ke instanceof Se))&&(this.remuxer=new Se(y,x,g,F)),(!ve||!(ve instanceof Le))&&(this.demuxer=new Le(y,x,g),this.probe=Le.probe),this.resetInitSegment(N,U,b,j),this.resetInitialTimestamp(A)},S.needsProbing=function(E,c,x){return!this.demuxer||!this.remuxer||c||x},S.getDecrypter=function(){var E=this.decrypter;return E||(E=this.decrypter=new P.default(this.observer,this.config)),E},O}();function a(O,S){var w=null;return O.byteLength>0&&S!=null&&S.key!=null&&S.iv!==null&&S.method!=null&&(w=S),w}var C=function(S){return{remuxResult:{},chunkMeta:S}};function _(O){return"then"in O&&O.then instanceof Function}var T=function(S,w,E,c,x){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=S,this.videoCodec=w,this.initSegmentData=E,this.duration=c,this.defaultInitPts=x},R=function(S,w,E,c,x){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=S,this.contiguous=w,this.accurateTimeOffset=E,this.trackSwitch=c,this.timeOffset=x}},"./src/demux/tsdemuxer.ts":function(oe,$,M){"use strict";M.r($),M.d($,"discardEPB",function(){return C});var X=M("./src/demux/adts.ts"),B=M("./src/demux/mpegaudio.ts"),P=M("./src/demux/exp-golomb.ts"),W=M("./src/demux/id3.ts"),H=M("./src/demux/sample-aes.ts"),i=M("./src/events.ts"),L=M("./src/utils/mp4-tools.ts"),v=M("./src/utils/logger.ts"),m=M("./src/errors.ts"),p={video:1,audio:2,id3:3,text:4},l=function(){function _(R,O,S){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=R,this.config=O,this.typeSupported=S}_.probe=function(O){var S=_.syncOffset(O);return S<0?!1:(S&&v.logger.warn("MPEG2-TS detected but first sync word found @ offset "+S+", junk ahead ?"),!0)},_.syncOffset=function(O){for(var S=Math.min(1e3,O.length-3*188),w=0;w<S;){if(O[w]===71&&O[w+188]===71&&O[w+2*188]===71)return w;w++}return-1},_.createTrack=function(O,S){return{container:O==="video"||O==="audio"?"video/mp2t":void 0,type:O,id:p[O],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:O==="audio"?S:void 0}};var T=_.prototype;return T.resetInitSegment=function(O,S,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=S,this._duration=w},T.resetTimeStamp=function(){},T.resetContiguity=function(){var O=this._audioTrack,S=this._avcTrack,w=this._id3Track;O&&(O.pesData=null),S&&(S.pesData=null),w&&(w.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},T.demux=function(O,S,w,E){w===void 0&&(w=!1),E===void 0&&(E=!1),w||(this.sampleAes=null);var c,x=this._avcTrack,y=this._audioTrack,g=this._id3Track,F=x.pid,U=x.pesData,A=y.pid,j=g.pid,N=y.pesData,b=g.pesData,Y=!1,re=this.pmtParsed,fe=this._pmtId,ve=O.length;if(this.remainderData&&(O=Object(L.appendUint8Array)(this.remainderData,O),ve=O.length,this.remainderData=null),ve<188&&!E)return this.remainderData=O,{audioTrack:y,avcTrack:x,id3Track:g,textTrack:this._txtTrack};var ke=Math.max(0,_.syncOffset(O));ve-=(ve+ke)%188,ve<O.byteLength&&!E&&(this.remainderData=new Uint8Array(O.buffer,ve,O.buffer.byteLength-ve));for(var Se=ke;Se<ve;Se+=188)if(O[Se]===71){var Le=!!(O[Se+1]&64),ye=((O[Se+1]&31)<<8)+O[Se+2],_e=(O[Se+3]&48)>>4,de=void 0;if(_e>1){if(de=Se+5+O[Se+4],de===Se+188)continue}else de=Se+4;switch(ye){case F:Le&&(U&&(c=u(U))&&this.parseAVCPES(c,!1),U={data:[],size:0}),U&&(U.data.push(O.subarray(de,Se+188)),U.size+=Se+188-de);break;case A:Le&&(N&&(c=u(N))&&(y.isAAC?this.parseAACPES(c):this.parseMPEGPES(c)),N={data:[],size:0}),N&&(N.data.push(O.subarray(de,Se+188)),N.size+=Se+188-de);break;case j:Le&&(b&&(c=u(b))&&this.parseID3PES(c),b={data:[],size:0}),b&&(b.data.push(O.subarray(de,Se+188)),b.size+=Se+188-de);break;case 0:Le&&(de+=O[de]+1),fe=this._pmtId=f(O,de);break;case fe:{Le&&(de+=O[de]+1);var z=o(O,de,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,w);F=z.avc,F>0&&(x.pid=F),A=z.audio,A>0&&(y.pid=A,y.isAAC=z.isAAC),j=z.id3,j>0&&(g.pid=j),Y&&!re&&(v.logger.log("reparse from beginning"),Y=!1,Se=ke-188),re=this.pmtParsed=!0;break}case 17:case 8191:break;default:Y=!0;break}}else this.observer.emit(i.Events.ERROR,i.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});x.pesData=U,y.pesData=N,g.pesData=b;var D={audioTrack:y,avcTrack:x,id3Track:g,textTrack:this._txtTrack};return E&&this.extractRemainingSamples(D),D},T.flush=function(){var O=this.remainderData;this.remainderData=null;var S;return O?S=this.demux(O,-1,!1,!0):S={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(S),this.sampleAes?this.decrypt(S,this.sampleAes):S},T.extractRemainingSamples=function(O){var S=O.audioTrack,w=O.avcTrack,E=O.id3Track,c=w.pesData,x=S.pesData,y=E.pesData,g;c&&(g=u(c))?(this.parseAVCPES(g,!0),w.pesData=null):w.pesData=c,x&&(g=u(x))?(S.isAAC?this.parseAACPES(g):this.parseMPEGPES(g),S.pesData=null):(x!=null&&x.size&&v.logger.log("last AAC PES packet truncated,might overlap between fragments"),S.pesData=x),y&&(g=u(y))?(this.parseID3PES(g),E.pesData=null):E.pesData=y},T.demuxSampleAes=function(O,S,w){var E=this.demux(O,w,!0,!this.config.progressive),c=this.sampleAes=new H.default(this.observer,this.config,S);return this.decrypt(E,c)},T.decrypt=function(O,S){return new Promise(function(w){var E=O.audioTrack,c=O.avcTrack;E.samples&&E.isAAC?S.decryptAacSamples(E.samples,0,function(){c.samples?S.decryptAvcSamples(c.samples,0,0,function(){w(O)}):w(O)}):c.samples&&S.decryptAvcSamples(c.samples,0,0,function(){w(O)})})},T.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},T.parseAVCPES=function(O,S){var w=this,E=this._avcTrack,c=this.parseAVCNALu(O.data),x=!1,y=this.avcSample,g,F=!1;O.data=null,y&&c.length&&!E.audFound&&(s(y,E),y=this.avcSample=h(!1,O.pts,O.dts,"")),c.forEach(function(U){switch(U.type){case 1:{g=!0,y||(y=w.avcSample=h(!0,O.pts,O.dts,"")),x&&(y.debug+="NDR "),y.frame=!0;var A=U.data;if(F&&A.length>4){var j=new P.default(A).readSliceType();(j===2||j===4||j===7||j===9)&&(y.key=!0)}break}case 5:g=!0,y||(y=w.avcSample=h(!0,O.pts,O.dts,"")),x&&(y.debug+="IDR "),y.key=!0,y.frame=!0;break;case 6:{g=!0,x&&y&&(y.debug+="SEI ");var N=new P.default(C(U.data));N.readUByte();for(var b=0,Y=0,re=!1,fe=0;!re&&N.bytesAvailable>1;){b=0;do fe=N.readUByte(),b+=fe;while(fe===255);Y=0;do fe=N.readUByte(),Y+=fe;while(fe===255);if(b===4&&N.bytesAvailable!==0){re=!0;var ve=N.readUByte();if(ve===181){var ke=N.readUShort();if(ke===49){var Se=N.readUInt();if(Se===1195456820){var Le=N.readUByte();if(Le===3){for(var ye=N.readUByte(),_e=N.readUByte(),de=31&ye,z=[ye,_e],D=0;D<de;D++)z.push(N.readUByte()),z.push(N.readUByte()),z.push(N.readUByte());a(w._txtTrack.samples,{type:3,pts:O.pts,bytes:z})}}}}}else if(b===5&&N.bytesAvailable!==0){if(re=!0,Y>16){for(var I=[],V=0;V<16;V++)I.push(N.readUByte().toString(16)),(V===3||V===5||V===7||V===9)&&I.push("-");for(var Q=Y-16,G=new Uint8Array(Q),ce=0;ce<Q;ce++)G[ce]=N.readUByte();a(w._txtTrack.samples,{pts:O.pts,payloadType:b,uuid:I.join(""),userData:Object(W.utf8ArrayToStr)(G),userDataBytes:G})}}else if(Y<N.bytesAvailable)for(var Ce=0;Ce<Y;Ce++)N.readUByte()}break}case 7:if(g=!0,F=!0,x&&y&&(y.debug+="SPS "),!E.sps){var De=new P.default(U.data),ue=De.readSPS();E.width=ue.width,E.height=ue.height,E.pixelRatio=ue.pixelRatio,E.sps=[U.data],E.duration=w._duration;for(var ge=U.data.subarray(1,4),we="avc1.",Ae=0;Ae<3;Ae++){var Ne=ge[Ae].toString(16);Ne.length<2&&(Ne="0"+Ne),we+=Ne}E.codec=we}break;case 8:g=!0,x&&y&&(y.debug+="PPS "),E.pps||(E.pps=[U.data]);break;case 9:g=!1,E.audFound=!0,y&&s(y,E),y=w.avcSample=h(!1,O.pts,O.dts,x?"AUD ":"");break;case 12:g=!1;break;default:g=!1,y&&(y.debug+="unknown NAL "+U.type+" ");break}if(y&&g){var Be=y.units;Be.push(U)}}),S&&y&&(s(y,E),this.avcSample=null)},T.getLastNalUnit=function(){var O,S=this.avcSample,w;if(!S||S.units.length===0){var E=this._avcTrack.samples;S=E[E.length-1]}if((O=S)!==null&&O!==void 0&&O.units){var c=S.units;w=c[c.length-1]}return w},T.parseAVCNALu=function(O){var S=O.byteLength,w=this._avcTrack,E=w.naluState||0,c=E,x=[],y=0,g,F,U,A=-1,j=0;for(E===-1&&(A=0,j=O[0]&31,E=0,y=1);y<S;){if(g=O[y++],!E){E=g?0:1;continue}if(E===1){E=g?0:2;continue}if(!g)E=3;else if(g===1){if(A>=0){var N={data:O.subarray(A,y-E-1),type:j};x.push(N)}else{var b=this.getLastNalUnit();if(b&&(c&&y<=4-c&&(b.state&&(b.data=b.data.subarray(0,b.data.byteLength-c))),F=y-E-1,F>0)){var Y=new Uint8Array(b.data.byteLength+F);Y.set(b.data,0),Y.set(O.subarray(0,F),b.data.byteLength),b.data=Y,b.state=0}}y<S?(U=O[y]&31,A=y,j=U,E=0):E=-1}else E=0}if(A>=0&&E>=0){var re={data:O.subarray(A,S),type:j,state:E};x.push(re)}if(x.length===0){var fe=this.getLastNalUnit();if(fe){var ve=new Uint8Array(fe.data.byteLength+O.byteLength);ve.set(fe.data,0),ve.set(O,fe.data.byteLength),fe.data=ve}}return w.naluState=E,x},T.parseAACPES=function(O){var S=0,w=this._audioTrack,E=this.aacOverFlow,c=O.data;if(E){this.aacOverFlow=null;var x=E.sample.unit.byteLength,y=Math.min(E.missing,x),g=x-y;E.sample.unit.set(c.subarray(0,y),g),w.samples.push(E.sample),S=E.missing}var F,U;for(F=S,U=c.length;F<U-1&&!X.isHeader(c,F);F++);if(F!==S){var A,j;if(F<U-1?(A="AAC PES did not start with ADTS header,offset:"+F,j=!1):(A="no ADTS header found in AAC PES",j=!0),v.logger.warn("parsing error:"+A),this.observer.emit(i.Events.ERROR,i.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:j,reason:A}),j)return}X.initTrackConfig(w,this.observer,c,F,this.audioCodec);var N;if(O.pts!==void 0)N=O.pts;else if(E){var b=X.getFrameDuration(w.samplerate);N=E.sample.pts+b}else{v.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var Y=0;F<U;)if(X.isHeader(c,F)){if(F+5<U){var re=X.appendFrame(w,c,F,N,Y);if(re)if(re.missing)this.aacOverFlow=re;else{F+=re.length,Y++;continue}}break}else F++},T.parseMPEGPES=function(O){var S=O.data,w=S.length,E=0,c=0,x=O.pts;if(x===void 0){v.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;c<w;)if(B.isHeader(S,c)){var y=B.appendFrame(this._audioTrack,S,c,x,E);if(y)c+=y.length,E++;else break}else c++},T.parseID3PES=function(O){if(O.pts===void 0){v.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(O)},_}();l.minProbeByteLength=188;function h(_,T,R,O){return{key:_,frame:!1,pts:T,dts:R,units:[],debug:O,length:0}}function f(_,T){return(_[T+10]&31)<<8|_[T+11]}function o(_,T,R,O){var S={audio:-1,avc:-1,id3:-1,isAAC:!0},w=(_[T+1]&15)<<8|_[T+2],E=T+3+w-4,c=(_[T+10]&15)<<8|_[T+11];for(T+=12+c;T<E;){var x=(_[T+1]&31)<<8|_[T+2];switch(_[T]){case 207:if(!O){v.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:S.audio===-1&&(S.audio=x);break;case 21:S.id3===-1&&(S.id3=x);break;case 219:if(!O){v.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:S.avc===-1&&(S.avc=x);break;case 3:case 4:R?S.audio===-1&&(S.audio=x,S.isAAC=!1):v.logger.log("MPEG audio found, not supported in this browser");break;case 36:v.logger.warn("Unsupported HEVC stream type found");break;default:break}T+=((_[T+3]&15)<<8|_[T+4])+5}return S}function u(_){var T=0,R,O,S,w,E,c=_.data;if(!_||_.size===0)return null;for(;c[0].length<19&&c.length>1;){var x=new Uint8Array(c[0].length+c[1].length);x.set(c[0]),x.set(c[1],c[0].length),c[0]=x,c.splice(1,1)}R=c[0];var y=(R[0]<<16)+(R[1]<<8)+R[2];if(y===1){if(O=(R[4]<<8)+R[5],O&&O>_.size-6)return null;var g=R[7];g&192&&(w=(R[9]&14)*536870912+(R[10]&255)*4194304+(R[11]&254)*16384+(R[12]&255)*128+(R[13]&254)/2,g&64?(E=(R[14]&14)*536870912+(R[15]&255)*4194304+(R[16]&254)*16384+(R[17]&255)*128+(R[18]&254)/2,w-E>60*9e4&&(v.logger.warn(Math.round((w-E)/9e4)+"s delta between PTS and DTS, align them"),w=E)):E=w),S=R[8];var F=S+9;if(_.size<=F)return null;_.size-=F;for(var U=new Uint8Array(_.size),A=0,j=c.length;A<j;A++){R=c[A];var N=R.byteLength;if(F)if(F>N){F-=N;continue}else R=R.subarray(F),N-=F,F=0;U.set(R,T),T+=N}return O&&(O-=S+3),{data:U,pts:w,dts:E,len:O}}return null}function s(_,T){if(_.units.length&&_.frame){if(_.pts===void 0){var R=T.samples,O=R.length;if(O){var S=R[O-1];_.pts=S.pts,_.dts=S.dts}else{T.dropped++;return}}T.samples.push(_)}_.debug.length&&v.logger.log(_.pts+"/"+_.dts+":"+_.debug)}function a(_,T){var R=_.length;if(R>0){if(T.pts>=_[R-1].pts)_.push(T);else for(var O=R-1;O>=0;O--)if(T.pts<_[O].pts){_.splice(O,0,T);break}}else _.push(T)}function C(_){for(var T=_.byteLength,R=[],O=1;O<T-2;)_[O]===0&&_[O+1]===0&&_[O+2]===3?(R.push(O+2),O+=2):O++;if(R.length===0)return _;var S=T-R.length,w=new Uint8Array(S),E=0;for(O=0;O<S;E++,O++)E===R[0]&&(E++,R.shift()),w[O]=_[E];return w}$.default=l},"./src/errors.ts":function(oe,$,M){"use strict";M.r($),M.d($,"ErrorTypes",function(){return X}),M.d($,"ErrorDetails",function(){return B});var X;(function(P){P.NETWORK_ERROR="networkError",P.MEDIA_ERROR="mediaError",P.KEY_SYSTEM_ERROR="keySystemError",P.MUX_ERROR="muxError",P.OTHER_ERROR="otherError"})(X||(X={}));var B;(function(P){P.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",P.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",P.KEY_SYSTEM_NO_SESSION="keySystemNoSession",P.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",P.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",P.MANIFEST_LOAD_ERROR="manifestLoadError",P.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",P.MANIFEST_PARSING_ERROR="manifestParsingError",P.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",P.LEVEL_EMPTY_ERROR="levelEmptyError",P.LEVEL_LOAD_ERROR="levelLoadError",P.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",P.LEVEL_SWITCH_ERROR="levelSwitchError",P.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",P.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",P.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",P.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",P.FRAG_LOAD_ERROR="fragLoadError",P.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",P.FRAG_DECRYPT_ERROR="fragDecryptError",P.FRAG_PARSING_ERROR="fragParsingError",P.REMUX_ALLOC_ERROR="remuxAllocError",P.KEY_LOAD_ERROR="keyLoadError",P.KEY_LOAD_TIMEOUT="keyLoadTimeOut",P.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",P.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",P.BUFFER_APPEND_ERROR="bufferAppendError",P.BUFFER_APPENDING_ERROR="bufferAppendingError",P.BUFFER_STALLED_ERROR="bufferStalledError",P.BUFFER_FULL_ERROR="bufferFullError",P.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",P.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",P.INTERNAL_EXCEPTION="internalException",P.INTERNAL_ABORTED="aborted",P.UNKNOWN="unknown"})(B||(B={}))},"./src/events.ts":function(oe,$,M){"use strict";M.r($),M.d($,"Events",function(){return X});var X;(function(B){B.MEDIA_ATTACHING="hlsMediaAttaching",B.MEDIA_ATTACHED="hlsMediaAttached",B.MEDIA_DETACHING="hlsMediaDetaching",B.MEDIA_DETACHED="hlsMediaDetached",B.BUFFER_RESET="hlsBufferReset",B.BUFFER_CODECS="hlsBufferCodecs",B.BUFFER_CREATED="hlsBufferCreated",B.BUFFER_APPENDING="hlsBufferAppending",B.BUFFER_APPENDED="hlsBufferAppended",B.BUFFER_EOS="hlsBufferEos",B.BUFFER_FLUSHING="hlsBufferFlushing",B.BUFFER_FLUSHED="hlsBufferFlushed",B.MANIFEST_LOADING="hlsManifestLoading",B.MANIFEST_LOADED="hlsManifestLoaded",B.MANIFEST_PARSED="hlsManifestParsed",B.LEVEL_SWITCHING="hlsLevelSwitching",B.LEVEL_SWITCHED="hlsLevelSwitched",B.LEVEL_LOADING="hlsLevelLoading",B.LEVEL_LOADED="hlsLevelLoaded",B.LEVEL_UPDATED="hlsLevelUpdated",B.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",B.LEVELS_UPDATED="hlsLevelsUpdated",B.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",B.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",B.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",B.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",B.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",B.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",B.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",B.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",B.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",B.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",B.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",B.CUES_PARSED="hlsCuesParsed",B.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",B.INIT_PTS_FOUND="hlsInitPtsFound",B.FRAG_LOADING="hlsFragLoading",B.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",B.FRAG_LOADED="hlsFragLoaded",B.FRAG_DECRYPTED="hlsFragDecrypted",B.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",B.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",B.FRAG_PARSING_METADATA="hlsFragParsingMetadata",B.FRAG_PARSED="hlsFragParsed",B.FRAG_BUFFERED="hlsFragBuffered",B.FRAG_CHANGED="hlsFragChanged",B.FPS_DROP="hlsFpsDrop",B.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",B.ERROR="hlsError",B.DESTROYING="hlsDestroying",B.KEY_LOADING="hlsKeyLoading",B.KEY_LOADED="hlsKeyLoaded",B.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",B.BACK_BUFFER_REACHED="hlsBackBufferReached"})(X||(X={}))},"./src/hls.ts":function(oe,$,M){"use strict";M.r($),M.d($,"default",function(){return _});var X=M("./node_modules/url-toolkit/src/url-toolkit.js"),B=M.n(X),P=M("./src/loader/playlist-loader.ts"),W=M("./src/loader/key-loader.ts"),H=M("./src/controller/id3-track-controller.ts"),i=M("./src/controller/latency-controller.ts"),L=M("./src/controller/level-controller.ts"),v=M("./src/controller/fragment-tracker.ts"),m=M("./src/controller/stream-controller.ts"),p=M("./src/is-supported.ts"),l=M("./src/utils/logger.ts"),h=M("./src/config.ts"),f=M("./node_modules/eventemitter3/index.js"),o=M.n(f),u=M("./src/events.ts"),s=M("./src/errors.ts");function a(T,R){for(var O=0;O<R.length;O++){var S=R[O];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(T,S.key,S)}}function C(T,R,O){return R&&a(T.prototype,R),O&&a(T,O),T}var _=function(){T.isSupported=function(){return Object(p.isSupported)()};function T(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 S=this.config=Object(h.mergeConfig)(T.DefaultConfig,O);this.userConfig=O,Object(l.enableLogs)(S.debug),this._autoLevelCapping=-1,S.progressive&&Object(h.enableStreamingMode)(S);var w=S.abrController,E=S.bufferController,c=S.capLevelController,x=S.fpsController,y=this.abrController=new w(this),g=this.bufferController=new E(this),F=this.capLevelController=new c(this),U=new x(this),A=new P.default(this),j=new W.default(this),N=new H.default(this),b=this.levelController=new L.default(this),Y=new v.FragmentTracker(this),re=this.streamController=new m.default(this,Y);F.setStreamController(re),U.setStreamController(re);var fe=[b,re];this.networkControllers=fe;var ve=[A,j,y,g,F,U,N,Y];this.audioTrackController=this.createController(S.audioTrackController,null,fe),this.createController(S.audioStreamController,Y,fe),this.subtitleTrackController=this.createController(S.subtitleTrackController,null,fe),this.createController(S.subtitleStreamController,Y,fe),this.createController(S.timelineController,null,ve),this.emeController=this.createController(S.emeController,null,ve),this.cmcdController=this.createController(S.cmcdController,null,ve),this.latencyController=this.createController(i.default,null,ve),this.coreComponents=ve}var R=T.prototype;return R.createController=function(S,w,E){if(S){var c=w?new S(this,w):new S(this);return E&&E.push(c),c}return null},R.on=function(S,w,E){E===void 0&&(E=this),this._emitter.on(S,w,E)},R.once=function(S,w,E){E===void 0&&(E=this),this._emitter.once(S,w,E)},R.removeAllListeners=function(S){this._emitter.removeAllListeners(S)},R.off=function(S,w,E,c){E===void 0&&(E=this),this._emitter.off(S,w,E,c)},R.listeners=function(S){return this._emitter.listeners(S)},R.emit=function(S,w,E){return this._emitter.emit(S,w,E)},R.trigger=function(S,w){if(this.config.debug)return this.emit(S,S,w);try{return this.emit(S,S,w)}catch(E){l.logger.error("An internal error happened while handling event "+S+'. Error message: "'+E.message+'". Here is a stacktrace:',E),this.trigger(u.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:S,error:E})}return!1},R.listenerCount=function(S){return this._emitter.listenerCount(S)},R.destroy=function(){l.logger.log("destroy"),this.trigger(u.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(S){return S.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(S){return S.destroy()}),this.coreComponents.length=0},R.attachMedia=function(S){l.logger.log("attachMedia"),this._media=S,this.trigger(u.Events.MEDIA_ATTACHING,{media:S})},R.detachMedia=function(){l.logger.log("detachMedia"),this.trigger(u.Events.MEDIA_DETACHING,void 0),this._media=null},R.loadSource=function(S){this.stopLoad();var w=this.media,E=this.url,c=this.url=X.buildAbsoluteURL(self.location.href,S,{alwaysNormalize:!0});l.logger.log("loadSource:"+c),w&&E&&E!==c&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(w)),this.trigger(u.Events.MANIFEST_LOADING,{url:S})},R.startLoad=function(S){S===void 0&&(S=-1),l.logger.log("startLoad("+S+")"),this.networkControllers.forEach(function(w){w.startLoad(S)})},R.stopLoad=function(){l.logger.log("stopLoad"),this.networkControllers.forEach(function(S){S.stopLoad()})},R.swapAudioCodec=function(){l.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},R.recoverMediaError=function(){l.logger.log("recoverMediaError");var S=this._media;this.detachMedia(),S&&this.attachMedia(S)},R.removeLevel=function(S,w){w===void 0&&(w=0),this.levelController.removeLevel(S,w)},C(T,[{key:"levels",get:function(){var S=this.levelController.levels;return S||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(S){l.logger.log("set currentLevel:"+S),this.loadLevel=S,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(S){l.logger.log("set nextLevel:"+S),this.levelController.manualLevel=S,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(S){l.logger.log("set loadLevel:"+S),this.levelController.manualLevel=S}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(S){this.levelController.nextLoadLevel=S}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(S){l.logger.log("set firstLevel:"+S),this.levelController.firstLevel=S}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(S){l.logger.log("set startLevel:"+S),S!==-1&&(S=Math.max(S,this.minAutoLevel)),this.levelController.startLevel=S}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(S){var w=!!S;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(S){this._autoLevelCapping!==S&&(l.logger.log("set autoLevelCapping:"+S),this._autoLevelCapping=S)}},{key:"bandwidthEstimate",get:function(){var S=this.abrController.bwEstimator;return S?S.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var S=this.levels,w=this.config.minAutoBitrate;if(!S)return 0;for(var E=S.length,c=0;c<E;c++)if(S[c].maxBitrate>w)return c;return 0}},{key:"maxAutoLevel",get:function(){var S=this.levels,w=this.autoLevelCapping,E;return w===-1&&S&&S.length?E=S.length-1:E=w,E}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(S){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,S)}},{key:"audioTracks",get:function(){var S=this.audioTrackController;return S?S.audioTracks:[]}},{key:"audioTrack",get:function(){var S=this.audioTrackController;return S?S.audioTrack:-1},set:function(S){var w=this.audioTrackController;w&&(w.audioTrack=S)}},{key:"subtitleTracks",get:function(){var S=this.subtitleTrackController;return S?S.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var S=this.subtitleTrackController;return S?S.subtitleTrack:-1},set:function(S){var w=this.subtitleTrackController;w&&(w.subtitleTrack=S)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var S=this.subtitleTrackController;return S?S.subtitleDisplay:!1},set:function(S){var w=this.subtitleTrackController;w&&(w.subtitleDisplay=S)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(S){this.config.lowLatencyMode=S}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return u.Events}},{key:"ErrorTypes",get:function(){return s.ErrorTypes}},{key:"ErrorDetails",get:function(){return s.ErrorDetails}},{key:"DefaultConfig",get:function(){return T.defaultConfig?T.defaultConfig:h.hlsDefaultConfig},set:function(S){T.defaultConfig=S}}]),T}();_.defaultConfig=void 0},"./src/is-supported.ts":function(oe,$,M){"use strict";M.r($),M.d($,"isSupported",function(){return P}),M.d($,"changeTypeSupported",function(){return W});var X=M("./src/utils/mediasource-helper.ts");function B(){return self.SourceBuffer||self.WebKitSourceBuffer}function P(){var H=Object(X.getMediaSource)();if(!H)return!1;var i=B(),L=H&&typeof H.isTypeSupported=="function"&&H.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),v=!i||i.prototype&&typeof i.prototype.appendBuffer=="function"&&typeof i.prototype.remove=="function";return!!L&&!!v}function W(){var H,i=B();return typeof(i==null||((H=i.prototype)===null||H===void 0)?void 0:H.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(oe,$,M){"use strict";M.r($),M.d($,"default",function(){return l}),M.d($,"LoadError",function(){return f});var X=M("./src/polyfills/number.ts"),B=M("./src/errors.ts");function P(o,u){o.prototype=Object.create(u.prototype),o.prototype.constructor=o,v(o,u)}function W(o){var u=typeof Map=="function"?new Map:void 0;return W=function(a){if(a===null||!L(a))return a;if(typeof a!="function")throw new TypeError("Super expression must either be null or a function");if(typeof u!="undefined"){if(u.has(a))return u.get(a);u.set(a,C)}function C(){return H(a,arguments,m(this).constructor)}return C.prototype=Object.create(a.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),v(C,a)},W(o)}function H(o,u,s){return i()?H=Reflect.construct:H=function(C,_,T){var R=[null];R.push.apply(R,_);var O=Function.bind.apply(C,R),S=new O;return T&&v(S,T.prototype),S},H.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(o){return!1}}function L(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function v(o,u){return v=Object.setPrototypeOf||function(a,C){return a.__proto__=C,a},v(o,u)}function m(o){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},m(o)}var p=Math.pow(2,17),l=function(){function o(s){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=s}var u=o.prototype;return u.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},u.abort=function(){this.loader&&this.loader.abort()},u.load=function(a,C){var _=this,T=a.url;if(!T)return Promise.reject(new f({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,networkDetails:null},"Fragment does not have a "+(T?"part list":"url")));this.abort();var R=this.config,O=R.fLoader,S=R.loader;return new Promise(function(w,E){_.loader&&_.loader.destroy();var c=_.loader=a.loader=O?new O(R):new S(R),x=h(a),y={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:p};a.stats=c.stats,c.load(x,y,{onSuccess:function(F,U,A,j){_.resetLoader(a,c),w({frag:a,part:null,payload:F.data,networkDetails:j})},onError:function(F,U,A){_.resetLoader(a,c),E(new f({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,response:F,networkDetails:A}))},onAbort:function(F,U,A){_.resetLoader(a,c),E(new f({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,networkDetails:A}))},onTimeout:function(F,U,A){_.resetLoader(a,c),E(new f({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,networkDetails:A}))},onProgress:function(F,U,A,j){C&&C({frag:a,part:null,payload:A,networkDetails:j})}})})},u.loadPart=function(a,C,_){var T=this;this.abort();var R=this.config,O=R.fLoader,S=R.loader;return new Promise(function(w,E){T.loader&&T.loader.destroy();var c=T.loader=a.loader=O?new O(R):new S(R),x=h(a,C),y={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:p};C.stats=c.stats,c.load(x,y,{onSuccess:function(F,U,A,j){T.resetLoader(a,c),T.updateStatsFromPart(a,C);var N={frag:a,part:C,payload:F.data,networkDetails:j};_(N),w(N)},onError:function(F,U,A){T.resetLoader(a,c),E(new f({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,part:C,response:F,networkDetails:A}))},onAbort:function(F,U,A){a.stats.aborted=C.stats.aborted,T.resetLoader(a,c),E(new f({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,part:C,networkDetails:A}))},onTimeout:function(F,U,A){T.resetLoader(a,c),E(new f({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,part:C,networkDetails:A}))}})})},u.updateStatsFromPart=function(a,C){var _=a.stats,T=C.stats,R=T.total;if(_.loaded+=T.loaded,R){var O=Math.round(a.duration/C.duration),S=Math.min(Math.round(_.loaded/R),O),w=O-S,E=w*Math.round(_.loaded/S);_.total=_.loaded+E}else _.total=Math.max(_.loaded,_.total);var c=_.loading,x=T.loading;c.start?c.first+=x.first-x.start:(c.start=x.start,c.first=x.first),c.end=x.end},u.resetLoader=function(a,C){a.loader=null,this.loader===C&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),C.destroy()},o}();function h(o,u){u===void 0&&(u=null);var s=u||o,a={frag:o,part:u,responseType:"arraybuffer",url:s.url,headers:{},rangeStart:0,rangeEnd:0},C=s.byteRangeStartOffset,_=s.byteRangeEndOffset;return Object(X.isFiniteNumber)(C)&&Object(X.isFiniteNumber)(_)&&(a.rangeStart=C,a.rangeEnd=_),a}var f=function(o){P(u,o);function u(s){for(var a,C=arguments.length,_=new Array(C>1?C-1:0),T=1;T<C;T++)_[T-1]=arguments[T];return a=o.call.apply(o,[this].concat(_))||this,a.data=void 0,a.data=s,a}return u}(W(Error))},"./src/loader/fragment.ts":function(oe,$,M){"use strict";M.r($),M.d($,"ElementaryStreamTypes",function(){return l}),M.d($,"BaseSegment",function(){return h}),M.d($,"Fragment",function(){return f}),M.d($,"Part",function(){return o});var X=M("./src/polyfills/number.ts"),B=M("./node_modules/url-toolkit/src/url-toolkit.js"),P=M.n(B),W=M("./src/utils/logger.ts"),H=M("./src/loader/level-key.ts"),i=M("./src/loader/load-stats.ts");function L(u,s){u.prototype=Object.create(s.prototype),u.prototype.constructor=u,v(u,s)}function v(u,s){return v=Object.setPrototypeOf||function(C,_){return C.__proto__=_,C},v(u,s)}function m(u,s){for(var a=0;a<s.length;a++){var C=s[a];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(u,C.key,C)}}function p(u,s,a){return s&&m(u.prototype,s),a&&m(u,a),u}var l;(function(u){u.AUDIO="audio",u.VIDEO="video",u.AUDIOVIDEO="audiovideo"})(l||(l={}));var h=function(){function u(a){var C;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(C={},C[l.AUDIO]=null,C[l.VIDEO]=null,C[l.AUDIOVIDEO]=null,C),this.baseurl=a}var s=u.prototype;return s.setByteRange=function(C,_){var T=C.split("@",2),R=[];T.length===1?R[0]=_?_.byteRangeEndOffset:0:R[0]=parseInt(T[1]),R[1]=parseInt(T[0])+R[0],this._byteRange=R},p(u,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(B.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(C){this._url=C}}]),u}(),f=function(u){L(s,u);function s(C,_){var T;return T=u.call(this,_)||this,T._decryptdata=null,T.rawProgramDateTime=null,T.programDateTime=null,T.tagList=[],T.duration=0,T.sn=0,T.levelkey=void 0,T.type=void 0,T.loader=null,T.level=-1,T.cc=0,T.startPTS=void 0,T.endPTS=void 0,T.appendedPTS=void 0,T.startDTS=void 0,T.endDTS=void 0,T.start=0,T.deltaPTS=void 0,T.maxStartPTS=void 0,T.minEndPTS=void 0,T.stats=new i.LoadStats,T.urlId=0,T.data=void 0,T.bitrateTest=!1,T.title=null,T.initSegment=null,T.type=C,T}var a=s.prototype;return a.createInitializationVector=function(_){for(var T=new Uint8Array(16),R=12;R<16;R++)T[R]=_>>8*(15-R)&255;return T},a.setDecryptDataFromLevelKey=function(_,T){var R=_;return(_==null?void 0:_.method)==="AES-128"&&_.uri&&!_.iv&&(R=H.LevelKey.fromURI(_.uri),R.method=_.method,R.iv=this.createInitializationVector(T),R.keyFormat="identity"),R},a.setElementaryStreamInfo=function(_,T,R,O,S,w){w===void 0&&(w=!1);var E=this.elementaryStreams,c=E[_];if(!c){E[_]={startPTS:T,endPTS:R,startDTS:O,endDTS:S,partial:w};return}c.startPTS=Math.min(c.startPTS,T),c.endPTS=Math.max(c.endPTS,R),c.startDTS=Math.min(c.startDTS,O),c.endDTS=Math.max(c.endDTS,S)},a.clearElementaryStreamInfo=function(){var _=this.elementaryStreams;_[l.AUDIO]=null,_[l.VIDEO]=null,_[l.AUDIOVIDEO]=null},p(s,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var _=this.sn;typeof _!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&W.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),_=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,_)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(X.isFiniteNumber)(this.programDateTime))return null;var _=Object(X.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+_*1e3}},{key:"encrypted",get:function(){var _;return!!((_=this.decryptdata)!==null&&_!==void 0&&_.keyFormat&&this.decryptdata.uri)}}]),s}(h),o=function(u){L(s,u);function s(a,C,_,T,R){var O;O=u.call(this,_)||this,O.fragOffset=0,O.duration=0,O.gap=!1,O.independent=!1,O.relurl=void 0,O.fragment=void 0,O.index=void 0,O.stats=new i.LoadStats,O.duration=a.decimalFloatingPoint("DURATION"),O.gap=a.bool("GAP"),O.independent=a.bool("INDEPENDENT"),O.relurl=a.enumeratedString("URI"),O.fragment=C,O.index=T;var S=a.enumeratedString("BYTERANGE");return S&&O.setByteRange(S,R),R&&(O.fragOffset=R.fragOffset+R.duration),O}return p(s,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var C=this.elementaryStreams;return!!(C.audio||C.video||C.audiovideo)}}]),s}(h)},"./src/loader/key-loader.ts":function(oe,$,M){"use strict";M.r($),M.d($,"default",function(){return W});var X=M("./src/events.ts"),B=M("./src/errors.ts"),P=M("./src/utils/logger.ts"),W=function(){function H(L){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=L,this._registerListeners()}var i=H.prototype;return i._registerListeners=function(){this.hls.on(X.Events.KEY_LOADING,this.onKeyLoading,this)},i._unregisterListeners=function(){this.hls.off(X.Events.KEY_LOADING,this.onKeyLoading)},i.destroy=function(){this._unregisterListeners();for(var v in this.loaders){var m=this.loaders[v];m&&m.destroy()}this.loaders={}},i.onKeyLoading=function(v,m){var p=m.frag,l=p.type,h=this.loaders[l];if(!p.decryptdata){P.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var f=p.decryptdata.uri;if(f!==this.decrypturl||this.decryptkey===null){var o=this.hls.config;if(h&&(P.logger.warn("abort previous key loader for type:"+l),h.abort()),!f){P.logger.warn("key uri is falsy");return}var u=o.loader,s=p.loader=this.loaders[l]=new u(o);this.decrypturl=f,this.decryptkey=null;var a={url:f,frag:p,responseType:"arraybuffer"},C={timeout:o.fragLoadingTimeOut,maxRetry:0,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout,highWaterMark:0},_={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};s.load(a,C,_)}else this.decryptkey&&(p.decryptdata.key=this.decryptkey,this.hls.trigger(X.Events.KEY_LOADED,{frag:p}))},i.loadsuccess=function(v,m,p){var l=p.frag;if(!l.decryptdata){P.logger.error("after key load, decryptdata unset");return}this.decryptkey=l.decryptdata.key=new Uint8Array(v.data),l.loader=null,delete this.loaders[l.type],this.hls.trigger(X.Events.KEY_LOADED,{frag:l})},i.loaderror=function(v,m){var p=m.frag,l=p.loader;l&&l.abort(),delete this.loaders[p.type],this.hls.trigger(X.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:p,response:v})},i.loadtimeout=function(v,m){var p=m.frag,l=p.loader;l&&l.abort(),delete this.loaders[p.type],this.hls.trigger(X.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:p})},H}()},"./src/loader/level-details.ts":function(oe,$,M){"use strict";M.r($),M.d($,"LevelDetails",function(){return H});var X=M("./src/polyfills/number.ts");function B(i,L){for(var v=0;v<L.length;v++){var m=L[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(i,m.key,m)}}function P(i,L,v){return L&&B(i.prototype,L),v&&B(i,v),i}var W=10,H=function(){function i(v){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=v}var L=i.prototype;return L.reloaded=function(m){if(!m){this.advanced=!0,this.updated=!0;return}var p=this.lastPartSn-m.lastPartSn,l=this.lastPartIndex-m.lastPartIndex;this.updated=this.endSN!==m.endSN||!!l||!!p,this.advanced=this.endSN>m.endSN||p>0||p===0&&l>0,this.updated||this.advanced?this.misses=Math.floor(m.misses*.6):this.misses=m.misses+1,this.availabilityDelay=m.availabilityDelay},P(i,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(X.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||W}},{key:"drift",get:function(){var m=this.driftEndTime-this.driftStartTime;if(m>0){var p=this.driftEnd-this.driftStart;return p*1e3/m}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var m;return(m=this.fragments)!==null&&m!==void 0&&m.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),i}()},"./src/loader/level-key.ts":function(oe,$,M){"use strict";M.r($),M.d($,"LevelKey",function(){return H});var X=M("./node_modules/url-toolkit/src/url-toolkit.js"),B=M.n(X);function P(i,L){for(var v=0;v<L.length;v++){var m=L[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(i,m.key,m)}}function W(i,L,v){return L&&P(i.prototype,L),v&&P(i,v),i}var H=function(){i.fromURL=function(v,m){return new i(v,m)},i.fromURI=function(v){return new i(v)};function i(L,v){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,v?this._uri=Object(X.buildAbsoluteURL)(L,v,{alwaysNormalize:!0}):this._uri=L}return W(i,[{key:"uri",get:function(){return this._uri}}]),i}()},"./src/loader/load-stats.ts":function(oe,$,M){"use strict";M.r($),M.d($,"LoadStats",function(){return X});var X=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(oe,$,M){"use strict";M.r($),M.d($,"default",function(){return s});var X=M("./src/polyfills/number.ts"),B=M("./node_modules/url-toolkit/src/url-toolkit.js"),P=M.n(B),W=M("./src/loader/fragment.ts"),H=M("./src/loader/level-details.ts"),i=M("./src/loader/level-key.ts"),L=M("./src/utils/attr-list.ts"),v=M("./src/utils/logger.ts"),m=M("./src/utils/codecs.ts"),p=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,l=/#EXT-X-MEDIA:(.*)/g,h=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),f=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),o=/\.(mp4|m4s|m4v|m4a)$/i;function u(R){var O,S;return o.test((O=(S=B.parseURL(R))===null||S===void 0?void 0:S.path)!=null?O:"")}var s=function(){function R(){}return R.findGroup=function(S,w){for(var E=0;E<S.length;E++){var c=S[E];if(c.id===w)return c}},R.convertAVC1ToAVCOTI=function(S){var w=S.split(".");if(w.length>2){var E=w.shift()+".";return E+=parseInt(w.shift()).toString(16),E+=("000"+parseInt(w.shift()).toString(16)).substr(-4),E}return S},R.resolve=function(S,w){return B.buildAbsoluteURL(w,S,{alwaysNormalize:!0})},R.parseMasterPlaylist=function(S,w){var E=[],c={},x=!1;p.lastIndex=0;for(var y;(y=p.exec(S))!=null;)if(y[1]){var g=new L.AttrList(y[1]),F={attrs:g,bitrate:g.decimalInteger("AVERAGE-BANDWIDTH")||g.decimalInteger("BANDWIDTH"),name:g.NAME,url:R.resolve(y[2],w)},U=g.decimalResolution("RESOLUTION");U&&(F.width=U.width,F.height=U.height),a((g.CODECS||"").split(/[ ,]+/).filter(function(j){return j}),F),F.videoCodec&&F.videoCodec.indexOf("avc1")!==-1&&(F.videoCodec=R.convertAVC1ToAVCOTI(F.videoCodec)),E.push(F)}else if(y[3]){var A=new L.AttrList(y[3]);A["DATA-ID"]&&(x=!0,c[A["DATA-ID"]]=A)}return{levels:E,sessionData:x?c:null}},R.parseMasterPlaylistMedia=function(S,w,E,c){c===void 0&&(c=[]);var x,y=[],g=0;for(l.lastIndex=0;(x=l.exec(S))!==null;){var F=new L.AttrList(x[1]);if(F.TYPE===E){var U={attrs:F,bitrate:0,id:g++,groupId:F["GROUP-ID"],instreamId:F["INSTREAM-ID"],name:F.NAME||F.LANGUAGE||"",type:E,default:F.bool("DEFAULT"),autoselect:F.bool("AUTOSELECT"),forced:F.bool("FORCED"),lang:F.LANGUAGE,url:F.URI?R.resolve(F.URI,w):""};if(c.length){var A=R.findGroup(c,U.groupId)||c[0];C(U,A,"audioCodec"),C(U,A,"textCodec")}y.push(U)}}return y},R.parseLevelPlaylist=function(S,w,E,c,x){var y=new H.LevelDetails(w),g=y.fragments,F=null,U=0,A=0,j=0,N=0,b=null,Y=new W.Fragment(c,w),re,fe,ve,ke=-1,Se=!1;for(h.lastIndex=0,y.m3u8=S;(re=h.exec(S))!==null;){Se&&(Se=!1,Y=new W.Fragment(c,w),Y.start=j,Y.sn=U,Y.cc=N,Y.level=E,F&&(Y.initSegment=F,Y.rawProgramDateTime=F.rawProgramDateTime));var Le=re[1];if(Le){Y.duration=parseFloat(Le);var ye=(" "+re[2]).slice(1);Y.title=ye||null,Y.tagList.push(ye?["INF",Le,ye]:["INF",Le])}else if(re[3])Object(X.isFiniteNumber)(Y.duration)&&(Y.start=j,ve&&(Y.levelkey=ve),Y.sn=U,Y.level=E,Y.cc=N,Y.urlId=x,g.push(Y),Y.relurl=(" "+re[3]).slice(1),T(Y,b),b=Y,j+=Y.duration,U++,A=0,Se=!0);else if(re[4]){var _e=(" "+re[4]).slice(1);b?Y.setByteRange(_e,b):Y.setByteRange(_e)}else if(re[5])Y.rawProgramDateTime=(" "+re[5]).slice(1),Y.tagList.push(["PROGRAM-DATE-TIME",Y.rawProgramDateTime]),ke===-1&&(ke=g.length);else{if(re=re[0].match(f),!re){v.logger.warn("No matches on slow regex match for level playlist!");continue}for(fe=1;fe<re.length&&!(typeof re[fe]!="undefined");fe++);var de=(" "+re[fe]).slice(1),z=(" "+re[fe+1]).slice(1),D=re[fe+2]?(" "+re[fe+2]).slice(1):"";switch(de){case"PLAYLIST-TYPE":y.type=z.toUpperCase();break;case"MEDIA-SEQUENCE":U=y.startSN=parseInt(z);break;case"SKIP":{var I=new L.AttrList(z),V=I.decimalInteger("SKIPPED-SEGMENTS");if(Object(X.isFiniteNumber)(V)){y.skippedSegments=V;for(var Q=V;Q--;)g.unshift(null);U+=V}var G=I.enumeratedString("RECENTLY-REMOVED-DATERANGES");G&&(y.recentlyRemovedDateranges=G.split(" "));break}case"TARGETDURATION":y.targetduration=parseFloat(z);break;case"VERSION":y.version=parseInt(z);break;case"EXTM3U":break;case"ENDLIST":y.live=!1;break;case"#":(z||D)&&Y.tagList.push(D?[z,D]:[z]);break;case"DIS":N++;case"GAP":Y.tagList.push([de]);break;case"BITRATE":Y.tagList.push([de,z]);break;case"DISCONTINUITY-SEQ":N=parseInt(z);break;case"KEY":{var ce,Ce=new L.AttrList(z),De=Ce.enumeratedString("METHOD"),ue=Ce.URI,ge=Ce.hexadecimalInteger("IV"),we=Ce.enumeratedString("KEYFORMATVERSIONS"),Ae=Ce.enumeratedString("KEYID"),Ne=(ce=Ce.enumeratedString("KEYFORMAT"))!=null?ce:"identity",Be=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Be.indexOf(Ne)>-1){v.logger.warn("Keyformat "+Ne+" is not supported from the manifest");continue}else if(Ne!=="identity")continue;De&&(ve=i.LevelKey.fromURL(w,ue),ue&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(De)>=0&&(ve.method=De,ve.keyFormat=Ne,Ae&&(ve.keyID=Ae),we&&(ve.keyFormatVersions=we),ve.iv=ge));break}case"START":{var Ge=new L.AttrList(z),He=Ge.decimalFloatingPoint("TIME-OFFSET");Object(X.isFiniteNumber)(He)&&(y.startTimeOffset=He);break}case"MAP":{var qe=new L.AttrList(z);Y.relurl=qe.URI,qe.BYTERANGE&&Y.setByteRange(qe.BYTERANGE),Y.level=E,Y.sn="initSegment",ve&&(Y.levelkey=ve),Y.initSegment=null,F=Y,Se=!0;break}case"SERVER-CONTROL":{var je=new L.AttrList(z);y.canBlockReload=je.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=je.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&je.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=je.optionalFloat("PART-HOLD-BACK",0),y.holdBack=je.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ke=new L.AttrList(z);y.partTarget=Ke.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Me=y.partList;Me||(Me=y.partList=[]);var et=A>0?Me[Me.length-1]:void 0,Je=A++,le=new W.Part(new L.AttrList(z),Y,w,Je,et);Me.push(le),Y.duration+=le.duration;break}case"PRELOAD-HINT":{var q=new L.AttrList(z);y.preloadHint=q;break}case"RENDITION-REPORT":{var te=new L.AttrList(z);y.renditionReports=y.renditionReports||[],y.renditionReports.push(te);break}default:v.logger.warn("line parsed but not handled: "+re);break}}}b&&!b.relurl?(g.pop(),j-=b.duration,y.partList&&(y.fragmentHint=b)):y.partList&&(T(Y,b),Y.cc=N,y.fragmentHint=Y);var se=g.length,he=g[0],ie=g[se-1];if(j+=y.skippedSegments*y.targetduration,j>0&&se&&ie){y.averagetargetduration=j/se;var ae=ie.sn;y.endSN=ae!=="initSegment"?ae:0,he&&(y.startCC=he.cc,he.initSegment||y.fragments.every(function(pe){return pe.relurl&&u(pe.relurl)})&&(v.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),Y=new W.Fragment(c,w),Y.relurl=ie.relurl,Y.level=E,Y.sn="initSegment",he.initSegment=Y,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(j+=y.fragmentHint.duration),y.totalduration=j,y.endCC=N,ke>0&&_(g,ke),y},R}();function a(R,O){["video","audio","text"].forEach(function(S){var w=R.filter(function(c){return Object(m.isCodecType)(c,S)});if(w.length){var E=w.filter(function(c){return c.lastIndexOf("avc1",0)===0||c.lastIndexOf("mp4a",0)===0});O[S+"Codec"]=E.length>0?E[0]:w[0],R=R.filter(function(c){return w.indexOf(c)===-1})}}),O.unknownCodecs=R}function C(R,O,S){var w=O[S];w&&(R[S]=w)}function _(R,O){for(var S=R[O],w=O;w--;){var E=R[w];if(!E)return;E.programDateTime=S.programDateTime-E.duration*1e3,S=E}}function T(R,O){R.rawProgramDateTime?R.programDateTime=Date.parse(R.rawProgramDateTime):O!=null&&O.programDateTime&&(R.programDateTime=O.endProgramDateTime),Object(X.isFiniteNumber)(R.programDateTime)||(R.programDateTime=null,R.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(oe,$,M){"use strict";M.r($);var X=M("./src/polyfills/number.ts"),B=M("./src/events.ts"),P=M("./src/errors.ts"),W=M("./src/utils/logger.ts"),H=M("./src/utils/mp4-tools.ts"),i=M("./src/loader/m3u8-parser.ts"),L=M("./src/types/loader.ts"),v=M("./src/utils/attr-list.ts");function m(h){var f=h.type;switch(f){case L.PlaylistContextType.AUDIO_TRACK:return L.PlaylistLevelType.AUDIO;case L.PlaylistContextType.SUBTITLE_TRACK:return L.PlaylistLevelType.SUBTITLE;default:return L.PlaylistLevelType.MAIN}}function p(h,f){var o=h.url;return(o===void 0||o.indexOf("data:")===0)&&(o=f.url),o}var l=function(){function h(o){this.hls=void 0,this.loaders=Object.create(null),this.hls=o,this.registerListeners()}var f=h.prototype;return f.registerListeners=function(){var u=this.hls;u.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(B.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(B.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.on(B.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.unregisterListeners=function(){var u=this.hls;u.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(B.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(B.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.off(B.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.createInternalLoader=function(u){var s=this.hls.config,a=s.pLoader,C=s.loader,_=a||C,T=new _(s);return u.loader=T,this.loaders[u.type]=T,T},f.getInternalLoader=function(u){return this.loaders[u.type]},f.resetInternalLoader=function(u){this.loaders[u]&&delete this.loaders[u]},f.destroyInternalLoaders=function(){for(var u in this.loaders){var s=this.loaders[u];s&&s.destroy(),this.resetInternalLoader(u)}},f.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},f.onManifestLoading=function(u,s){var a=s.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:L.PlaylistContextType.MANIFEST,url:a,deliveryDirectives:null})},f.onLevelLoading=function(u,s){var a=s.id,C=s.level,_=s.url,T=s.deliveryDirectives;this.load({id:a,groupId:null,level:C,responseType:"text",type:L.PlaylistContextType.LEVEL,url:_,deliveryDirectives:T})},f.onAudioTrackLoading=function(u,s){var a=s.id,C=s.groupId,_=s.url,T=s.deliveryDirectives;this.load({id:a,groupId:C,level:null,responseType:"text",type:L.PlaylistContextType.AUDIO_TRACK,url:_,deliveryDirectives:T})},f.onSubtitleTrackLoading=function(u,s){var a=s.id,C=s.groupId,_=s.url,T=s.deliveryDirectives;this.load({id:a,groupId:C,level:null,responseType:"text",type:L.PlaylistContextType.SUBTITLE_TRACK,url:_,deliveryDirectives:T})},f.load=function(u){var s,a=this.hls.config,C=this.getInternalLoader(u);if(C){var _=C.context;if(_&&_.url===u.url){W.logger.trace("[playlist-loader]: playlist request ongoing");return}W.logger.log("[playlist-loader]: aborting previous loader for type: "+u.type),C.abort()}var T,R,O,S;switch(u.type){case L.PlaylistContextType.MANIFEST:T=a.manifestLoadingMaxRetry,R=a.manifestLoadingTimeOut,O=a.manifestLoadingRetryDelay,S=a.manifestLoadingMaxRetryTimeout;break;case L.PlaylistContextType.LEVEL:case L.PlaylistContextType.AUDIO_TRACK:case L.PlaylistContextType.SUBTITLE_TRACK:T=0,R=a.levelLoadingTimeOut;break;default:T=a.levelLoadingMaxRetry,R=a.levelLoadingTimeOut,O=a.levelLoadingRetryDelay,S=a.levelLoadingMaxRetryTimeout;break}if(C=this.createInternalLoader(u),(s=u.deliveryDirectives)!==null&&s!==void 0&&s.part){var w;if(u.type===L.PlaylistContextType.LEVEL&&u.level!==null?w=this.hls.levels[u.level].details:u.type===L.PlaylistContextType.AUDIO_TRACK&&u.id!==null?w=this.hls.audioTracks[u.id].details:u.type===L.PlaylistContextType.SUBTITLE_TRACK&&u.id!==null&&(w=this.hls.subtitleTracks[u.id].details),w){var E=w.partTarget,c=w.targetduration;E&&c&&(R=Math.min(Math.max(E*3,c*.8)*1e3,R))}}var x={timeout:R,maxRetry:T,retryDelay:O,maxRetryDelay:S,highWaterMark:0},y={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};C.load(u,x,y)},f.loadsuccess=function(u,s,a,C){if(C===void 0&&(C=null),a.isSidxRequest){this.handleSidxRequest(u,a),this.handlePlaylistLoaded(u,s,a,C);return}this.resetInternalLoader(a.type);var _=u.data;if(_.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,a,"no EXTM3U delimiter",C);return}s.parsing.start=performance.now(),_.indexOf("#EXTINF:")>0||_.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(u,s,a,C):this.handleMasterPlaylist(u,s,a,C)},f.loaderror=function(u,s,a){a===void 0&&(a=null),this.handleNetworkError(s,a,!1,u)},f.loadtimeout=function(u,s,a){a===void 0&&(a=null),this.handleNetworkError(s,a,!0)},f.handleMasterPlaylist=function(u,s,a,C){var _=this.hls,T=u.data,R=p(u,a),O=i.default.parseMasterPlaylist(T,R),S=O.levels,w=O.sessionData;if(!S.length){this.handleManifestParsingError(u,a,"no level found in manifest",C);return}var E=S.map(function(U){return{id:U.attrs.AUDIO,audioCodec:U.audioCodec}}),c=S.map(function(U){return{id:U.attrs.SUBTITLES,textCodec:U.textCodec}}),x=i.default.parseMasterPlaylistMedia(T,R,"AUDIO",E),y=i.default.parseMasterPlaylistMedia(T,R,"SUBTITLES",c),g=i.default.parseMasterPlaylistMedia(T,R,"CLOSED-CAPTIONS");if(x.length){var F=x.some(function(U){return!U.url});!F&&S[0].audioCodec&&!S[0].attrs.AUDIO&&(W.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),x.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new v.AttrList({}),bitrate:0,url:""}))}_.trigger(B.Events.MANIFEST_LOADED,{levels:S,audioTracks:x,subtitles:y,captions:g,url:R,stats:s,networkDetails:C,sessionData:w})},f.handleTrackOrLevelPlaylist=function(u,s,a,C){var _=this.hls,T=a.id,R=a.level,O=a.type,S=p(u,a),w=Object(X.isFiniteNumber)(T)?T:0,E=Object(X.isFiniteNumber)(R)?R:w,c=m(a),x=i.default.parseLevelPlaylist(u.data,S,E,c,w);if(!x.fragments.length){_.trigger(B.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:S,reason:"no fragments found in level",level:typeof a.level=="number"?a.level:void 0});return}if(O===L.PlaylistContextType.MANIFEST){var y={attrs:new v.AttrList({}),bitrate:0,details:x,name:"",url:S};_.trigger(B.Events.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:S,stats:s,networkDetails:C,sessionData:null})}if(s.parsing.end=performance.now(),x.needSidxRanges){var g,F=(g=x.fragments[0].initSegment)===null||g===void 0?void 0:g.url;this.load({url:F,isSidxRequest:!0,type:O,level:R,levelDetails:x,id:T,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}a.levelDetails=x,this.handlePlaylistLoaded(u,s,a,C)},f.handleSidxRequest=function(u,s){var a=Object(H.parseSegmentIndex)(new Uint8Array(u.data));if(!a)return;var C=a.references,_=s.levelDetails;C.forEach(function(T,R){var O=T.info,S=_.fragments[R];S.byteRange.length===0&&S.setByteRange(String(1+O.end-O.start)+"@"+String(O.start)),S.initSegment&&S.initSegment.setByteRange(String(a.moovEndOffset)+"@0")})},f.handleManifestParsingError=function(u,s,a,C){this.hls.trigger(B.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:s.type===L.PlaylistContextType.MANIFEST,url:u.url,reason:a,response:u,context:s,networkDetails:C})},f.handleNetworkError=function(u,s,a,C){a===void 0&&(a=!1),W.logger.warn("[playlist-loader]: A network "+(a?"timeout":"error")+" occurred while loading "+u.type+" level: "+u.level+" id: "+u.id+' group-id: "'+u.groupId+'"');var _=P.ErrorDetails.UNKNOWN,T=!1,R=this.getInternalLoader(u);switch(u.type){case L.PlaylistContextType.MANIFEST:_=a?P.ErrorDetails.MANIFEST_LOAD_TIMEOUT:P.ErrorDetails.MANIFEST_LOAD_ERROR,T=!0;break;case L.PlaylistContextType.LEVEL:_=a?P.ErrorDetails.LEVEL_LOAD_TIMEOUT:P.ErrorDetails.LEVEL_LOAD_ERROR,T=!1;break;case L.PlaylistContextType.AUDIO_TRACK:_=a?P.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,T=!1;break;case L.PlaylistContextType.SUBTITLE_TRACK:_=a?P.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:P.ErrorDetails.SUBTITLE_LOAD_ERROR,T=!1;break}R&&this.resetInternalLoader(u.type);var O={type:P.ErrorTypes.NETWORK_ERROR,details:_,fatal:T,url:u.url,loader:R,context:u,networkDetails:s};C&&(O.response=C),this.hls.trigger(B.Events.ERROR,O)},f.handlePlaylistLoaded=function(u,s,a,C){var _=a.type,T=a.level,R=a.id,O=a.groupId,S=a.loader,w=a.levelDetails,E=a.deliveryDirectives;if(!(w!=null&&w.targetduration)){this.handleManifestParsingError(u,a,"invalid target duration",C);return}if(!S)return;w.live&&(S.getCacheAge&&(w.ageHeader=S.getCacheAge()||0),(!S.getCacheAge||isNaN(w.ageHeader))&&(w.ageHeader=0));switch(_){case L.PlaylistContextType.MANIFEST:case L.PlaylistContextType.LEVEL:this.hls.trigger(B.Events.LEVEL_LOADED,{details:w,level:T||0,id:R||0,stats:s,networkDetails:C,deliveryDirectives:E});break;case L.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(B.Events.AUDIO_TRACK_LOADED,{details:w,id:R||0,groupId:O||"",stats:s,networkDetails:C,deliveryDirectives:E});break;case L.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(B.Events.SUBTITLE_TRACK_LOADED,{details:w,id:R||0,groupId:O||"",stats:s,networkDetails:C,deliveryDirectives:E});break}},h}();$.default=l},"./src/polyfills/number.ts":function(oe,$,M){"use strict";M.r($),M.d($,"isFiniteNumber",function(){return X}),M.d($,"MAX_SAFE_INTEGER",function(){return B});var X=Number.isFinite||function(P){return typeof P=="number"&&isFinite(P)},B=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(oe,$,M){"use strict";M.r($);var X=function(){function B(){}return B.getSilentFrame=function(W,H){switch(W){case"mp4a.40.2":if(H===1)return new Uint8Array([0,200,0,128,35,128]);if(H===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(H===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(H===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(H===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(H===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(H===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(H===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(H===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},B}();$.default=X},"./src/remux/mp4-generator.ts":function(oe,$,M){"use strict";M.r($);var X=Math.pow(2,32)-1,B=function(){function P(){}return P.init=function(){P.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var H;for(H in P.types)P.types.hasOwnProperty(H)&&(P.types[H]=[H.charCodeAt(0),H.charCodeAt(1),H.charCodeAt(2),H.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]),L=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);P.HDLR_TYPES={video:i,audio:L};var v=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),m=new Uint8Array([0,0,0,0,0,0,0,0]);P.STTS=P.STSC=P.STCO=m,P.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),P.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),P.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),P.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var p=new Uint8Array([105,115,111,109]),l=new Uint8Array([97,118,99,49]),h=new Uint8Array([0,0,0,1]);P.FTYP=P.box(P.types.ftyp,p,h,p,l),P.DINF=P.box(P.types.dinf,P.box(P.types.dref,v))},P.box=function(H){for(var i=8,L=arguments.length,v=new Array(L>1?L-1:0),m=1;m<L;m++)v[m-1]=arguments[m];for(var p=v.length,l=p;p--;)i+=v[p].byteLength;var h=new Uint8Array(i);for(h[0]=i>>24&255,h[1]=i>>16&255,h[2]=i>>8&255,h[3]=i&255,h.set(H,4),p=0,i=8;p<l;p++)h.set(v[p],i),i+=v[p].byteLength;return h},P.hdlr=function(H){return P.box(P.types.hdlr,P.HDLR_TYPES[H])},P.mdat=function(H){return P.box(P.types.mdat,H)},P.mdhd=function(H,i){i*=H;var L=Math.floor(i/(X+1)),v=Math.floor(i%(X+1));return P.box(P.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,H>>24&255,H>>16&255,H>>8&255,H&255,L>>24,L>>16&255,L>>8&255,L&255,v>>24,v>>16&255,v>>8&255,v&255,85,196,0,0]))},P.mdia=function(H){return P.box(P.types.mdia,P.mdhd(H.timescale,H.duration),P.hdlr(H.type),P.minf(H))},P.mfhd=function(H){return P.box(P.types.mfhd,new Uint8Array([0,0,0,0,H>>24,H>>16&255,H>>8&255,H&255]))},P.minf=function(H){return H.type==="audio"?P.box(P.types.minf,P.box(P.types.smhd,P.SMHD),P.DINF,P.stbl(H)):P.box(P.types.minf,P.box(P.types.vmhd,P.VMHD),P.DINF,P.stbl(H))},P.moof=function(H,i,L){return P.box(P.types.moof,P.mfhd(H),P.traf(L,i))},P.moov=function(H){for(var i=H.length,L=[];i--;)L[i]=P.trak(H[i]);return P.box.apply(null,[P.types.moov,P.mvhd(H[0].timescale,H[0].duration)].concat(L).concat(P.mvex(H)))},P.mvex=function(H){for(var i=H.length,L=[];i--;)L[i]=P.trex(H[i]);return P.box.apply(null,[P.types.mvex].concat(L))},P.mvhd=function(H,i){i*=H;var L=Math.floor(i/(X+1)),v=Math.floor(i%(X+1)),m=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,H>>24&255,H>>16&255,H>>8&255,H&255,L>>24,L>>16&255,L>>8&255,L&255,v>>24,v>>16&255,v>>8&255,v&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return P.box(P.types.mvhd,m)},P.sdtp=function(H){var i=H.samples||[],L=new Uint8Array(4+i.length),v,m;for(v=0;v<i.length;v++)m=i[v].flags,L[v+4]=m.dependsOn<<4|m.isDependedOn<<2|m.hasRedundancy;return P.box(P.types.sdtp,L)},P.stbl=function(H){return P.box(P.types.stbl,P.stsd(H),P.box(P.types.stts,P.STTS),P.box(P.types.stsc,P.STSC),P.box(P.types.stsz,P.STSZ),P.box(P.types.stco,P.STCO))},P.avc1=function(H){var i=[],L=[],v,m,p;for(v=0;v<H.sps.length;v++)m=H.sps[v],p=m.byteLength,i.push(p>>>8&255),i.push(p&255),i=i.concat(Array.prototype.slice.call(m));for(v=0;v<H.pps.length;v++)m=H.pps[v],p=m.byteLength,L.push(p>>>8&255),L.push(p&255),L=L.concat(Array.prototype.slice.call(m));var l=P.box(P.types.avcC,new Uint8Array([1,i[3],i[4],i[5],252|3,224|H.sps.length].concat(i).concat([H.pps.length]).concat(L))),h=H.width,f=H.height,o=H.pixelRatio[0],u=H.pixelRatio[1];return P.box(P.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,h>>8&255,h&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]),l,P.box(P.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),P.box(P.types.pasp,new Uint8Array([o>>24,o>>16&255,o>>8&255,o&255,u>>24,u>>16&255,u>>8&255,u&255])))},P.esds=function(H){var i=H.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(H.config).concat([6,1,2]))},P.mp4a=function(H){var i=H.samplerate;return P.box(P.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,H.channelCount,0,16,0,0,0,0,i>>8&255,i&255,0,0]),P.box(P.types.esds,P.esds(H)))},P.mp3=function(H){var i=H.samplerate;return P.box(P.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,H.channelCount,0,16,0,0,0,0,i>>8&255,i&255,0,0]))},P.stsd=function(H){return H.type==="audio"?!H.isAAC&&H.codec==="mp3"?P.box(P.types.stsd,P.STSD,P.mp3(H)):P.box(P.types.stsd,P.STSD,P.mp4a(H)):P.box(P.types.stsd,P.STSD,P.avc1(H))},P.tkhd=function(H){var i=H.id,L=H.duration*H.timescale,v=H.width,m=H.height,p=Math.floor(L/(X+1)),l=Math.floor(L%(X+1));return P.box(P.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,i>>24&255,i>>16&255,i>>8&255,i&255,0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,l>>24,l>>16&255,l>>8&255,l&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,v>>8&255,v&255,0,0,m>>8&255,m&255,0,0]))},P.traf=function(H,i){var L=P.sdtp(H),v=H.id,m=Math.floor(i/(X+1)),p=Math.floor(i%(X+1));return P.box(P.types.traf,P.box(P.types.tfhd,new Uint8Array([0,0,0,0,v>>24,v>>16&255,v>>8&255,v&255])),P.box(P.types.tfdt,new Uint8Array([1,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,p>>24,p>>16&255,p>>8&255,p&255])),P.trun(H,L.length+16+20+8+16+8+8),L)},P.trak=function(H){return H.duration=H.duration||4294967295,P.box(P.types.trak,P.tkhd(H),P.mdia(H))},P.trex=function(H){var i=H.id;return P.box(P.types.trex,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},P.trun=function(H,i){var L=H.samples||[],v=L.length,m=12+16*v,p=new Uint8Array(m),l,h,f,o,u,s;for(i+=8+m,p.set([0,0,15,1,v>>>24&255,v>>>16&255,v>>>8&255,v&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255],0),l=0;l<v;l++)h=L[l],f=h.duration,o=h.size,u=h.flags,s=h.cts,p.set([f>>>24&255,f>>>16&255,f>>>8&255,f&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,u.degradPrio&240<<8,u.degradPrio&15,s>>>24&255,s>>>16&255,s>>>8&255,s&255],12+16*l);return P.box(P.types.trun,p)},P.initSegment=function(H){P.types||P.init();var i=P.moov(H),L=new Uint8Array(P.FTYP.byteLength+i.byteLength);return L.set(P.FTYP),L.set(i,P.FTYP.byteLength),L},P}();B.types=void 0,B.HDLR_TYPES=void 0,B.STTS=void 0,B.STSC=void 0,B.STCO=void 0,B.STSZ=void 0,B.VMHD=void 0,B.SMHD=void 0,B.STSD=void 0,B.FTYP=void 0,B.DINF=void 0,$.default=B},"./src/remux/mp4-remuxer.ts":function(oe,$,M){"use strict";M.r($),M.d($,"default",function(){return s}),M.d($,"normalizePts",function(){return a});var X=M("./src/polyfills/number.ts"),B=M("./src/remux/aac-helper.ts"),P=M("./src/remux/mp4-generator.ts"),W=M("./src/events.ts"),H=M("./src/errors.ts"),i=M("./src/utils/logger.ts"),L=M("./src/types/loader.ts"),v=M("./src/utils/timescale-conversion.ts");function m(){return m=Object.assign||function(R){for(var O=1;O<arguments.length;O++){var S=arguments[O];for(var w in S)Object.prototype.hasOwnProperty.call(S,w)&&(R[w]=S[w])}return R},m.apply(this,arguments)}var p=10*1e3,l=1024,h=1152,f=null,o=null,u=!1,s=function(){function R(S,w,E,c){if(c===void 0&&(c=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=S,this.config=w,this.typeSupported=E,this.ISGenerated=!1,f===null){var x=navigator.userAgent||"",y=x.match(/Chrome\/(\d+)/i);f=y?parseInt(y[1]):0}if(o===null){var g=navigator.userAgent.match(/Safari\/(\d+)/i);o=g?parseInt(g[1]):0}u=!!f&&f<75||!!o&&o<600}var O=R.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 E=!1,c=w.reduce(function(x,y){var g=y.pts-x;return g<-4294967296?(E=!0,a(x,y.pts)):g>0?x:y.pts},w[0].pts);return E&&i.logger.debug("PTS rollover detected"),c},O.remux=function(w,E,c,x,y,g,F,U){var A,j,N,b,Y,re,fe=y,ve=y,ke=w.pid>-1,Se=E.pid>-1,Le=E.samples.length,ye=w.samples.length>0,_e=Le>1,de=(!ke||ye)&&(!Se||_e)||this.ISGenerated||F;if(de){this.ISGenerated||(N=this.generateIS(w,E,y));var z=this.isVideoContiguous,D=-1;if(_e&&(D=C(E.samples),!z&&this.config.forceKeyFrameOnDiscontinuity))if(re=!0,D>0){i.logger.warn("[mp4-remuxer]: Dropped "+D+" out of "+Le+" video samples due to a missing keyframe");var I=this.getVideoStartPts(E.samples);E.samples=E.samples.slice(D),E.dropped+=D,ve+=(E.samples[0].pts-I)/(E.timescale||9e4)}else D===-1&&(i.logger.warn("[mp4-remuxer]: No keyframe found out of "+Le+" video samples"),re=!1);if(this.ISGenerated){if(ye&&_e){var V=this.getVideoStartPts(E.samples),Q=a(w.samples[0].pts,V)-V,G=Q/E.inputTimeScale;fe+=Math.max(0,G),ve+=Math.max(0,-G)}if(ye){if(w.samplerate||(i.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),N=this.generateIS(w,E,y)),j=this.remuxAudio(w,fe,this.isAudioContiguous,g,Se||_e||U===L.PlaylistLevelType.AUDIO?ve:void 0),_e){var ce=j?j.endPTS-j.startPTS:0;E.inputTimeScale||(i.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),N=this.generateIS(w,E,y)),A=this.remuxVideo(E,ve,z,ce)}}else _e&&(A=this.remuxVideo(E,ve,z,0));A&&(A.firstKeyFrame=D,A.independent=D!==-1)}}return this.ISGenerated&&(c.samples.length&&(Y=this.remuxID3(c,y)),x.samples.length&&(b=this.remuxText(x,y))),{audio:j,video:A,initSegment:N,independent:re,text:b,id3:Y}},O.generateIS=function(w,E,c){var x=w.samples,y=E.samples,g=this.typeSupported,F={},U=!Object(X.isFiniteNumber)(this._initPTS),A="audio/mp4",j,N,b;if(U&&(j=N=Infinity),w.config&&x.length&&(w.timescale=w.samplerate,w.isAAC||(g.mpeg?(A="audio/mpeg",w.codec=""):g.mp3&&(w.codec="mp3")),F.audio={id:"audio",container:A,codec:w.codec,initSegment:!w.isAAC&&g.mpeg?new Uint8Array(0):P.default.initSegment([w]),metadata:{channelCount:w.channelCount}},U&&(b=w.inputTimeScale,j=N=x[0].pts-Math.round(b*c))),E.sps&&E.pps&&y.length&&(E.timescale=E.inputTimeScale,F.video={id:"main",container:"video/mp4",codec:E.codec,initSegment:P.default.initSegment([E]),metadata:{width:E.width,height:E.height}},U)){b=E.inputTimeScale;var Y=this.getVideoStartPts(y),re=Math.round(b*c);N=Math.min(N,a(y[0].dts,Y)-re),j=Math.min(j,Y-re)}if(Object.keys(F).length)return this.ISGenerated=!0,U&&(this._initPTS=j,this._initDTS=N),{tracks:F,initPTS:j,timescale:b}},O.remuxVideo=function(w,E,c,x){var y=w.inputTimeScale,g=w.samples,F=[],U=g.length,A=this._initPTS,j=this.nextAvcDts,N=8,b,Y,re,fe=Number.POSITIVE_INFINITY,ve=Number.NEGATIVE_INFINITY,ke=0,Se=!1;if(!c||j===null){var Le=E*y,ye=g[0].pts-a(g[0].dts,g[0].pts);j=Le-ye}for(var _e=0;_e<U;_e++){var de=g[_e];if(de.pts=a(de.pts-A,j),de.dts=a(de.dts-A,j),de.dts>de.pts){var z=9e4*.2;ke=Math.max(Math.min(ke,de.pts-de.dts),-1*z)}de.dts<g[_e>0?_e-1:_e].dts&&(Se=!0)}Se&&g.sort(function(yt,ot){var at=yt.dts-ot.dts,Lt=yt.pts-ot.pts;return at||Lt}),Y=g[0].dts,re=g[g.length-1].dts;var D=Math.round((re-Y)/(U-1));if(ke<0){if(ke<D*-2){i.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(v.toMsFromMpegTsClock)(-D,!0)+" ms");for(var I=ke,V=0;V<U;V++)g[V].dts=I=Math.max(I,g[V].pts-D),g[V].pts=Math.max(I,g[V].pts)}else{i.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(v.toMsFromMpegTsClock)(ke,!0)+" ms to overcome this issue");for(var Q=0;Q<U;Q++)g[Q].dts=g[Q].dts+ke}Y=g[0].dts}if(c){var G=Y-j,ce=G>D,Ce=G<-1;if(ce||Ce){ce?i.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(G,!0)+" ms ("+G+"dts) hole between fragments detected, filling it"):i.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(-G,!0)+" ms ("+G+"dts) overlapping between fragments detected"),Y=j;var De=g[0].pts-G;g[0].dts=Y,g[0].pts=De,i.logger.log("Video: First PTS/DTS adjusted: "+Object(v.toMsFromMpegTsClock)(De,!0)+"/"+Object(v.toMsFromMpegTsClock)(Y,!0)+", delta: "+Object(v.toMsFromMpegTsClock)(G,!0)+" ms")}}u&&(Y=Math.max(0,Y));for(var ue=0,ge=0,we=0;we<U;we++){for(var Ae=g[we],Ne=Ae.units,Be=Ne.length,Ge=0,He=0;He<Be;He++)Ge+=Ne[He].data.length;ge+=Ge,ue+=Be,Ae.length=Ge,Ae.dts=Math.max(Ae.dts,Y),Ae.pts=Math.max(Ae.pts,Ae.dts,0),fe=Math.min(Ae.pts,fe),ve=Math.max(Ae.pts,ve)}re=g[U-1].dts;var qe=ge+4*ue+8,je;try{je=new Uint8Array(qe)}catch(yt){this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:H.ErrorTypes.MUX_ERROR,details:H.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:qe,reason:"fail allocating video mdat "+qe});return}var Ke=new DataView(je.buffer);Ke.setUint32(0,qe),je.set(P.default.types.mdat,4);for(var Me=0;Me<U;Me++){for(var et=g[Me],Je=et.units,le=0,q=0,te=Je.length;q<te;q++){var se=Je[q],he=se.data,ie=se.data.byteLength;Ke.setUint32(N,ie),N+=4,je.set(he,N),N+=ie,le+=4+ie}if(Me<U-1)b=g[Me+1].dts-et.dts;else{var ae=this.config,pe=et.dts-g[Me>0?Me-1:Me].dts;if(ae.stretchShortVideoTrack&&this.nextAudioPts!==null){var me=Math.floor(ae.maxBufferHole*y),xe=(x?fe+x*y:this.nextAudioPts)-et.pts;xe>me?(b=xe-pe,b<0&&(b=pe),i.logger.log("[mp4-remuxer]: It is approximately "+xe/90+" ms to the next segment; using duration "+b/90+" ms for the last video frame.")):b=pe}else b=pe}var Oe=Math.round(et.pts-et.dts);F.push(new _(et.key,b,le,Oe))}if(F.length&&f&&f<70){var Pe=F[0].flags;Pe.dependsOn=2,Pe.isNonSync=0}console.assert(b!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=j=re+b,this.isVideoContiguous=!0;var ze=P.default.moof(w.sequenceNumber++,Y,m({},w,{samples:F})),tt="video",rt={data1:ze,data2:je,startPTS:fe/y,endPTS:(ve+b)/y,startDTS:Y/y,endDTS:j/y,type:tt,hasAudio:!1,hasVideo:!0,nb:F.length,dropped:w.dropped};return w.samples=[],w.dropped=0,console.assert(je.length,"MDAT length must not be zero"),rt},O.remuxAudio=function(w,E,c,x,y){var g=w.inputTimeScale,F=w.samplerate?w.samplerate:g,U=g/F,A=w.isAAC?l:h,j=A*U,N=this._initPTS,b=!w.isAAC&&this.typeSupported.mpeg,Y=[],re=w.samples,fe=b?0:8,ve=this.nextAudioPts||-1,ke=E*g;if(this.isAudioContiguous=c=c||re.length&&ve>0&&(x&&Math.abs(ke-ve)<9e3||Math.abs(a(re[0].pts-N,ke)-ve)<20*j),re.forEach(function(he){he.pts=a(he.pts-N,ke)}),!c||ve<0){if(re=re.filter(function(he){return he.pts>=0}),!re.length)return;y===0?ve=0:x?ve=Math.max(0,ke):ve=re[0].pts}if(w.isAAC)for(var Se=y!==void 0,Le=this.config.maxAudioFramesDrift,ye=0,_e=ve;ye<re.length;ye++){var de=re[ye],z=de.pts,D=z-_e,I=Math.abs(1e3*D/g);if(D<=-Le*j&&Se)ye===0&&(i.logger.warn("Audio frame @ "+(z/g).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*D/g)+" ms."),this.nextAudioPts=ve=_e=z);else if(D>=Le*j&&I<p&&Se){var V=Math.round(D/j);_e=z-V*j,_e<0&&(V--,_e+=j),ye===0&&(this.nextAudioPts=ve=_e),i.logger.warn("[mp4-remuxer]: Injecting "+V+" audio frame @ "+(_e/g).toFixed(3)+"s due to "+Math.round(1e3*D/g)+" ms gap.");for(var Q=0;Q<V;Q++){var G=Math.max(_e,0),ce=B.default.getSilentFrame(w.manifestCodec||w.codec,w.channelCount);ce||(i.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ce=de.unit.subarray()),re.splice(ye,0,{unit:ce,pts:G}),_e+=j,ye++}}de.pts=_e,_e+=j}for(var Ce=null,De=null,ue,ge=0,we=re.length;we--;)ge+=re[we].unit.byteLength;for(var Ae=0,Ne=re.length;Ae<Ne;Ae++){var Be=re[Ae],Ge=Be.unit,He=Be.pts;if(De!==null){var qe=Y[Ae-1];qe.duration=Math.round((He-De)/U)}else if(c&&w.isAAC&&(He=ve),Ce=He,ge>0){ge+=fe;try{ue=new Uint8Array(ge)}catch(he){this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:H.ErrorTypes.MUX_ERROR,details:H.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ge,reason:"fail allocating audio mdat "+ge});return}if(!b){var je=new DataView(ue.buffer);je.setUint32(0,ge),ue.set(P.default.types.mdat,4)}}else return;ue.set(Ge,fe);var Ke=Ge.byteLength;fe+=Ke,Y.push(new _(!0,A,Ke,0)),De=He}var Me=Y.length;if(!Me)return;var et=Y[Y.length-1];this.nextAudioPts=ve=De+U*et.duration;var Je=b?new Uint8Array(0):P.default.moof(w.sequenceNumber++,Ce/U,m({},w,{samples:Y}));w.samples=[];var le=Ce/g,q=ve/g,te="audio",se={data1:Je,data2:ue,startPTS:le,endPTS:q,startDTS:le,endDTS:q,type:te,hasAudio:!0,hasVideo:!1,nb:Me};return this.isAudioContiguous=!0,console.assert(ue.length,"MDAT length must not be zero"),se},O.remuxEmptyAudio=function(w,E,c,x){var y=w.inputTimeScale,g=w.samplerate?w.samplerate:y,F=y/g,U=this.nextAudioPts,A=(U!==null?U:x.startDTS*y)+this._initDTS,j=x.endDTS*y+this._initDTS,N=F*l,b=Math.ceil((j-A)/N),Y=B.default.getSilentFrame(w.manifestCodec||w.codec,w.channelCount);if(i.logger.warn("[mp4-remuxer]: remux empty Audio"),!Y){i.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var re=[],fe=0;fe<b;fe++){var ve=A+fe*N;re.push({unit:Y,pts:ve,dts:ve})}return w.samples=re,this.remuxAudio(w,E,c,!1)},O.remuxID3=function(w,E){var c=w.samples.length;if(!c)return;for(var x=w.inputTimeScale,y=this._initPTS,g=this._initDTS,F=0;F<c;F++){var U=w.samples[F];U.pts=a(U.pts-y,E*x)/x,U.dts=a(U.dts-g,E*x)/x}var A=w.samples;return w.samples=[],{samples:A}},O.remuxText=function(w,E){var c=w.samples.length;if(!c)return;for(var x=w.inputTimeScale,y=this._initPTS,g=0;g<c;g++){var F=w.samples[g];F.pts=a(F.pts-y,E*x)/x}w.samples.sort(function(A,j){return A.pts-j.pts});var U=w.samples;return w.samples=[],{samples:U}},R}();function a(R,O){var S;if(O===null)return R;for(O<R?S=-8589934592:S=8589934592;Math.abs(R-O)>4294967296;)R+=S;return R}function C(R){for(var O=0;O<R.length;O++)if(R[O].key)return O;return-1}var _=function(O,S,w,E){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=S,this.size=w,this.cts=E,this.flags=new T(O)},T=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(oe,$,M){"use strict";M.r($);var X=M("./src/polyfills/number.ts"),B=M("./src/utils/mp4-tools.ts"),P=M("./src/loader/fragment.ts"),W=M("./src/utils/logger.ts"),H=function(){function v(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var m=v.prototype;return m.destroy=function(){},m.resetTimeStamp=function(l){this.initPTS=l,this.lastEndDTS=null},m.resetNextTimestamp=function(){this.lastEndDTS=null},m.resetInitSegment=function(l,h,f){this.audioCodec=h,this.videoCodec=f,this.generateInitSegment(l),this.emitInitSegment=!0},m.generateInitSegment=function(l){var h=this.audioCodec,f=this.videoCodec;if(!l||!l.byteLength){this.initTracks=void 0,this.initData=void 0;return}var o=this.initData=Object(B.parseInitSegment)(l);h||(h=L(o.audio,P.ElementaryStreamTypes.AUDIO)),f||(f=L(o.video,P.ElementaryStreamTypes.VIDEO));var u={};o.audio&&o.video?u.audiovideo={container:"video/mp4",codec:h+","+f,initSegment:l,id:"main"}:o.audio?u.audio={container:"audio/mp4",codec:h,initSegment:l,id:"audio"}:o.video?u.video={container:"video/mp4",codec:f,initSegment:l,id:"main"}:W.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=u},m.remux=function(l,h,f,o,u){var s=this.initPTS,a=this.lastEndDTS,C={audio:void 0,video:void 0,text:o,id3:f,initSegment:void 0};Object(X.isFiniteNumber)(a)||(a=this.lastEndDTS=u||0);var _=h.samples;if(!_||!_.length)return C;var T={initPTS:void 0,timescale:1},R=this.initData;if((!R||!R.length)&&(this.generateInitSegment(_),R=this.initData),!R||!R.length)return W.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),C;this.emitInitSegment&&(T.tracks=this.initTracks,this.emitInitSegment=!1),Object(X.isFiniteNumber)(s)||(this.initPTS=T.initPTS=s=i(R,_,a));var O=Object(B.getDuration)(_,R),S=a,w=O+S;Object(B.offsetStartDTS)(R,_,s),O>0?this.lastEndDTS=w:(W.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var E=!!R.audio,c=!!R.video,x="";E&&(x+="audio"),c&&(x+="video");var y={data1:_,startPTS:S,startDTS:S,endPTS:w,endDTS:w,type:x,hasAudio:E,hasVideo:c,nb:1,dropped:0};return C.audio=y.type==="audio"?y:void 0,C.video=y.type!=="audio"?y:void 0,C.text=o,C.id3=f,C.initSegment=T,C},v}(),i=function(m,p,l){return Object(B.getStartDTS)(m,p)-l};function L(v,m){var p=v==null?void 0:v.codec;return p&&p.length>4?p:p==="hvc1"?"hvc1.1.c.L120.90":p==="av01"?"av01.0.04M.08":p==="avc1"||m===P.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}$.default=H},"./src/task-loop.ts":function(oe,$,M){"use strict";M.r($),M.d($,"default",function(){return X});var X=function(){function B(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var P=B.prototype;return P.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},P.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},P.onHandlerDestroyed=function(){},P.hasInterval=function(){return!!this._tickInterval},P.hasNextTick=function(){return!!this._tickTimer},P.setInterval=function(H){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,H),!0)},P.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},P.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},P.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},P.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},P.doTick=function(){},B}()},"./src/types/cmcd.ts":function(oe,$,M){"use strict";M.r($),M.d($,"CMCDVersion",function(){return X}),M.d($,"CMCDObjectType",function(){return B}),M.d($,"CMCDStreamingFormat",function(){return P}),M.d($,"CMCDStreamType",function(){return W});var X=1,B;(function(H){H.MANIFEST="m",H.AUDIO="a",H.VIDEO="v",H.MUXED="av",H.INIT="i",H.CAPTION="c",H.TIMED_TEXT="tt",H.KEY="k",H.OTHER="o"})(B||(B={}));var P;(function(H){H.DASH="d",H.HLS="h",H.SMOOTH="s",H.OTHER="o"})(P||(P={}));var W;(function(H){H.VOD="v",H.LIVE="l"})(W||(W={}))},"./src/types/level.ts":function(oe,$,M){"use strict";M.r($),M.d($,"HlsSkip",function(){return P}),M.d($,"getSkipValue",function(){return W}),M.d($,"HlsUrlParameters",function(){return H}),M.d($,"Level",function(){return i});function X(L,v){for(var m=0;m<v.length;m++){var p=v[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(L,p.key,p)}}function B(L,v,m){return v&&X(L.prototype,v),m&&X(L,m),L}var P;(function(L){L.No="",L.Yes="YES",L.v2="v2"})(P||(P={}));function W(L,v){var m=L.canSkipUntil,p=L.canSkipDateRanges,l=L.endSN,h=v!==void 0?v-l:0;return m&&h<m?p?P.v2:P.Yes:P.No}var H=function(){function L(m,p,l){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=m,this.part=p,this.skip=l}var v=L.prototype;return v.addDirectives=function(p){var l=new self.URL(p);return this.msn!==void 0&&l.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&l.searchParams.set("_HLS_part",this.part.toString()),this.skip&&l.searchParams.set("_HLS_skip",this.skip),l.toString()},L}(),i=function(){function L(v){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[v.url],this.attrs=v.attrs,this.bitrate=v.bitrate,v.details&&(this.details=v.details),this.id=v.id||0,this.name=v.name,this.width=v.width||0,this.height=v.height||0,this.audioCodec=v.audioCodec,this.videoCodec=v.videoCodec,this.unknownCodecs=v.unknownCodecs,this.codecSet=[v.videoCodec,v.audioCodec].filter(function(m){return m}).join(",").replace(/\.[^.,]+/g,"")}return B(L,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(m){var p=m%this.url.length;this._urlId!==p&&(this.details=void 0,this._urlId=p)}}]),L}()},"./src/types/loader.ts":function(oe,$,M){"use strict";M.r($),M.d($,"PlaylistContextType",function(){return X}),M.d($,"PlaylistLevelType",function(){return B});var X;(function(P){P.MANIFEST="manifest",P.LEVEL="level",P.AUDIO_TRACK="audioTrack",P.SUBTITLE_TRACK="subtitleTrack"})(X||(X={}));var B;(function(P){P.MAIN="main",P.AUDIO="audio",P.SUBTITLE="subtitle"})(B||(B={}))},"./src/types/transmuxer.ts":function(oe,$,M){"use strict";M.r($),M.d($,"ChunkMetadata",function(){return X});var X=function(W,H,i,L,v,m){L===void 0&&(L=0),v===void 0&&(v=-1),m===void 0&&(m=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=B(),this.buffering={audio:B(),video:B(),audiovideo:B()},this.level=W,this.sn=H,this.id=i,this.size=L,this.part=v,this.partial=m};function B(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(oe,$,M){"use strict";M.r($),M.d($,"AttrList",function(){return P});var X=/^(\d+)x(\d+)$/,B=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,P=function(){function W(i){typeof i=="string"&&(i=W.parseAttrList(i));for(var L in i)i.hasOwnProperty(L)&&(this[L]=i[L])}var H=W.prototype;return H.decimalInteger=function(L){var v=parseInt(this[L],10);return v>Number.MAX_SAFE_INTEGER?Infinity:v},H.hexadecimalInteger=function(L){if(this[L]){var v=(this[L]||"0x").slice(2);v=(v.length&1?"0":"")+v;for(var m=new Uint8Array(v.length/2),p=0;p<v.length/2;p++)m[p]=parseInt(v.slice(p*2,p*2+2),16);return m}else return null},H.hexadecimalIntegerAsNumber=function(L){var v=parseInt(this[L],16);return v>Number.MAX_SAFE_INTEGER?Infinity:v},H.decimalFloatingPoint=function(L){return parseFloat(this[L])},H.optionalFloat=function(L,v){var m=this[L];return m?parseFloat(m):v},H.enumeratedString=function(L){return this[L]},H.bool=function(L){return this[L]==="YES"},H.decimalResolution=function(L){var v=X.exec(this[L]);return v===null?void 0:{width:parseInt(v[1],10),height:parseInt(v[2],10)}},W.parseAttrList=function(L){var v,m={},p='"';for(B.lastIndex=0;(v=B.exec(L))!==null;){var l=v[2];l.indexOf(p)===0&&l.lastIndexOf(p)===l.length-1&&(l=l.slice(1,-1)),m[v[1]]=l}return m},W}()},"./src/utils/binary-search.ts":function(oe,$,M){"use strict";M.r($);var X={search:function(P,W){for(var H=0,i=P.length-1,L=null,v=null;H<=i;){L=(H+i)/2|0,v=P[L];var m=W(v);if(m>0)H=L+1;else if(m<0)i=L-1;else return v}return null}};$.default=X},"./src/utils/buffer-helper.ts":function(oe,$,M){"use strict";M.r($),M.d($,"BufferHelper",function(){return P});var X=M("./src/utils/logger.ts"),B={length:0,start:function(){return 0},end:function(){return 0}},P=function(){function W(){}return W.isBuffered=function(i,L){try{if(i){for(var v=W.getBuffered(i),m=0;m<v.length;m++)if(L>=v.start(m)&&L<=v.end(m))return!0}}catch(p){}return!1},W.bufferInfo=function(i,L,v){try{if(i){var m=W.getBuffered(i),p=[],l;for(l=0;l<m.length;l++)p.push({start:m.start(l),end:m.end(l)});return this.bufferedInfo(p,L,v)}}catch(h){}return{len:0,start:L,end:L,nextStart:void 0}},W.bufferedInfo=function(i,L,v){L=Math.max(0,L),i.sort(function(T,R){var O=T.start-R.start;return O||R.end-T.end});var m=[];if(v)for(var p=0;p<i.length;p++){var l=m.length;if(l){var h=m[l-1].end;i[p].start-h<v?i[p].end>h&&(m[l-1].end=i[p].end):m.push(i[p])}else m.push(i[p])}else m=i;for(var f=0,o,u=L,s=L,a=0;a<m.length;a++){var C=m[a].start,_=m[a].end;if(L+v>=C&&L<_)u=C,s=_,f=s-L;else if(L+v<C){o=C;break}}return{len:f,start:u||0,end:s||0,nextStart:o}},W.getBuffered=function(i){try{return i.buffered}catch(L){return X.logger.log("failed to get media.buffered",L),B}},W}()},"./src/utils/cea-608-parser.ts":function(oe,$,M){"use strict";M.r($),M.d($,"Row",function(){return s}),M.d($,"CaptionScreen",function(){return a});var X=M("./src/utils/logger.ts"),B={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},P=function(w){var E=w;return B.hasOwnProperty(w)&&(E=B[w]),String.fromCharCode(E)},W=15,H=100,i={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},L={17:2,18:4,21:6,22:8,23:10,19:13,20:15},v={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},m={25:2,26:4,29:6,30:8,31:10,27:13,28:15},p=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],l;(function(S){S[S.ERROR=0]="ERROR",S[S.TEXT=1]="TEXT",S[S.WARNING=2]="WARNING",S[S.INFO=2]="INFO",S[S.DEBUG=3]="DEBUG",S[S.DATA=3]="DATA"})(l||(l={}));var h=function(){function S(){this.time=null,this.verboseLevel=l.ERROR}var w=S.prototype;return w.log=function(c,x){this.verboseLevel>=c&&X.logger.log(this.time+" ["+c+"] "+x)},S}(),f=function(w){for(var E=[],c=0;c<w.length;c++)E.push(w[c].toString(16));return E},o=function(){function S(E,c,x,y,g){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=E||"white",this.underline=c||!1,this.italics=x||!1,this.background=y||"black",this.flash=g||!1}var w=S.prototype;return w.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},w.setStyles=function(c){for(var x=["foreground","underline","italics","background","flash"],y=0;y<x.length;y++){var g=x[y];c.hasOwnProperty(g)&&(this[g]=c[g])}},w.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},w.equals=function(c){return this.foreground===c.foreground&&this.underline===c.underline&&this.italics===c.italics&&this.background===c.background&&this.flash===c.flash},w.copy=function(c){this.foreground=c.foreground,this.underline=c.underline,this.italics=c.italics,this.background=c.background,this.flash=c.flash},w.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},S}(),u=function(){function S(E,c,x,y,g,F){this.uchar=void 0,this.penState=void 0,this.uchar=E||" ",this.penState=new o(c,x,y,g,F)}var w=S.prototype;return w.reset=function(){this.uchar=" ",this.penState.reset()},w.setChar=function(c,x){this.uchar=c,this.penState.copy(x)},w.setPenState=function(c){this.penState.copy(c)},w.equals=function(c){return this.uchar===c.uchar&&this.penState.equals(c.penState)},w.copy=function(c){this.uchar=c.uchar,this.penState.copy(c.penState)},w.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},S}(),s=function(){function S(E){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var c=0;c<H;c++)this.chars.push(new u);this.logger=E,this.pos=0,this.currPenState=new o}var w=S.prototype;return w.equals=function(c){for(var x=!0,y=0;y<H;y++)if(!this.chars[y].equals(c.chars[y])){x=!1;break}return x},w.copy=function(c){for(var x=0;x<H;x++)this.chars[x].copy(c.chars[x])},w.isEmpty=function(){for(var c=!0,x=0;x<H;x++)if(!this.chars[x].isEmpty()){c=!1;break}return c},w.setCursor=function(c){this.pos!==c&&(this.pos=c),this.pos<0?(this.logger.log(l.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>H&&(this.logger.log(l.DEBUG,"Too large cursor position "+this.pos),this.pos=H)},w.moveCursor=function(c){var x=this.pos+c;if(c>1)for(var y=this.pos+1;y<x+1;y++)this.chars[y].setPenState(this.currPenState);this.setCursor(x)},w.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},w.insertChar=function(c){c>=144&&this.backSpace();var x=P(c);if(this.pos>=H){this.logger.log(l.ERROR,"Cannot insert "+c.toString(16)+" ("+x+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(x,this.currPenState),this.moveCursor(1)},w.clearFromPos=function(c){var x;for(x=c;x<H;x++)this.chars[x].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 c=[],x=!0,y=0;y<H;y++){var g=this.chars[y].uchar;g!==" "&&(x=!1),c.push(g)}return x?"":c.join("")},w.setPenStyles=function(c){this.currPenState.setStyles(c);var x=this.chars[this.pos];x.setPenState(this.currPenState)},S}(),a=function(){function S(E){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var c=0;c<W;c++)this.rows.push(new s(E));this.logger=E,this.currRow=W-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var w=S.prototype;return w.reset=function(){for(var c=0;c<W;c++)this.rows[c].clear();this.currRow=W-1},w.equals=function(c){for(var x=!0,y=0;y<W;y++)if(!this.rows[y].equals(c.rows[y])){x=!1;break}return x},w.copy=function(c){for(var x=0;x<W;x++)this.rows[x].copy(c.rows[x])},w.isEmpty=function(){for(var c=!0,x=0;x<W;x++)if(!this.rows[x].isEmpty()){c=!1;break}return c},w.backSpace=function(){var c=this.rows[this.currRow];c.backSpace()},w.clearToEndOfRow=function(){var c=this.rows[this.currRow];c.clearToEndOfRow()},w.insertChar=function(c){var x=this.rows[this.currRow];x.insertChar(c)},w.setPen=function(c){var x=this.rows[this.currRow];x.setPenStyles(c)},w.moveCursor=function(c){var x=this.rows[this.currRow];x.moveCursor(c)},w.setCursor=function(c){this.logger.log(l.INFO,"setCursor: "+c);var x=this.rows[this.currRow];x.setCursor(c)},w.setPAC=function(c){this.logger.log(l.INFO,"pacData = "+JSON.stringify(c));var x=c.row-1;if(this.nrRollUpRows&&x<this.nrRollUpRows-1&&(x=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==x){for(var y=0;y<W;y++)this.rows[y].clear();var g=this.currRow+1-this.nrRollUpRows,F=this.lastOutputScreen;if(F){var U=F.rows[g].cueStartTime,A=this.logger.time;if(U&&A!==null&&U<A)for(var j=0;j<this.nrRollUpRows;j++)this.rows[x-this.nrRollUpRows+j+1].copy(F.rows[g+j])}}this.currRow=x;var N=this.rows[this.currRow];if(c.indent!==null){var b=c.indent,Y=Math.max(b-1,0);N.setCursor(c.indent),c.color=N.chars[Y].penState.foreground}var re={foreground:c.color,underline:c.underline,italics:c.italics,background:"black",flash:!1};this.setPen(re)},w.setBkgData=function(c){this.logger.log(l.INFO,"bkgData = "+JSON.stringify(c)),this.backSpace(),this.setPen(c),this.insertChar(32)},w.setRollUpRows=function(c){this.nrRollUpRows=c},w.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(l.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(l.TEXT,this.getDisplayText());var c=this.currRow+1-this.nrRollUpRows,x=this.rows.splice(c,1)[0];x.clear(),this.rows.splice(this.currRow,0,x),this.logger.log(l.INFO,"Rolling up")},w.getDisplayText=function(c){c=c||!1;for(var x=[],y="",g=-1,F=0;F<W;F++){var U=this.rows[F].getTextString();U&&(g=F+1,c?x.push("Row "+g+": '"+U+"'"):x.push(U.trim()))}return x.length>0&&(c?y="["+x.join(" | ")+"]":y=x.join(`
|
|
`)),y},w.getTextAndFormat=function(){return this.rows},S}(),C=function(){function S(E,c,x){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=E,this.outputFilter=c,this.mode=null,this.verbose=0,this.displayedMemory=new a(x),this.nonDisplayedMemory=new a(x),this.lastOutputScreen=new a(x),this.currRollUpRow=this.displayedMemory.rows[W-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=x}var w=S.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[W-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},w.getHandler=function(){return this.outputFilter},w.setHandler=function(c){this.outputFilter=c},w.setPAC=function(c){this.writeScreen.setPAC(c)},w.setBkgData=function(c){this.writeScreen.setBkgData(c)},w.setMode=function(c){if(c===this.mode)return;this.mode=c,this.logger.log(l.INFO,"MODE="+c),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=c},w.insertChars=function(c){for(var x=0;x<c.length;x++)this.writeScreen.insertChar(c[x]);var y=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(l.INFO,y+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(l.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},w.ccRCL=function(){this.logger.log(l.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},w.ccBS=function(){if(this.logger.log(l.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(l.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},w.ccRU=function(c){this.logger.log(l.INFO,"RU("+c+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(c)},w.ccFON=function(){this.logger.log(l.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},w.ccRDC=function(){this.logger.log(l.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},w.ccTR=function(){this.logger.log(l.INFO,"TR"),this.setMode("MODE_TEXT")},w.ccRTD=function(){this.logger.log(l.INFO,"RTD"),this.setMode("MODE_TEXT")},w.ccEDM=function(){this.logger.log(l.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},w.ccCR=function(){this.logger.log(l.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},w.ccENM=function(){this.logger.log(l.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},w.ccEOC=function(){if(this.logger.log(l.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var c=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=c,this.writeScreen=this.nonDisplayedMemory,this.logger.log(l.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},w.ccTO=function(c){this.logger.log(l.INFO,"TO("+c+") - Tab Offset"),this.writeScreen.moveCursor(c)},w.ccMIDROW=function(c){var x={flash:!1};if(x.underline=c%2===1,x.italics=c>=46,x.italics)x.foreground="white";else{var y=Math.floor(c/2)-16,g=["white","green","blue","cyan","red","yellow","magenta"];x.foreground=g[y]}this.logger.log(l.INFO,"MIDROW: "+JSON.stringify(x)),this.writeScreen.setPen(x)},w.outputDataUpdate=function(c){c===void 0&&(c=!1);var x=this.logger.time;if(x===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=x:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,x,this.lastOutputScreen),c&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:x),this.lastOutputScreen.copy(this.displayedMemory))},w.cueSplitAtTime=function(c){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,c,this.displayedMemory),this.cueStartTime=c))},S}(),_=function(){function S(E,c,x){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var y=new h;this.channels=[null,new C(E,c,y),new C(E+1,x,y)],this.cmdHistory=O(),this.logger=y}var w=S.prototype;return w.getHandler=function(c){return this.channels[c].getHandler()},w.setHandler=function(c,x){this.channels[c].setHandler(x)},w.addData=function(c,x){var y,g,F,U=!1;this.logger.time=c;for(var A=0;A<x.length;A+=2){if(g=x[A]&127,F=x[A+1]&127,g===0&&F===0)continue;if(this.logger.log(l.DATA,"["+f([x[A],x[A+1]])+"] -> ("+f([g,F])+")"),y=this.parseCmd(g,F),y||(y=this.parseMidrow(g,F)),y||(y=this.parsePAC(g,F)),y||(y=this.parseBackgroundAttributes(g,F)),!y&&(U=this.parseChars(g,F),U)){var j=this.currentChannel;if(j&&j>0){var N=this.channels[j];N.insertChars(U)}else this.logger.log(l.WARNING,"No channel found yet. TEXT-MODE?")}!y&&!U&&this.logger.log(l.WARNING,"Couldn't parse cleaned data "+f([g,F])+" orig: "+f([x[A],x[A+1]]))}},w.parseCmd=function(c,x){var y=this.cmdHistory,g=(c===20||c===28||c===21||c===29)&&x>=32&&x<=47,F=(c===23||c===31)&&x>=33&&x<=35;if(!(g||F))return!1;if(R(c,x,y))return T(null,null,y),this.logger.log(l.DEBUG,"Repeated command ("+f([c,x])+") is dropped"),!0;var U=c===20||c===21||c===23?1:2,A=this.channels[U];return c===20||c===21||c===28||c===29?x===32?A.ccRCL():x===33?A.ccBS():x===34?A.ccAOF():x===35?A.ccAON():x===36?A.ccDER():x===37?A.ccRU(2):x===38?A.ccRU(3):x===39?A.ccRU(4):x===40?A.ccFON():x===41?A.ccRDC():x===42?A.ccTR():x===43?A.ccRTD():x===44?A.ccEDM():x===45?A.ccCR():x===46?A.ccENM():x===47&&A.ccEOC():A.ccTO(x-32),T(c,x,y),this.currentChannel=U,!0},w.parseMidrow=function(c,x){var y=0;if((c===17||c===25)&&x>=32&&x<=47){if(c===17?y=1:y=2,y!==this.currentChannel)return this.logger.log(l.ERROR,"Mismatch channel in midrow parsing"),!1;var g=this.channels[y];return g?(g.ccMIDROW(x),this.logger.log(l.DEBUG,"MIDROW ("+f([c,x])+")"),!0):!1}return!1},w.parsePAC=function(c,x){var y,g=this.cmdHistory,F=(c>=17&&c<=23||c>=25&&c<=31)&&x>=64&&x<=127,U=(c===16||c===24)&&x>=64&&x<=95;if(!(F||U))return!1;if(R(c,x,g))return T(null,null,g),!0;var A=c<=23?1:2;x>=64&&x<=95?y=A===1?i[c]:v[c]:y=A===1?L[c]:m[c];var j=this.channels[A];return j?(j.setPAC(this.interpretPAC(y,x)),T(c,x,g),this.currentChannel=A,!0):!1},w.interpretPAC=function(c,x){var y,g={color:null,italics:!1,indent:null,underline:!1,row:c};return x>95?y=x-96:y=x-64,g.underline=(y&1)===1,y<=13?g.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(y/2)]:y<=15?(g.italics=!0,g.color="white"):g.indent=Math.floor((y-16)/2)*4,g},w.parseChars=function(c,x){var y,g=null,F=null;if(c>=25?(y=2,F=c-8):(y=1,F=c),F>=17&&F<=19){var U;F===17?U=x+80:F===18?U=x+112:U=x+144,this.logger.log(l.INFO,"Special char '"+P(U)+"' in channel "+y),g=[U]}else c>=32&&c<=127&&(g=x===0?[c]:[c,x]);if(g){var A=f(g);this.logger.log(l.DEBUG,"Char codes = "+A.join(",")),T(c,x,this.cmdHistory)}return g},w.parseBackgroundAttributes=function(c,x){var y=(c===16||c===24)&&x>=32&&x<=47,g=(c===23||c===31)&&x>=45&&x<=47;if(!(y||g))return!1;var F,U={};c===16||c===24?(F=Math.floor((x-32)/2),U.background=p[F],x%2===1&&(U.background=U.background+"_semi")):x===45?U.background="transparent":(U.foreground="black",x===47&&(U.underline=!0));var A=c<=23?1:2,j=this.channels[A];return j.setBkgData(U),T(c,x,this.cmdHistory),!0},w.reset=function(){for(var c=0;c<Object.keys(this.channels).length;c++){var x=this.channels[c];x&&x.reset()}this.cmdHistory=O()},w.cueSplitAtTime=function(c){for(var x=0;x<this.channels.length;x++){var y=this.channels[x];y&&y.cueSplitAtTime(c)}},S}();function T(S,w,E){E.a=S,E.b=w}function R(S,w,E){return E.a===S&&E.b===w}function O(){return{a:null,b:null}}$.default=_},"./src/utils/codecs.ts":function(oe,$,M){"use strict";M.r($),M.d($,"isCodecType",function(){return B}),M.d($,"isCodecSupportedInMp4",function(){return P});var X={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function B(W,H){var i=X[H];return!!i&&i[W.slice(0,4)]===!0}function P(W,H){return MediaSource.isTypeSupported((H||"video")+'/mp4;codecs="'+W+'"')}},"./src/utils/cues.ts":function(oe,$,M){"use strict";M.r($);var X=M("./src/utils/vttparser.ts"),B=M("./src/utils/webvtt-parser.ts"),P=M("./src/utils/texttrack-utils.ts"),W=/\s/,H={newCue:function(L,v,m,p){for(var l=[],h,f,o,u,s,a=self.VTTCue||self.TextTrackCue,C=0;C<p.rows.length;C++)if(h=p.rows[C],o=!0,u=0,s="",!h.isEmpty()){for(var _=0;_<h.chars.length;_++)W.test(h.chars[_].uchar)&&o?u++:(s+=h.chars[_].uchar,o=!1);h.cueStartTime=v,v===m&&(m+=1e-4),u>=16?u--:u++;var T=Object(X.fixLineBreaks)(s.trim()),R=Object(B.generateCueId)(v,m,T);(!L||!L.cues||!L.cues.getCueById(R))&&(f=new a(v,m,T),f.id=R,f.line=C+1,f.align="left",f.position=10+Math.min(80,Math.floor(u*8/32)*10),l.push(f))}return L&&l.length&&(l.sort(function(O,S){return O.line==="auto"||S.line==="auto"?0:O.line>8&&S.line>8?S.line-O.line:O.line-S.line}),l.forEach(function(O){return Object(P.addCueToTrack)(L,O)})),l}};$.default=H},"./src/utils/discontinuities.ts":function(oe,$,M){"use strict";M.r($),M.d($,"findFirstFragWithCC",function(){return W}),M.d($,"shouldAlignOnDiscontinuities",function(){return H}),M.d($,"findDiscontinuousReferenceFrag",function(){return i}),M.d($,"adjustSlidingStart",function(){return v}),M.d($,"alignStream",function(){return m}),M.d($,"alignPDT",function(){return l}),M.d($,"alignFragmentByPDTDelta",function(){return h}),M.d($,"alignMediaPlaylistByPDT",function(){return f});var X=M("./src/polyfills/number.ts"),B=M("./src/utils/logger.ts"),P=M("./src/controller/level-helper.ts");function W(o,u){for(var s=null,a=0,C=o.length;a<C;a++){var _=o[a];if(_&&_.cc===u){s=_;break}}return s}function H(o,u,s){return!!(u.details&&(s.endCC>s.startCC||o&&o.cc<s.startCC))}function i(o,u){var s=o.fragments,a=u.fragments;if(!a.length||!s.length){B.logger.log("No fragments to align");return}var C=W(s,a[0].cc);if(!C||C&&!C.startPTS){B.logger.log("No frag in previous level to align on");return}return C}function L(o,u){if(o){var s=o.start+u;o.start=o.startPTS=s,o.endPTS=s+o.duration}}function v(o,u){for(var s=u.fragments,a=0,C=s.length;a<C;a++)L(s[a],o);u.fragmentHint&&L(u.fragmentHint,o),u.alignedSliding=!0}function m(o,u,s){if(!u)return;p(o,s,u),!s.alignedSliding&&u.details&&l(s,u.details),!s.alignedSliding&&u.details&&!s.skippedSegments&&Object(P.adjustSliding)(u.details,s)}function p(o,u,s){if(H(o,s,u)){var a=i(s.details,u);a&&Object(X.isFiniteNumber)(a.start)&&(B.logger.log("Adjusting PTS using last level due to CC increase within current level "+u.url),v(a.start,u))}}function l(o,u){if(!u.fragments.length||!o.hasProgramDateTime||!u.hasProgramDateTime)return;var s=u.fragments[0].programDateTime,a=o.fragments[0].programDateTime,C=(a-s)/1e3+u.fragments[0].start;C&&Object(X.isFiniteNumber)(C)&&(B.logger.log("Adjusting PTS using programDateTime delta "+(a-s)+"ms, sliding:"+C.toFixed(3)+" "+o.url+" "),v(C,o))}function h(o,u){var s=o.programDateTime;if(!s)return;var a=(s-u)/1e3;o.start=o.startPTS=a,o.endPTS=a+o.duration}function f(o,u){if(!u.fragments.length||!o.hasProgramDateTime||!u.hasProgramDateTime)return;var s=u.fragments[0].programDateTime,a=u.fragments[0].start,C=s-a*1e3;o.fragments.forEach(function(_){h(_,C)}),o.fragmentHint&&h(o.fragmentHint,C),o.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(oe,$,M){"use strict";M.r($);var X=M("./src/utils/ewma.ts"),B=function(){function P(H,i,L){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=L,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new X.default(H),this.fast_=new X.default(i)}var W=P.prototype;return W.update=function(i,L){var v=this.slow_,m=this.fast_;this.slow_.halfLife!==i&&(this.slow_=new X.default(i,v.getEstimate(),v.getTotalWeight())),this.fast_.halfLife!==L&&(this.fast_=new X.default(L,m.getEstimate(),m.getTotalWeight()))},W.sample=function(i,L){i=Math.max(i,this.minDelayMs_);var v=8*L,m=i/1e3,p=v/m;this.fast_.sample(m,p),this.slow_.sample(m,p)},W.canEstimate=function(){var i=this.fast_;return i&&i.getTotalWeight()>=this.minWeight_},W.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},W.destroy=function(){},P}();$.default=B},"./src/utils/ewma.ts":function(oe,$,M){"use strict";M.r($);var X=function(){function B(W,H,i){H===void 0&&(H=0),i===void 0&&(i=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=W,this.alpha_=W?Math.exp(Math.log(.5)/W):0,this.estimate_=H,this.totalWeight_=i}var P=B.prototype;return P.sample=function(H,i){var L=Math.pow(this.alpha_,H);this.estimate_=i*(1-L)+L*this.estimate_,this.totalWeight_+=H},P.getTotalWeight=function(){return this.totalWeight_},P.getEstimate=function(){if(this.alpha_){var H=1-Math.pow(this.alpha_,this.totalWeight_);if(H)return this.estimate_/H}return this.estimate_},B}();$.default=X},"./src/utils/fetch-loader.ts":function(oe,$,M){"use strict";M.r($),M.d($,"fetchSupported",function(){return h});var X=M("./src/polyfills/number.ts"),B=M("./src/loader/load-stats.ts"),P=M("./src/demux/chunk-cache.ts");function W(a,C){a.prototype=Object.create(C.prototype),a.prototype.constructor=a,m(a,C)}function H(a){var C=typeof Map=="function"?new Map:void 0;return H=function(T){if(T===null||!v(T))return T;if(typeof T!="function")throw new TypeError("Super expression must either be null or a function");if(typeof C!="undefined"){if(C.has(T))return C.get(T);C.set(T,R)}function R(){return i(T,arguments,p(this).constructor)}return R.prototype=Object.create(T.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),m(R,T)},H(a)}function i(a,C,_){return L()?i=Reflect.construct:i=function(R,O,S){var w=[null];w.push.apply(w,O);var E=Function.bind.apply(R,w),c=new E;return S&&m(c,S.prototype),c},i.apply(null,arguments)}function L(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}function v(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function m(a,C){return m=Object.setPrototypeOf||function(T,R){return T.__proto__=R,T},m(a,C)}function p(a){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(_){return _.__proto__||Object.getPrototypeOf(_)},p(a)}function l(){return l=Object.assign||function(a){for(var C=1;C<arguments.length;C++){var _=arguments[C];for(var T in _)Object.prototype.hasOwnProperty.call(_,T)&&(a[T]=_[T])}return a},l.apply(this,arguments)}function h(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}var f=function(){function a(_){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=_.fetchSetup||u,this.controller=new self.AbortController,this.stats=new B.LoadStats}var C=a.prototype;return C.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},C.abortInternal=function(){var T=this.response;(!T||!T.ok)&&(this.stats.aborted=!0,this.controller.abort())},C.abort=function(){var T;this.abortInternal(),(T=this.callbacks)!==null&&T!==void 0&&T.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},C.load=function(T,R,O){var S=this,w=this.stats;if(w.loading.start)throw new Error("Loader can only be used once.");w.loading.start=self.performance.now();var E=o(T,this.controller.signal),c=O.onProgress,x=T.responseType==="arraybuffer",y=x?"byteLength":"length";this.context=T,this.config=R,this.callbacks=O,this.request=this.fetchSetup(T,E),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){S.abortInternal(),O.onTimeout(w,T,S.response)},R.timeout),self.fetch(this.request).then(function(g){if(S.response=S.loader=g,!g.ok){var F=g.status,U=g.statusText;throw new s(U||"fetch, bad network response",F,g)}return w.loading.first=Math.max(self.performance.now(),w.loading.start),w.total=parseInt(g.headers.get("Content-Length")||"0"),c&&Object(X.isFiniteNumber)(R.highWaterMark)?S.loadProgressively(g,w,T,R.highWaterMark,c):x?g.arrayBuffer():g.text()}).then(function(g){var F=S.response;self.clearTimeout(S.requestTimeout),w.loading.end=Math.max(self.performance.now(),w.loading.first),w.loaded=w.total=g[y];var U={url:F.url,data:g};c&&!Object(X.isFiniteNumber)(R.highWaterMark)&&c(w,T,g,F),O.onSuccess(U,w,T,F)}).catch(function(g){if(self.clearTimeout(S.requestTimeout),w.aborted)return;var F=g.code||0;O.onError({code:F,text:g.message},T,g.details)})},C.getCacheAge=function(){var T=null;if(this.response){var R=this.response.headers.get("age");T=R?parseFloat(R):null}return T},C.loadProgressively=function(T,R,O,S,w){S===void 0&&(S=0);var E=new P.default,c=T.body.getReader(),x=function y(){return c.read().then(function(g){if(g.done)return E.dataLength&&w(R,O,E.flush(),T),Promise.resolve(new ArrayBuffer(0));var F=g.value,U=F.length;return R.loaded+=U,U<S||E.dataLength?(E.push(F),E.dataLength>=S&&w(R,O,E.flush(),T)):w(R,O,F,T),y()}).catch(function(){return Promise.reject()})};return x()},a}();function o(a,C){var _={method:"GET",mode:"cors",credentials:"same-origin",signal:C,headers:new self.Headers(l({},a.headers))};return a.rangeEnd&&_.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),_}function u(a,C){return new self.Request(a.url,C)}var s=function(a){W(C,a);function C(_,T,R){var O;return O=a.call(this,_)||this,O.code=void 0,O.details=void 0,O.code=T,O.details=R,O}return C}(H(Error));$.default=f},"./src/utils/imsc1-ttml-parser.ts":function(oe,$,M){"use strict";M.r($),M.d($,"IMSC1_CODEC",function(){return v}),M.d($,"parseIMSC1",function(){return h});var X=M("./src/utils/mp4-tools.ts"),B=M("./src/utils/vttparser.ts"),P=M("./src/utils/vttcue.ts"),W=M("./src/demux/id3.ts"),H=M("./src/utils/timescale-conversion.ts"),i=M("./src/utils/webvtt-parser.ts");function L(){return L=Object.assign||function(S){for(var w=1;w<arguments.length;w++){var E=arguments[w];for(var c in E)Object.prototype.hasOwnProperty.call(E,c)&&(S[c]=E[c])}return S},L.apply(this,arguments)}var v="stpp.ttml.im1t",m=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,p=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,l={left:"start",center:"center",right:"end",start:"start",end:"end"};function h(S,w,E,c,x){var y=Object(X.findBox)(new Uint8Array(S),["mdat"]);if(y.length===0){x(new Error("Could not parse IMSC1 mdat"));return}var g=y[0],F=Object(W.utf8ArrayToStr)(new Uint8Array(S,g.start,g.end-g.start)),U=Object(H.toTimescaleFromScale)(w,1,E);try{c(f(F,U))}catch(A){x(A)}}function f(S,w){var E=new DOMParser,c=E.parseFromString(S,"text/xml"),x=c.getElementsByTagName("tt")[0];if(!x)throw new Error("Invalid ttml");var y={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},g=Object.keys(y).reduce(function(N,b){return N[b]=x.getAttribute("ttp:"+b)||y[b],N},{}),F=x.getAttribute("xml:space")!=="preserve",U=u(o(x,"styling","style")),A=u(o(x,"layout","region")),j=o(x,"body","[begin]");return[].map.call(j,function(N){var b=s(N,F);if(!b||!N.hasAttribute("begin"))return null;var Y=T(N.getAttribute("begin"),g),re=T(N.getAttribute("dur"),g),fe=T(N.getAttribute("end"),g);if(Y===null)throw _(N);if(fe===null){if(re===null)throw _(N);fe=Y+re}var ve=new P.default(Y-w,fe-w,b);ve.id=Object(i.generateCueId)(ve.startTime,ve.endTime,ve.text);var ke=A[N.getAttribute("region")],Se=U[N.getAttribute("style")];ve.position=10,ve.size=80;var Le=a(ke,Se),ye=Le.textAlign;if(ye){var _e=l[ye];_e&&(ve.lineAlign=_e),ve.align=ye}return L(ve,Le),ve}).filter(function(N){return N!==null})}function o(S,w,E){var c=S.getElementsByTagName(w)[0];return c?[].slice.call(c.querySelectorAll(E)):[]}function u(S){return S.reduce(function(w,E){var c=E.getAttribute("xml:id");return c&&(w[c]=E),w},{})}function s(S,w){return[].slice.call(S.childNodes).reduce(function(E,c,x){var y;return c.nodeName==="br"&&x?E+`
|
|
`:(y=c.childNodes)!==null&&y!==void 0&&y.length?s(c,w):w?E+c.textContent.trim().replace(/\s+/g," "):E+c.textContent},"")}function a(S,w){var E="http://www.w3.org/ns/ttml#styling",c=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return c.reduce(function(x,y){var g=C(w,E,y)||C(S,E,y);return g&&(x[y]=g),x},{})}function C(S,w,E){return S.hasAttributeNS(w,E)?S.getAttributeNS(w,E):null}function _(S){return new Error("Could not parse ttml timestamp "+S)}function T(S,w){if(!S)return null;var E=Object(B.parseTimeStamp)(S);return E===null&&(m.test(S)?E=R(S,w):p.test(S)&&(E=O(S,w))),E}function R(S,w){var E=m.exec(S),c=(E[4]|0)+(E[5]|0)/w.subFrameRate;return(E[1]|0)*3600+(E[2]|0)*60+(E[3]|0)+c/w.frameRate}function O(S,w){var E=p.exec(S),c=Number(E[1]),x=E[2];switch(x){case"h":return c*3600;case"m":return c*60;case"ms":return c*1e3;case"f":return c/w.frameRate;case"t":return c/w.tickRate}return c}},"./src/utils/logger.ts":function(oe,$,M){"use strict";M.r($),M.d($,"enableLogs",function(){return i}),M.d($,"logger",function(){return L});var X=function(){},B={trace:X,debug:X,log:X,warn:X,info:X,error:X},P=B;function W(v){var m=self.console[v];return m?m.bind(self.console,"["+v+"] >"):X}function H(v){for(var m=arguments.length,p=new Array(m>1?m-1:0),l=1;l<m;l++)p[l-1]=arguments[l];p.forEach(function(h){P[h]=v[h]?v[h].bind(v):W(h)})}function i(v){if(self.console&&v===!0||typeof v=="object"){H(v,"debug","log","info","warn","error");try{P.log()}catch(m){P=B}}else P=B}var L=P},"./src/utils/mediakeys-helper.ts":function(oe,$,M){"use strict";M.r($),M.d($,"KeySystems",function(){return X}),M.d($,"requestMediaKeySystemAccess",function(){return B});var X;(function(P){P.WIDEVINE="com.widevine.alpha",P.PLAYREADY="com.microsoft.playready"})(X||(X={}));var B=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(oe,$,M){"use strict";M.r($),M.d($,"getMediaSource",function(){return X});function X(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(oe,$,M){"use strict";M.r($),M.d($,"bin2str",function(){return H}),M.d($,"readUint16",function(){return i}),M.d($,"readUint32",function(){return L}),M.d($,"writeUint32",function(){return v}),M.d($,"findBox",function(){return m}),M.d($,"parseSegmentIndex",function(){return p}),M.d($,"parseInitSegment",function(){return l}),M.d($,"getStartDTS",function(){return h}),M.d($,"getDuration",function(){return f}),M.d($,"computeRawDurationFromSamples",function(){return o}),M.d($,"offsetStartDTS",function(){return u}),M.d($,"segmentValidRange",function(){return s}),M.d($,"appendUint8Array",function(){return a});var X=M("./src/utils/typed-array.ts"),B=M("./src/loader/fragment.ts"),P=Math.pow(2,32)-1,W=[].push;function H(C){return String.fromCharCode.apply(null,C)}function i(C,_){"data"in C&&(_+=C.start,C=C.data);var T=C[_]<<8|C[_+1];return T<0?65536+T:T}function L(C,_){"data"in C&&(_+=C.start,C=C.data);var T=C[_]<<24|C[_+1]<<16|C[_+2]<<8|C[_+3];return T<0?4294967296+T:T}function v(C,_,T){"data"in C&&(_+=C.start,C=C.data),C[_]=T>>24,C[_+1]=T>>16&255,C[_+2]=T>>8&255,C[_+3]=T&255}function m(C,_){var T=[];if(!_.length)return T;var R,O,S;"data"in C?(R=C.data,O=C.start,S=C.end):(R=C,O=0,S=R.byteLength);for(var w=O;w<S;){var E=L(R,w),c=H(R.subarray(w+4,w+8)),x=E>1?w+E:S;if(c===_[0])if(_.length===1)T.push({data:R,start:w+8,end:x});else{var y=m({data:R,start:w+8,end:x},_.slice(1));y.length&&W.apply(T,y)}w=x}return T}function p(C){var _=m(C,["moov"]),T=_[0],R=T?T.end:null,O=m(C,["sidx"]);if(!O||!O[0])return null;var S=[],w=O[0],E=w.data[0],c=E===0?8:16,x=L(w,c);c+=4;var y=0,g=0;E===0?c+=8:c+=16,c+=2;var F=w.end+g,U=i(w,c);c+=2;for(var A=0;A<U;A++){var j=c,N=L(w,j);j+=4;var b=N&2147483647,Y=(N&2147483648)>>>31;if(Y===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var re=L(w,j);j+=4,S.push({referenceSize:b,subsegmentDuration:re,info:{duration:re/x,start:F,end:F+b-1}}),F+=b,j+=4,c=j}return{earliestPresentationTime:y,timescale:x,version:E,referencesCount:U,references:S,moovEndOffset:R}}function l(C){for(var _=[],T=m(C,["moov","trak"]),R=0;R<T.length;R++){var O=T[R],S=m(O,["tkhd"])[0];if(S){var w=S.data[S.start],E=w===0?12:20,c=L(S,E),x=m(O,["mdia","mdhd"])[0];if(x){w=x.data[x.start],E=w===0?12:20;var y=L(x,E),g=m(O,["mdia","hdlr"])[0];if(g){var F=H(g.data.subarray(g.start+8,g.start+12)),U={soun:B.ElementaryStreamTypes.AUDIO,vide:B.ElementaryStreamTypes.VIDEO}[F];if(U){var A=m(O,["mdia","minf","stbl","stsd"])[0],j=void 0;A&&(j=H(A.data.subarray(A.start+12,A.start+16))),_[c]={timescale:y,type:U},_[U]={timescale:y,id:c,codec:j}}}}}}var N=m(C,["moov","mvex","trex"]);return N.forEach(function(b){var Y=L(b,4),re=_[Y];re&&(re.default={duration:L(b,12),flags:L(b,20)})}),_}function h(C,_){return m(_,["moof","traf"]).reduce(function(T,R){var O=m(R,["tfdt"])[0],S=O.data[O.start],w=m(R,["tfhd"]).reduce(function(E,c){var x=L(c,4),y=C[x];if(y){var g=L(O,4);S===1&&(g*=Math.pow(2,32),g+=L(O,8));var F=y.timescale||9e4,U=g/F;if(isFinite(U)&&(E===null||U<E))return U}return E},null);return w!==null&&isFinite(w)&&(T===null||w<T)?w:T},null)||0}function f(C,_){for(var T=0,R=0,O=0,S=m(C,["moof","traf"]),w=0;w<S.length;w++){var E=S[w],c=m(E,["tfhd"])[0],x=L(c,4),y=_[x];if(!y)continue;var g=y.default,F=L(c,0)|(g==null?void 0:g.flags),U=g==null?void 0:g.duration;F&8&&(F&2?U=L(c,12):U=L(c,8));for(var A=y.timescale||9e4,j=m(E,["trun"]),N=0;N<j.length;N++){if(U){var b=L(j[N],4);T=U*b}else T=o(j[N]);y.type===B.ElementaryStreamTypes.VIDEO?R+=T/A:y.type===B.ElementaryStreamTypes.AUDIO&&(O+=T/A)}}if(R===0&&O===0){var Y=p(C);if(Y!=null&&Y.references)return Y.references.reduce(function(re,fe){return re+fe.info.duration||0},0)}return R||O}function o(C){var _=L(C,0),T=8;_&1&&(T+=4),_&4&&(T+=4);for(var R=0,O=L(C,4),S=0;S<O;S++){if(_&256){var w=L(C,T);R+=w,T+=4}_&512&&(T+=4),_&1024&&(T+=4),_&2048&&(T+=4)}return R}function u(C,_,T){m(_,["moof","traf"]).forEach(function(R){m(R,["tfhd"]).forEach(function(O){var S=L(O,4),w=C[S];if(!w)return;var E=w.timescale||9e4;m(R,["tfdt"]).forEach(function(c){var x=c.data[c.start],y=L(c,4);if(x===0)v(c,4,y-T*E);else{y*=Math.pow(2,32),y+=L(c,8),y-=T*E,y=Math.max(y,0);var g=Math.floor(y/(P+1)),F=Math.floor(y%(P+1));v(c,4,g),v(c,8,F)}})})})}function s(C){var _={valid:null,remainder:null},T=m(C,["moof"]);if(T){if(T.length<2)return _.remainder=C,_}else return _;var R=T[T.length-1];return _.valid=Object(X.sliceUint8)(C,0,R.start-8),_.remainder=Object(X.sliceUint8)(C,R.start-8),_}function a(C,_){var T=new Uint8Array(C.length+_.length);return T.set(C),T.set(_,C.length),T}},"./src/utils/output-filter.ts":function(oe,$,M){"use strict";M.r($),M.d($,"default",function(){return X});var X=function(){function B(W,H){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=W,this.trackName=H}var P=B.prototype;return P.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},P.newCue=function(H,i,L){(this.startTime===null||this.startTime>H)&&(this.startTime=H),this.endTime=i,this.screen=L,this.timelineController.createCaptionsTrack(this.trackName)},P.reset=function(){this.cueRanges=[]},B}()},"./src/utils/texttrack-utils.ts":function(oe,$,M){"use strict";M.r($),M.d($,"sendAddTrackEvent",function(){return B}),M.d($,"addCueToTrack",function(){return P}),M.d($,"clearCurrentCues",function(){return W}),M.d($,"removeCuesInRange",function(){return H}),M.d($,"getCuesInRange",function(){return L});var X=M("./src/utils/logger.ts");function B(v,m){var p;try{p=new Event("addtrack")}catch(l){p=document.createEvent("Event"),p.initEvent("addtrack",!1,!1)}p.track=v,m.dispatchEvent(p)}function P(v,m){var p=v.mode;if(p==="disabled"&&(v.mode="hidden"),v.cues&&!v.cues.getCueById(m.id))try{if(v.addCue(m),!v.cues.getCueById(m.id))throw new Error("addCue is failed for: "+m)}catch(h){X.logger.debug("[texttrack-utils]: "+h);var l=new self.TextTrackCue(m.startTime,m.endTime,m.text);l.id=m.id,v.addCue(l)}p==="disabled"&&(v.mode=p)}function W(v){var m=v.mode;if(m==="disabled"&&(v.mode="hidden"),v.cues)for(var p=v.cues.length;p--;)v.removeCue(v.cues[p]);m==="disabled"&&(v.mode=m)}function H(v,m,p){var l=v.mode;if(l==="disabled"&&(v.mode="hidden"),v.cues&&v.cues.length>0)for(var h=L(v.cues,m,p),f=0;f<h.length;f++)v.removeCue(h[f]);l==="disabled"&&(v.mode=l)}function i(v,m){if(m<v[0].startTime)return 0;var p=v.length-1;if(m>v[p].endTime)return-1;for(var l=0,h=p;l<=h;){var f=Math.floor((h+l)/2);if(m<v[f].startTime)h=f-1;else if(m>v[f].startTime&&l<p)l=f+1;else return f}return v[l].startTime-m<m-v[h].startTime?l:h}function L(v,m,p){var l=[],h=i(v,m);if(h>-1)for(var f=h,o=v.length;f<o;f++){var u=v[f];if(u.startTime>=m&&u.endTime<=p)l.push(u);else if(u.startTime>p)return l}return l}},"./src/utils/time-ranges.ts":function(oe,$,M){"use strict";M.r($);var X={toString:function(P){for(var W="",H=P.length,i=0;i<H;i++)W+="["+P.start(i).toFixed(3)+","+P.end(i).toFixed(3)+"]";return W}};$.default=X},"./src/utils/timescale-conversion.ts":function(oe,$,M){"use strict";M.r($),M.d($,"toTimescaleFromBase",function(){return B}),M.d($,"toTimescaleFromScale",function(){return P}),M.d($,"toMsFromMpegTsClock",function(){return W}),M.d($,"toMpegTsClockFromTimescale",function(){return H});var X=9e4;function B(i,L,v,m){v===void 0&&(v=1),m===void 0&&(m=!1);var p=i*L*v;return m?Math.round(p):p}function P(i,L,v,m){return v===void 0&&(v=1),m===void 0&&(m=!1),B(i,L,1/v,m)}function W(i,L){return L===void 0&&(L=!1),B(i,1e3,1/X,L)}function H(i,L){return L===void 0&&(L=1),B(i,X,1/L)}},"./src/utils/typed-array.ts":function(oe,$,M){"use strict";M.r($),M.d($,"sliceUint8",function(){return X});function X(B,P,W){return Uint8Array.prototype.slice?B.slice(P,W):new Uint8Array(Array.prototype.slice.call(B,P,W))}},"./src/utils/vttcue.ts":function(oe,$,M){"use strict";M.r($),$.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var X=["","lr","rl"],B=["start","middle","end","left","right"];function P(v,m){if(typeof m!="string")return!1;if(!Array.isArray(v))return!1;var p=m.toLowerCase();return~v.indexOf(p)?p:!1}function W(v){return P(X,v)}function H(v){return P(B,v)}function i(v){for(var m=arguments.length,p=new Array(m>1?m-1:0),l=1;l<m;l++)p[l-1]=arguments[l];for(var h=1;h<arguments.length;h++){var f=arguments[h];for(var o in f)v[o]=f[o]}return v}function L(v,m,p){var l=this,h={enumerable:!0};l.hasBeenReset=!1;var f="",o=!1,u=v,s=m,a=p,C=null,_="",T=!0,R="auto",O="start",S=50,w="middle",E=50,c="middle";Object.defineProperty(l,"id",i({},h,{get:function(){return f},set:function(y){f=""+y}})),Object.defineProperty(l,"pauseOnExit",i({},h,{get:function(){return o},set:function(y){o=!!y}})),Object.defineProperty(l,"startTime",i({},h,{get:function(){return u},set:function(y){if(typeof y!="number")throw new TypeError("Start time must be set to a number.");u=y,this.hasBeenReset=!0}})),Object.defineProperty(l,"endTime",i({},h,{get:function(){return s},set:function(y){if(typeof y!="number")throw new TypeError("End time must be set to a number.");s=y,this.hasBeenReset=!0}})),Object.defineProperty(l,"text",i({},h,{get:function(){return a},set:function(y){a=""+y,this.hasBeenReset=!0}})),Object.defineProperty(l,"region",i({},h,{get:function(){return C},set:function(y){C=y,this.hasBeenReset=!0}})),Object.defineProperty(l,"vertical",i({},h,{get:function(){return _},set:function(y){var g=W(y);if(g===!1)throw new SyntaxError("An invalid or illegal string was specified.");_=g,this.hasBeenReset=!0}})),Object.defineProperty(l,"snapToLines",i({},h,{get:function(){return T},set:function(y){T=!!y,this.hasBeenReset=!0}})),Object.defineProperty(l,"line",i({},h,{get:function(){return R},set:function(y){if(typeof y!="number"&&y!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");R=y,this.hasBeenReset=!0}})),Object.defineProperty(l,"lineAlign",i({},h,{get:function(){return O},set:function(y){var g=H(y);if(!g)throw new SyntaxError("An invalid or illegal string was specified.");O=g,this.hasBeenReset=!0}})),Object.defineProperty(l,"position",i({},h,{get:function(){return S},set:function(y){if(y<0||y>100)throw new Error("Position must be between 0 and 100.");S=y,this.hasBeenReset=!0}})),Object.defineProperty(l,"positionAlign",i({},h,{get:function(){return w},set:function(y){var g=H(y);if(!g)throw new SyntaxError("An invalid or illegal string was specified.");w=g,this.hasBeenReset=!0}})),Object.defineProperty(l,"size",i({},h,{get:function(){return E},set:function(y){if(y<0||y>100)throw new Error("Size must be between 0 and 100.");E=y,this.hasBeenReset=!0}})),Object.defineProperty(l,"align",i({},h,{get:function(){return c},set:function(y){var g=H(y);if(!g)throw new SyntaxError("An invalid or illegal string was specified.");c=g,this.hasBeenReset=!0}})),l.displayState=void 0}return L.prototype.getCueAsHTML=function(){var v=self.WebVTT;return v.convertCueToDOMTree(self,this.text)},L}()},"./src/utils/vttparser.ts":function(oe,$,M){"use strict";M.r($),M.d($,"parseTimeStamp",function(){return P}),M.d($,"fixLineBreaks",function(){return m}),M.d($,"VTTParser",function(){return p});var X=M("./src/utils/vttcue.ts"),B=function(){function l(){}var h=l.prototype;return h.decode=function(o,u){if(!o)return"";if(typeof o!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(o))},l}();function P(l){function h(o,u,s,a){return(o|0)*3600+(u|0)*60+(s|0)+parseFloat(a||0)}var f=l.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return f?parseFloat(f[2])>59?h(f[2],f[3],0,f[4]):h(f[1],f[2],f[3],f[4]):null}var W=function(){function l(){this.values=Object.create(null)}var h=l.prototype;return h.set=function(o,u){!this.get(o)&&u!==""&&(this.values[o]=u)},h.get=function(o,u,s){return s?this.has(o)?this.values[o]:u[s]:this.has(o)?this.values[o]:u},h.has=function(o){return o in this.values},h.alt=function(o,u,s){for(var a=0;a<s.length;++a)if(u===s[a]){this.set(o,u);break}},h.integer=function(o,u){/^-?\d+$/.test(u)&&this.set(o,parseInt(u,10))},h.percent=function(o,u){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(u)){var s=parseFloat(u);if(s>=0&&s<=100)return this.set(o,s),!0}return!1},l}();function H(l,h,f,o){var u=o?l.split(o):[l];for(var s in u){if(typeof u[s]!="string")continue;var a=u[s].split(f);if(a.length!==2)continue;var C=a[0],_=a[1];h(C,_)}}var i=new X.default(0,0,""),L=i.align==="middle"?"middle":"center";function v(l,h,f){var o=l;function u(){var C=P(l);if(C===null)throw new Error("Malformed timestamp: "+o);return l=l.replace(/^[^\sa-zA-Z-]+/,""),C}function s(C,_){var T=new W;H(C,function(S,w){var E;switch(S){case"region":for(var c=f.length-1;c>=0;c--)if(f[c].id===w){T.set(S,f[c].region);break}break;case"vertical":T.alt(S,w,["rl","lr"]);break;case"line":E=w.split(","),T.integer(S,E[0]),T.percent(S,E[0])&&T.set("snapToLines",!1),T.alt(S,E[0],["auto"]),E.length===2&&T.alt("lineAlign",E[1],["start",L,"end"]);break;case"position":E=w.split(","),T.percent(S,E[0]),E.length===2&&T.alt("positionAlign",E[1],["start",L,"end","line-left","line-right","auto"]);break;case"size":T.percent(S,w);break;case"align":T.alt(S,w,["start",L,"end","left","right"]);break}},/:/,/\s/),_.region=T.get("region",null),_.vertical=T.get("vertical","");var R=T.get("line","auto");R==="auto"&&i.line===-1&&(R=-1),_.line=R,_.lineAlign=T.get("lineAlign","start"),_.snapToLines=T.get("snapToLines",!0),_.size=T.get("size",100),_.align=T.get("align",L);var O=T.get("position","auto");O==="auto"&&i.position===50&&(O=_.align==="start"||_.align==="left"?0:_.align==="end"||_.align==="right"?100:50),_.position=O}function a(){l=l.replace(/^\s+/,"")}if(a(),h.startTime=u(),a(),l.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);l=l.substr(3),a(),h.endTime=u(),a(),s(l,h)}function m(l){return l.replace(/<br(?: \/)?>/gi,`
|
|
`)}var p=function(){function l(){this.state="INITIAL",this.buffer="",this.decoder=new B,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var h=l.prototype;return h.parse=function(o){var u=this;o&&(u.buffer+=u.decoder.decode(o,{stream:!0}));function s(){var O=u.buffer,S=0;for(O=m(O);S<O.length&&O[S]!=="\r"&&O[S]!==`
|
|
`;)++S;var w=O.substr(0,S);return O[S]==="\r"&&++S,O[S]===`
|
|
`&&++S,u.buffer=O.substr(S),w}function a(O){H(O,function(S,w){},/:/)}try{var C="";if(u.state==="INITIAL"){if(!/\r\n|\n/.test(u.buffer))return this;C=s();var _=C.match(/^()?WEBVTT([ \t].*)?$/);if(!_||!_[0])throw new Error("Malformed WebVTT signature.");u.state="HEADER"}for(var T=!1;u.buffer;){if(!/\r\n|\n/.test(u.buffer))return this;T?T=!1:C=s();switch(u.state){case"HEADER":/:/.test(C)?a(C):C||(u.state="ID");continue;case"NOTE":C||(u.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(C)){u.state="NOTE";break}if(!C)continue;if(u.cue=new X.default(0,0,""),u.state="CUE",C.indexOf("-->")===-1){u.cue.id=C;continue}case"CUE":if(!u.cue){u.state="BADCUE";continue}try{v(C,u.cue,u.regionList)}catch(O){u.cue=null,u.state="BADCUE";continue}u.state="CUETEXT";continue;case"CUETEXT":{var R=C.indexOf("-->")!==-1;if(!C||R&&(T=!0)){u.oncue&&u.cue&&u.oncue(u.cue),u.cue=null,u.state="ID";continue}if(u.cue===null)continue;u.cue.text&&(u.cue.text+=`
|
|
`),u.cue.text+=C}continue;case"BADCUE":C||(u.state="ID")}}}catch(O){u.state==="CUETEXT"&&u.cue&&u.oncue&&u.oncue(u.cue),u.cue=null,u.state=u.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},h.flush=function(){var o=this;try{if((o.cue||o.state==="HEADER")&&(o.buffer+=`
|
|
|
|
`,o.parse()),o.state==="INITIAL"||o.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(u){o.onparsingerror&&o.onparsingerror(u)}return o.onflush&&o.onflush(),this},l}()},"./src/utils/webvtt-parser.ts":function(oe,$,M){"use strict";M.r($),M.d($,"generateCueId",function(){return p}),M.d($,"parseWebVTT",function(){return h});var X=M("./src/polyfills/number.ts"),B=M("./src/utils/vttparser.ts"),P=M("./src/demux/id3.ts"),W=M("./src/utils/timescale-conversion.ts"),H=M("./src/remux/mp4-remuxer.ts"),i=/\r\n|\n\r|\n|\r/g,L=function(o,u,s){return s===void 0&&(s=0),o.substr(s,u.length)===u},v=function(o){var u=parseInt(o.substr(-3)),s=parseInt(o.substr(-6,2)),a=parseInt(o.substr(-9,2)),C=o.length>9?parseInt(o.substr(0,o.indexOf(":"))):0;if(!Object(X.isFiniteNumber)(u)||!Object(X.isFiniteNumber)(s)||!Object(X.isFiniteNumber)(a)||!Object(X.isFiniteNumber)(C))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+o);return u+=1e3*s,u+=60*1e3*a,u+=60*60*1e3*C,u},m=function(o){for(var u=5381,s=o.length;s;)u=u*33^o.charCodeAt(--s);return(u>>>0).toString()};function p(f,o,u){return m(f.toString())+m(o.toString())+m(u)}var l=function(o,u,s){var a=o[u],C=o[a.prevCC];if(!C||!C.new&&a.new){o.ccOffset=o.presentationOffset=a.start,a.new=!1;return}for(;(_=C)!==null&&_!==void 0&&_.new;){var _;o.ccOffset+=a.start-C.start,a.new=!1,a=C,C=o[a.prevCC]}o.presentationOffset=s};function h(f,o,u,s,a,C,_,T){var R=new B.VTTParser,O=Object(P.utf8ArrayToStr)(new Uint8Array(f)).trim().replace(i,`
|
|
`).split(`
|
|
`),S=[],w=Object(W.toMpegTsClockFromTimescale)(o,u),E="00:00.000",c=0,x=0,y,g=!0,F=!1;R.oncue=function(U){var A=s[a],j=s.ccOffset,N=(c-w)/9e4;if(A!=null&&A.new&&(x!==void 0?j=s.ccOffset=A.start:l(s,a,N)),N&&(j=N-s.presentationOffset),F){var b=U.endTime-U.startTime,Y=Object(H.normalizePts)((U.startTime+j-x)*9e4,C*9e4)/9e4;U.startTime=Y,U.endTime=Y+b}var re=U.text.trim();U.text=decodeURIComponent(encodeURIComponent(re)),U.id||(U.id=p(U.startTime,U.endTime,re)),U.endTime>0&&S.push(U)},R.onparsingerror=function(U){y=U},R.onflush=function(){if(y){T(y);return}_(S)},O.forEach(function(U){if(g)if(L(U,"X-TIMESTAMP-MAP=")){g=!1,F=!0,U.substr(16).split(",").forEach(function(A){L(A,"LOCAL:")?E=A.substr(6):L(A,"MPEGTS:")&&(c=parseInt(A.substr(7)))});try{x=v(E)/1e3}catch(A){F=!1,y=A}return}else U===""&&(g=!1);R.parse(U+`
|
|
`)}),R.flush()}},"./src/utils/xhr-loader.ts":function(oe,$,M){"use strict";M.r($);var X=M("./src/utils/logger.ts"),B=M("./src/loader/load-stats.ts"),P=/^age:\s*[\d.]+\s*$/m,W=function(){function H(L){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=L?L.xhrSetup:null,this.stats=new B.LoadStats,this.retryDelay=0}var i=H.prototype;return i.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},i.abortInternal=function(){var v=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),v&&(v.onreadystatechange=null,v.onprogress=null,v.readyState!==4&&(this.stats.aborted=!0,v.abort()))},i.abort=function(){var v;this.abortInternal(),(v=this.callbacks)!==null&&v!==void 0&&v.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},i.load=function(v,m,p){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=v,this.config=m,this.callbacks=p,this.retryDelay=m.retryDelay,this.loadInternal()},i.loadInternal=function(){var v=this.config,m=this.context;if(!v)return;var p=this.loader=new self.XMLHttpRequest,l=this.stats;l.loading.first=0,l.loaded=0;var h=this.xhrSetup;try{if(h)try{h(p,m.url)}catch(u){p.open("GET",m.url,!0),h(p,m.url)}p.readyState||p.open("GET",m.url,!0);var f=this.context.headers;if(f)for(var o in f)p.setRequestHeader(o,f[o])}catch(u){this.callbacks.onError({code:p.status,text:u.message},m,p);return}m.rangeEnd&&p.setRequestHeader("Range","bytes="+m.rangeStart+"-"+(m.rangeEnd-1)),p.onreadystatechange=this.readystatechange.bind(this),p.onprogress=this.loadprogress.bind(this),p.responseType=m.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),v.timeout),p.send()},i.readystatechange=function(){var v=this.context,m=this.loader,p=this.stats;if(!v||!m)return;var l=m.readyState,h=this.config;if(p.aborted)return;if(l>=2)if(self.clearTimeout(this.requestTimeout),p.loading.first===0&&(p.loading.first=Math.max(self.performance.now(),p.loading.start)),l===4){m.onreadystatechange=null,m.onprogress=null;var f=m.status;if(f>=200&&f<300){p.loading.end=Math.max(self.performance.now(),p.loading.first);var o,u;if(v.responseType==="arraybuffer"?(o=m.response,u=o.byteLength):(o=m.responseText,u=o.length),p.loaded=p.total=u,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(p,v,o,m),!this.callbacks)return;var a={url:m.responseURL,data:o};this.callbacks.onSuccess(a,p,v,m)}else p.retry>=h.maxRetry||f>=400&&f<499?(X.logger.error(f+" while loading "+v.url),this.callbacks.onError({code:f,text:m.statusText},v,m)):(X.logger.warn(f+" while loading "+v.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,h.maxRetryDelay),p.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),h.timeout)},i.loadtimeout=function(){X.logger.warn("timeout while loading "+this.context.url);var v=this.callbacks;v&&(this.abortInternal(),v.onTimeout(this.stats,this.context,this.loader))},i.loadprogress=function(v){var m=this.stats;m.loaded=v.loaded,v.lengthComputable&&(m.total=v.total)},i.getCacheAge=function(){var v=null;if(this.loader&&P.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");v=m?parseFloat(m):null}return v},H}();$.default=W}}).default})},vHTk:function(Ze,Te,Z){Ze.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);
|