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.
445 lines
1.2 MiB
445 lines
1.2 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[82,5,6,7],{"+NIl":function(nt,ye,Q){(function(ne){ne(Q("VrN/"))})(function(ne){"use strict";ne.defineMode("stex",function(J,P){"use strict";function Y(u,h){u.cmdState.push(h)}function j(u){return u.cmdState.length>0?u.cmdState[u.cmdState.length-1]:null}function U(u){var h=u.cmdState.pop();h&&h.closeBracket()}function z(u){for(var h=u.cmdState,c=h.length-1;c>=0;c--){var o=h[c];if(o.name=="DEFAULT")continue;return o}return{styleIdentifier:function(){return null}}}function H(u,h,c){return function(){this.name=u,this.bracketNo=0,this.style=h,this.styles=c,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var r={};r.importmodule=H("importmodule","tag",["string","builtin"]),r.documentclass=H("documentclass","tag",["","atom"]),r.usepackage=H("usepackage","tag",["atom"]),r.begin=H("begin","tag",["atom"]),r.end=H("end","tag",["atom"]),r.label=H("label","tag",["atom"]),r.ref=H("ref","tag",["atom"]),r.eqref=H("eqref","tag",["atom"]),r.cite=H("cite","tag",["atom"]),r.bibitem=H("bibitem","tag",["atom"]),r.Bibitem=H("Bibitem","tag",["atom"]),r.RBibitem=H("RBibitem","tag",["atom"]),r.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function L(u,h){u.f=h}function v(u,h){var c;if(u.match(/^\\[a-zA-Z@]+/)){var o=u.current().slice(1);return c=r.hasOwnProperty(o)?r[o]:r.DEFAULT,c=new c,Y(h,c),L(h,p),c.style}if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/\\]/))return"tag";if(u.match("\\["))return L(h,function(s,a){return g(s,a,"\\]")}),"keyword";if(u.match("\\("))return L(h,function(s,a){return g(s,a,"\\)")}),"keyword";if(u.match("$$"))return L(h,function(s,a){return g(s,a,"$$")}),"keyword";if(u.match("$"))return L(h,function(s,a){return g(s,a,"$")}),"keyword";var l=u.next();if(l=="%")return u.skipToEnd(),"comment";if(l=="}"||l=="]"){if(c=j(h),c)c.closeBracket(l),L(h,p);else return"error";return"bracket"}else return l=="{"||l=="["?(c=r.DEFAULT,c=new c,Y(h,c),"bracket"):/\d/.test(l)?(u.eatWhile(/[\w.%]/),"atom"):(u.eatWhile(/[\w\-_]/),c=z(h),c.name=="begin"&&(c.argument=u.current()),c.styleIdentifier())}function g(u,h,c){if(u.eatSpace())return null;if(c&&u.match(c))return L(h,v),"keyword";if(u.match(/^\\[a-zA-Z@]+/))return"tag";if(u.match(/^[a-zA-Z]+/))return"variable-2";if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/]/))return"tag";if(u.match(/^[\^_&]/))return"tag";if(u.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(u.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var o=u.next();return o=="{"||o=="}"||o=="["||o=="]"||o=="("||o==")"?"bracket":o=="%"?(u.skipToEnd(),"comment"):"error"}function p(u,h){var c=u.peek(),o;return c=="{"||c=="["?(o=j(h),o.openBracket(c),u.eat(c),L(h,v),"bracket"):/[ \t\r]/.test(c)?(u.eat(c),null):(L(h,v),U(h),v(u,h))}return{startState:function(){var u=P.inMathMode?function(h,c){return g(h,c)}:v;return{cmdState:[],f:u}},copyState:function(u){return{cmdState:u.cmdState.slice(),f:u.f}},token:function(u,h){return h.f(u,h)},blankLine:function(u){u.f=v,u.cmdState.length=0},lineComment:"%"}}),ne.defineMIME("text/x-stex","stex"),ne.defineMIME("text/x-latex","stex")})},"+ua5":function(nt,ye,Q){},"/cxE":function(nt,ye,Q){"use strict";Q.d(ye,"f",function(){return P}),Q.d(ye,"g",function(){return Y}),Q.d(ye,"h",function(){return j}),Q.d(ye,"e",function(){return z}),Q.d(ye,"b",function(){return H}),Q.d(ye,"c",function(){return r}),Q.d(ye,"d",function(){return L}),Q.d(ye,"a",function(){return v});class ne{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(g){setTimeout(()=>{throw g.stack?new Error(g.message+`
|
|
|
|
`+g.stack):g},0)}}emit(g){this.listeners.forEach(p=>{p(g)})}onUnexpectedError(g){this.unexpectedErrorHandler(g),this.emit(g)}onUnexpectedExternalError(g){this.unexpectedErrorHandler(g)}}const J=new ne;function P(g){z(g)||J.onUnexpectedError(g);return}function Y(g){z(g)||J.onUnexpectedExternalError(g);return}function j(g){if(g instanceof Error){let{name:p,message:u}=g;const h=g.stacktrace||g.stack;return{$isError:!0,name:p,message:u,stack:h}}return g}const U="Canceled";function z(g){return g instanceof Error&&g.name===U&&g.message===U}function H(){const g=new Error(U);return g.name=g.message,g}function r(g){return g?new Error(`Illegal argument: ${g}`):new Error("Illegal argument")}function L(g){return g?new Error(`Illegal state: ${g}`):new Error("Illegal state")}class v extends Error{constructor(g){super("NotSupported");g&&(this.message=g)}}},"19Vz":function(nt,ye,Q){(function(ne){ne(Q("VrN/"))})(function(ne){ne.defineOption("placeholder","",function(H,r,L){var v=L&&L!=ne.Init;if(r&&!v)H.on("blur",j),H.on("change",U),H.on("swapDoc",U),ne.on(H.getInputField(),"compositionupdate",H.state.placeholderCompose=function(){Y(H)}),U(H);else if(!r&&v){H.off("blur",j),H.off("change",U),H.off("swapDoc",U),ne.off(H.getInputField(),"compositionupdate",H.state.placeholderCompose),J(H);var g=H.getWrapperElement();g.className=g.className.replace(" CodeMirror-empty","")}r&&!H.hasFocus()&&j(H)});function J(H){H.state.placeholder&&(H.state.placeholder.parentNode.removeChild(H.state.placeholder),H.state.placeholder=null)}function P(H){J(H);var r=H.state.placeholder=document.createElement("pre");r.style.cssText="height: 0; overflow: visible",r.style.direction=H.getOption("direction"),r.className="CodeMirror-placeholder CodeMirror-line-like";var L=H.getOption("placeholder");typeof L=="string"&&(L=document.createTextNode(L)),r.appendChild(L),H.display.lineSpace.insertBefore(r,H.display.lineSpace.firstChild)}function Y(H){setTimeout(function(){var r=!1,L=H.getInputField();L.nodeName=="TEXTAREA"?r=!L.value:H.lineCount()==1&&(r=!/[^\u200b]/.test(L.querySelector(".CodeMirror-line").textContent)),r?P(H):J(H)},20)}function j(H){z(H)&&P(H)}function U(H){var r=H.getWrapperElement(),L=z(H);r.className=r.className.replace(" CodeMirror-empty","")+(L?" CodeMirror-empty":""),L?P(H):J(H)}function z(H){return H.lineCount()===1&&H.getLine(0)===""}})},"1eCo":function(nt,ye,Q){(function(ne){ne(Q("VrN/"))})(function(ne){"use strict";var J={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},P={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ne.defineMode("xml",function(Y,j){var U=Y.indentUnit,z={},H=j.htmlMode?J:P;for(var r in H)z[r]=H[r];for(var r in j)z[r]=j[r];var L,v;function g(f,w){function b(F){return w.tokenize=F,F(f,w)}var y=f.next();if(y=="<")return f.eat("!")?f.eat("[")?f.match("CDATA[")?b(h("atom","]]>")):null:f.match("--")?b(h("comment","-->")):f.match("DOCTYPE",!0,!0)?(f.eatWhile(/[\w\._\-]/),b(c(1))):null:f.eat("?")?(f.eatWhile(/[\w\._\-]/),w.tokenize=h("meta","?>"),"meta"):(L=f.eat("/")?"closeTag":"openTag",w.tokenize=p,"tag bracket");if(y=="&"){var B;return f.eat("#")?f.eat("x")?B=f.eatWhile(/[a-fA-F\d]/)&&f.eat(";"):B=f.eatWhile(/[\d]/)&&f.eat(";"):B=f.eatWhile(/[\w\.\-:]/)&&f.eat(";"),B?"atom":"error"}else return f.eatWhile(/[^&<]/),null}g.isInText=!0;function p(f,w){var b=f.next();if(b==">"||b=="/"&&f.eat(">"))return w.tokenize=g,L=b==">"?"endTag":"selfcloseTag","tag bracket";if(b=="=")return L="equals",null;if(b=="<"){w.tokenize=g,w.state=a,w.tagName=w.tagStart=null;var y=w.tokenize(f,w);return y?y+" tag error":"tag error"}else return/[\'\"]/.test(b)?(w.tokenize=u(b),w.stringStartCol=f.column(),w.tokenize(f,w)):(f.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function u(f){var w=function(b,y){for(;!b.eol();)if(b.next()==f){y.tokenize=p;break}return"string"};return w.isInAttribute=!0,w}function h(f,w){return function(b,y){for(;!b.eol();){if(b.match(w)){y.tokenize=g;break}b.next()}return f}}function c(f){return function(w,b){for(var y;(y=w.next())!=null;){if(y=="<")return b.tokenize=c(f+1),b.tokenize(w,b);if(y==">")if(f==1){b.tokenize=g;break}else return b.tokenize=c(f-1),b.tokenize(w,b)}return"meta"}}function o(f,w,b){this.prev=f.context,this.tagName=w,this.indent=f.indented,this.startOfLine=b,(z.doNotIndent.hasOwnProperty(w)||f.context&&f.context.noIndent)&&(this.noIndent=!0)}function l(f){f.context&&(f.context=f.context.prev)}function s(f,w){for(var b;;){if(!f.context)return;if(b=f.context.tagName,!z.contextGrabbers.hasOwnProperty(b)||!z.contextGrabbers[b].hasOwnProperty(w))return;l(f)}}function a(f,w,b){return f=="openTag"?(b.tagStart=w.column(),R):f=="closeTag"?E:a}function R(f,w,b){return f=="word"?(b.tagName=w.current(),v="tag",A):z.allowMissingTagName&&f=="endTag"?(v="tag bracket",A(f,w,b)):(v="error",R)}function E(f,w,b){if(f=="word"){var y=w.current();return b.context&&b.context.tagName!=y&&z.implicitlyClosed.hasOwnProperty(b.context.tagName)&&l(b),b.context&&b.context.tagName==y||z.matchClosing===!1?(v="tag",S):(v="tag error",D)}else return z.allowMissingTagName&&f=="endTag"?(v="tag bracket",S(f,w,b)):(v="error",D)}function S(f,w,b){return f!="endTag"?(v="error",S):(l(b),a)}function D(f,w,b){return v="error",S(f,w,b)}function A(f,w,b){if(f=="word")return v="attribute",O;if(f=="endTag"||f=="selfcloseTag"){var y=b.tagName,B=b.tagStart;return b.tagName=b.tagStart=null,f=="selfcloseTag"||z.autoSelfClosers.hasOwnProperty(y)?s(b,y):(s(b,y),b.context=new o(b,y,B==b.indented)),a}return v="error",A}function O(f,w,b){return f=="equals"?C:(z.allowMissing||(v="error"),A(f,w,b))}function C(f,w,b){return f=="string"?x:f=="word"&&z.allowUnquoted?(v="string",A):(v="error",A(f,w,b))}function x(f,w,b){return f=="string"?x:A(f,w,b)}return{startState:function(f){var w={tokenize:g,state:a,indented:f||0,tagName:null,tagStart:null,context:null};return f!=null&&(w.baseIndent=f),w},token:function(f,w){if(!w.tagName&&f.sol()&&(w.indented=f.indentation()),f.eatSpace())return null;L=null;var b=w.tokenize(f,w);return(b||L)&&b!="comment"&&(v=null,w.state=w.state(L||b,f,w),v&&(b=v=="error"?b+" error":v)),b},indent:function(f,w,b){var y=f.context;if(f.tokenize.isInAttribute)return f.tagStart==f.indented?f.stringStartCol+1:f.indented+U;if(y&&y.noIndent)return ne.Pass;if(f.tokenize!=p&&f.tokenize!=g)return b?b.match(/^(\s*)/)[0].length:0;if(f.tagName)return z.multilineTagIndentPastTag!==!1?f.tagStart+f.tagName.length+2:f.tagStart+U*(z.multilineTagIndentFactor||1);if(z.alignCDATA&&/<!\[CDATA\[/.test(w))return 0;var B=w&&/^<(\/)?([\w_:\.-]*)/.exec(w);if(B&&B[1])for(;y;)if(y.tagName==B[2]){y=y.prev;break}else if(z.implicitlyClosed.hasOwnProperty(y.tagName))y=y.prev;else break;else if(B)for(;y;){var F=z.contextGrabbers[y.tagName];if(F&&F.hasOwnProperty(B[2]))y=y.prev;else break}for(;y&&y.prev&&!y.startOfLine;)y=y.prev;return y?y.indent+U:f.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:z.htmlMode?"html":"xml",helperType:z.htmlMode?"html":"xml",skipAttribute:function(f){f.state==C&&(f.state=A)},xmlCurrentTag:function(f){return f.tagName?{name:f.tagName,close:f.type=="closeTag"}:null},xmlCurrentContext:function(f){for(var w=[],b=f.context;b;b=b.prev)b.tagName&&w.push(b.tagName);return w.reverse()}}}),ne.defineMIME("text/xml","xml"),ne.defineMIME("application/xml","xml"),ne.mimeModes.hasOwnProperty("text/html")||ne.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(nt,ye,Q){"use strict";Q.d(ye,"a",function(){return J});class ne{constructor(P){this.element=P,this.next=ne.Undefined,this.prev=ne.Undefined}}ne.Undefined=new ne(void 0);class J{constructor(){this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ne.Undefined}clear(){let P=this._first;for(;P!==ne.Undefined;){const Y=P.next;P.prev=ne.Undefined,P.next=ne.Undefined,P=Y}this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}unshift(P){return this._insert(P,!1)}push(P){return this._insert(P,!0)}_insert(P,Y){const j=new ne(P);if(this._first===ne.Undefined)this._first=j,this._last=j;else if(Y){const z=this._last;this._last=j,j.prev=z,z.next=j}else{const z=this._first;this._first=j,j.next=z,z.prev=j}this._size+=1;let U=!1;return()=>{U||(U=!0,this._remove(j))}}shift(){if(this._first===ne.Undefined)return;{const P=this._first.element;return this._remove(this._first),P}}pop(){if(this._last===ne.Undefined)return;{const P=this._last.element;return this._remove(this._last),P}}_remove(P){if(P.prev!==ne.Undefined&&P.next!==ne.Undefined){const Y=P.prev;Y.next=P.next,P.next.prev=Y}else P.prev===ne.Undefined&&P.next===ne.Undefined?(this._first=ne.Undefined,this._last=ne.Undefined):P.next===ne.Undefined?(this._last=this._last.prev,this._last.next=ne.Undefined):P.prev===ne.Undefined&&(this._first=this._first.next,this._first.prev=ne.Undefined);this._size-=1}*[Symbol.iterator](){let P=this._first;for(;P!==ne.Undefined;)yield P.element,P=P.next}}},"3/fG":function(nt,ye,Q){"use strict";Q.d(ye,"a",function(){return J});function ne(P,Y){let j;return Y.length===0?j=P:j=P.replace(/\{(\d+)\}/g,function(U,z){const H=z[0];return typeof Y[H]!="undefined"?Y[H]:U}),j}function J(P,Y,...j){return ne(Y,j)}},"500L":function(nt,ye,Q){"use strict";Q.d(ye,"a",function(){return E});var ne=Q("+L6B"),J=Q("2/Rp"),P=Q("2qtc"),Y=Q("kLXV"),j=Q("9og8"),U=Q("k1fw"),z=Q("miYZ"),H=Q("tsqr"),r=Q("oBTY"),L=Q("tJVT"),v=Q("DZo9"),g=Q("8z0m"),p=Q("WmNS"),u=Q.n(p),h=Q("q1tI"),c=Q.n(h),o=Q("m3rI"),l=Q("wzkS"),s=Q("y5JW"),a=Q("LtfV"),R=g.a.Dragger;function E(S){var D=[];return S&&S.length>0&&(D=S.map(function(A){return{uid:A.id,id:A.id,name:A.title+s.c+A.filesize,url:A.url,filesize:A.filesize,status:"done",response:{id:A.id}}})),D}ye.b=function(S){var D=S.value,A=S.onChange,O=S.action,C=S.className,x=S.maxSize,f=x===void 0?150:x,w=S.title,b=w===void 0?"\u4E0A\u4F20\u9644\u4EF6":w,y=S.showRemoveModal,B=y===void 0?!1:y,F=S.accept,_=F===void 0?"":F,M=S.additionalText,I=S.isDragger,m=S.number,W=m===void 0?1e3:m,$=S.aloneClear,ae=$===void 0?!1:$,ue=Object(h.useState)(!1),Oe=Object(L.a)(ue,2),ve=Oe[0],Ee=Oe[1],xe=Object(h.useState)(D||[]),Ie=Object(L.a)(xe,2),de=Ie[0],ce=Ie[1];Object(h.useEffect)(function(){D&&(ce(Object(r.a)(D)),W===(D==null?void 0:D.length)&&Ee(!0))},[D]);var ie=function(){setTimeout(function(){de.pop(),ce(Object(r.a)(de))},500)},fe={multiple:!0,disabled:ve,accept:_,withCredentials:!0,fileList:de,beforeUpload:function(Ne,Ae){var Le=Ne.size/1024/1024;return de.concat(Ae).length>W?(de.pop(),ce(Object(r.a)(de)),H.b.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(W,"\u4E2A\u6587\u4EF6")),ae?Promise.reject():(ie(),!1)):!0},action:O||"".concat(o.a.API_SERVER,"/api/attachments.json"),onChange:function(Ne){var Ae,Le,Fe=Object(r.a)(Ne.fileList);if(Ne.file.status==="done"&&((Ae=Ne.file)===null||Ae===void 0||((Le=Ae.response)===null||Le===void 0)?void 0:Le.status)===-1){var oe,ge;H.b.error((oe=Ne.file)===null||oe===void 0||((ge=oe.response)===null||ge===void 0)?void 0:ge.message);return}Fe.length>=W?Ee(!0):Ee(!1),ce(Object(r.a)(Fe)),Fe=Fe.map(function(we){var De;if(we!=null&&(De=we.response)!==null&&De!==void 0&&De.id){var je;we.url="/api/attachments/".concat(we==null||((je=we.response)===null||je===void 0)?void 0:je.id)}return we.name.indexOf(s.c)===-1&&(we.name="".concat(we.name).concat(s.c).concat(Object(s.a)(we.size))),Object(U.a)({},we)}),console.log("info:",Ne),A(Fe)},onRemove:function(){var ke=Object(j.a)(u.a.mark(function Ae(Le){var Fe;return u.a.wrap(function(ge){for(;;)switch(ge.prev=ge.next){case 0:if(Fe=function(){var we=Object(j.a)(u.a.mark(function De(){var je,Ve;return u.a.wrap(function(Xe){for(;;)switch(Xe.prev=Xe.next){case 0:if(je=Le.response?Le.response.id:Le.id,!je){Xe.next=8;break}return Xe.next=4,Object(l.d)(Le.response?Le.response.id:Le.uid);case 4:return Ve=Xe.sent,Xe.abrupt("return",Ve);case 8:return Xe.abrupt("return",!0);case 9:case"end":return Xe.stop()}},De)}));return function(){return we.apply(this,arguments)}}(),!B){ge.next=5;break}return ge.abrupt("return",new Promise(function(we,De){Y.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:c.a.createElement("div",{className:"tc font16"},"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:function(){var je=Object(j.a)(u.a.mark(function Je(){var Xe;return u.a.wrap(function(Ze){for(;;)switch(Ze.prev=Ze.next){case 0:return Ze.next=2,Fe();case 2:Xe=Ze.sent,H.b.success("\u5220\u9664\u6210\u529F"),we(!0);case 5:case"end":return Ze.stop()}},Je)}));function Ve(){return je.apply(this,arguments)}return Ve}(),onCancel:function(){return we(!1)}})}));case 5:return ge.next=7,Fe();case 7:return ge.abrupt("return",ge.sent);case 8:case"end":return ge.stop()}},Ae)}));function Ne(Ae){return ke.apply(this,arguments)}return Ne}()};function le(ke){ke.preventDefault(),ke.stopPropagation()}return c.a.createElement("div",{className:"multi-upload ".concat(C||"")},I&&c.a.createElement(R,fe,c.a.createElement("p",{className:"ant-upload-drag-icon"},c.a.createElement(a.a,null)),c.a.createElement("p",{className:"ant-upload-text"},"\u70B9\u51FB\u4E0A\u4F20\u56FE\u6807\uFF0C\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64",c.a.createElement("br",null),"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A",f,"MB)"," "),M),!I&&c.a.createElement(g.a,fe,c.a.createElement(J.a,{style:{width:"108px",height:"32px",background:"#F6F7F9 linear-gradient(180deg, #FFFFFF 0%, #F6F7F9 100%)",boxShadow:"0px 2px 4px 0px #E0DFE1, inset 0px 1px 3px 0px rgba(255,255,255,0.5)",borderRadius:"2px",border:"1px solid #BACFFE",color:"#3061D0"},icon:c.a.createElement("i",{className:"iconfont icon-shangchuan3",style:{marginRight:"6px"}}),disabled:ve},b),c.a.createElement("span",{onClick:le,style:{marginLeft:10,color:"#FA6400"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",f,"MB)"," ")))}},"55Ip":function(nt,ye,Q){"use strict";Q.d(ye,"a",function(){return s});var ne=Q("Ty5D"),J=Q("dI71"),P=Q("q1tI"),Y=Q.n(P),j=Q("YS25"),U=Q("17x9"),z=Q.n(U),H=Q("wx14"),r=Q("zLVn"),L=Q("9R94"),v=function(C){Object(J.a)(x,C);function x(){for(var w,b=arguments.length,y=new Array(b),B=0;B<b;B++)y[B]=arguments[B];return w=C.call.apply(C,[this].concat(y))||this,w.history=Object(j.a)(w.props),w}var f=x.prototype;return f.render=function(){return Y.a.createElement(ne.c,{history:this.history,children:this.props.children})},x}(Y.a.Component),g=function(C){Object(J.a)(x,C);function x(){for(var w,b=arguments.length,y=new Array(b),B=0;B<b;B++)y[B]=arguments[B];return w=C.call.apply(C,[this].concat(y))||this,w.history=Object(j.b)(w.props),w}var f=x.prototype;return f.render=function(){return Y.a.createElement(ne.c,{history:this.history,children:this.props.children})},x}(Y.a.Component),p=function(x,f){return typeof x=="function"?x(f):x},u=function(x,f){return typeof x=="string"?Object(j.c)(x,null,null,f):x},h=function(x){return x},c=Y.a.forwardRef;typeof c=="undefined"&&(c=h);function o(C){return!!(C.metaKey||C.altKey||C.ctrlKey||C.shiftKey)}var l=c(function(C,x){var f=C.innerRef,w=C.navigate,b=C.onClick,y=Object(r.a)(C,["innerRef","navigate","onClick"]),B=y.target,F=Object(H.a)({},y,{onClick:function(M){try{b&&b(M)}catch(I){throw M.preventDefault(),I}!M.defaultPrevented&&M.button===0&&(!B||B==="_self")&&!o(M)&&(M.preventDefault(),w())}});return h!==c?F.ref=x||f:F.ref=f,Y.a.createElement("a",F)}),s=c(function(C,x){var f=C.component,w=f===void 0?l:f,b=C.replace,y=C.to,B=C.innerRef,F=Object(r.a)(C,["component","replace","to","innerRef"]);return Y.a.createElement(ne.e.Consumer,null,function(_){_||Object(L.a)(!1);var M=_.history,I=u(p(y,_.location),_.location),m=I?M.createHref(I):"",W=Object(H.a)({},F,{href:m,navigate:function(){var ae=p(y,_.location),ue=b?M.replace:M.push;ue(ae)}});return h!==c?W.ref=x||B:W.innerRef=B,Y.a.createElement(w,W)})});if(!1)var a,R;var E=function(x){return x},S=Y.a.forwardRef;typeof S=="undefined"&&(S=E);function D(){for(var C=arguments.length,x=new Array(C),f=0;f<C;f++)x[f]=arguments[f];return x.filter(function(w){return w}).join(" ")}var A=S(function(C,x){var f=C["aria-current"],w=f===void 0?"page":f,b=C.activeClassName,y=b===void 0?"active":b,B=C.activeStyle,F=C.className,_=C.exact,M=C.isActive,I=C.location,m=C.sensitive,W=C.strict,$=C.style,ae=C.to,ue=C.innerRef,Oe=Object(r.a)(C,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return Y.a.createElement(ne.e.Consumer,null,function(ve){ve||Object(L.a)(!1);var Ee=I||ve.location,xe=u(p(ae,Ee),Ee),Ie=xe.pathname,de=Ie&&Ie.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ce=de?Object(ne.f)(Ee.pathname,{path:de,exact:_,sensitive:m,strict:W}):null,ie=!!(M?M(ce,Ee):ce),fe=ie?D(F,y):F,le=ie?Object(H.a)({},$,{},B):$,ke=Object(H.a)({"aria-current":ie&&w||null,className:fe,style:le,to:xe},Oe);return E!==S?ke.ref=x||ue:ke.innerRef=ue,Y.a.createElement(s,ke)})});if(!1)var O},"5VLF":function(nt,ye,Q){"use strict";var ne,J;function P(Y,j,U){var z=function(H,r){return Y.js_beautify(H,r)};return z.js=Y.js_beautify,z.css=j.css_beautify,z.html=U.html_beautify,z.js_beautify=Y.js_beautify,z.css_beautify=j.css_beautify,z.html_beautify=U.html_beautify,z}!(ne=[Q("6UM0"),Q("TXwP"),Q("psGv")],J=function(Y,j,U){return P(Y,j,U)}.apply(ye,ne),J!==void 0&&(nt.exports=J))},"5Y4S":function(nt,ye,Q){"use strict";Q.d(ye,"a",function(){return P});var ne=Q("MNsG");const J=ne.b.performance&&typeof ne.b.performance.now=="function";class P{constructor(Y){this._highResolution=J&&Y,this._startTime=this._now(),this._stopTime=-1}static create(Y=!0){return new P(Y)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?ne.b.performance.now():Date.now()}}},"6UM0":function(nt,ye,Q){var ne,J;(function(){var P;(function(){"use strict";var j=[function(r,L,v){var g=v(1).Beautifier,p=v(5).Options;function u(h,c){var o=new g(h,c);return o.beautify()}r.exports=u,r.exports.defaultOptions=function(){return new p}},function(r,L,v){var g=v(2).Output,p=v(3).Token,u=v(4),h=v(5).Options,c=v(7).Tokenizer,o=v(7).line_starters,l=v(7).positionable_operators,s=v(7).TOKEN;function a(m,W){return W.indexOf(m)!==-1}function R(m){return m.replace(/^\s+/g,"")}function E(m){for(var W={},$=0;$<m.length;$++)W[m[$].replace(/-/g,"_")]=m[$];return W}function S(m,W){return m&&m.type===s.RESERVED&&m.text===W}function D(m,W){return m&&m.type===s.RESERVED&&a(m.text,W)}var A=["case","return","do","if","throw","else","await","break","continue","async"],O=["before-newline","after-newline","preserve-newline"],C=E(O),x=[C.before_newline,C.preserve_newline],f={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function w(m,W){if(W.multiline_frame||W.mode===f.ForInitializer||W.mode===f.Conditional)return;m.remove_indent(W.start_line_index)}function b(m){m=m.replace(u.allLineBreaks,`
|
|
`);for(var W=[],$=m.indexOf(`
|
|
`);$!==-1;)W.push(m.substring(0,$)),m=m.substring($+1),$=m.indexOf(`
|
|
`);return m.length&&W.push(m),W}function y(m){return m===f.ArrayLiteral}function B(m){return a(m,[f.Expression,f.ForInitializer,f.Conditional])}function F(m,W){for(var $=0;$<m.length;$++){var ae=m[$].trim();if(ae.charAt(0)!==W)return!1}return!0}function _(m,W){for(var $=0,ae=m.length,ue;$<ae;$++)if(ue=m[$],ue&&ue.indexOf(W)!==0)return!1;return!0}function M(m,W){W=W||{},this._source_text=m||"",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(W)}M.prototype.create_flags=function(m,W){var $=0;m&&($=m.indentation_level,!this._output.just_added_newline()&&m.line_indent_level>$&&($=m.line_indent_level));var ae={mode:W,parent:m,last_token:m?m.last_token:new p(s.START_BLOCK,""),last_word:m?m.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:$,alignment:0,line_indent_level:m?m.line_indent_level:$,start_line_index:this._output.get_line_number(),ternary_depth:0};return ae},M.prototype._reset=function(m){var W=m.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new g(this._options,W),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(f.BlockStatement);var $=new c(m,this._options);return this._tokens=$.tokenize(),m},M.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var m,W=this._reset(this._source_text),$=this._options.eol;this._options.eol==="auto"&&($=`
|
|
`,W&&u.lineBreak.test(W||"")&&($=W.match(u.lineBreak)[0]));for(var ae=this._tokens.next();ae;)this.handle_token(ae),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ae,ae=this._tokens.next();return m=this._output.get_code($),m},M.prototype.handle_token=function(m,W){m.type===s.START_EXPR?this.handle_start_expr(m):m.type===s.END_EXPR?this.handle_end_expr(m):m.type===s.START_BLOCK?this.handle_start_block(m):m.type===s.END_BLOCK?this.handle_end_block(m):m.type===s.WORD?this.handle_word(m):m.type===s.RESERVED?this.handle_word(m):m.type===s.SEMICOLON?this.handle_semicolon(m):m.type===s.STRING?this.handle_string(m):m.type===s.EQUALS?this.handle_equals(m):m.type===s.OPERATOR?this.handle_operator(m):m.type===s.COMMA?this.handle_comma(m):m.type===s.BLOCK_COMMENT?this.handle_block_comment(m,W):m.type===s.COMMENT?this.handle_comment(m,W):m.type===s.DOT?this.handle_dot(m):m.type===s.EOF?this.handle_eof(m):m.type===s.UNKNOWN?this.handle_unknown(m,W):this.handle_unknown(m,W)},M.prototype.handle_whitespace_and_comments=function(m,W){var $=m.newlines,ae=this._options.keep_array_indentation&&y(this._flags.mode);if(m.comments_before)for(var ue=m.comments_before.next();ue;)this.handle_whitespace_and_comments(ue,W),this.handle_token(ue,W),ue=m.comments_before.next();if(ae)for(var Oe=0;Oe<$;Oe+=1)this.print_newline(Oe>0,W);else if(this._options.max_preserve_newlines&&$>this._options.max_preserve_newlines&&($=this._options.max_preserve_newlines),this._options.preserve_newlines&&$>1){this.print_newline(!1,W);for(var ve=1;ve<$;ve+=1)this.print_newline(!0,W)}};var I=["async","break","continue","return","throw","yield"];M.prototype.allow_wrap_or_preserved_newline=function(m,W){if(W=W===void 0?!1:W,this._output.just_added_newline())return;var $=this._options.preserve_newlines&&m.newlines||W,ae=a(this._flags.last_token.text,l)||a(m.text,l);if(ae){var ue=a(this._flags.last_token.text,l)&&a(this._options.operator_position,x)||a(m.text,l);$=$&&ue}if($)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(D(this._flags.last_token,I))return;this._output.set_wrap_point()}},M.prototype.print_newline=function(m,W){if(!W&&(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 $=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&S($,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(m)&&(this._flags.multiline_frame=!0)},M.prototype.print_token_line_indentation=function(m){this._output.just_added_newline()&&(this._options.keep_array_indentation&&m.newlines&&(m.text==="["||y(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(m.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))},M.prototype.print_token=function(m){if(this._output.raw){this._output.add_raw_token(m);return}if(this._options.comma_first&&m.previous&&m.previous.type===s.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var W=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(W),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(m),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(m),this._output.non_breaking_space=!0,this._output.add_token(m.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},M.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},M.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))},M.prototype.set_mode=function(m){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,m),this._flags=this.create_flags(this._previous_flags,m),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},M.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===f.Statement&&w(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},M.prototype.start_of_object_property=function(){return this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||D(this._flags.last_token,["get","set"]))},M.prototype.start_of_statement=function(m){var W=!1;return W=W||D(this._flags.last_token,["var","let","const"])&&m.type===s.WORD,W=W||S(this._flags.last_token,"do"),W=W||!(this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement)&&D(this._flags.last_token,I)&&!m.newlines,W=W||S(this._flags.last_token,"else")&&!(S(m,"if")&&!m.comments_before),W=W||this._flags.last_token.type===s.END_EXPR&&(this._previous_flags.mode===f.ForInitializer||this._previous_flags.mode===f.Conditional),W=W||this._flags.last_token.type===s.WORD&&this._flags.mode===f.BlockStatement&&!this._flags.in_case&&!(m.text==="--"||m.text==="++")&&this._last_last_text!=="function"&&m.type!==s.WORD&&m.type!==s.RESERVED,W=W||this._flags.mode===f.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||D(this._flags.last_token,["get","set"])),W?(this.set_mode(f.Statement),this.indent(),this.handle_whitespace_and_comments(m,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(m,D(m,["do","for","if","while"])),!0):!1},M.prototype.handle_start_expr=function(m){this.start_of_statement(m)||this.handle_whitespace_and_comments(m);var W=f.Expression;if(m.text==="["){if(this._flags.last_token.type===s.WORD||this._flags.last_token.text===")"){D(this._flags.last_token,o)&&(this._output.space_before_token=!0),this.print_token(m),this.set_mode(W),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}W=f.ArrayLiteral,y(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),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,W=f.ForInitializer):a(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,W=f.Conditional):a(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&m.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(m);else if(this._flags.last_token.type===s.WORD){this._output.space_before_token=!1;var $=this._tokens.peek(-3);if(this._options.space_after_named_function&&$){var ae=this._tokens.peek(-4);D($,["async","function"])||$.text==="*"&&D(ae,["async","function"])?this._output.space_before_token=!0:this._flags.mode===f.ObjectLiteral?($.text==="{"||$.text===","||$.text==="*"&&(ae.text==="{"||ae.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(m);(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===f.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(m,m.newlines),this.print_token(m),this.set_mode(W),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},M.prototype.handle_end_expr=function(m){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(m),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(m,m.text==="]"&&y(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(m),this.restore_mode(),w(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===f.Conditional&&(this._previous_flags.mode=f.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},M.prototype.handle_start_block=function(m){this.handle_whitespace_and_comments(m);var W=this._tokens.peek(),$=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===s.END_EXPR?(this.set_mode(f.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(f.BlockStatement):$&&(a($.text,[":",","])&&a(W.type,[s.STRING,s.WORD,s.RESERVED])||a(W.text,["get","set","..."])&&a($.type,[s.WORD,s.RESERVED]))?a(this._last_last_text,["class","interface"])&&!a($.text,[":",","])?this.set_mode(f.BlockStatement):this.set_mode(f.ObjectLiteral):this._flags.last_token.type===s.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(f.BlockStatement):a(this._flags.last_token.type,[s.EQUALS,s.START_EXPR,s.COMMA,s.OPERATOR])||D(this._flags.last_token,["return","throw","import","default"])?this.set_mode(f.ObjectLiteral):this.set_mode(f.BlockStatement),this._flags.last_token&&(D(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ae=!W.comments_before&&W.text==="}",ue=ae&&this._flags.last_word==="function"&&this._flags.last_token.type===s.END_EXPR;if(this._options.brace_preserve_inline){var Oe=0,ve=null;this._flags.inline_frame=!0;do if(Oe+=1,ve=this._tokens.peek(Oe-1),ve.newlines){this._flags.inline_frame=!1;break}while(ve.type!==s.EOF&&!(ve.type===s.END_BLOCK&&ve.opened===m))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&m.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==s.OPERATOR&&(ue||this._flags.last_token.type===s.EQUALS||D(this._flags.last_token,A)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(y(this._previous_flags.mode)&&(this._flags.last_token.type===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(m),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(m),this.indent(),!ae&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},M.prototype.handle_end_block=function(m){for(this.handle_whitespace_and_comments(m);this._flags.mode===f.Statement;)this.restore_mode();var W=this._flags.last_token.type===s.START_BLOCK;this._flags.inline_frame&&!W?this._output.space_before_token=!0:this._options.brace_style==="expand"?W||this.print_newline():W||(y(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(m)},M.prototype.handle_word=function(m){if(m.type===s.RESERVED){if(a(m.text,["set","get"])&&this._flags.mode!==f.ObjectLiteral)m.type=s.WORD;else if(m.text==="import"&&a(this._tokens.peek().text,["(","."]))m.type=s.WORD;else if(a(m.text,["as","from"])&&!this._flags.import_block)m.type=s.WORD;else if(this._flags.mode===f.ObjectLiteral){var W=this._tokens.peek();W.text===":"&&(m.type=s.WORD)}}if(this.start_of_statement(m)?D(this._flags.last_token,["var","let","const"])&&m.type===s.WORD&&(this._flags.declaration_statement=!0):m.newlines&&!B(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||!D(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(m),this.print_newline()):this.handle_whitespace_and_comments(m),this._flags.do_block&&!this._flags.do_while)if(S(m,"while")){this._output.space_before_token=!0,this.print_token(m),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&S(m,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===f.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&D(m,["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(m),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(m)),S(m,"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()&&!m.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD?D(this._flags.last_token,["get","set","new","export"])||D(this._flags.last_token,I)?this._output.space_before_token=!0:S(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===s.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(B(this._flags.mode)||y(this._flags.mode))||this.print_newline(),this.print_token(m),this._flags.last_word=m.text;return}var $="NONE";if(this._flags.last_token.type===s.END_BLOCK?this._previous_flags.inline_frame?$="SPACE":D(m,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&m.newlines?$="NEWLINE":($="SPACE",this._output.space_before_token=!0):$="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&this._flags.mode===f.BlockStatement?$="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&B(this._flags.mode)?$="SPACE":this._flags.last_token.type===s.STRING?$="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===f.ObjectLiteral&&a(this._last_last_text,["{",","]))?$="SPACE":this._flags.last_token.type===s.START_BLOCK?this._flags.inline_frame?$="SPACE":$="NEWLINE":this._flags.last_token.type===s.END_EXPR&&(this._output.space_before_token=!0,$="NEWLINE"),D(m,o)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?$="SPACE":$="NEWLINE"),D(m,["else","catch","finally"]))if((!(this._flags.last_token.type===s.END_BLOCK&&this._previous_flags.mode===f.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&m.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ae=this._output.current_line;ae.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else $==="NEWLINE"?D(this._flags.last_token,A)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&D(m,["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||!D(m,["var","let","const"]))&&this._flags.last_token.text!==":"&&(S(m,"if")&&S(m.previous,"else")?this._output.space_before_token=!0:this.print_newline()):D(m,o)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&y(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():$==="SPACE"&&(this._output.space_before_token=!0);m.previous&&(m.previous.type===s.WORD||m.previous.type===s.RESERVED)&&(this._output.space_before_token=!0),this.print_token(m),this._flags.last_word=m.text,m.type===s.RESERVED&&(m.text==="do"?this._flags.do_block=!0:m.text==="if"?this._flags.if_block=!0:m.text==="import"?this._flags.import_block=!0:this._flags.import_block&&S(m,"from")&&(this._flags.import_block=!1))},M.prototype.handle_semicolon=function(m){this.start_of_statement(m)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(m);for(var W=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&S(W,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(m)},M.prototype.handle_string=function(m){m.text.startsWith("`")&&m.newlines===0&&m.whitespace_before===""&&(m.previous.text===")"||this._flags.last_token.type===s.WORD)||(this.start_of_statement(m)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(m),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(m):m.text.startsWith("`")&&this._flags.last_token.type===s.END_EXPR&&(m.previous.text==="]"||m.previous.text===")")&&m.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(m)},M.prototype.handle_equals=function(m){this.start_of_statement(m)||this.handle_whitespace_and_comments(m),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(m),this._output.space_before_token=!0},M.prototype.handle_comma=function(m){this.handle_whitespace_and_comments(m,!0),this.print_token(m),this._output.space_before_token=!0,this._flags.declaration_statement?(B(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(m)):this._flags.mode===f.ObjectLiteral||this._flags.mode===f.Statement&&this._flags.parent.mode===f.ObjectLiteral?(this._flags.mode===f.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(m)},M.prototype.handle_operator=function(m){var W=m.text==="*"&&(D(this._flags.last_token,["function","yield"])||a(this._flags.last_token.type,[s.START_BLOCK,s.COMMA,s.END_BLOCK,s.SEMICOLON])),$=a(m.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(m)){var ae=!W;this.handle_whitespace_and_comments(m,ae)}if(m.text==="*"&&this._flags.last_token.type===s.DOT){this.print_token(m);return}if(m.text==="::"){this.print_token(m);return}if(this._flags.last_token.type===s.OPERATOR&&a(this._options.operator_position,x)&&this.allow_wrap_or_preserved_newline(m),m.text===":"&&this._flags.in_case){this.print_token(m),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 ue=!0,Oe=!0,ve=!1;if(m.text===":"?this._flags.ternary_depth===0?ue=!1:(this._flags.ternary_depth-=1,ve=!0):m.text==="?"&&(this._flags.ternary_depth+=1),!$&&!W&&this._options.preserve_newlines&&a(m.text,l)){var Ee=m.text===":",xe=Ee&&ve,Ie=Ee&&!ve;switch(this._options.operator_position){case C.before_newline:this._output.space_before_token=!Ie,this.print_token(m),(!Ee||xe)&&this.allow_wrap_or_preserved_newline(m),this._output.space_before_token=!0;return;case C.after_newline:this._output.space_before_token=!0,!Ee||xe?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(m):this._output.space_before_token=!1,this.print_token(m),this._output.space_before_token=!0;return;case C.preserve_newline:Ie||this.allow_wrap_or_preserved_newline(m),ue=!(this._output.just_added_newline()||Ie),this._output.space_before_token=ue,this.print_token(m),this._output.space_before_token=!0;return}}if(W){this.allow_wrap_or_preserved_newline(m),ue=!1;var de=this._tokens.peek();Oe=de&&a(de.type,[s.WORD,s.RESERVED])}else if(m.text==="...")this.allow_wrap_or_preserved_newline(m),ue=this._flags.last_token.type===s.START_BLOCK,Oe=!1;else if(a(m.text,["--","++","!","~"])||$){if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR)&&this.allow_wrap_or_preserved_newline(m),ue=!1,Oe=!1,m.newlines&&(m.text==="--"||m.text==="++"||m.text==="~")){var ce=D(this._flags.last_token,A)&&m.newlines;ce&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ce,!0)}this._flags.last_token.text===";"&&B(this._flags.mode)&&(ue=!0),this._flags.last_token.type===s.RESERVED?ue=!0:this._flags.last_token.type===s.END_EXPR?ue=!(this._flags.last_token.text==="]"&&(m.text==="--"||m.text==="++")):this._flags.last_token.type===s.OPERATOR&&(ue=a(m.text,["--","-","++","+"])&&a(this._flags.last_token.text,["--","-","++","+"]),a(m.text,["+","-"])&&a(this._flags.last_token.text,["--","++"])&&(Oe=!0)),(this._flags.mode===f.BlockStatement&&!this._flags.inline_frame||this._flags.mode===f.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ue,this.print_token(m),this._output.space_before_token=Oe},M.prototype.handle_block_comment=function(m,W){if(this._output.raw){this._output.add_raw_token(m),m.directives&&m.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(m.directives){this.print_newline(!1,W),this.print_token(m),m.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!u.newline.test(m.text)&&!m.newlines){this._output.space_before_token=!0,this.print_token(m),this._output.space_before_token=!0;return}else this.print_block_commment(m,W)},M.prototype.print_block_commment=function(m,W){var $=b(m.text),ae,ue=!1,Oe=!1,ve=m.whitespace_before,Ee=ve.length;if(this.print_newline(!1,W),this.print_token_line_indentation(m),this._output.add_token($[0]),this.print_newline(!1,W),$.length>1){for($=$.slice(1),ue=F($,"*"),Oe=_($,ve),ue&&(this._flags.alignment=1),ae=0;ae<$.length;ae++)ue?(this.print_token_line_indentation(m),this._output.add_token(R($[ae]))):Oe&&$[ae]?(this.print_token_line_indentation(m),this._output.add_token($[ae].substring(Ee))):(this._output.current_line.set_indent(-1),this._output.add_token($[ae])),this.print_newline(!1,W);this._flags.alignment=0}},M.prototype.handle_comment=function(m,W){m.newlines?this.print_newline(!1,W):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(m),this.print_newline(!1,W)},M.prototype.handle_dot=function(m){this.start_of_statement(m)||this.handle_whitespace_and_comments(m,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),D(this._flags.last_token,A)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(m,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(m)},M.prototype.handle_unknown=function(m,W){this.print_token(m),m.text[m.text.length-1]===`
|
|
`&&this.print_newline(!1,W)},M.prototype.handle_eof=function(m){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(m)},r.exports.Beautifier=M},function(r){function L(p){this.__parent=p,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}L.prototype.clone_empty=function(){var p=new L(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},L.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},L.prototype.has_match=function(p){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(p))return!0;return!1},L.prototype.set_indent=function(p,u){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=u||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 u=p.lastIndexOf(`
|
|
`);u!==-1?this.__character_count=p.length-u: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,u){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)),u=u||"",p.indent_level>0&&(u=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}v.prototype.get_indent_size=function(p,u){var h=this.__base_string_length;return u=u||0,p<0&&(h=0),h+=p*this.__indent_size,h+=u,h},v.prototype.get_indent_string=function(p,u){var h=this.__base_string;return u=u||0,p<0&&(p=0,h=""),u+=p*this.__indent_size,this.__ensure_cache(u),h+=this.__cache[u],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,u=0,h="";this.__indent_size&&p>=this.__indent_size&&(u=Math.floor(p/this.__indent_size),p-=u*this.__indent_size,h=new Array(u+1).join(this.__indent_string)),p&&(h+=new Array(p+1).join(" ")),this.__cache.push(h)};function g(p,u){this.__indent_cache=new v(p,u),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()}g.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},g.prototype.get_line_number=function(){return this.__lines.length},g.prototype.get_indent_string=function(p,u){return this.__indent_cache.get_indent_string(p,u)},g.prototype.get_indent_size=function(p,u){return this.__indent_cache.get_indent_size(p,u)},g.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},g.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},g.prototype.get_code=function(p){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
|
|
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var h=this.__lines.join(`
|
|
`);return p!==`
|
|
`&&(h=h.replace(/[\n]/g,p)),h},g.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},g.prototype.set_indent=function(p,u){return p=p||0,u=u||0,this.next_line.set_indent(p,u),this.__lines.length>1?(this.current_line.set_indent(p,u),!0):(this.current_line.set_indent(),!1)},g.prototype.add_raw_token=function(p){for(var u=0;u<p.newlines;u++)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},g.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()},g.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(" "))},g.prototype.remove_indent=function(p){for(var u=this.__lines.length;p<u;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},g.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},g.prototype.just_added_newline=function(){return this.current_line.is_empty()},g.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},g.prototype.ensure_empty_line_above=function(p,u){for(var h=this.__lines.length-2;h>=0;){var c=this.__lines[h];if(c.is_empty())break;if(c.item(0).indexOf(p)!==0&&c.item(-1)!==u){this.__lines.splice(h+1,0,new L(this)),this.previous_line=this.__lines[this.__lines.length-2];break}h--}},r.exports.Output=g},function(r){function L(v,g,p,u){this.type=v,this.text=g,this.comments_before=null,this.newlines=p||0,this.whitespace_before=u||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}r.exports.Token=L},function(r,L){var v="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",g="\\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",u="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",h="(?:\\\\u[0-9a-fA-F]{4}|["+v+p+"])",c="(?:\\\\u[0-9a-fA-F]{4}|["+g+p+u+"])*";L.identifier=new RegExp(h+c,"g"),L.identifierStart=new RegExp(h),L.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+g+p+u+"])+");var o=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;L.newline=/[\n\r\u2028\u2029]/,L.lineBreak=new RegExp(`\r
|
|
|`+L.newline.source),L.allLineBreaks=new RegExp(L.lineBreak.source,"g")},function(r,L,v){var g=v(6).Options,p=["before-newline","after-newline","preserve-newline"];function u(h){g.call(this,h,"js");var c=this.raw_options.brace_style||null;c==="expand-strict"?this.raw_options.brace_style="expand":c==="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 l=0;l<o.length;l++)o[l]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=o[l];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)}u.prototype=new g,r.exports.Options=u},function(r){function L(p,u){this.raw_options=v(p,u),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}L.prototype._get_array=function(p,u){var h=this.raw_options[p],c=u||[];return typeof h=="object"?h!==null&&typeof h.concat=="function"&&(c=h.concat()):typeof h=="string"&&(c=h.split(/[^a-zA-Z0-9_\/\-]+/)),c},L.prototype._get_boolean=function(p,u){var h=this.raw_options[p],c=h===void 0?!!u:!!h;return c},L.prototype._get_characters=function(p,u){var h=this.raw_options[p],c=u||"";return typeof h=="string"&&(c=h.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),c},L.prototype._get_number=function(p,u){var h=this.raw_options[p];u=parseInt(u,10),isNaN(u)&&(u=0);var c=parseInt(h,10);return isNaN(c)&&(c=u),c},L.prototype._get_selection=function(p,u,h){var c=this._get_selection_list(p,u,h);if(c.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[p]+"'");return c[0]},L.prototype._get_selection_list=function(p,u,h){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(h=h||[u[0]],!this._is_valid_selection(h,u))throw new Error("Invalid Default Value!");var c=this._get_array(p,h);if(!this._is_valid_selection(c,u))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[p]+"'");return c},L.prototype._is_valid_selection=function(p,u){return p.length&&u.length&&!p.some(function(h){return u.indexOf(h)===-1})};function v(p,u){var h={};p=g(p);var c;for(c in p)c!==u&&(h[c]=p[c]);if(u&&p[u])for(c in p[u])h[c]=p[u][c];return h}function g(p){var u={},h;for(h in p){var c=h.replace(/-/g,"_");u[c]=p[h]}return u}r.exports.Options=L,r.exports.normalizeOpts=g,r.exports.mergeOpts=v},function(r,L,v){var g=v(8).InputScanner,p=v(9).Tokenizer,u=v(9).TOKEN,h=v(13).Directives,c=v(4),o=v(12).Pattern,l=v(14).TemplatablePattern;function s(F,_){return _.indexOf(F)!==-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:u.START,RAW:u.RAW,EOF:u.EOF},R=new h(/\/\*/,/\*\//),E=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,S=/[0-9]/,D=/[^\d\.]/,A=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),O=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";O=O.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),O="\\?\\.(?!\\d) "+O,O=O.replace(/ /g,"|");var C=new RegExp(O),x="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),f=x.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),w=new RegExp("^(?:"+f.join("|")+")$"),b,y=function(F,_){p.call(this,F,_),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var M=new o(this._input),I=new l(this._input).read_options(this._options);this.__patterns={template:I,identifier:I.starting_with(c.identifier).matching(c.identifierMatch),number:M.matching(E),punct:M.matching(C),comment:M.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:M.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:M.matching(/<!--/),html_comment_end:M.matching(/-->/),include:M.starting_with(/#include/).until_after(c.lineBreak),shebang:M.starting_with(/#!/).until_after(c.lineBreak),xml:M.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:I.until(/['\\\n\r\u2028\u2029]/),double_quote:I.until(/["\\\n\r\u2028\u2029]/),template_text:I.until(/[`\\$]/),template_expression:I.until(/[`}\\]/)}};y.prototype=new p,y.prototype._is_comment=function(F){return F.type===a.COMMENT||F.type===a.BLOCK_COMMENT||F.type===a.UNKNOWN},y.prototype._is_opening=function(F){return F.type===a.START_BLOCK||F.type===a.START_EXPR},y.prototype._is_closing=function(F,_){return(F.type===a.END_BLOCK||F.type===a.END_EXPR)&&_&&(F.text==="]"&&_.text==="["||F.text===")"&&_.text==="("||F.text==="}"&&_.text==="{")},y.prototype._reset=function(){b=!1},y.prototype._get_next_token=function(F,_){var M=null;this._readWhitespace();var I=this._input.peek();return I===null?this._create_token(a.EOF,""):(M=M||this._read_non_javascript(I),M=M||this._read_string(I),M=M||this._read_word(F),M=M||this._read_singles(I),M=M||this._read_comment(I),M=M||this._read_regexp(I,F),M=M||this._read_xml(I,F),M=M||this._read_punctuation(),M=M||this._create_token(a.UNKNOWN,this._input.next()),M)},y.prototype._read_word=function(F){var _;if(_=this.__patterns.identifier.read(),_!=="")return _=_.replace(c.allLineBreaks,`
|
|
`),!(F.type===a.DOT||F.type===a.RESERVED&&(F.text==="set"||F.text==="get"))&&w.test(_)?(_==="in"||_==="of")&&(F.type===a.WORD||F.type===a.STRING)?this._create_token(a.OPERATOR,_):this._create_token(a.RESERVED,_):this._create_token(a.WORD,_);if(_=this.__patterns.number.read(),_!=="")return this._create_token(a.WORD,_)},y.prototype._read_singles=function(F){var _=null;return F==="("||F==="["?_=this._create_token(a.START_EXPR,F):F===")"||F==="]"?_=this._create_token(a.END_EXPR,F):F==="{"?_=this._create_token(a.START_BLOCK,F):F==="}"?_=this._create_token(a.END_BLOCK,F):F===";"?_=this._create_token(a.SEMICOLON,F):F==="."&&D.test(this._input.peek(1))?_=this._create_token(a.DOT,F):F===","&&(_=this._create_token(a.COMMA,F)),_&&this._input.next(),_},y.prototype._read_punctuation=function(){var F=this.__patterns.punct.read();if(F!=="")return F==="="?this._create_token(a.EQUALS,F):F==="?."?this._create_token(a.DOT,F):this._create_token(a.OPERATOR,F)},y.prototype._read_non_javascript=function(F){var _="";if(F==="#"){if(this._is_first_token()&&(_=this.__patterns.shebang.read(),_))return this._create_token(a.UNKNOWN,_.trim()+`
|
|
`);if(_=this.__patterns.include.read(),_)return this._create_token(a.UNKNOWN,_.trim()+`
|
|
`);F=this._input.next();var M="#";if(this._input.hasNext()&&this._input.testChar(S)){do F=this._input.next(),M+=F;while(this._input.hasNext()&&F!=="#"&&F!=="=");return F==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(M+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(M+="{}",this._input.next(),this._input.next())),this._create_token(a.WORD,M)}this._input.back()}else if(F==="<"&&this._is_first_token()){if(_=this.__patterns.html_comment_start.read(),_){for(;this._input.hasNext()&&!this._input.testChar(c.newline);)_+=this._input.next();return b=!0,this._create_token(a.COMMENT,_)}}else if(b&&F==="-"&&(_=this.__patterns.html_comment_end.read(),_))return b=!1,this._create_token(a.COMMENT,_);return null},y.prototype._read_comment=function(F){var _=null;if(F==="/"){var M="";if(this._input.peek(1)==="*"){M=this.__patterns.block_comment.read();var I=R.get_directives(M);I&&I.ignore==="start"&&(M+=R.readIgnored(this._input)),M=M.replace(c.allLineBreaks,`
|
|
`),_=this._create_token(a.BLOCK_COMMENT,M),_.directives=I}else this._input.peek(1)==="/"&&(M=this.__patterns.comment.read(),_=this._create_token(a.COMMENT,M))}return _},y.prototype._read_string=function(F){if(F==="`"||F==="'"||F==='"'){var _=this._input.next();return this.has_char_escapes=!1,F==="`"?_+=this._read_string_recursive("`",!0,"${"):_+=this._read_string_recursive(F),this.has_char_escapes&&this._options.unescape_strings&&(_=B(_)),this._input.peek()===F&&(_+=this._input.next()),_=_.replace(c.allLineBreaks,`
|
|
`),this._create_token(a.STRING,_)}return null},y.prototype._allow_regexp_or_xml=function(F){return F.type===a.RESERVED&&s(F.text,["return","case","throw","else","do","typeof","yield"])||F.type===a.END_EXPR&&F.text===")"&&F.opened.previous.type===a.RESERVED&&s(F.opened.previous.text,["if","while","for"])||s(F.type,[a.COMMENT,a.START_EXPR,a.START_BLOCK,a.START,a.END_BLOCK,a.OPERATOR,a.EQUALS,a.EOF,a.SEMICOLON,a.COMMA])},y.prototype._read_regexp=function(F,_){if(F==="/"&&this._allow_regexp_or_xml(_)){for(var M=this._input.next(),I=!1,m=!1;this._input.hasNext()&&(I||m||this._input.peek()!==F)&&!this._input.testChar(c.newline);)M+=this._input.peek(),I?I=!1:(I=this._input.peek()==="\\",this._input.peek()==="["?m=!0:this._input.peek()==="]"&&(m=!1)),this._input.next();return this._input.peek()===F&&(M+=this._input.next(),M+=this._input.read(c.identifier)),this._create_token(a.STRING,M)}return null},y.prototype._read_xml=function(F,_){if(this._options.e4x&&F==="<"&&this._allow_regexp_or_xml(_)){var M="",I=this.__patterns.xml.read_match();if(I){for(var m=I[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),W=m.indexOf("{")===0,$=0;I;){var ae=!!I[1],ue=I[2],Oe=!!I[I.length-1]||ue.slice(0,8)==="![CDATA[";if(!Oe&&(ue===m||W&&ue.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ae?--$:++$),M+=I[0],$<=0)break;I=this.__patterns.xml.read_match()}return I||(M+=this._input.match(/[\s\S]*/g)[0]),M=M.replace(c.allLineBreaks,`
|
|
`),this._create_token(a.STRING,M)}}return null};function B(F){for(var _="",M=0,I=new g(F),m=null;I.hasNext();)if(m=I.match(/([\s]|[^\\]|\\\\)+/g),m&&(_+=m[0]),I.peek()==="\\"){if(I.next(),I.peek()==="x")m=I.match(/x([0-9A-Fa-f]{2})/g);else if(I.peek()==="u")m=I.match(/u([0-9A-Fa-f]{4})/g);else{_+="\\",I.hasNext()&&(_+=I.next());continue}if(!m)return F;if(M=parseInt(m[1],16),M>126&&M<=255&&m[0].indexOf("x")===0)return F;if(M>=0&&M<32){_+="\\"+m[0];continue}else M===34||M===39||M===92?_+="\\"+String.fromCharCode(M):_+=String.fromCharCode(M)}return _}y.prototype._read_string_recursive=function(F,_,M){var I,m;F==="'"?m=this.__patterns.single_quote:F==='"'?m=this.__patterns.double_quote:F==="`"?m=this.__patterns.template_text:F==="}"&&(m=this.__patterns.template_expression);for(var W=m.read(),$="";this._input.hasNext();){if($=this._input.next(),$===F||!_&&c.newline.test($)){this._input.back();break}else $==="\\"&&this._input.hasNext()?(I=this._input.peek(),I==="x"||I==="u"?this.has_char_escapes=!0:I==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),$+=this._input.next()):M&&(M==="${"&&$==="$"&&this._input.peek()==="{"&&($+=this._input.next()),M===$&&(F==="`"?$+=this._read_string_recursive("}",_,"`"):$+=this._read_string_recursive("`",_,"${"),this._input.hasNext()&&($+=this._input.next())));$+=m.read(),W+=$}return W},r.exports.Tokenizer=y,r.exports.TOKEN=a,r.exports.positionable_operators=A.slice(),r.exports.line_starters=x.slice()},function(r){var L=RegExp.prototype.hasOwnProperty("sticky");function v(g){this.__input=g||"",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 g=null;return this.hasNext()&&(g=this.__input.charAt(this.__position),this.__position+=1),g},v.prototype.peek=function(g){var p=null;return g=g||0,g+=this.__position,g>=0&&g<this.__input_length&&(p=this.__input.charAt(g)),p},v.prototype.__match=function(g,p){g.lastIndex=p;var u=g.exec(this.__input);return u&&!(L&&g.sticky)&&(u.index!==p&&(u=null)),u},v.prototype.test=function(g,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(g,p):!1},v.prototype.testChar=function(g,p){var u=this.peek(p);return g.lastIndex=0,u!==null&&g.test(u)},v.prototype.match=function(g){var p=this.__match(g,this.__position);return p?this.__position+=p[0].length:p=null,p},v.prototype.read=function(g,p,u){var h="",c;return g&&(c=this.match(g),c&&(h+=c[0])),p&&(c||!g)&&(h+=this.readUntil(p,u)),h},v.prototype.readUntil=function(g,p){var u="",h=this.__position;g.lastIndex=this.__position;var c=g.exec(this.__input);return c?(h=c.index,p&&(h+=c[0].length)):h=this.__input_length,u=this.__input.substring(this.__position,h),this.__position=h,u},v.prototype.readUntilAfter=function(g){return this.readUntil(g,!0)},v.prototype.get_regexp=function(g,p){var u=null,h="g";return p&&L&&(h="y"),typeof g=="string"&&g!==""?u=new RegExp(g,h):g&&(u=new RegExp(g.source,h)),u},v.prototype.get_literal_regexp=function(g){return RegExp(g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(g){var p=this.__position,u=this.readUntilAfter(g);return this.__position=p,u},v.prototype.lookBack=function(g){var p=this.__position-1;return p>=g.length&&this.__input.substring(p-g.length,p).toLowerCase()===g},r.exports.InputScanner=v},function(r,L,v){var g=v(8).InputScanner,p=v(3).Token,u=v(10).TokenStream,h=v(11).WhitespacePattern,c={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(l,s){this._input=new g(l),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 u,this._reset();for(var l,s=new p(c.START,""),a=null,R=[],E=new u;s.type!==c.EOF;){for(l=this._get_next_token(s,a);this._is_comment(l);)E.add(l),l=this._get_next_token(s,a);E.isEmpty()||(l.comments_before=E,E=new u),l.parent=a,this._is_opening(l)?(R.push(a),a=l):a&&this._is_closing(l,a)&&(l.opened=a,a.closed=l,a=R.pop(),l.parent=a),l.previous=s,s.next=l,this.__tokens.add(l),s=l}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(l,s){this._readWhitespace();var a=this._input.read(/.+/g);return a?this._create_token(c.RAW,a):this._create_token(c.EOF,"")},o.prototype._is_comment=function(l){return!1},o.prototype._is_opening=function(l){return!1},o.prototype._is_closing=function(l,s){return!1},o.prototype._create_token=function(l,s){var a=new p(l,s,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return a},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},r.exports.Tokenizer=o,r.exports.TOKEN=c},function(r){function L(v){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=v}L.prototype.restart=function(){this.__position=0},L.prototype.isEmpty=function(){return this.__tokens_length===0},L.prototype.hasNext=function(){return this.__position<this.__tokens_length},L.prototype.next=function(){var v=null;return this.hasNext()&&(v=this.__tokens[this.__position],this.__position+=1),v},L.prototype.peek=function(v){var g=null;return v=v||0,v+=this.__position,v>=0&&v<this.__tokens_length&&(g=this.__tokens[v]),g},L.prototype.add=function(v){this.__parent_token&&(v.parent=this.__parent_token),this.__tokens.push(v),this.__tokens_length+=1},r.exports.TokenStream=L},function(r,L,v){var g=v(12).Pattern;function p(u,h){g.call(this,u,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 g,p.prototype.__set_whitespace_patterns=function(u,h){u+="\\t ",h+="\\n\\r",this._match_pattern=this._input.get_regexp("["+u+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 u=this._input.read(this._match_pattern);if(u===" ")this.whitespace_before_token=" ";else if(u){var h=this.__split(this._newline_regexp,u);this.newline_count=h.length-1,this.whitespace_before_token=h[this.newline_count]}return u},p.prototype.matching=function(u,h){var c=this._create();return c.__set_whitespace_patterns(u,h),c._update(),c},p.prototype._create=function(){return new p(this._input,this)},p.prototype.__split=function(u,h){u.lastIndex=0;for(var c=0,o=[],l=u.exec(h);l;)o.push(h.substring(c,l.index)),c=l.index+l[0].length,l=u.exec(h);return c<h.length?o.push(h.substring(c,h.length)):o.push(""),o},r.exports.WhitespacePattern=p},function(r){function L(v,g){this._input=v,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,g&&(this._starting_pattern=this._input.get_regexp(g._starting_pattern,!0),this._match_pattern=this._input.get_regexp(g._match_pattern,!0),this._until_pattern=this._input.get_regexp(g._until_pattern),this._until_after=g._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 g=this._create();return g._until_after=!0,g._until_pattern=this._input.get_regexp(v),g._update(),g},L.prototype.until=function(v){var g=this._create();return g._until_after=!1,g._until_pattern=this._input.get_regexp(v),g._update(),g},L.prototype.starting_with=function(v){var g=this._create();return g._starting_pattern=this._input.get_regexp(v,!0),g._update(),g},L.prototype.matching=function(v){var g=this._create();return g._match_pattern=this._input.get_regexp(v,!0),g._update(),g},L.prototype._create=function(){return new L(this._input,this)},L.prototype._update=function(){},r.exports.Pattern=L},function(r){function L(v,g){v=typeof v=="string"?v:v.source,g=typeof g=="string"?g:g.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+g,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+g,"g")}L.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var g={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(v);p;)g[p[1]]=p[2],p=this.__directive_pattern.exec(v);return g},L.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=L},function(r,L,v){var g=v(12).Pattern,p={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function u(h,c){g.call(this,h,c),this.__template_pattern=null,this._disabled=Object.assign({},p),this._excluded=Object.assign({},p),c&&(this.__template_pattern=this._input.get_regexp(c.__template_pattern),this._excluded=Object.assign(this._excluded,c._excluded),this._disabled=Object.assign(this._disabled,c._disabled));var o=new g(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}/)}}u.prototype=new g,u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){this.__set_templated_pattern()},u.prototype.disable=function(h){var c=this._create();return c._disabled[h]=!0,c._update(),c},u.prototype.read_options=function(h){var c=this._create();for(var o in p)c._disabled[o]=h.templating.indexOf(o)===-1;return c._update(),c},u.prototype.exclude=function(h){var c=this._create();return c._excluded[h]=!0,c._update(),c},u.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 c=this._read_template();c;)this._match_pattern?c+=this._input.read(this._match_pattern):c+=this._input.readUntil(this.__template_pattern),h+=c,c=this._read_template();return this._until_after&&(h+=this._input.readUntilAfter(this._until_pattern)),h},u.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("|")+")")},u.prototype._read_template=function(){var h="",c=this._input.peek();if(c==="<"){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 c==="{"&&(!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},r.exports.TemplatablePattern=u}],U={};function z(r){var L=U[r];if(L!==void 0)return L.exports;var v=U[r]={exports:{}};return j[r](v,v.exports,z),v.exports}var H=z(0);P=H})();var Y=P;!(ne=[],J=function(){return{js_beautify:Y}}.apply(ye,ne),J!==void 0&&(nt.exports=J))})()},"746U":function(nt,ye,Q){"use strict";Q.d(ye,"f",function(){return ne}),Q.d(ye,"l",function(){return J}),Q.d(ye,"k",function(){return P}),Q.d(ye,"j",function(){return Y}),Q.d(ye,"g",function(){return j}),Q.d(ye,"m",function(){return U}),Q.d(ye,"h",function(){return z}),Q.d(ye,"n",function(){return H}),Q.d(ye,"c",function(){return r}),Q.d(ye,"a",function(){return L}),Q.d(ye,"i",function(){return v}),Q.d(ye,"o",function(){return g}),Q.d(ye,"e",function(){return h}),Q.d(ye,"d",function(){return c}),Q.d(ye,"p",function(){return o}),Q.d(ye,"b",function(){return l});function ne(s){return Array.isArray(s)}function J(s){return typeof s=="string"}function P(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&!(s instanceof RegExp)&&!(s instanceof Date)}function Y(s){return typeof s=="number"&&!isNaN(s)}function j(s){return s===!0||s===!1}function U(s){return typeof s=="undefined"}function z(s){return!H(s)}function H(s){return U(s)||s===null}function r(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 g(s,a){const R=Math.min(s.length,a.length);for(let E=0;E<R;E++)p(s[E],a[E])}function p(s,a){if(J(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(R){}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 u(s){let a=[],R=Object.getPrototypeOf(s);for(;Object.prototype!==R;)a=a.concat(Object.getOwnPropertyNames(R)),R=Object.getPrototypeOf(R);return a}function h(s){const a=[];for(const R of u(s))typeof s[R]=="function"&&a.push(R);return a}function c(s,a){const R=S=>function(){const D=Array.prototype.slice.call(arguments,0);return a(S,D)};let E={};for(const S of s)E[S]=R(S);return E}function o(s){return s===null?void 0:s}function l(s,a="Unreachable"){throw new Error(a)}},"7Cbv":function(nt,ye,Q){"use strict";var ne=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),J=new Uint8Array(16);function P(){if(!ne)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ne(J)}var Y=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function j(p){return typeof p=="string"&&Y.test(p)}for(var U=j,z=[],H=0;H<256;++H)z.push((H+256).toString(16).substr(1));function r(p){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,h=(z[p[u+0]]+z[p[u+1]]+z[p[u+2]]+z[p[u+3]]+"-"+z[p[u+4]]+z[p[u+5]]+"-"+z[p[u+6]]+z[p[u+7]]+"-"+z[p[u+8]]+z[p[u+9]]+"-"+z[p[u+10]]+z[p[u+11]]+z[p[u+12]]+z[p[u+13]]+z[p[u+14]]+z[p[u+15]]).toLowerCase();if(!U(h))throw TypeError("Stringified UUID is invalid");return h}var L=r;function v(p,u,h){p=p||{};var c=p.random||(p.rng||P)();if(c[6]=c[6]&15|64,c[8]=c[8]&63|128,u){h=h||0;for(var o=0;o<16;++o)u[h+o]=c[o];return u}return L(c)}var g=ye.a=v},"7ahc":function(nt,ye,Q){"use strict";Q.d(ye,"a",function(){return R});var ne=Q("k1fw"),J=Q("0Owb"),P=Q("+L6B"),Y=Q("2/Rp"),j=Q("y8nQ"),U=Q("Vl3Y"),z=Q("tJVT"),H=Q("OaEy"),r=Q("2fM7"),L=Q("q1tI"),v=Q.n(L),g=Q("VrN/"),p=Q.n(g),u=Q("p77/"),h=Q.n(u),c=Q("c5Ni"),o=Q.n(c),l=r.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"]};ye.b=function(E){var S=E.callback,D=E.onCancel,A=Object(L.useState)("python"),O=Object(z.a)(A,2),C=O[0],x=O[1];function f(b){x(a[b][1])}function w(b){S(b)}return v.a.createElement(U.a,Object(J.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:w}),v.a.createElement(U.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},v.a.createElement(r.a,{onChange:f},Object.keys(a).map(function(b){return v.a.createElement(l,{key:b,value:b},a[b][0])}))),v.a.createElement(U.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},v.a.createElement(R,{mode:C})),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(Y.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(Y.a,{type:"ghost",onClick:D},"\u53D6\u6D88")))};function R(E){var S=E.value,D=E.onChange,A=E.mode,O=E.options,C=O===void 0?{}:O,x=Object(L.useRef)(),f=Object(L.useState)(),w=Object(z.a)(f,2),b=w[0],y=w[1];return Object(L.useEffect)(function(){if(b){function B(F){var _=F.getValue();D&&D(_)}return b.on("change",B),function(){b.off("change",B)}}},[b,D]),Object(L.useEffect)(function(){b&&b.setOption("mode",A)},[b,A]),Object(L.useEffect)(function(){b&&((S!==b.getValue()||S==="")&&setTimeout(function(){b.setValue(S||" ")},300))},[b,S]),Object(L.useEffect)(function(){if(x.current&&!b){var B=p.a.fromTextArea(x.current,Object(ne.a)({mode:A,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},C));y(B)}},[x.current,b]),v.a.createElement("div",{className:"my-codemirror-container"},v.a.createElement("textarea",{ref:x}))}},"8EBN":function(nt,ye,Q){(function(ne){ne(Q("VrN/"))})(function(ne){"use strict";ne.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var J=0;J<ne.modeInfo.length;J++){var P=ne.modeInfo[J];P.mimes&&(P.mime=P.mimes[0])}ne.findModeByMIME=function(Y){Y=Y.toLowerCase();for(var j=0;j<ne.modeInfo.length;j++){var U=ne.modeInfo[j];if(U.mime==Y)return U;if(U.mimes){for(var z=0;z<U.mimes.length;z++)if(U.mimes[z]==Y)return U}}if(/\+xml$/.test(Y))return ne.findModeByMIME("application/xml");if(/\+json$/.test(Y))return ne.findModeByMIME("application/json")},ne.findModeByExtension=function(Y){Y=Y.toLowerCase();for(var j=0;j<ne.modeInfo.length;j++){var U=ne.modeInfo[j];if(U.ext){for(var z=0;z<U.ext.length;z++)if(U.ext[z]==Y)return U}}},ne.findModeByFileName=function(Y){for(var j=0;j<ne.modeInfo.length;j++){var U=ne.modeInfo[j];if(U.file&&U.file.test(Y))return U}var z=Y.lastIndexOf("."),H=z>-1&&Y.substring(z+1,Y.length);if(H)return ne.findModeByExtension(H)},ne.findModeByName=function(Y){Y=Y.toLowerCase();for(var j=0;j<ne.modeInfo.length;j++){var U=ne.modeInfo[j];if(U.name.toLowerCase()==Y)return U;if(U.alias){for(var z=0;z<U.alias.length;z++)if(U.alias[z].toLowerCase()==Y)return U}}}})},"8HAY":function(nt,ye,Q){"use strict";Q.d(ye,"a",function(){return j}),Q.d(ye,"b",function(){return U}),Q.d(ye,"d",function(){return z}),Q.d(ye,"e",function(){return H}),Q.d(ye,"c",function(){return r});var ne=Q("MI8n"),J=Q("pmY6"),P=Q("3/fG"),Y=function(L,v,g,p){function u(h){return h instanceof g?h:new g(function(c){c(h)})}return new(g||(g=Promise))(function(h,c){function o(a){try{s(p.next(a))}catch(R){c(R)}}function l(a){try{s(p.throw(a))}catch(R){c(R)}}function s(a){a.done?h(a.value):u(a.value).then(o,l)}s((p=p.apply(L,v||[])).next())})};class j extends J.a{constructor(L,v="",g="",p=!0,u){super();this._onDidChange=this._register(new ne.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=L,this._label=v,this._cssClass=g,this._enabled=p,this._actionCallback=u}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 Y(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(L))})}}class U extends J.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new ne.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new ne.b),this.onDidRun=this._onDidRun.event}run(L,v){return Y(this,void 0,void 0,function*(){if(!L.enabled)return;this._onBeforeRun.fire({action:L});let g;try{yield this.runAction(L,v)}catch(p){g=p}this._onDidRun.fire({action:L,error:g})})}runAction(L,v){return Y(this,void 0,void 0,function*(){yield L.run(v)})}}class z extends j{constructor(L){super(z.ID,L,L?"separator text":"separator");this.checked=!1,this.enabled=!1}}z.ID="vs.actions.separator";class H{constructor(L,v,g,p){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=L,this.label=v,this.class=p,this._actions=g}get actions(){return this._actions}dispose(){}run(){return Y(this,void 0,void 0,function*(){})}}class r extends j{constructor(){super(r.ID,P.a("submenu.empty","(empty)"),void 0,!1)}}r.ID="vs.actions.empty"},"8hTe":function(nt,ye,Q){nt.exports={button:"button___1wy9m"}},"9Bee":function(nt,ye,Q){"use strict";var ne=Q("DYRE"),J=Q("zeV3"),P=Q("+L6B"),Y=Q("2/Rp"),j=Q("k1fw"),U=Q("9og8"),z=Q("tJVT"),H=Q("WmNS"),r=Q.n(H),L=Q("q1tI"),v=Q.n(L),g=Q("vg9a"),p=Q("DlQD"),u=Q.n(p),h=Q("rUJ1");function c(X,T){var k=X.match(/^(\s+)(?:```)/);if(k===null)return T;var G=k[1];return T.split(`
|
|
`).map(function(ee){var V=ee.match(/^\s+/);if(V===null)return ee;var Te=Object(z.a)(V,1),ze=Te[0];return ze.length>=G.length?ee.slice(G.length):ee}).join(`
|
|
`)}var o=[],l=["<ul>"],s=new u.a.Renderer,a=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function R(){o.length=0,l=["<ul>"]}var E={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(X,T,k,G){if(T>=X.length||X[T].level<=k)return T;var ee=X[T];G.push("<li><a href='#"+ee.anchor+"'>"+ee.text+"</a>"),T++;var V=[];return T=S(X,T,ee.level,V),V.length>0&&(G.push("<ul>"),V.forEach(function(Te){G.push(Te)}),G.push("</ul>")),G.push("</li>"),T=S(X,T,k,G),T}function D(){return S(o,0,0,l),l.push("</ul>"),l.join("")}var A={heading:function(T){var k=a.exec(T);if(k)return{type:"heading",raw:k[0],depth:k[1].length,text:k[2]}},fences:function(T){var k=this.rules.block.fences.exec(T);if(k){var G=k[0],ee=c(G,k[3]||""),V=k[2]?k[2].trim():k[2];if(["latex","katex","math"].indexOf(V)>=0){var Te=x(),ze=ee;ee=Te,f[Te]={type:"block",expression:ze}}return{type:"code",raw:G,lang:V,text:ee}}}},O=/(?:\${2})([^\n`]+?)(?:\${2})/gi,C=0,x=function(){return"__special_katext_id_".concat(C++,"__")},f={};function w(){return f}function b(){C=0,f={}}function y(X){return X=X.replace(O,function(T,k){var G=x();return f[G]={type:"inline",expression:k},G}),X}var B=s.listitem;s.listitem=function(X){return B(y(X))};var F=s.paragraph;s.paragraph=function(X){return F(y(X))};var _=s.tablecell;s.tablecell=function(X,T){return _(y(X),T)},s.code=function(X,T,k){var G=(T||"").match(/\S*/)[0];return G?["latex","katex","math"].indexOf(G)>=0?"<p class='editormd-tex'>".concat(X,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(T,'">').concat(k?X:Object(h.escape)(X,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(k?X:Object(h.escape)(X,!0))+"</code></pre>"},s.heading=function(X,T,k){var G=this.options.headerPrefix+k.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return o.push({anchor:G,level:T,text:X}),"<h"+T+' id="'+G+'">'+X+"</h"+T+">"},u.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),u.a.use({tokenizer:A,renderer:s});var M=u.a,I=Q("SJMd"),m=Q("ulZh"),W=Q.n(m),$=Q("m3rI"),ae=Q("Oy/b"),ue=Q("p5ED"),Oe=Q("ErOA");/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var ve=function(X,T){return(ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,G){k.__proto__=G}||function(k,G){for(var ee in G)Object.prototype.hasOwnProperty.call(G,ee)&&(k[ee]=G[ee])})(X,T)};function Ee(X,T){function k(){this.constructor=X}ve(X,T),X.prototype=T===null?Object.create(T):(k.prototype=T.prototype,new k)}function xe(X,T,k,G){return new(k||(k=Promise))(function(ee,V){function Te(pt){try{tt(G.next(pt))}catch(Ye){V(Ye)}}function ze(pt){try{tt(G.throw(pt))}catch(Ye){V(Ye)}}function tt(pt){var Ye;pt.done?ee(pt.value):(Ye=pt.value,Ye instanceof k?Ye:new k(function(_t){_t(Ye)})).then(Te,ze)}tt((G=G.apply(X,T||[])).next())})}function Ie(X,T){var k,G,ee,V,Te={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return V={next:ze(0),throw:ze(1),return:ze(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function ze(tt){return function(pt){return function(Ye){if(k)throw new TypeError("Generator is already executing.");for(;Te;)try{if(k=1,G&&(ee=2&Ye[0]?G.return:Ye[0]?G.throw||((ee=G.return)&&ee.call(G),0):G.next)&&!(ee=ee.call(G,Ye[1])).done)return ee;switch(G=0,ee&&(Ye=[2&Ye[0],ee.value]),Ye[0]){case 0:case 1:ee=Ye;break;case 4:return Te.label++,{value:Ye[1],done:!1};case 5:Te.label++,G=Ye[1],Ye=[0];continue;case 7:Ye=Te.ops.pop(),Te.trys.pop();continue;default:if(!(ee=Te.trys,(ee=ee.length>0&&ee[ee.length-1])||Ye[0]!==6&&Ye[0]!==2)){Te=0;continue}if(Ye[0]===3&&(!ee||Ye[1]>ee[0]&&Ye[1]<ee[3])){Te.label=Ye[1];break}if(Ye[0]===6&&Te.label<ee[1]){Te.label=ee[1],ee=Ye;break}if(ee&&Te.label<ee[2]){Te.label=ee[2],Te.ops.push(Ye);break}ee[2]&&Te.ops.pop(),Te.trys.pop();continue}Ye=T.call(X,Te)}catch(_t){Ye=[6,_t],G=0}finally{k=ee=0}if(5&Ye[0])throw Ye[1];return{value:Ye[0]?Ye[1]:void 0,done:!0}}([tt,pt])}}}function de(){for(var X=0,T=0,k=arguments.length;T<k;T++)X+=arguments[T].length;var G=Array(X),ee=0;for(T=0;T<k;T++)for(var V=arguments[T],Te=0,ze=V.length;Te<ze;Te++,ee++)G[ee]=V[Te];return G}var ce=function(){function X(){}return X.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},X.setAttributes=function(T,k){for(var G=0,ee=k;G<ee.length;G++){var V=ee[G],Te=V[0],ze=V[1];T.setAttribute(Te,ze)}},X.createRect=function(T,k,G){var ee=document.createElementNS("http://www.w3.org/2000/svg","rect");return ee.setAttribute("width",T.toString()),ee.setAttribute("height",k.toString()),G&&X.setAttributes(ee,G),ee},X.createLine=function(T,k,G,ee,V){var Te=document.createElementNS("http://www.w3.org/2000/svg","line");return Te.setAttribute("x1",T.toString()),Te.setAttribute("y1",k.toString()),Te.setAttribute("x2",G.toString()),Te.setAttribute("y2",ee.toString()),V&&X.setAttributes(Te,V),Te},X.createPolygon=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","polygon");return G.setAttribute("points",T),k&&X.setAttributes(G,k),G},X.createCircle=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","circle");return G.setAttribute("cx",(T/2).toString()),G.setAttribute("cy",(T/2).toString()),G.setAttribute("r",T.toString()),k&&X.setAttributes(G,k),G},X.createEllipse=function(T,k,G){var ee=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ee.setAttribute("cx",(T/2).toString()),ee.setAttribute("cy",(k/2).toString()),ee.setAttribute("rx",(T/2).toString()),ee.setAttribute("ry",(k/2).toString()),G&&X.setAttributes(ee,G),ee},X.createGroup=function(T){var k=document.createElementNS("http://www.w3.org/2000/svg","g");return T&&X.setAttributes(k,T),k},X.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},X.createMarker=function(T,k,G,ee,V,Te,ze){var tt=document.createElementNS("http://www.w3.org/2000/svg","marker");return X.setAttributes(tt,[["id",T],["orient",k],["markerWidth",G.toString()],["markerHeight",ee.toString()],["refX",V.toString()],["refY",Te.toString()]]),tt.appendChild(ze),tt},X.createText=function(T){var k=document.createElementNS("http://www.w3.org/2000/svg","text");return k.setAttribute("x","0"),k.setAttribute("y","0"),T&&X.setAttributes(k,T),k},X.createTSpan=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","tspan");return G.textContent=T,k&&X.setAttributes(G,k),G},X.createImage=function(T){var k=document.createElementNS("http://www.w3.org/2000/svg","image");return T&&X.setAttributes(k,T),k},X.createPoint=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return G.x=T,G.y=k,G},X.createPath=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","path");return G.setAttribute("d",T),k&&X.setAttributes(G,k),G},X}(),ie=function(){function X(){}return X.addKey=function(T){X.key=T},Object.defineProperty(X,"isLicensed",{get:function(){return!!X.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(X.key)},enumerable:!1,configurable:!0}),X}(),fe=function(){function X(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return X.prototype.rasterize=function(T,k,G){var ee=this;return new Promise(function(V){var Te=G!==void 0?G:document.createElement("canvas");T===null&&(ee.markersOnly=!0,ee.naturalSize=!1);var ze=document.createElementNS("http://www.w3.org/2000/svg","svg");ze.setAttribute("xmlns","http://www.w3.org/2000/svg"),ze.setAttribute("width",k.width.baseVal.valueAsString),ze.setAttribute("height",k.height.baseVal.valueAsString),ze.setAttribute("viewBox","0 0 "+k.viewBox.baseVal.width.toString()+" "+k.viewBox.baseVal.height.toString()),ze.innerHTML=k.innerHTML,ee.naturalSize===!0?(ze.width.baseVal.value=T.naturalWidth,ze.height.baseVal.value=T.naturalHeight):ee.width!==void 0&&ee.height!==void 0&&(ze.width.baseVal.value=ee.width,ze.height.baseVal.value=ee.height),Te.width=ze.width.baseVal.value,Te.height=ze.height.baseVal.value;var tt=ze.outerHTML,pt=Te.getContext("2d");ee.markersOnly!==!0&&pt.drawImage(T,0,0,Te.width,Te.height);var Ye=window.URL,_t=new Image(Te.width,Te.height);_t.setAttribute("crossOrigin","anonymous");var jt=new Blob([tt],{type:"image/svg+xml"}),$t=Ye.createObjectURL(jt);_t.onload=function(){pt.drawImage(_t,0,0),Ye.revokeObjectURL($t);var jr=Te.toDataURL(ee.imageType,ee.imageQuality);V(jr)},_t.src=$t})},X}(),le=function(){},ke=function(){function X(T){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+T+"_"}return Object.defineProperty(X.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),X.prototype.addClass=function(T){return this.styleSheet===void 0&&this.addStyleSheet(),T.name=""+this.classNamePrefix+T.localName,this.classes.push(T),this.styleSheet.sheet.insertRule("."+T.name+" {"+T.style+"}",this.styleSheet.sheet.cssRules.length),T},X.prototype.addRule=function(T){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(T),this.styleSheet.sheet.insertRule(T.selector+" {"+T.style+"}",this.styleSheet.sheet.cssRules.length)},X.prototype.addStyleSheet=function(){var T;this.styleSheet=document.createElement("style"),((T=this.styleSheetRoot)!==null&&T!==void 0?T:document.head).appendChild(this.styleSheet),this.addRule(new Ne("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ne("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Ne("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Ae("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Ae("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},X.prototype.removeStyleSheet=function(){var T;this.styleSheet&&(((T=this.styleSheetRoot)!==null&&T!==void 0?T:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},X}(),Ne=function(X,T){this.selector=X,this.style=T},Ae=function(X,T){this.localName=X,this.style=T},Le=function(){function X(T,k,G,ee,V){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=T,this.displayMode=k,this.markerItems=G,this.uiStyleSettings=ee,this.styles=V,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return X.prototype.show=function(T){var k=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=T,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var G=document.createElement("div");G.className=this.toolbarBlockStyleClass.name,G.style.whiteSpace="nowrap",this.uiContainer.appendChild(G),this.addActionButton(G,'<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(G,'<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(G,'<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(G,'<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(G,'<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(G,'<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(G,'<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(G,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(V){var Te=document.createElement("div");Te.className=""+k.toolbarButtonStyleClass.name,Te.setAttribute("data-type-name",V.typeName),Te.innerHTML=V.icon,Te.addEventListener("click",function(){k.markerToolbarButtonClicked(Te,V)}),k.buttons.push(Te),k.markerButtons.push(Te)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var ee=document.createElement("div");ee.className=this.toolbarBlockStyleClass.name,ee.style.whiteSpace="nowrap",ee.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ee),this.addActionButton(ee,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(ee,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},X.prototype.addButtonClickListener=function(T){this.buttonClickListeners.push(T)},X.prototype.removeButtonClickListener=function(T){this.buttonClickListeners.indexOf(T)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(T),1)},X.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},X.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var T=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var k=0;k<this.markerButtons.length;k++)k<T||k===T&&this.markerButtons.length-1===T?this.markerButtonBlock.appendChild(this.markerButtons[k]):(k===T&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[k]))}},X.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},X.prototype.resetButtonStyles=function(){var T=this;this.buttons.forEach(function(k){k.className=k.className.replace(T.uiStyleSettings.toolbarButtonStyleColorsClassName?T.uiStyleSettings.toolbarButtonStyleColorsClassName:T.toolbarButtonStyleColorsClass.name,"").trim(),k.className=k.className.replace(T.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?T.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:T.toolbarActiveButtonStyleColorsClass.name,"").trim(),k.className+=" "+(T.uiStyleSettings.toolbarButtonStyleColorsClassName?T.uiStyleSettings.toolbarButtonStyleColorsClassName:T.toolbarButtonStyleColorsClass.name)})},X.prototype.addActionButton=function(T,k,G){var ee=this,V=document.createElement("div");switch(V.className=""+this.toolbarButtonStyleClass.name,V.innerHTML=k,V.setAttribute("data-action",G),V.addEventListener("click",function(){ee.actionToolbarButtonClicked(V,G)}),G){case"select":V.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":V.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":V.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":V.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":V.style.fill=this.uiStyleSettings.closeButtonColor}T.appendChild(V),this.buttons.push(V)},X.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ae("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 Ae("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ae("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Ae("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 Ae("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var T=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ae("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*T)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*T)+`px;
|
|
padding: `+T+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ae("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ae("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ne("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Ne("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},X.prototype.markerToolbarButtonClicked=function(T,k){this.setActiveButton(T),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(G){return G("marker",k)}),this.markerButtonOverflowBlock.style.display="none"},X.prototype.actionToolbarButtonClicked=function(T,k){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(G){return G("action",k)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},X.prototype.setActiveButton=function(T){this.resetButtonStyles(),T.className=T.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),T.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},X.prototype.setActiveMarkerButton=function(T){var k=this.markerButtons.find(function(G){return G.getAttribute("data-type-name")===T});k&&this.setActiveButton(k)},X.prototype.setCurrentMarker=function(T){var k=this;this.currentMarker=T,this.buttons.filter(function(G){return/delete|notes/.test(G.getAttribute("data-action"))}).forEach(function(G){k.currentMarker===void 0?(G.style.fillOpacity="0.4",G.style.pointerEvents="none"):(G.style.fillOpacity="1",G.style.pointerEvents="all")})},X}(),Fe=function(){function X(T,k,G,ee){this.panels=[],this.panelButtons=[],this.markerjsContainer=T,this.displayMode=k,this.uiStyleSettings=G,this.styles=ee,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return X.prototype.addStyles=function(){var T;this.toolboxStyleClass=this.styles.addClass(new Ae("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 Ae("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var k=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ae("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ae("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ae("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 Ae("toolbox-panel-row_colors",`
|
|
background-color: `+((T=this.uiStyleSettings.toolboxBackgroundColor)!==null&&T!==void 0?T:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ae("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
|
|
padding: `+k+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Ae("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ae("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new Ne("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ne("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},X.prototype.show=function(T){var k;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=T,this.uiContainer.className=this.toolboxStyleClass.name+" "+((k=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},X.prototype.setPanelButtons=function(T){var k,G,ee=this;this.panels=T,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((k=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((G=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&G!==void 0?G:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(V){var Te;V.uiStyleSettings=ee.uiStyleSettings;var ze=document.createElement("div");ze.className=ee.toolboxButtonStyleClass.name+" "+((Te=ee.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Te!==void 0?Te:ee.toolboxButtonStyleColorsClass.name),ze.innerHTML=V.icon,ze.title=V.title,ze.addEventListener("click",function(){ee.panelButtonClick(V)}),ee.panelButtons.push(ze),ee.buttonRow.appendChild(ze)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},X.prototype.panelButtonClick=function(T){var k=this,G=-1;if(T!==this.activePanel){G=this.panels.indexOf(T),this.panelRow.innerHTML="";var ee=T.getUi();ee.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ee),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=T}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){k.displayMode==="inline"?k.panelRow.style.display="none":k.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(V,Te){var ze,tt;V.className=k.toolboxButtonStyleClass.name+" "+(Te===G?""+((ze=k.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ze!==void 0?ze:k.toolboxActiveButtonStyleColorsClass.name):""+((tt=k.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&tt!==void 0?tt:k.toolboxButtonStyleColorsClass.name))})},X}(),oe=function(X,T){this.title=X,this.icon=T},ge=function(X){function T(k,G,ee,V){var Te=X.call(this,k,V||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return Te.colors=[],Te.addTransparent=!1,Te.colorBoxes=[],Te.colors=G,Te.currentColor=ee,Te.setCurrentColor=Te.setCurrentColor.bind(Te),Te.getColorBox=Te.getColorBox.bind(Te),Te}return Ee(T,X),T.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.overflow="hidden",G.style.whiteSpace="nowrap",this.colors.forEach(function(ee){var V=k.getColorBox(ee);G.appendChild(V),k.colorBoxes.push(V)}),G},T.prototype.getColorBox=function(k){var G=this,ee=this.uiStyleSettings.toolbarHeight/4,V=this.uiStyleSettings.toolbarHeight-ee,Te=document.createElement("div");Te.style.display="inline-block",Te.style.boxSizing="content-box",Te.style.width=V-2+"px",Te.style.height=V-2+"px",Te.style.padding="1px",Te.style.marginRight="2px",Te.style.marginBottom="2px",Te.style.borderWidth="2px",Te.style.borderStyle="solid",Te.style.borderRadius=(V+2)/2+"px",Te.style.borderColor=k===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Te.addEventListener("click",function(){G.setCurrentColor(k,Te)});var ze=document.createElement("div");return ze.style.display="inline-block",ze.style.width=V-2+"px",ze.style.height=V-2+"px",ze.style.backgroundColor=k,ze.style.borderRadius=V/2+"px",k==="transparent"&&(ze.style.fill=this.uiStyleSettings.toolboxAccentColor,ze.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>`),Te.appendChild(ze),Te},T.prototype.setCurrentColor=function(k,G){var ee=this;this.currentColor=k,this.colorBoxes.forEach(function(V){V.style.borderColor=V===G?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(k)},T}(oe),we=function(){function X(T,k,G){this._state="new",this._isSelected=!1,this._container=T,this._overlayContainer=k,this.globalSettings=G,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(X.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),X.prototype.ownsTarget=function(T){return!1},Object.defineProperty(X.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),X.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},X.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},X.prototype.pointerDown=function(T,k){},X.prototype.dblClick=function(T,k){},X.prototype.manipulate=function(T){},X.prototype.pointerUp=function(T){this.stateChanged()},X.prototype.dispose=function(){},X.prototype.addMarkerVisualToContainer=function(T){this.container.childNodes.length>0?this.container.insertBefore(T,this.container.childNodes[0]):this.container.appendChild(T)},X.prototype.getState=function(){return{typeName:X.typeName,state:this.state,notes:this.notes}},X.prototype.restoreState=function(T){this._state=T.state,this.notes=T.notes},X.prototype.scale=function(T,k){},X.prototype.colorChanged=function(T){this.onColorChanged&&this.onColorChanged(T),this.stateChanged()},X.prototype.fillColorChanged=function(T){this.onFillColorChanged&&this.onFillColorChanged(T),this.stateChanged()},X.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var T=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),T.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(T)&&this.onStateChanged(this)}},X.typeName="MarkerBase",X}(),De=function(){function X(){this.findGripByVisual=this.findGripByVisual.bind(this)}return X.prototype.findGripByVisual=function(T){return this.topLeft.ownsTarget(T)?this.topLeft:this.topCenter.ownsTarget(T)?this.topCenter:this.topRight.ownsTarget(T)?this.topRight:this.centerLeft.ownsTarget(T)?this.centerLeft:this.centerRight.ownsTarget(T)?this.centerRight:this.bottomLeft.ownsTarget(T)?this.bottomLeft:this.bottomCenter.ownsTarget(T)?this.bottomCenter:this.bottomRight.ownsTarget(T)?this.bottomRight:void 0},X}(),je=function(){function X(){this.GRIP_SIZE=10,this.visual=ce.createGroup(),this.visual.appendChild(ce.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ce.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(T){return T===this.visual||T===this.visual.childNodes[0]||T===this.visual.childNodes[1]},X}(),Ve=function(){function X(){}return X.toITransformMatrix=function(T){return{a:T.a,b:T.b,c:T.c,d:T.d,e:T.e,f:T.f}},X.toSVGMatrix=function(T,k){return T.a=k.a,T.b=k.b,T.c=k.c,T.d=k.d,T.e=k.e,T.f=k.f,T},X}(),Je=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.left=0,V.top=0,V.width=0,V.height=0,V.defaultSize={x:50,y:20},V.offsetX=0,V.offsetY=0,V.rotationAngle=0,V.CB_DISTANCE=10,V._suppressMarkerCreateEvent=!1,V.container.transform.baseVal.appendItem(ce.createTransform()),V.setupControlBox(),V}return Ee(T,X),Object.defineProperty(T.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"visual",{get:function(){return this._visual},set:function(k){this._visual=k;var G=ce.createTransform();this._visual.transform.baseVal.appendItem(G)},enumerable:!1,configurable:!0}),T.prototype.ownsTarget=function(k){return!!X.prototype.ownsTarget.call(this,k)||!!(this.controlGrips.findGripByVisual(k)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(k))},T.prototype.pointerDown=function(k,G){X.prototype.pointerDown.call(this,k,G),this.state==="new"&&(this.left=k.x,this.top=k.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ee=this.unrotatePoint(k);if(this.manipulationStartX=ee.x,this.manipulationStartY=ee.y,this.offsetX=ee.x-this.left,this.offsetY=ee.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(G),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(G)){this.activeGrip=this.rotatorGrip;var V=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=V.x-this.width/2,this.top=V.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Te=this.container.transform.baseVal.getItem(0);Te.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Te,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},T.prototype.pointerUp=function(k){var G=this.state;X.prototype.pointerUp.call(this,k),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(k),this._state="select",G==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},T.prototype.moveVisual=function(k){this.visual.style.transform="translate("+k.x+"px, "+k.y+"px)"},T.prototype.manipulate=function(k){var G=this.unrotatePoint(k);this.state==="creating"?this.resize(k):this.state==="move"?(this.left=this.manipulationStartLeft+(G.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(G.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(G):this.state==="rotate"&&this.rotate(k)},T.prototype.resize=function(k){var G=this.manipulationStartLeft,ee=this.manipulationStartWidth,V=this.manipulationStartTop,Te=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:G=this.manipulationStartLeft+k.x-this.manipulationStartX,ee=this.manipulationStartWidth+this.manipulationStartLeft-G;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ee=this.manipulationStartWidth+k.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:V=this.manipulationStartTop+k.y-this.manipulationStartY,Te=this.manipulationStartHeight+this.manipulationStartTop-V;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Te=this.manipulationStartHeight+k.y-this.manipulationStartY}ee>=0?(this.left=G,this.width=ee):(this.left=G+ee,this.width=-ee),Te>=0?(this.top=V,this.height=Te):(this.top=V+Te,this.height=-Te),this.setSize()},T.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},T.prototype.rotate=function(k){if(Math.abs(k.x-this.centerX)>.1){var G=Math.sign(k.x-this.centerX);this.rotationAngle=180*Math.atan((k.y-this.centerY)/(k.x-this.centerX))/Math.PI+90*G,this.applyRotation()}},T.prototype.applyRotation=function(){var k=this.container.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(k,0)},T.prototype.rotatePoint=function(k){if(this.rotationAngle===0)return k;var G=this.container.getCTM(),ee=ce.createPoint(k.x,k.y);return{x:(ee=ee.matrixTransform(G)).x,y:ee.y}},T.prototype.unrotatePoint=function(k){if(this.rotationAngle===0)return k;var G=this.container.getCTM();G=G.inverse();var ee=ce.createPoint(k.x,k.y);return{x:(ee=ee.matrixTransform(G)).x,y:ee.y}},T.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},T.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},T.prototype.setupControlBox=function(){this.controlBox=ce.createGroup();var k=ce.createTransform();k.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(k),this.container.appendChild(this.controlBox),this.controlRect=ce.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=ce.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new De,this.addControlGrips(),this.controlBox.style.display="none"},T.prototype.adjustControlBox=function(){var k=this.controlBox.transform.baseVal.getItem(0);k.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(k,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},T.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()},T.prototype.createGrip=function(){var k=new je;return k.visual.transform.baseVal.appendItem(ce.createTransform()),this.controlBox.appendChild(k.visual),k},T.prototype.positionGrips=function(){var k=this.controlGrips.topLeft.GRIP_SIZE,G=-k/2,ee=G,V=(this.width+this.CB_DISTANCE)/2-k/2,Te=(this.height+this.CB_DISTANCE)/2-k/2,ze=this.height+this.CB_DISTANCE-k/2,tt=this.width+this.CB_DISTANCE-k/2;this.positionGrip(this.controlGrips.topLeft.visual,G,ee),this.positionGrip(this.controlGrips.topCenter.visual,V,ee),this.positionGrip(this.controlGrips.topRight.visual,tt,ee),this.positionGrip(this.controlGrips.centerLeft.visual,G,Te),this.positionGrip(this.controlGrips.centerRight.visual,tt,Te),this.positionGrip(this.controlGrips.bottomLeft.visual,G,ze),this.positionGrip(this.controlGrips.bottomCenter.visual,V,ze),this.positionGrip(this.controlGrips.bottomRight.visual,tt,ze),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,V,ee-3*this.CB_DISTANCE)},T.prototype.positionGrip=function(k,G,ee){var V=k.transform.baseVal.getItem(0);V.setTranslate(G,ee),k.transform.baseVal.replaceItem(V,0)},T.prototype.hideControlBox=function(){this.controlBox.style.display="none"},T.prototype.showControlBox=function(){this.controlBox.style.display=""},T.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Ve.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Ve.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},X.prototype.getState.call(this))},T.prototype.restoreState=function(k){X.prototype.restoreState.call(this,k);var G=k;this.left=G.left,this.top=G.top,this.width=G.width,this.height=G.height,this.rotationAngle=G.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Ve.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,G.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Ve.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,G.containerTransformMatrix))},T.prototype.scale=function(k,G){X.prototype.scale.call(this,k,G);var ee=this.rotatePoint({x:this.left,y:this.top}),V=this.unrotatePoint({x:ee.x*k,y:ee.y*G});this.left=V.x,this.top=V.y,this.width=this.width*k,this.height=this.height*G,this.adjustControlBox()},T}(we),Xe=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.createVisual=V.createVisual.bind(V),V}return Ee(T,X),T.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.visual)},T.prototype.createVisual=function(){this.visual=ce.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(k,G){X.prototype.pointerDown.call(this,k,G),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},T.prototype.manipulate=function(k){X.prototype.manipulate.call(this,k)},T.prototype.resize=function(k){X.prototype.resize.call(this,k),this.setSize()},T.prototype.setSize=function(){X.prototype.setSize.call(this),ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},T.prototype.pointerUp=function(k){X.prototype.pointerUp.call(this,k),this.setSize()},T.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&ce.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},T.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&ce.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},T.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&ce.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},T.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&ce.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},T.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this))},T.prototype.restoreState=function(k){var G=k;this.fillColor=G.fillColor,this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.opacity=G.opacity,this.createVisual(),X.prototype.restoreState.call(this,k),this.setSize()},T.prototype.scale=function(k,G){X.prototype.scale.call(this,k,G),this.setSize()},T.title="Rectangle marker",T}(Je),et=function(X){function T(k,G,ee,V){var Te=X.call(this,k,V||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Te.widths=[],Te.widthBoxes=[],Te.widths=G,Te.currentWidth=ee,Te.setCurrentWidth=Te.setCurrentWidth.bind(Te),Te}return Ee(T,X),T.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",this.widths.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.flexGrow="2",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=ee===k.currentWidth?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentWidth(ee,V)}),G.appendChild(V);var Te=document.createElement("div");Te.innerText=ee.toString(),Te.style.marginRight="5px",V.appendChild(Te);var ze=document.createElement("div");ze.style.minHeight="20px",ze.style.flexGrow="2",ze.style.display="flex",ze.style.alignItems="center";var tt=document.createElement("hr");tt.style.minWidth="20px",tt.style.border="0px",tt.style.borderTop=ee+"px solid "+k.uiStyleSettings.toolboxColor,tt.style.flexGrow="2",ze.appendChild(tt),V.appendChild(ze),k.widthBoxes.push(V)}),G},T.prototype.setCurrentWidth=function(k,G){var ee=this;this.currentWidth=k,this.widthBoxes.forEach(function(V){V.style.borderColor=V===G?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},T}(oe),Ze=function(X){function T(k,G,ee,V){var Te=X.call(this,k,V||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return Te.styles=[],Te.styleBoxes=[],Te.styles=G,Te.currentStyle=ee,Te.setCurrentStyle=Te.setCurrentStyle.bind(Te),Te}return Ee(T,X),T.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",this.styles.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/k.styles.length-5+"%",V.style.borderColor=ee===k.currentStyle?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentStyle(ee,V)}),G.appendChild(V);var Te=document.createElement("div");Te.style.minHeight="20px",Te.style.flexGrow="2",Te.style.overflow="hidden";var ze=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+k.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ee!==""?'stroke-dasharray="'+ee+'"':"")+` />
|
|
</svg>`;Te.innerHTML=ze,V.appendChild(Te),k.styleBoxes.push(V)}),G},T.prototype.setCurrentStyle=function(k,G){var ee=this;this.currentStyle=k,this.styleBoxes.forEach(function(V){V.style.borderColor=V===G?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},T}(oe),rt=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new ge("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new et("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new Ze("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Ee(T,X),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=X.prototype.getState.call(this);return k.typeName=T.typeName,k},T.typeName="FrameMarker",T.title="Frame marker",T.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',T}(Xe),Be=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},ut=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.x1=0,V.y1=0,V.x2=0,V.y2=0,V.defaultLength=50,V.manipulationStartX=0,V.manipulationStartY=0,V.manipulationStartX1=0,V.manipulationStartY1=0,V.manipulationStartX2=0,V.manipulationStartY2=0,V.setupControlBox(),V}return Ee(T,X),T.prototype.ownsTarget=function(k){return!!X.prototype.ownsTarget.call(this,k)||!(!this.grip1.ownsTarget(k)&&!this.grip2.ownsTarget(k))},T.prototype.pointerDown=function(k,G){X.prototype.pointerDown.call(this,k,G),this.manipulationStartX=k.x,this.manipulationStartY=k.y,this.state==="new"&&(this.x1=k.x,this.y1=k.y,this.x2=k.x,this.y2=k.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(G)?this.activeGrip=this.grip1:this.grip2.ownsTarget(G)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},T.prototype.pointerUp=function(k){var G=this.state;X.prototype.pointerUp.call(this,k),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(k),this._state="select",G==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},T.prototype.adjustVisual=function(){},T.prototype.manipulate=function(k){this.state==="creating"?this.resize(k):this.state==="move"?(this.x1=this.manipulationStartX1+k.x-this.manipulationStartX,this.y1=this.manipulationStartY1+k.y-this.manipulationStartY,this.x2=this.manipulationStartX2+k.x-this.manipulationStartX,this.y2=this.manipulationStartY2+k.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(k)},T.prototype.resize=function(k){switch(this.activeGrip){case this.grip1:this.x1=k.x,this.y1=k.y;break;case this.grip2:case void 0:this.x2=k.x,this.y2=k.y}this.adjustVisual(),this.adjustControlBox()},T.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},T.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},T.prototype.setupControlBox=function(){this.controlBox=ce.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},T.prototype.adjustControlBox=function(){this.positionGrips()},T.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},T.prototype.createGrip=function(){var k=new je;return k.visual.transform.baseVal.appendItem(ce.createTransform()),this.controlBox.appendChild(k.visual),k},T.prototype.positionGrips=function(){var k=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-k/2,this.y1-k/2),this.positionGrip(this.grip2.visual,this.x2-k/2,this.y2-k/2)},T.prototype.positionGrip=function(k,G,ee){var V=k.transform.baseVal.getItem(0);V.setTranslate(G,ee),k.transform.baseVal.replaceItem(V,0)},T.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},X.prototype.getState.call(this))},T.prototype.restoreState=function(k){X.prototype.restoreState.call(this,k);var G=k;this.x1=G.x1,this.y1=G.y1,this.x2=G.x2,this.y2=G.y2},T.prototype.scale=function(k,G){X.prototype.scale.call(this,k,G),this.x1=this.x1*k,this.y1=this.y1*G,this.x2=this.x2*k,this.y2=this.y2*G,this.adjustVisual(),this.adjustControlBox()},T}(we),it=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new ge("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new et("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new Ze("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Ee(T,X),T.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorLine&&k!==this.visibleLine)},T.prototype.createVisual=function(){this.visual=ce.createGroup(),this.selectorLine=ce.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ce.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(k,G){X.prototype.pointerDown.call(this,k,G),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},T.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),ce.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ce.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},T.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},T.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},T.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},X.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){X.prototype.restoreState.call(this,k);var G=k;this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.createVisual(),this.adjustVisual()},T.typeName="LineMarker",T.title="Line marker",T.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',T}(ut),He=function(X){function T(k,G,ee,V){var Te=X.call(this,k,V||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return Te.fonts=[],Te.fontBoxes=[],Te.fonts=G,Te.currentFont=ee,Te.setCurrentFont=Te.setCurrentFont.bind(Te),Te}return Ee(T,X),T.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.overflow="hidden",G.style.flexGrow="2",this.fonts.forEach(function(ee){var V=document.createElement("div");V.style.display="inline-block",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/k.fonts.length-5+"%",V.style.borderColor=ee===k.currentFont?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentFont(ee,V)}),G.appendChild(V);var Te=document.createElement("div");Te.style.display="flex",Te.style.minHeight="20px",Te.style.flexGrow="2",Te.style.fontFamily=ee,Te.style.overflow="hidden";var ze=document.createElement("div");ze.style.whiteSpace="nowrap",ze.style.overflow="hidden",ze.style.textOverflow="ellipsis",ze.innerHTML="The quick brown fox jumps over the lazy dog",Te.appendChild(ze),V.appendChild(Te),k.fontBoxes.push(V)}),G},T.prototype.setCurrentFont=function(k,G){var ee=this;this.currentFont=k,this.fontBoxes.forEach(function(V){V.style.borderColor=V===G?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},T}(oe),We=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.color="transparent",V.padding=5,V.DEFAULT_TEXT="your text here",V.text=V.DEFAULT_TEXT,V.isMoved=!1,V.color=ee.defaultColor,V.fontFamily=ee.defaultFontFamily,V.defaultSize={x:100,y:30},V.setColor=V.setColor.bind(V),V.setFont=V.setFont.bind(V),V.renderText=V.renderText.bind(V),V.sizeText=V.sizeText.bind(V),V.textEditDivClicked=V.textEditDivClicked.bind(V),V.showTextEditor=V.showTextEditor.bind(V),V.setSize=V.setSize.bind(V),V.positionTextEditor=V.positionTextEditor.bind(V),V.colorPanel=new ge("Color",ee.defaultColorSet,ee.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.fontFamilyPanel=new He("Font",ee.defaultFontFamilies,ee.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V}return Ee(T,X),T.prototype.ownsTarget=function(k){if(X.prototype.ownsTarget.call(this,k)||k===this.visual||k===this.textElement||k===this.bgRectangle)return!0;var G=!1;return this.textElement.childNodes.forEach(function(ee){ee===k&&(G=!0)}),G},T.prototype.createVisual=function(){this.visual=ce.createGroup(),this.bgRectangle=ce.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ce.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ce.createTransform()),this.textElement.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},T.prototype.pointerDown=function(k,G){X.prototype.pointerDown.call(this,k,G),this.isMoved=!1,this.pointerDownPoint=k,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},T.prototype.renderText=function(){var k=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(G){k.textElement.appendChild(ce.createTSpan(G.trim()===""?" ":G.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},T.prototype.getTextScale=function(){var k=this.textElement.getBBox(),G=1;if(k.width>0&&k.height>0){var ee=(1*this.width-this.width*this.padding*2/100)/k.width,V=(1*this.height-this.height*this.padding*2/100)/k.height;G=Math.min(ee,V)}return G},T.prototype.getTextPosition=function(k){var G=this.textElement.getBBox(),ee=0,V=0;return G.width>0&&G.height>0&&(ee=(this.width-G.width*k)/2,V=this.height/2-G.height*k/2),{x:ee,y:V}},T.prototype.sizeText=function(){var k=this.textElement.getBBox(),G=this.getTextScale(),ee=this.getTextPosition(G);ee.y-=k.y*G,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ee.x+"px, "+ee.y+"px) scale("+G+", "+G+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ee.x,ee.y),this.textElement.transform.baseVal.getItem(1).setScale(G,G))},T.prototype.manipulate=function(k){X.prototype.manipulate.call(this,k),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(k.x-this.pointerDownPoint.x)>5||Math.abs(k.y-this.pointerDownPoint.y)>5)},T.prototype.resize=function(k){X.prototype.resize.call(this,k),this.isMoved=!0,this.setSize(),this.sizeText()},T.prototype.setSize=function(){X.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},T.prototype.pointerUp=function(k){var G=this.state;G==="creating"&&(this._suppressMarkerCreateEvent=!0),X.prototype.pointerUp.call(this,k),this.setSize(),(G==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},T.prototype.showTextEditor=function(){var k=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(G){G.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var G=Number.parseFloat(k.textEditor.style.fontSize);k.textEditor.clientWidth>=Number.parseInt(k.textEditor.style.maxWidth)&&G>.9;)G-=.1,k.textEditor.style.fontSize=Math.max(G,.9)+"em"}),this.textEditor.addEventListener("keyup",function(G){G.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(G){if(G.clipboardData){var ee=G.clipboardData.getData("text"),V=window.getSelection();if(!V.rangeCount)return!1;V.deleteFromDocument(),V.getRangeAt(0).insertNode(document.createTextNode(ee)),G.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){k.textEditDivClicked(k.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},T.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var k=this.getTextScale(),G=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ee=this.textElement.getBBox(),V={x:ee.width*k,y:ee.height*k};G.x-=V.x/2,G.y-=V.y/2,this.textEditor.style.top=G.y+"px",this.textEditor.style.left=G.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-G.x+"px",this.textEditor.style.fontSize=Math.max(16*k,12)+"px",this.textElement.style.display="none"}},T.prototype.textEditDivClicked=function(k){this.text=k.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},T.prototype.select=function(){X.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},T.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),X.prototype.deselect.call(this)},T.prototype.dblClick=function(k,G){X.prototype.dblClick.call(this,k,G),this.showTextEditor()},T.prototype.setColor=function(k){this.textElement&&ce.setAttributes(this.textElement,[["fill",k]]),this.color=k,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(k)},T.prototype.setFont=function(k){this.textElement&&ce.setAttributes(this.textElement,[["font-family",k]]),this.fontFamily=k,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},T.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},T.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},X.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){var G=k;this.color=G.color,this.fontFamily=G.fontFamily,this.padding=G.padding,this.text=G.text,this.createVisual(),X.prototype.restoreState.call(this,k),this.setSize()},T.prototype.scale=function(k,G){X.prototype.scale.call(this,k,G),this.setSize(),this.sizeText(),this.positionTextEditor()},T.typeName="TextMarker",T.title="Text marker",T.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>',T}(Je),Re=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.color="transparent",V.lineWidth=3,V.drawing=!1,V.pixelRatio=1,V.color=ee.defaultColor,V.lineWidth=ee.defaultStrokeWidth,V.pixelRatio=ee.freehandPixelRatio,V.setColor=V.setColor.bind(V),V.addCanvas=V.addCanvas.bind(V),V.finishCreation=V.finishCreation.bind(V),V.setLineWidth=V.setLineWidth.bind(V),V.colorPanel=new ge("Color",ee.defaultColorSet,ee.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.lineWidthPanel=new et("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.lineWidthPanel.onWidthChanged=V.setLineWidth,V}return Ee(T,X),T.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.drawingImage)},T.prototype.createVisual=function(){this.visual=ce.createGroup(),this.drawingImage=ce.createImage(),this.visual.appendChild(this.drawingImage);var k=ce.createTransform();this.visual.transform.baseVal.appendItem(k),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(k,G){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(k.x,k.y),this.drawing=!0):X.prototype.pointerDown.call(this,k,G)},T.prototype.manipulate=function(k){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(k.x,k.y),this.canvasContext.stroke()):X.prototype.manipulate.call(this,k)},T.prototype.resize=function(k){X.prototype.resize.call(this,k),ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},T.prototype.pointerUp=function(k){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):X.prototype.pointerUp.call(this,k)},T.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)},T.prototype.select=function(){this.state==="creating"&&this.finishCreation(),X.prototype.select.call(this)},T.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),X.prototype.deselect.call(this)},T.prototype.finishCreation=function(){for(var k=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),G=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ee=G[0],V=G[1],Te=G[2],ze=G[3],tt=!1,pt=0;pt<this.canvasElement.height;pt++)for(var Ye=0;Ye<this.canvasElement.width;Ye++)k.data[pt*this.canvasElement.width*4+4*Ye+3]>0&&(tt=!0,pt<V&&(V=pt),Ye<ee&&(ee=Ye),pt>ze&&(ze=pt),Ye>Te&&(Te=Ye));if(tt){this.left=ee/this.pixelRatio,this.top=V/this.pixelRatio,this.width=(Te-ee)/this.pixelRatio,this.height=(ze-V)/this.pixelRatio;var _t=document.createElement("canvas");_t.width=Te-ee,_t.height=ze-V,_t.getContext("2d").putImageData(this.canvasContext.getImageData(ee,V,Te-ee,ze-V),0,0),this.drawingImgUrl=_t.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},T.prototype.setDrawingImage=function(){ce.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},T.prototype.setColor=function(k){this.color=k,this.colorChanged(k)},T.prototype.setLineWidth=function(k){this.lineWidth=k},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Object.assign({drawingImgUrl:this.drawingImgUrl},X.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){this.createVisual(),X.prototype.restoreState.call(this,k),this.drawingImgUrl=k.drawingImgUrl,this.setDrawingImage()},T.prototype.scale=function(k,G){X.prototype.scale.call(this,k,G),this.setDrawingImage()},T.typeName="FreehandMarker",T.title="Freehand marker",T.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>',T}(Je),be=function(X){function T(k,G,ee){var V=X.call(this,k,ee||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return V.typeBoxes=[],V.currentType=G,V.setCurrentType=V.setCurrentType.bind(V),V}return Ee(T,X),T.prototype.getUi=function(){var k=this,G=document.createElement("div");G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2";for(var ee=function(ze){var tt="both";switch(ze){case 0:tt="both";break;case 1:tt="start";break;case 2:tt="end";break;case 3:tt="none"}var pt=document.createElement("div");if(pt.style.display="flex",pt.style.flexGrow="2",pt.style.alignItems="center",pt.style.justifyContent="space-between",pt.style.padding="5px",pt.style.borderWidth="2px",pt.style.borderStyle="solid",pt.style.borderColor=tt===V.currentType?V.uiStyleSettings.toolboxAccentColor:"transparent",pt.addEventListener("click",function(){k.setCurrentType(tt,pt)}),G.appendChild(pt),tt==="both"||tt==="start"){var Ye=document.createElement("div");Ye.style.display="flex",Ye.style.alignItems="center",Ye.style.minHeight="20px",Ye.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,5 10,0 10,10" fill="`+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Ye.style.marginLeft="5px",pt.appendChild(Ye)}var _t=document.createElement("div");_t.style.display="flex",_t.style.alignItems="center",_t.style.minHeight="20px",_t.style.flexGrow="2";var jt=document.createElement("hr");if(jt.style.minWidth="20px",jt.style.border="0px",jt.style.borderTop="3px solid "+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee"),jt.style.flexGrow="2",_t.appendChild(jt),pt.appendChild(_t),tt==="both"||tt==="end"){var $t=document.createElement("div");$t.style.display="flex",$t.style.alignItems="center",$t.style.minHeight="20px",$t.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,0 10,5 0,10" fill="`+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,$t.style.marginRight="5px",pt.appendChild($t)}V.typeBoxes.push(pt)},V=this,Te=0;Te<4;Te++)ee(Te);return G},T.prototype.setCurrentType=function(k,G){var ee=this;this.currentType=k,this.typeBoxes.forEach(function(V){V.style.borderColor=V===G?ee.uiStyleSettings!==void 0?ee.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},T}(oe),Ce=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.arrowType="end",V.arrowBaseHeight=10,V.arrowBaseWidth=10,V.getArrowPoints=V.getArrowPoints.bind(V),V.setArrowType=V.setArrowType.bind(V),V.arrowTypePanel=new be("Arrow type","end"),V.arrowTypePanel.onArrowTypeChanged=V.setArrowType,V}return Ee(T,X),T.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.arrow1&&k!==this.arrow2)},T.prototype.getArrowPoints=function(k,G){var ee=this.arrowBaseWidth+2*this.strokeWidth,V=this.arrowBaseHeight+2*this.strokeWidth;return k-ee/2+","+(G+V/2)+" "+k+","+(G-V/2)+" "+(k+ee/2)+","+(G+V/2)},T.prototype.createTips=function(){this.arrow1=ce.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ce.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.arrow2)},T.prototype.pointerDown=function(k,G){X.prototype.pointerDown.call(this,k,G),this.state==="creating"&&this.createTips()},T.prototype.adjustVisual=function(){if(X.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",ce.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ce.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),G=this.arrow1.transform.baseVal.getItem(0);G.setRotate(k,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(G,0);var ee=this.arrow2.transform.baseVal.getItem(0);ee.setRotate(k+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ee,0)}},T.prototype.setArrowType=function(k){this.arrowType=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Object.assign({arrowType:this.arrowType},X.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){X.prototype.restoreState.call(this,k);var G=k;this.arrowType=G.arrowType,this.createTips(),this.adjustVisual()},T.typeName="ArrowMarker",T.title="Arrow marker",T.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',T}(it),re=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.fillColor=ee.defaultFillColor,V.strokeWidth=0,V.fillPanel=new ge("Color",ee.defaultColorSet,ee.defaultFillColor),V.fillPanel.onColorChanged=V.setFillColor,V}return Ee(T,X),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=X.prototype.getState.call(this);return k.typeName=T.typeName,k},T.typeName="CoverMarker",T.title="Cover marker",T.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',T}(Xe),se=function(X){function T(k,G,ee,V){var Te=X.call(this,k,V||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return Te.opacities=[],Te.opacityBoxes=[],Te.opacities=G,Te.currentOpacity=ee,Te.setCurrentOpacity=Te.setCurrentOpacity.bind(Te),Te}return Ee(T,X),T.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",G.style.justifyContent="space-between",this.opacities.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="center",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=ee===k.currentOpacity?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentOpacity(ee,V)}),G.appendChild(V);var Te=document.createElement("div");Te.innerText=100*ee+"%",V.appendChild(Te),k.opacityBoxes.push(V)}),G},T.prototype.setCurrentOpacity=function(k,G){var ee=this;this.currentOpacity=k,this.opacityBoxes.forEach(function(V){V.style.borderColor=V===G?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},T}(oe),he=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.setOpacity=V.setOpacity.bind(V),V.fillColor=ee.defaultHighlightColor,V.strokeWidth=0,V.opacity=ee.defaultHighlightOpacity,V.fillPanel=new ge("Color",ee.defaultColorSet,V.fillColor),V.fillPanel.onColorChanged=V.setFillColor,V.opacityPanel=new se("Opacity",ee.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return Ee(T,X),T.prototype.setOpacity=function(k){this.opacity=k,this.visual&&ce.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=X.prototype.getState.call(this);return k.typeName=T.typeName,k},T.typeName="HighlightMarker",T.title="Highlight marker",T.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>',T}(re),me='<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>',Se=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.bgColor="transparent",V.tipPosition={x:0,y:0},V.tipBase1Position={x:0,y:0},V.tipBase2Position={x:0,y:0},V.tipMoving=!1,V.color=ee.defaultStrokeColor,V.bgColor=ee.defaultFillColor,V.fontFamily=ee.defaultFontFamily,V.defaultSize={x:100,y:30},V.setBgColor=V.setBgColor.bind(V),V.getTipPoints=V.getTipPoints.bind(V),V.positionTip=V.positionTip.bind(V),V.setTipPoints=V.setTipPoints.bind(V),V.colorPanel=new ge("Text color",ee.defaultColorSet,V.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),V.colorPanel.onColorChanged=V.setColor,V.bgColorPanel=new ge("Fill color",ee.defaultColorSet,V.bgColor,me),V.bgColorPanel.onColorChanged=V.setBgColor,V.fontFamilyPanel=new He("Font",ee.defaultFontFamilies,ee.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V.tipGrip=new je,V.tipGrip.visual.transform.baseVal.appendItem(ce.createTransform()),V.controlBox.appendChild(V.tipGrip.visual),V}return Ee(T,X),T.prototype.ownsTarget=function(k){return X.prototype.ownsTarget.call(this,k)||this.tipGrip.ownsTarget(k)||this.tip===k},T.prototype.createTip=function(){ce.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ce.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},T.prototype.pointerDown=function(k,G){this.state==="new"&&X.prototype.pointerDown.call(this,k,G),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(G)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):X.prototype.pointerDown.call(this,k,G)},T.prototype.pointerUp=function(k){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,X.prototype.pointerUp.call(this,k);else{var G=this.state==="creating";X.prototype.pointerUp.call(this,k),this.setTipPoints(G),this.positionTip()}},T.prototype.manipulate=function(k){if(this.tipMoving){var G=this.unrotatePoint(k);this.tipPosition={x:G.x-this.manipulationStartLeft,y:G.y-this.manipulationStartTop},this.positionTip()}else X.prototype.manipulate.call(this,k)},T.prototype.setBgColor=function(k){this.bgRectangle&&this.tip&&(ce.setAttributes(this.bgRectangle,[["fill",k]]),ce.setAttributes(this.tip,[["fill",k]])),this.bgColor=k,this.fillColorChanged(k)},T.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},T.prototype.setTipPoints=function(k){k===void 0&&(k=!1);var G=Math.min(this.height/2,15),ee=this.height/5;k&&(this.tipPosition={x:G+ee/2,y:this.height+20});var V=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?V<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ee=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:G,y:0},this.tipBase2Position={x:G+ee,y:0}):(this.tipBase1Position={x:0,y:G},this.tipBase2Position={x:0,y:G+ee}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?V<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ee=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-G-ee,y:0},this.tipBase2Position={x:this.width-G,y:0}):(this.tipBase1Position={x:this.width,y:G},this.tipBase2Position={x:this.width,y:G+ee}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?V<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ee=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-G-ee,y:this.height},this.tipBase2Position={x:this.width-G,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-G-ee},this.tipBase2Position={x:this.width,y:this.height-G}):V<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ee=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:G,y:this.height},this.tipBase2Position={x:G+ee,y:this.height}):(this.tipBase1Position={x:0,y:this.height-G},this.tipBase2Position={x:0,y:this.height-G-ee})},T.prototype.resize=function(k){X.prototype.resize.call(this,k),this.positionTip()},T.prototype.positionTip=function(){ce.setAttributes(this.tip,[["points",this.getTipPoints()]]);var k=this.tipGrip.visual.transform.baseVal.getItem(0);k.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(k,0)},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),T.prototype.select=function(){this.positionTip(),X.prototype.select.call(this)},T.prototype.getState=function(){var k=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},X.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){var G=k;this.bgColor=G.bgColor,this.tipPosition=G.tipPosition,X.prototype.restoreState.call(this,k),this.createTip(),this.setTipPoints()},T.prototype.scale=function(k,G){X.prototype.scale.call(this,k,G),this.tipPosition={x:this.tipPosition.x*k,y:this.tipPosition.y*G},this.positionTip()},T.typeName="CalloutMarker",T.title="Callout marker",T.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>',T}(We),Ue=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.fillColor=ee.defaultFillColor,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.setOpacity=V.setOpacity.bind(V),V.createVisual=V.createVisual.bind(V),V.strokePanel=new ge("Line color",de(ee.defaultColorSet,["transparent"]),ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.fillPanel=new ge("Fill color",de(ee.defaultColorSet,["transparent"]),V.fillColor,me),V.fillPanel.onColorChanged=V.setFillColor,V.strokeWidthPanel=new et("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new Ze("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V.opacityPanel=new se("Opacity",ee.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return Ee(T,X),T.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.visual)},T.prototype.createVisual=function(){this.visual=ce.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(k,G){X.prototype.pointerDown.call(this,k,G),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},T.prototype.manipulate=function(k){X.prototype.manipulate.call(this,k)},T.prototype.resize=function(k){X.prototype.resize.call(this,k),this.setSize()},T.prototype.setSize=function(){X.prototype.setSize.call(this),ce.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},T.prototype.pointerUp=function(k){X.prototype.pointerUp.call(this,k),this.setSize()},T.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&ce.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},T.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&ce.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(k),this.stateChanged()},T.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&ce.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},T.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&ce.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},T.prototype.setOpacity=function(k){this.opacity=k,this.visual&&ce.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){var G=k;this.fillColor=G.fillColor,this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.opacity=G.opacity,this.createVisual(),X.prototype.restoreState.call(this,k),this.setSize()},T.prototype.scale=function(k,G){X.prototype.scale.call(this,k,G),this.setSize()},T.typeName="EllipseMarker",T.title="Ellipse marker",T.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>',T}(Je),Ke=function(X){function T(k,G,ee){return X.call(this,k,G,ee)||this}return Ee(T,X),Object.defineProperty(T.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),T.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.tip1&&k!==this.tip2)},T.prototype.createTips=function(){this.tip1=ce.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ce.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.tip2)},T.prototype.pointerDown=function(k,G){X.prototype.pointerDown.call(this,k,G),this.state==="creating"&&this.createTips()},T.prototype.adjustVisual=function(){if(X.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ce.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),G=this.tip1.transform.baseVal.getItem(0);G.setRotate(k,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(G,0);var ee=this.tip2.transform.baseVal.getItem(0);ee.setRotate(k+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ee,0)}},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=X.prototype.getState.call(this);return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){X.prototype.restoreState.call(this,k),this.createTips(),this.adjustVisual()},T.typeName="MeasurementMarker",T.title="Measurement marker",T.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>',T}(it),ot=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.strokePanel.colors=ee.defaultColorSet,V.fillColor="transparent",V}return Ee(T,X),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=X.prototype.getState.call(this);return k.typeName=T.typeName,k},T.typeName="EllipseFrameMarker",T.title="Ellipse frame marker",T.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>',T}(Ue),mt=function(){function X(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),X.prototype.addUndoStep=function(T){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(T)||(this.undoStack.push(T),JSON.stringify(this.lastRedoStep)!==JSON.stringify(T)&&this.redoStack.splice(0,this.redoStack.length))},X.prototype.replaceLastUndoStep=function(T){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=T)},X.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},X.prototype.undo=function(){if(this.undoStack.length>1){var T=this.undoStack.pop();return T!==void 0&&this.redoStack.push(T),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},X.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},X}(),ft=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.curveX=0,V.curveY=0,V.manipulationStartCurveX=0,V.manipulationStartCurveY=0,V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.positionGrips=V.positionGrips.bind(V),V.addControlGrips=V.addControlGrips.bind(V),V.adjustVisual=V.adjustVisual.bind(V),V.setupControlBox=V.setupControlBox.bind(V),V.resize=V.resize.bind(V),V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new ge("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new et("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new Ze("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Ee(T,X),T.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorCurve&&k!==this.visibleCurve&&!this.curveGrip.ownsTarget(k))},T.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},T.prototype.createVisual=function(){this.visual=ce.createGroup(),this.selectorCurve=ce.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ce.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(k,G){X.prototype.pointerDown.call(this,k,G),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=k.x,this.curveY=k.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(G)&&(this.activeGrip=this.curveGrip,this._state="resize")},T.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ce.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ce.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},T.prototype.setupControlBox=function(){X.prototype.setupControlBox.call(this),this.curveControlLine1=ce.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ce.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},T.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,X.prototype.addControlGrips.call(this)},T.prototype.positionGrips=function(){X.prototype.positionGrips.call(this);var k=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-k/2,this.curveY-k/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},T.prototype.manipulate=function(k){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+k.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+k.y-this.manipulationStartY),X.prototype.manipulate.call(this,k)},T.prototype.resize=function(k){this.activeGrip===this.curveGrip&&(this.curveX=k.x,this.curveY=k.y),X.prototype.resize.call(this,k),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},T.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},T.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},T.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual()},T.prototype.scale=function(k,G){this.curveX=this.curveX*k,this.curveY=this.curveY*G,X.prototype.scale.call(this,k,G)},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},X.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){X.prototype.restoreState.call(this,k);var G=k;this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.curveX=G.curveX,this.curveY=G.curveY,this.createVisual(),this.adjustVisual()},T.typeName="CurveMarker",T.title="Curve marker",T.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>',T}(ut),wt=function(){function X(T,k){k===void 0&&(k=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=T,this.cancelable=k}return Object.defineProperty(X.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),X.prototype.preventDefault=function(){this._defaultPrevented=!0},X}(),St=function(X){function T(k,G,ee){var V=X.call(this,k,!1)||this;return V.dataUrl=G,V.state=ee,V}return Ee(T,X),T}(wt),dt=function(X){function T(k,G,ee){ee===void 0&&(ee=!1);var V=X.call(this,k,ee)||this;return V.marker=G,V}return Ee(T,X),T}(wt),Bt=function(){function X(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return X.prototype.addEventListener=function(T,k){this[T].push(k)},X.prototype.removeEventListener=function(T,k){var G=this[T].indexOf(k);G>-1&&this[T].splice(G,1)},X}(),Lt=function(){function X(T){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Be,this._isOpen=!1,this.undoRedoManager=new mt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Bt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=X.instanceCounter++,this.styles=new ke(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=T,this.targetRoot=document.body,this.width=T.clientWidth,this.height=T.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(X.prototype,"ALL_MARKER_TYPES",{get:function(){return[rt,Re,Ce,We,ot,Ue,he,Se,Ke,re,it,ft]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[rt,Re,Ce,We,Ue,he,Se]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"BASIC_MARKER_TYPES",{get:function(){return[rt,Re,Ce,We,he]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(T){var k=this;this._availableMarkerTypes.splice(0),T.forEach(function(G){if(typeof G=="string"){var ee=k.ALL_MARKER_TYPES.find(function(V){return V.typeName===G});ee!==void 0&&k._availableMarkerTypes.push(ee)}else k._availableMarkerTypes.push(G)})},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(T){this._zoomLevel=T,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),X.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ie.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},X.prototype.show=function(){var T=this;this.styles.styleSheetRoot===void 0&&le.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=le.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(k){return k(new wt(T))})},X.prototype.render=function(){return xe(this,void 0,void 0,function(){var T;return Ie(this,function(k){switch(k.label){case 0:return this.setCurrentMarker(),(T=new fe).naturalSize=this.renderAtNaturalSize,T.imageType=this.renderImageType,T.imageQuality=this.renderImageQuality,T.markersOnly=this.renderMarkersOnly,T.width=this.renderWidth,T.height=this.renderHeight,[4,T.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return k.sent(),[4,T.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,k.sent()]}})})},X.prototype.close=function(T){var k=this;if(T===void 0&&(T=!1),this.isOpen){var G=!1;T||this.eventListeners.beforeclose.forEach(function(ee){var V=new wt(k,!0);ee(V),V.defaultPrevented&&(G=!0)}),G||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(ee){return ee(new wt(k))}),this.detachEvents(),this._isOpen=!1)}},X.prototype.addMarkersToToolbar=function(){for(var T,k=[],G=0;G<arguments.length;G++)k[G]=arguments[G];(T=this._availableMarkerTypes).push.apply(T,k)},X.prototype.addRenderEventListener=function(T){this.addEventListener("render",function(k){T(k.dataUrl,k.state)})},X.prototype.removeRenderEventListener=function(T){},X.prototype.addCloseEventListener=function(T){this.addEventListener("close",function(){T()})},X.prototype.removeCloseEventListener=function(T){},X.prototype.setupResizeObserver=function(){var T=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){T.resize(T.target.clientWidth,T.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return T.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},X.prototype.onPopupTargetResize=function(){var T=1*this.target.clientWidth/this.target.clientHeight,k=this.editorCanvas.clientWidth/T>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*T:this.editorCanvas.clientWidth,G=k<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/T;this.resize(k,G)},X.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},X.prototype.resize=function(T,k){this._isResizing=!0;var G=T/this.imageWidth,ee=k/this.imageHeight;this.imageWidth=Math.round(T),this.imageHeight=Math.round(k),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(G,ee),this._isResizing=!1},X.prototype.scaleMarkers=function(T,k){var G,ee=this;this._currentMarker&&this._currentMarker instanceof We?this._currentMarker.scale(T,k):(G=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(V){V!==ee._currentMarker&&V.scale(T,k)}),G!==void 0&&this.setCurrentMarker(G)},X.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},X.prototype.setTopLeft=function(){var T=this.editingTarget.getBoundingClientRect(),k=this.editorCanvas.getBoundingClientRect();this.left=T.left-k.left,this.top=T.top-k.top},X.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},X.prototype.addDefs=function(){for(var T,k=[],G=0;G<arguments.length;G++)k[G]=arguments[G];this.defs=ce.createDefs(),this.addDefsToImage(),(T=this.defs).append.apply(T,k)},X.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},X.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},X.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},X.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},X.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},X.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},X.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},X.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var T=document.createElement("a");T.href="https://markerjs.com/",T.target="_blank",T.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>',T.title="Powered by marker.js",T.style.display="grid",T.style.alignItems="center",T.style.justifyItems="center",T.style.padding="3px",T.style.width="20px",T.style.height="20px",this.logoUI.appendChild(T),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},X.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},X.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},X.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},X.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var T=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=T+"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 Le(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 Fe(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},X.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},X.prototype.removeMarker=function(T){this.markerImage.removeChild(T.container),this.markers.indexOf(T)>-1&&this.markers.splice(this.markers.indexOf(T),1),T.dispose()},X.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},X.prototype.toolbarButtonClicked=function(T,k){if(T==="marker"&&k!==void 0)this.createNewMarker(k);else if(T==="action")switch(k){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},X.prototype.deleteSelectedMarker=function(){var T=this;if(this._currentMarker!==void 0){var k=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ee){var V=new dt(T,T._currentMarker,!0);ee(V),V.defaultPrevented&&(k=!0)}),!k){var G=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(ee){return ee(new dt(T,G))})}}},X.prototype.clear=function(){var T=this,k=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Te){var ze=new dt(T,void 0,!0);Te(ze),ze.defaultPrevented&&(k=!0)}),!k)){this.setCurrentMarker();for(var G=function(Te){var ze=ee.markers[Te];ee.setCurrentMarker(ee.markers[Te]),ee._currentMarker.dispose(),ee.markerImage.removeChild(ee._currentMarker.container),ee.markers.splice(ee.markers.indexOf(ee._currentMarker),1),ee.eventListeners.markerdelete.forEach(function(tt){return tt(new dt(T,ze))})},ee=this,V=this.markers.length-1;V>=0;V--)G(V);this.addUndoStep()}},Object.defineProperty(X.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),X.prototype.showNotesEditor=function(){var T;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=(T=this._currentMarker.notes)!==null&&T!==void 0?T:"",this.overlayContainer.appendChild(this.notesArea))},X.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},X.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},X.prototype.addUndoStep=function(){var T=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var k=this.getState(),G=this.undoRedoManager.getLastUndoStep();if(!G||G.width===k.width&&G.height===k.height){var ee=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(k),ee<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(V){return V(new wt(T))})}else this.undoRedoManager.replaceLastUndoStep(k),this.eventListeners.statechange.forEach(function(V){return V(new wt(T))})}},X.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},X.prototype.undoStep=function(){var T=this,k=this.undoRedoManager.undo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(G){return G(new wt(T))}))},X.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},X.prototype.redoStep=function(){var T=this,k=this.undoRedoManager.redo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(G){return G(new wt(T))}))},X.prototype.stepZoom=function(){var T=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=T<this.zoomSteps.length-1?this.zoomSteps[T+1]:this.zoomSteps[0]},X.prototype.panTo=function(T){this.contentDiv.scrollBy({left:this.prevPanPoint.x-T.x,top:this.prevPanPoint.y-T.y}),this.prevPanPoint=T},X.prototype.startRenderAndClose=function(){return xe(this,void 0,void 0,function(){var T,k,G=this;return Ie(this,function(ee){switch(ee.label){case 0:return[4,this.render()];case 1:return T=ee.sent(),k=this.getState(),this.eventListeners.render.forEach(function(V){return V(new St(G,T,k))}),this.close(!0),[2]}})})},X.prototype.getState=function(T){T===!0&&this.setCurrentMarker();var k={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(G){return k.markers.push(G.getState())}),k},X.prototype.restoreState=function(T){var k=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);T.markers.forEach(function(G){var ee=k._availableMarkerTypes.find(function(Te){return Te.typeName===G.typeName});if(ee!==void 0){var V=k.addNewMarker(ee);V.restoreState(G),k.markers.push(V)}}),T.width&&T.height&&(T.width!==this.imageWidth||T.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/T.width,this.imageHeight/T.height),this.eventListeners.restorestate.forEach(function(G){return G(new wt(k))})},X.prototype.addNewMarker=function(T){var k=ce.createGroup();return this.markerImage.appendChild(k),new T(k,this.overlayContainer,this.settings)},X.prototype.createNewMarker=function(T){var k,G=this;(k=typeof T=="string"?this._availableMarkerTypes.find(function(ee){return ee.typeName===T}):T)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(k),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(k.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ee){return ee(new dt(G,G._currentMarker))}))},X.prototype.markerCreated=function(T){var k=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(T),this.setCurrentMarker(T),T instanceof Re&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Re):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(G){return G(new dt(k,k._currentMarker))})},X.prototype.colorChanged=function(T){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=T,this.settings.defaultStrokeColor=T)},X.prototype.fillColorChanged=function(T){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=T)},X.prototype.markerStateChanged=function(T){var k=this;this.eventListeners.markerchange.forEach(function(G){return G(new dt(k,T))})},X.prototype.setCurrentMarker=function(T){var k=this;this._currentMarker!==T&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(G){return G(new dt(k,k._currentMarker))})),this._currentMarker=T,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(G){return G(new dt(k,k._currentMarker))}))},X.prototype.onPointerDown=function(T){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||T.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var k=this.markers.find(function(G){return G.ownsTarget(T.target)});k!==void 0?(this.setCurrentMarker(k),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(T.clientX,T.clientY),T.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:T.clientX,y:T.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(T.clientX,T.clientY))},X.prototype.onDblClick=function(T){if(this._isFocused||this.focus(),this.mode==="select"){var k=this.markers.find(function(G){return G.ownsTarget(T.target)});k!==void 0&&k!==this._currentMarker&&this.setCurrentMarker(k),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(T.clientX,T.clientY),T.target):this.setCurrentMarker()}},X.prototype.onPointerMove=function(T){this.touchPoints!==1&&T.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||T.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(T.clientX,T.clientY)):this.zoomLevel>1&&this.panTo({x:T.clientX,y:T.clientY}))},X.prototype.onPointerUp=function(T){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(T.clientX,T.clientY)),this.isDragging=!1,this.addUndoStep()},X.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},X.prototype.onKeyUp=function(T){this._currentMarker===void 0||this.notesArea!==void 0||T.key!=="Delete"&&T.key!=="Backspace"||this.deleteSelectedMarker()},X.prototype.clientToLocalCoordinates=function(T,k){var G=this.markerImage.getBoundingClientRect();return{x:(T-G.left)/this.zoomLevel,y:(k-G.top)/this.zoomLevel}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var T=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=T+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},X.prototype.addLicenseKey=function(T){ie.addKey(T)},X.prototype.addEventListener=function(T,k){this.eventListeners.addEventListener(T,k)},X.prototype.removeEventListener=function(T,k){this.eventListeners.removeEventListener(T,k)},X.prototype.renderState=function(T){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(T),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(X.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),X.prototype.focus=function(){var T=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(k){return k(new wt(T))}))},X.prototype.blur=function(){var T=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(k){return k(new wt(T))}))},X.instanceCounter=0,X}();/* **********************************
|
|
cropro version 1.2.0
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
copyright Alan Mendelevich
|
|
see README and LICENSE for details
|
|
********************************** *//*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var qt=function(X,T){return(qt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,G){k.__proto__=G}||function(k,G){for(var ee in G)Object.prototype.hasOwnProperty.call(G,ee)&&(k[ee]=G[ee])})(X,T)};function Qt(X,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");function k(){this.constructor=X}qt(X,T),X.prototype=T===null?Object.create(T):(k.prototype=T.prototype,new k)}function It(X,T,k,G){return new(k||(k=Promise))(function(ee,V){function Te(pt){try{tt(G.next(pt))}catch(Ye){V(Ye)}}function ze(pt){try{tt(G.throw(pt))}catch(Ye){V(Ye)}}function tt(pt){var Ye;pt.done?ee(pt.value):(Ye=pt.value,Ye instanceof k?Ye:new k(function(_t){_t(Ye)})).then(Te,ze)}tt((G=G.apply(X,T||[])).next())})}function Cr(X,T){var k,G,ee,V,Te={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return V={next:ze(0),throw:ze(1),return:ze(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function ze(tt){return function(pt){return function(Ye){if(k)throw new TypeError("Generator is already executing.");for(;Te;)try{if(k=1,G&&(ee=2&Ye[0]?G.return:Ye[0]?G.throw||((ee=G.return)&&ee.call(G),0):G.next)&&!(ee=ee.call(G,Ye[1])).done)return ee;switch(G=0,ee&&(Ye=[2&Ye[0],ee.value]),Ye[0]){case 0:case 1:ee=Ye;break;case 4:return Te.label++,{value:Ye[1],done:!1};case 5:Te.label++,G=Ye[1],Ye=[0];continue;case 7:Ye=Te.ops.pop(),Te.trys.pop();continue;default:if(!(ee=Te.trys,(ee=ee.length>0&&ee[ee.length-1])||Ye[0]!==6&&Ye[0]!==2)){Te=0;continue}if(Ye[0]===3&&(!ee||Ye[1]>ee[0]&&Ye[1]<ee[3])){Te.label=Ye[1];break}if(Ye[0]===6&&Te.label<ee[1]){Te.label=ee[1],ee=Ye;break}if(ee&&Te.label<ee[2]){Te.label=ee[2],Te.ops.push(Ye);break}ee[2]&&Te.ops.pop(),Te.trys.pop();continue}Ye=T.call(X,Te)}catch(_t){Ye=[6,_t],G=0}finally{k=ee=0}if(5&Ye[0])throw Ye[1];return{value:Ye[0]?Ye[1]:void 0,done:!0}}([tt,pt])}}}var zr=function(){function X(){}return X.addKey=function(T){X.key=T},Object.defineProperty(X,"isLicensed",{get:function(){return!!X.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(X.key)},enumerable:!1,configurable:!0}),X}(),yt=function(){function X(){}return X.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},X.setAttributes=function(T,k){for(var G=0,ee=k;G<ee.length;G++){var V=ee[G],Te=V[0],ze=V[1];T.setAttribute(Te,ze)}},X.createRect=function(T,k,G){var ee=document.createElementNS("http://www.w3.org/2000/svg","rect");return ee.setAttribute("width",T.toString()),ee.setAttribute("height",k.toString()),G&&X.setAttributes(ee,G),ee},X.createLine=function(T,k,G,ee,V){var Te=document.createElementNS("http://www.w3.org/2000/svg","line");return Te.setAttribute("x1",T.toString()),Te.setAttribute("y1",k.toString()),Te.setAttribute("x2",G.toString()),Te.setAttribute("y2",ee.toString()),V&&X.setAttributes(Te,V),Te},X.createPolygon=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","polygon");return G.setAttribute("points",T),k&&X.setAttributes(G,k),G},X.createCircle=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","circle");return G.setAttribute("cx",(T/2).toString()),G.setAttribute("cy",(T/2).toString()),G.setAttribute("r",T.toString()),k&&X.setAttributes(G,k),G},X.createEllipse=function(T,k,G){var ee=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ee.setAttribute("cx",(T/2).toString()),ee.setAttribute("cy",(k/2).toString()),ee.setAttribute("rx",(T/2).toString()),ee.setAttribute("ry",(k/2).toString()),G&&X.setAttributes(ee,G),ee},X.createGroup=function(T){var k=document.createElementNS("http://www.w3.org/2000/svg","g");return T&&X.setAttributes(k,T),k},X.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},X.createMarker=function(T,k,G,ee,V,Te,ze){var tt=document.createElementNS("http://www.w3.org/2000/svg","marker");return X.setAttributes(tt,[["id",T],["orient",k],["markerWidth",G.toString()],["markerHeight",ee.toString()],["refX",V.toString()],["refY",Te.toString()]]),tt.appendChild(ze),tt},X.createText=function(T){var k=document.createElementNS("http://www.w3.org/2000/svg","text");return k.setAttribute("x","0"),k.setAttribute("y","0"),T&&X.setAttributes(k,T),k},X.createTSpan=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","tspan");return G.textContent=T,k&&X.setAttributes(G,k),G},X.createImage=function(T){var k=document.createElementNS("http://www.w3.org/2000/svg","image");return T&&X.setAttributes(k,T),k},X.createPoint=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return G.x=T,G.y=k,G},X.createPath=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","path");return G.setAttribute("d",T),k&&X.setAttributes(G,k),G},X.createElement=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg",T);return k&&X.setAttributes(G,k),G},X.getHollowRectanglePath=function(T,k,G,ee,V,Te,ze,tt){return"M"+T+","+k+"V"+(k+ee)+"H"+(T+G)+"V"+k+"H"+V+"V"+Te+"H"+(V+ze)+"V"+(Te+tt)+"H"+V+"V"+k+"Z"},X}(),Lr=function(){function X(T){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+T+"_"}return Object.defineProperty(X.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#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(X.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),X.prototype.addClass=function(T){return this.styleSheet===void 0&&this.addStyleSheet(),T.name=""+this.classNamePrefix+T.localName,this.classes.push(T),this.styleSheet.sheet.insertRule("."+T.name+" {"+T.style+"}",this.styleSheet.sheet.cssRules.length),T},X.prototype.addRule=function(T){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(T),this.styleSheet.sheet.insertRule(T.selector+" {"+T.style+"}",this.styleSheet.sheet.cssRules.length)},X.prototype.addStyleSheet=function(){var T;this.styleSheet=document.createElement("style"),((T=this.styleSheetRoot)!==null&&T!==void 0?T:document.head).appendChild(this.styleSheet),this.addRule(new bt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new bt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new bt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new xt("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new xt("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},X.prototype.removeStyleSheet=function(){var T;this.styleSheet&&(((T=this.styleSheetRoot)!==null&&T!==void 0?T:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},X}(),bt=function(X,T){this.selector=X,this.style=T},xt=function(X,T){this.localName=X,this.style=T},Ft=function(){function X(){this.blocks=[],this.display=""}return X.prototype.addButtonBlock=function(T){T.className=this.blockClassName,T.buttonClassName=this.buttonClassName,T.buttonColorsClassName=this.buttonColorsClassName,T.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(T)},X.prototype.addElementBlock=function(T){T.className===void 0&&(T.className=this.blockClassName),this.blocks.push(T)},X.prototype.getUI=function(){var T=document.createElement("div");return T.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,T.style.display=this.display,this.blocks.forEach(function(k){return T.appendChild(k.getUI())}),T},X}(),tr=function(){function X(){}return X.prototype.getUI=function(){var T=document.createElement("div");if(T.className=this.className,this.minWidth!==void 0&&(T.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":T.style.justifyContent="flex-start";break;case"center":T.style.justifyContent="center";break;case"end":T.style.justifyContent="flex-end"}return T.style.whiteSpace="nowrap",T},X}(),dr=function(X){function T(){var k=X!==null&&X.apply(this,arguments)||this;return k.buttons=[],k}return Qt(T,X),T.prototype.addButton=function(k){k.className=this.buttonClassName,k.colorsClassName=this.buttonColorsClassName,k.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(k)},T.prototype.getUI=function(){var k=X.prototype.getUI.call(this);return this.buttons.forEach(function(G){return k.appendChild(G.getUI())}),k},T}(tr),Pt=function(){function X(T,k){this._isActive=!1,this._isHidden=!1,this._icon=T,this.title=k,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(X.prototype,"icon",{get:function(){return this._icon},set:function(T){this._icon=T,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isActive",{get:function(){return this._isActive},set:function(T){this._isActive=T,this.adjustClassName()},enumerable:!1,configurable:!0}),X.prototype.getUI=function(){var T=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 T.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},X.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,"")))},X.prototype.hide=function(){this._isHidden=!0},X}(),ct=function(X){function T(){var k=X!==null&&X.apply(this,arguments)||this;return k.elements=[],k}return Qt(T,X),T.prototype.addElement=function(k){this.elements.push(k)},T.prototype.getUI=function(){var k=X.prototype.getUI.call(this);return this.elements.forEach(function(G){return k.appendChild(G)}),k},T}(tr),Br=function(){function X(T,k){this.horizontal=T,this.vertical=k}return Object.defineProperty(X.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),X.prototype.getVerticalLength=function(T){return T/this.ratio},X.prototype.getHorizontalLength=function(T){return T*this.ratio},X}(),Vt=function(){function X(){}return X.getIcon=function(T,k){if(T>0&&k>0){var G=new Br(T,k),ee=G.ratio>=1?20:G.getHorizontalLength(20),V=G.ratio<1?20:G.getVerticalLength(20),Te=document.createElementNS("http://www.w3.org/2000/svg","svg");Te.setAttribute("xmlns","http://www.w3.org/2000/svg"),Te.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Te);var ze=yt.createDefs();Te.appendChild(ze);var tt=yt.createElement("clipPath",[["id","text-bg-clip"]]);ze.appendChild(tt);var pt=yt.createPath(yt.getHollowRectanglePath((24-ee)/2,(24-V)/2,ee,V,(24-ee)/2+2,(24-V)/2+2,ee-4,V-4));Te.appendChild(pt);var Ye=yt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ye.appendChild(yt.createTSpan(T+":"+k)),Te.appendChild(Ye);var _t=Ye.getBBox();yt.setAttributes(Ye,[["x",((24-_t.width)/2).toString()],["y",((24-_t.height)/2-_t.y).toString()]]);var jt=yt.createPath(yt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(_t.width))/2,(24-Math.ceil(_t.height))/2,Math.ceil(_t.width),Math.ceil(_t.height)));return tt.appendChild(jt),yt.setAttributes(pt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Te),Te.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},X}(),Jt=function(X){function T(k,G,ee){var V=X.call(this,k,G)||this;return V.isDropdownOpen=!1,V.onClick=V.dropdownButtonClicked,V.dropdownButtons=ee,V}return Qt(T,X),T.prototype.setupDropdown=function(){var k=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(G){G.className=k.className,G.colorsClassName=k.colorsClassName,k.dropdownBlock.appendChild(G.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},T.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},T.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},T.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},T.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},T.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},T}(Pt),Ot=function(){function X(T,k){this.GRIP_SIZE=10,this.color=T,this.fillColor=k,this.visual=yt.createGroup(),this.visual.appendChild(yt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(yt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(T){return T===this.visual||T===this.visual.childNodes[0]||T===this.visual.childNodes[1]},X.prototype.setCenter=function(T,k){this.visual.childNodes.forEach(function(G){return yt.setAttributes(G,[["cx",T.toString()],["cy",k.toString()]])})},X}(),lr=function(){function X(T,k,G,ee){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=T,this.canvasHeight=k,this.margin=G,this.container=ee,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(X.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(T){this._aspectRatio=T,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(T){this._isGridVisible=T,this.gridContainer&&yt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(T){this._zoomFactor=T,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),X.prototype.open=function(){var T=this;this.cropShadeElement=yt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=yt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var k=0;k<this.numberOfGridLines;k++)this.horizontalGridLines.push(yt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(yt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(G){return T.gridContainer.appendChild(G)}),this.verticalGridLines.forEach(function(G){return T.gridContainer.appendChild(G)}),this.cropRectElement=yt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},X.prototype.setCropRectangle=function(T){this.cropRect=T;var k=Object.assign({},this.cropRect);this.zoomFactor!==1&&(k.width=this.cropRect.width*this.zoomFactor,k.height=this.cropRect.height*this.zoomFactor,k.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-k.width/2,k.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-k.height/2),yt.setAttributes(this.cropRectElement,[["x",k.x.toString()],["y",k.y.toString()],["width",k.width.toString()],["height",k.height.toString()]]);var G=k.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(V,Te){var ze=k.y+G*(Te+1);yt.setAttributes(V,[["x1",""+k.x],["y1",""+ze],["x2",""+(k.x+k.width)],["y2",""+ze]])});var ee=k.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(V,Te){var ze=k.x+ee*(Te+1);yt.setAttributes(V,[["x1",""+ze],["y1",""+k.y],["x2",""+ze],["y2",""+(k.y+k.height)]])}),yt.setAttributes(this.cropShadeElement,[["d",yt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,k.x,k.y,k.width,k.height)]]),this.topLeftGrip.setCenter(k.x,k.y),this.topRightGrip.setCenter(k.x+k.width,k.y),this.bottomLeftGrip.setCenter(k.x,k.y+k.height),this.bottomRightGrip.setCenter(k.x+k.width,k.y+k.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},X.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)},X.prototype.clientToLocalCoordinates=function(T,k){var G=this.container.getBoundingClientRect();return{x:T-G.left+this.margin,y:k-G.top+this.margin}},X.prototype.onPointerDown=function(T){this.container.setPointerCapture(T.pointerId),this.previousPoint=this.clientToLocalCoordinates(T.clientX,T.clientY),this.cropRectElement===T.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(T.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(T.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(T.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(T.target)&&(this.activeGrip=this.bottomRightGrip)},X.prototype.onPointerMove=function(T){if(this.isMoving)this.move(this.clientToLocalCoordinates(T.clientX,T.clientY));else if(this.activeGrip){var k=this.clientToLocalCoordinates(T.clientX,T.clientY);this.resize(k)}T.preventDefault()},X.prototype.onPointerUp=function(T){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(T.pointerId)},X.prototype.move=function(T){var k=T.x-this.previousPoint.x,G=T.y-this.previousPoint.y;this.zoomFactor!==1&&(k=-k/this.zoomFactor,G=-G/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+k),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+G),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=T},X.prototype.resize=function(T){var k=Object.assign({},this.cropRect),G=T.x-this.previousPoint.x,ee=T.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:k.x+G<this.margin&&(G=this.margin-k.x),k.x+=G,k.width=this.cropRect.x+this.cropRect.width-k.x;break;case this.bottomRightGrip:case this.topRightGrip:k.width+G>this.canvasWidth*this.zoomFactor&&(G=this.canvasWidth*this.zoomFactor-k.width),k.width+=G}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(k.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(G),k.height=this.aspectRatio.getVerticalLength(k.width)):(k.y+=ee,k.height=this.cropRect.y+this.cropRect.height-k.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?k.height=this.aspectRatio.getVerticalLength(k.width):k.height+=ee}k.width<10&&(k.x=this.cropRect.x,k.width=10),k.height<10&&(k.y=this.cropRect.y,k.height=10),this.previousPoint=T,k.x>=this.margin&&k.y>=this.margin&&k.x-this.margin+k.width<=this.canvasWidth&&k.y-this.margin+k.height<=this.canvasHeight&&(this.cropRect=k,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},X.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var T=this.cropRect.x+this.cropRect.width/2,k=this.cropRect.y+this.cropRect.height/2,G=this.aspectRatio.getHorizontalLength(this.cropRect.height),ee=this.aspectRatio.getVerticalLength(this.cropRect.width);G/this.canvasWidth<ee/this.canvasHeight?this.cropRect.width=G:this.cropRect.height=ee,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=T-this.cropRect.width/2,this.cropRect.y=k-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},X.prototype.getRescaledRect=function(T,k,G,ee,V,Te){var ze=G/T,tt=ee/k;return{x:(V.x-Te)*ze+Te,y:(V.y-Te)*tt+Te,width:V.width*ze,height:V.height*tt}},X.prototype.scaleCanvas=function(T,k){var G=this.getRescaledRect(this.canvasWidth,this.canvasHeight,T,k,this.cropRect,this.margin);this.canvasWidth=T,this.canvasHeight=k,this.onCropChange&&this.onCropChange(G),this.setCropRectangle(G)},X}(),Ir=function(){function X(T){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=T,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(X.prototype,"angle",{get:function(){return this._angle},set:function(T){this._angle=T,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),X.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},X.prototype.onPointerDown=function(T){this.controlContainer.setPointerCapture(T.pointerId),this.isDragging=!0,this.previousPoint={x:T.clientX,y:T.clientY}},X.prototype.onPointerMove=function(T){this.isDragging&&(this.onAngleChange&&this.onAngleChange((T.clientX-this.previousPoint.x)/5),this.previousPoint.x=T.clientX)},X.prototype.onPointerUp=function(T){this.isDragging&&this.onAngleChange&&this.onAngleChange((T.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(T.pointerId)},X.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var T=this.angleLabelText.getBBox();yt.setAttributes(this.angleLabelElement,[["x",((this.width-T.width)/2).toString()],["y",(this.height/2).toString()]])}},X.prototype.positionScaleShape=function(){if(this.scaleShape){var T=this.scaleShape.transform.baseVal.getItem(0);T.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(T,0)}},X.prototype.getVisual=function(){var T=document.createElementNS("http://www.w3.org/2000/svg","svg");T.setAttribute("xmlns","http://www.w3.org/2000/svg"),T.setAttribute("width",this.width+"px"),T.setAttribute("height",this.height+"px"),T.setAttribute("viewBox","0 0 "+this.width+" "+this.height),T.style.flexShrink="0",document.body.appendChild(T);for(var k="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,G=1;G<=this.width/5+10;G++){var ee=G%5==0?this.height/3:this.height/6;k+="h4v"+-ee+"h1v"+ee}k+="v1H0Z",this.scaleShape=yt.createPath(k);var V=yt.createTransform();this.scaleShape.transform.baseVal.appendItem(V),T.appendChild(this.scaleShape),this.angleLabelElement=yt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=yt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Te=yt.createTSpan("");return Te.innerHTML="°",this.angleLabelElement.appendChild(Te),T.appendChild(this.angleLabelElement),document.body.removeChild(T),T},X}(),Yr=function(){function X(){this.naturalSize=!1,this.imageType="image/png"}return X.prototype.rasterize=function(T,k,G,ee,V,Te,ze){var tt=this;return new Promise(function(pt){var Ye=document.createElement("canvas");Ye.width=T.width.baseVal.value-2*ee,Ye.height=T.height.baseVal.value-2*ee;var _t=1,jt=1;tt.naturalSize===!0?(_t=k.naturalWidth/(T.width.baseVal.value-2*ee)/Te,jt=k.naturalHeight/(T.height.baseVal.value-2*ee)/ze,Ye.width=k.naturalWidth/Te,Ye.height=k.naturalHeight/ze):tt.width!==void 0&&tt.height!==void 0&&(_t=tt.width/G.width,jt=tt.height/G.height,Ye.width*=_t,Ye.height*=jt);var $t=Ye.getContext("2d");$t.translate(Ye.width/2,Ye.height/2),$t.rotate(V*Math.PI/180),$t.scale(Te,ze),$t.translate(-Ye.width/2,-Ye.height/2),$t.drawImage(k,0,0,Ye.width,Ye.height);var jr=document.createElement("canvas");jr.width=G.width*_t,jr.height=G.height*jt,jr.getContext("2d").putImageData($t.getImageData((G.x-ee)*_t,(G.y-ee)*jt,G.width*_t,G.height*jt),0,0),pt(jr.toDataURL(tt.imageType,tt.imageQuality))})},X}(),Qe=function(){function X(T){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=X.instanceCounter++,this.styles=new Lr(this.instanceNo),this.target=T,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(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(T){this._zoomToCropEnabled=T,T?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(T){this._isGridVisible=T,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"gridLines",{get:function(){return this._gridLines},set:function(T){this._gridLines=T,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(T){this._rotationAngle=T,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"aspectRatio",{get:function(){var T;return(T=this._aspectRatio)!==null&&T!==void 0?T:this.aspectRatios[0]},set:function(T){this._aspectRatio=T},enumerable:!1,configurable:!0}),X.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},X.prototype.show=function(){this.showUI(),this.open()},X.prototype.close=function(T){T===void 0&&(T=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),T||this.closeEventListeners.forEach(function(k){return k()}),this._isOpen=!1)},X.prototype.addRenderEventListener=function(T){this.renderEventListeners.push(T)},X.prototype.removeRenderEventListener=function(T){this.renderEventListeners.indexOf(T)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(T),1)},X.prototype.addCloseEventListener=function(T){this.closeEventListeners.push(T)},X.prototype.removeCloseEventListener=function(T){this.closeEventListeners.indexOf(T)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(T),1)},X.prototype.setupResizeObserver=function(){var T=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){T.resize(T.target.clientWidth,T.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))},X.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var T=1*this.target.clientWidth/this.target.clientHeight,k=this.contentDiv.clientWidth/T>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*T:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,G=k+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/T;this.resize(k,G)}},X.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},X.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",yt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},X.prototype.resize=function(T,k){this.imageWidth=Math.round(T),this.imageHeight=Math.round(k),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},X.prototype.setEditingTarget=function(){var T=document.createElement("canvas");T.width=this.target.naturalWidth,T.height=this.target.naturalHeight,T.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var k=T.toDataURL();yt.setAttributes(this.editingTarget,[["href",k]]),this.setEditingTargetSize()},X.prototype.setTopLeft=function(){var T=this.target.getBoundingClientRect(),k=this.editorCanvas.getBoundingClientRect();this.left=T.left-k.left-this.CANVAS_MARGIN,this.top=T.top-k.top-this.CANVAS_MARGIN},X.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=yt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=yt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=yt.createGroup(),this.editingTargetRotationScaleContainer=yt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var T=yt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(T);var k=yt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(k),this.editingTargetContainer=yt.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},X.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},X.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=yt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new lr(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},X.prototype.zoomToCrop=function(){if(this.cropRect){var T=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,k=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=T+"px "+k+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-T+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-k+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},X.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)},X.prototype.cropRectChanged=function(T){this.cropRect=T,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},X.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},X.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},X.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},X.prototype.showUI=function(){switch(this.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 T=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,k=this.target.offsetTop>T+this.CANVAS_MARGIN?this.target.offsetTop-(T+this.CANVAS_MARGIN):0;this.coverDiv.style.top=k+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},X.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},X.prototype.addTopToolbar=function(){var T=this;this.topToolbar=new Ft,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var k=new dr;k.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(k);var G=[];this.aspectRatios.forEach(function(jt){var $t=new Pt(Vt.getIcon(jt.horizontal,jt.vertical),jt.horizontal===0&&jt.vertical===0?"FREE":jt.horizontal+":"+jt.vertical);$t.onClick=function(){return T.ratioButtonClicked(jt)},G.push($t)}),this.aspectRatioButton=new Jt(Vt.getIcon(0,0),"Aspect ratio",G),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,k.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ee=new Pt('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");ee.isActive=this.isGridVisible,ee.onClick=function(){T.isGridVisible=!T.isGridVisible,ee.isActive=T.isGridVisible},k.addButton(ee);var V=new Pt('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(V.isActive=this.zoomToCropEnabled,V.onClick=function(){T.zoomToCropEnabled=!T.zoomToCropEnabled,V.isActive=T.zoomToCropEnabled},k.addButton(V),!zr.isLicensed){var Te=new ct;this.topToolbar.addElementBlock(Te);var ze=document.createElement("div");ze.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var tt=document.createElement("a");tt.style.color="currentColor",tt.href="https://markerjs.com/products/cropro",tt.target="_blank",tt.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>',ze.appendChild(tt),Te.addElement(ze)}var pt=new dr;pt.minWidth=3*this.toolbarHeight+"px",pt.contentAlign="end",this.topToolbar.addButtonBlock(pt);var Ye=new Pt('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");Ye.onClick=this.startRenderAndClose,pt.addButton(Ye),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ye.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var _t=new Pt('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");_t.onClick=this.close,pt.addButton(_t),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(_t.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},X.prototype.addBottomToolbar=function(){var T=this;this.bottomToolbar=new Ft,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var k=new dr;k.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(k);var G=new Pt('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");G.onClick=this.rotateLeftButtonClicked,k.addButton(G);var ee=new Pt('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");ee.onClick=this.rotateRightButtonClicked,k.addButton(ee);var V=new ct;V.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(V),this.straightener=new Ir("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(pt){T.rotateBy(pt),T.straightener.angle=T.rotationAngle},V.addElement(this.straightener.getUI());var Te=new dr;Te.minWidth=2*this.toolbarHeight+"px",Te.contentAlign="end",this.bottomToolbar.addButtonBlock(Te);var ze=new Pt('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");ze.onClick=this.flipHorizontallyButtonClicked,Te.addButton(ze);var tt=new Pt('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");tt.onClick=this.flipVerticallyButtonClicked,Te.addButton(tt)},X.prototype.ratioButtonClicked=function(T){this.aspectRatio=T,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},X.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Vt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},X.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Br(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},X.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},X.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},X.prototype.restoreState=function(T){if(T){var k=this.cropLayer.getRescaledRect(T.width,T.height,this.imageWidth,this.imageHeight,T.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(k),this.cropRectChanged(k),this.flippedHorizontally=T.flippedHorizontally,this.flippedVertically=T.flippedVertically,this.applyFlip(),this.rotationAngle=T.rotationAngle,this.applyRotation()}},X.prototype.clientToLocalCoordinates=function(T,k){var G=this.cropImage.getBoundingClientRect();return{x:T-G.left,y:k-G.top}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var T=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=T+"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()},X.prototype.rotateLeftButtonClicked=function(){var T=this.rotationAngle-90;this.rotationAngle%90!=0&&(T+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(T)},X.prototype.rotateRightButtonClicked=function(){var T=this.rotationAngle+90;this.rotationAngle%90!=0&&(T-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(T)},X.prototype.rotateTo=function(T){T=(T=T>180?T-360:T)<=-180?T+360:T,this.rotationAngle=T,this.applyRotation()},X.prototype.rotateBy=function(T){this.rotateTo((this.rotationAngle+T)%360)},X.prototype.applyRotation=function(){var T=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var k=this.editingTargetRotationContainer.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(k,0);var G=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/G.width,this.imageHeight/G.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=T},X.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},X.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},X.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},X.prototype.startRenderAndClose=function(){return It(this,void 0,void 0,function(){var T,k;return Cr(this,function(G){switch(G.label){case 0:return[4,this.render()];case 1:return T=G.sent(),k=this.getState(),this.renderEventListeners.forEach(function(ee){return ee(T,k)}),this.close(!0),[2]}})})},X.prototype.render=function(){return It(this,void 0,void 0,function(){var T;return Cr(this,function(k){switch(k.label){case 0:return(T=new Yr).naturalSize=this.renderAtNaturalSize,T.imageType=this.renderImageType,T.imageQuality=this.renderImageQuality,T.width=this.renderWidth,T.height=this.renderHeight,this.unzoomFromCrop(),yt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,T.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return k.sent(),[4,T.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,k.sent()]}})})},X.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new xt("toolbar",`
|
|
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
height: `+this.toolbarHeight+`px;
|
|
box-sizing: content-box;
|
|
overflow: hidden;
|
|
line-height: 0px;
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new xt("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new xt("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var T=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new xt("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*T)+`px;
|
|
height: `+(this.toolbarHeight-2*T)+`px;
|
|
padding: `+T+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new xt("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new xt("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new bt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new bt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new xt("toolbar_dropdown",`
|
|
position: absolute;
|
|
max-width: `+4*this.toolbarHeight+`px;
|
|
z-index: 20;
|
|
white-space: normal;
|
|
box-sizing: content-box;
|
|
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
|
|
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
|
|
line-height: 0px;
|
|
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new xt("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new xt("toolbar_straightener_block",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
|
|
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new xt("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*T)+`px;
|
|
padding: `+T+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new xt("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},X.instanceCounter=0,X}(),Ct=Q("8hTe"),mn=Q.n(Ct),gn=/<pre[^>]*>/g;function vn(X){var T=document.createElement("div");return T.innerHTML=X,T.childNodes.length===0?"":T.childNodes[0].nodeValue}var yn=ye.a=function(X){var T=X.value,k=T===void 0?"":T,G=X.edit,ee=G===void 0?!1:G,V=X.className,Te=X.showTextOnly,ze=X.showLines,tt=X.replaces,pt=X.zoomImg,Ye=X.hasMask,_t=X.style,jt=_t===void 0?{}:_t,$t=X.stylesPrev,jr=$t===void 0?{}:$t,Er=String(k),xr=Object(L.useRef)(),Qr=Object(L.useRef)(),Dn=Object(L.useState)(""),cr=Object(z.a)(Dn,2),Kr=cr[0],un=cr[1],hn=Object(L.useState)("office"),Hr=Object(z.a)(hn,2),kn=Hr[0],bn=Hr[1],Kn=function(){var Ht=new Qe(Qr.current);Ht.displayMode="popup",Ht.addRenderEventListener(function(){var yr=Object(U.a)(r.a.mark(function kt(ar){var zt;return r.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:return xr.current.style.display="none",fr.next=3,Object(Oe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ar}});case 3:zt=fr.sent,zt!=null&&zt.id&&tt(Qr.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(zt==null?void 0:zt.id,"?type=").concat(zt.content_type));case 5:case"end":return fr.stop()}},kt)}));return function(kt){return yr.apply(this,arguments)}}()),Ht.show()},Vn=function(){var Ht=new Lt(Qr.current);Ht.settings.displayMode="popup",Ht.addEventListener("render",function(){var yr=Object(U.a)(r.a.mark(function kt(ar){var zt;return r.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:if(xr.current.style.display="none",!Qr.current){fr.next=6;break}return fr.next=4,Object(Oe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ar.dataUrl}});case 4:zt=fr.sent,zt!=null&&zt.id&&tt(Qr.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(zt==null?void 0:zt.id,"?type=").concat(zt.content_type));case 6:case"end":return fr.stop()}},kt)}));return function(kt){return yr.apply(this,arguments)}}()),Ht.show(),window.markerArea=Ht},Zr=Object(L.useMemo)(function(){xr.current&&(xr.current.style.zIndex=-1);try{var nr=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ht=/\"\/api\/attachments\/|\"\/attachments\/download\//g,yr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Er=Er.replace(nr,"("+$.a.API_SERVER+"/api/attachments/").replace(Ht,'"'+$.a.API_SERVER+"/api/attachments/").replace(yr,'"'+$.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`)}catch(nn){}var kt=M(Er),ar=w();if(Er.match(/\[TOC\]/)&&(kt=kt.replace("<p>[TOC]</p>",D()),R()),kt=kt.replace(/(__special_katext_id_\d+__)/g,function(nn,fr){var Ar=ar[fr],Xn=Ar.type,xn=Ar.expression;return Object(ae.renderToString)(vn(xn)||"",{displayMode:Xn==="block",throwOnError:!1,output:"html"})}),kt=kt.replace(/▁/g,"\u2581\u2581\u2581"),b(),Te){var zt=document.createElement("div");return zt.innerHTML=kt,zt.innerText}return setTimeout(function(){return di()},500),kt},[Er]),$r=Object(L.useRef)();E.WebkitLineClamp=ze,ze&&(jt=Object(j.a)(Object(j.a)({},jt),E));function _n(nr){var Ht=nr.target;if(Ht.tagName.toUpperCase()==="IMG"){if(pt){var yr=Ht.getAttribute("src");un(yr),bn("image")}}else if(Ht.tagName.toUpperCase()==="A"){var kt=Ht.getAttribute("href");if(kt.indexOf("office")>-1)nr.preventDefault(),un(kt),bn("office");else if(kt.indexOf("application/pdf")>-1)nr.preventDefault(),un(kt),bn("pdf");else if(kt.indexOf("text/html")>-1)nr.preventDefault(),un(kt),bn("html");else if(kt.startsWith("#")){nr.preventDefault();var ar=document.getElementById(kt.replace("#",""));ar&&ar.scrollIntoView(!0)}}}var di=function(){var Ht,yr=(Ht=$r.current)===null||Ht===void 0?void 0:Ht.querySelectorAll("video");yr==null||yr.forEach(function(kt){if(kt.oncontextmenu=function(){return!1},kt.src.indexOf(".m3u8")>-1&&!kt.canPlayType("application/vnd.apple.mpegurl")){if(W.a.isSupported()){var ar=new W.a;ar.loadSource(kt.src),ar.attachMedia(kt)}}})};Object(L.useEffect)(function(){if($r.current&&Zr&&(Zr.match(gn)&&window.PR.prettyPrint()),$r.current)return $r.current.addEventListener("click",_n),function(){$r.current.removeEventListener("click",_n),b(),R()}},[Zr,$r.current,_n]);var En=function(Ht){if(!ee)return;Ht.target.nodeName==="IMG"?(xr.current.style.zIndex=1,xr.current.style.display="flex",xr.current.style.width=Ht.target.clientWidth+"px",xr.current.style.height=Ht.target.clientHeight+"px",xr.current.style.top=Ht.target.offsetTop+"px",xr.current.style.left=Ht.target.offsetLeft+"px",Qr.current.src=Ht.target.getAttribute("src")):xr.current.style.display="none"};return v.a.createElement("div",{style:{position:"relative"}},v.a.createElement("div",{ref:$r,style:Object(j.a)({},jt),className:"".concat(V||""," markdown-body ").concat(mn.a.mdBody),onMouseOver:En,dangerouslySetInnerHTML:{__html:Zr}}),v.a.createElement("div",{ref:xr,className:mn.a.button},v.a.createElement(J.a,null,v.a.createElement(Y.a,{onClick:function(){return Kn()}},"\u88C1\u526A"),v.a.createElement(Y.a,{onClick:function(){return Vn()}},"\u7F16\u8F91"))),v.a.createElement("img",{ref:Qr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),v.a.createElement(ue.a,{close:!0,data:Kr,type:Kr!=null&&Kr.length?kn:"",style:Object(j.a)({},jr),onClose:function(){return un("")}}))}},"9VGf":function(nt,ye,Q){"use strict";Q.d(ye,"a",function(){return P});var ne=Q("q1tI"),J=Q.n(ne);function P(Y,j){var U=Object(ne.useRef)();Object(ne.useEffect)(function(){U.current=Y}),Object(ne.useEffect)(function(){function z(){U.current()}if(j!==null){var H=setInterval(z,j);return function(){return clearInterval(H)}}},[j])}},BU3w:function(nt,ye,Q){"use strict";Q.d(ye,"a",function(){return U});var ne=Q("MNnm"),J="rc-util-key";function P(z){if(z.attachTo)return z.attachTo;var H=document.querySelector("head");return H||document.body}function Y(z){var H,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ne.a)())return null;var L=document.createElement("style");if((H=r.csp)===null||H===void 0?void 0:H.nonce){var v;L.nonce=(v=r.csp)===null||v===void 0?void 0:v.nonce}L.innerHTML=z;var g=P(r),p=g.firstChild;return r.prepend&&g.prepend?g.prepend(L):r.prepend&&p?g.insertBefore(L,p):g.appendChild(L),L}var j=new Map;function U(z,H){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},L=P(r);if(!j.has(L)){var v=Y("",r),g=v.parentNode;j.set(L,g),g.removeChild(v)}var p=Array.from(j.get(L).children).find(function(l){return l.tagName==="STYLE"&&l[J]===H});if(p){var u,h;if(((u=r.csp)===null||u===void 0?void 0:u.nonce)&&p.nonce!==((h=r.csp)===null||h===void 0?void 0:h.nonce)){var c;p.nonce=(c=r.csp)===null||c===void 0?void 0:c.nonce}return p.innerHTML!==z&&(p.innerHTML=z),p}var o=Y(z,r);return o[J]=H,o}},Bd2K:function(nt,ye,Q){(function(ne){ne(Q("VrN/"),Q("osHv"))})(function(ne){ne.defineOption("autoCloseTags",!1,function(r,L,v){if(v!=ne.Init&&v&&r.removeKeyMap("autoCloseTags"),!L)return;var g={name:"autoCloseTags"};(typeof L!="object"||L.whenClosing!==!1)&&(g["'/'"]=function(p){return U(p)}),(typeof L!="object"||L.whenOpening!==!1)&&(g["'>'"]=function(p){return Y(p)}),r.addKeyMap(g)});var J=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],P=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function Y(r){if(r.getOption("disableInput"))return ne.Pass;for(var L=r.listSelections(),v=[],g=r.getOption("autoCloseTags"),p=0;p<L.length;p++){if(!L[p].empty())return ne.Pass;var u=L[p].head,h=r.getTokenAt(u),c=ne.innerMode(r.getMode(),h.state),o=c.state,l=c.mode.xmlCurrentTag&&c.mode.xmlCurrentTag(o),s=l&&l.name;if(!s)return ne.Pass;var a=c.mode.configuration=="html",R=typeof g=="object"&&g.dontCloseTags||a&&J,E=typeof g=="object"&&g.indentTags||a&&P;h.end>u.ch&&(s=s.slice(0,s.length-h.end+u.ch));var S=s.toLowerCase();if(!s||h.type=="string"&&(h.end!=u.ch||!/[\"\']/.test(h.string.charAt(h.string.length-1))||h.string.length==1)||h.type=="tag"&&l.close||h.string.indexOf("/")==u.ch-h.start-1||R&&z(R,S)>-1||H(r,c.mode.xmlCurrentContext&&c.mode.xmlCurrentContext(o)||[],s,u,!0))return ne.Pass;var D=typeof g=="object"&&g.emptyTags;if(D&&z(D,s)>-1){v[p]={text:"/>",newPos:ne.Pos(u.line,u.ch+2)};continue}var A=E&&z(E,S)>-1;v[p]={indent:A,text:">"+(A?`
|
|
|
|
`:"")+"</"+s+">",newPos:A?ne.Pos(u.line+1,0):ne.Pos(u.line,u.ch+1)}}for(var O=typeof g=="object"&&g.dontIndentOnAutoClose,p=L.length-1;p>=0;p--){var C=v[p];r.replaceRange(C.text,L[p].head,L[p].anchor,"+insert");var x=r.listSelections().slice(0);x[p]={head:C.newPos,anchor:C.newPos},r.setSelections(x),!O&&C.indent&&(r.indentLine(C.newPos.line,null,!0),r.indentLine(C.newPos.line+1,null,!0))}}function j(r,L){for(var v=r.listSelections(),g=[],p=L?"/":"</",u=r.getOption("autoCloseTags"),h=typeof u=="object"&&u.dontIndentOnSlash,c=0;c<v.length;c++){if(!v[c].empty())return ne.Pass;var o=v[c].head,l=r.getTokenAt(o),s=ne.innerMode(r.getMode(),l.state),a=s.state;if(L&&(l.type=="string"||l.string.charAt(0)!="<"||l.start!=o.ch-1))return ne.Pass;var R,E=s.mode.name!="xml"&&r.getMode().name=="htmlmixed";if(E&&s.mode.name=="javascript")R=p+"script";else if(E&&s.mode.name=="css")R=p+"style";else{var S=s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(a);if(!S||S.length&&H(r,S,S[S.length-1],o))return ne.Pass;R=p+S[S.length-1]}r.getLine(o.line).charAt(l.end)!=">"&&(R+=">"),g[c]=R}if(r.replaceSelections(g),v=r.listSelections(),!h)for(var c=0;c<v.length;c++)(c==v.length-1||v[c].head.line<v[c+1].head.line)&&r.indentLine(v[c].head.line)}function U(r){return r.getOption("disableInput")?ne.Pass:j(r,!0)}ne.commands.closeTag=function(r){return j(r)};function z(r,L){if(r.indexOf)return r.indexOf(L);for(var v=0,g=r.length;v<g;++v)if(r[v]==L)return v;return-1}function H(r,L,v,g,p){if(!ne.scanForClosingTag)return!1;var u=Math.min(r.lastLine()+1,g.line+500),h=ne.scanForClosingTag(r,g,null,u);if(!h||h.tag!=v)return!1;for(var c=p?1:0,o=L.length-1;o>=0&&L[o]==v;o--)++c;g=h.to;for(var o=1;o<c;o++){var l=ne.scanForClosingTag(r,g,null,u);if(!l||l.tag!=v)return!1;g=l.to}return!0}})},BjJ7:function(nt,ye,Q){"use strict";Q.d(ye,"d",function(){return J}),Q.d(ye,"c",function(){return P}),Q.d(ye,"e",function(){return Y}),Q.d(ye,"b",function(){return j}),Q.d(ye,"a",function(){return z});var ne=Q("m3rI");function J(H){var r=!0;if(H.length>0){for(var L=0;L<H.length;L++)if(H[L].compile_success==0||!H[L].compile_success){r=!1;break}}else r=!1;return r}function P(H){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",L=[],v=0;v<H.length;v++){var g=H[v],p=r?"".concat(r,"/").concat(g.name):"".concat(g.name);L.push({title:g.name,isLeaf:!(g.type==="tree"),key:p})}return L}function Y(H,r,L){for(var v=0;v<H.length;v++){var g=H[v];if(g.key===r){g.children=L;break}g.children&&Y(g.children,r,L)}return H}function j(H,r,L){var v;return function(){var g=this,p=arguments,u=function(){v=null,L||H.apply(g,p)},h=L&&!v;clearTimeout(v),v=setTimeout(u,r),h&&H.apply(g,p)}}var U=!0,z=ne.a.API_SERVER},"C+DQ":function(nt,ye,Q){},"C/vA":function(nt,ye,Q){"use strict";Q.d(ye,"a",function(){return ne});function ne(J){const P=this;let Y=!1,j;return function(){return Y||(Y=!0,j=J.apply(P,arguments)),j}}},"Cg/j":function(nt,ye,Q){"use strict";Q.d(ye,"b",function(){return ne}),Q.d(ye,"a",function(){return J}),Q.d(ye,"c",function(){return Y}),Q.d(ye,"d",function(){return j});var ne;(function(U){U.serviceIds=new Map,U.DI_TARGET="$di$target",U.DI_DEPENDENCIES="$di$dependencies";function z(H){return H[U.DI_DEPENDENCIES]||[]}U.getServiceDependencies=z})(ne||(ne={}));const J=Y("instantiationService");function P(U,z,H,r){z[ne.DI_TARGET]===z?z[ne.DI_DEPENDENCIES].push({id:U,index:H,optional:r}):(z[ne.DI_DEPENDENCIES]=[{id:U,index:H,optional:r}],z[ne.DI_TARGET]=z)}function Y(U){if(ne.serviceIds.has(U))return ne.serviceIds.get(U);const z=function(H,r,L){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");P(z,H,L,!1)};return z.toString=()=>U,ne.serviceIds.set(U,z),z}function j(U){return function(z,H,r){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");P(U,z,r,!0)}}},DlQD:function(nt,ye,Q){(function(ne,J){nt.exports=J()})(this,function(){"use strict";function ne(Re,be){for(var Ce=0;Ce<be.length;Ce++){var re=be[Ce];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(Re,re.key,re)}}function J(Re,be,Ce){return be&&ne(Re.prototype,be),Ce&&ne(Re,Ce),Re}function P(Re,be){if(!Re)return;if(typeof Re=="string")return Y(Re,be);var Ce=Object.prototype.toString.call(Re).slice(8,-1);if(Ce==="Object"&&Re.constructor&&(Ce=Re.constructor.name),Ce==="Map"||Ce==="Set")return Array.from(Re);if(Ce==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ce))return Y(Re,be)}function Y(Re,be){(be==null||be>Re.length)&&(be=Re.length);for(var Ce=0,re=new Array(be);Ce<be;Ce++)re[Ce]=Re[Ce];return re}function j(Re,be){var Ce;if(typeof Symbol=="undefined"||Re[Symbol.iterator]==null){if(Array.isArray(Re)||(Ce=P(Re))||be&&Re&&typeof Re.length=="number"){Ce&&(Re=Ce);var re=0;return function(){return re>=Re.length?{done:!0}:{done:!1,value:Re[re++]}}}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 Ce=Re[Symbol.iterator](),Ce.next.bind(Ce)}function U(Re,be){return be={exports:{}},Re(be,be.exports),be.exports}var z=U(function(Re){function be(){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 Ce(re){Re.exports.defaults=re}Re.exports={defaults:be(),getDefaults:be,changeDefaults:Ce}}),H=z.defaults,r=z.getDefaults,L=z.changeDefaults,v=/[&<>"']/,g=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,h={"&":"&","<":"<",">":">",'"':""","'":"'"},c=function(be){return h[be]};function o(Re,be){if(be){if(v.test(Re))return Re.replace(g,c)}else if(p.test(Re))return Re.replace(u,c);return Re}var l=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(Re){return Re.replace(l,function(be,Ce){return Ce=Ce.toLowerCase(),Ce==="colon"?":":Ce.charAt(0)==="#"?Ce.charAt(1)==="x"?String.fromCharCode(parseInt(Ce.substring(2),16)):String.fromCharCode(+Ce.substring(1)):""})}var a=/(^|[^\[])\^/g;function R(Re,be){Re=Re.source||Re,be=be||"";var Ce={replace:function(se,he){return he=he.source||he,he=he.replace(a,"$1"),Re=Re.replace(se,he),Ce},getRegex:function(){return new RegExp(Re,be)}};return Ce}var E=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(Re,be,Ce){if(Re){var re;try{re=decodeURIComponent(s(Ce)).replace(E,"").toLowerCase()}catch(se){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}be&&!S.test(Ce)&&(Ce=f(be,Ce));try{Ce=encodeURI(Ce).replace(/%25/g,"%")}catch(se){return null}return Ce}var A={},O=/^[^:]+:\/*[^/]*$/,C=/^([^:]+:)[\s\S]*$/,x=/^([^:]+:\/*[^/]*)[\s\S]*$/;function f(Re,be){A[" "+Re]||(O.test(Re)?A[" "+Re]=Re+"/":A[" "+Re]=B(Re,"/",!0)),Re=A[" "+Re];var Ce=Re.indexOf(":")===-1;return be.substring(0,2)==="//"?Ce?be:Re.replace(C,"$1")+be:be.charAt(0)==="/"?Ce?be:Re.replace(x,"$1")+be:Re+be}var w={exec:function(){}};function b(Re){for(var be=1,Ce,re;be<arguments.length;be++){Ce=arguments[be];for(re in Ce)Object.prototype.hasOwnProperty.call(Ce,re)&&(Re[re]=Ce[re])}return Re}function y(Re,be){var Ce=Re.replace(/\|/g,function(he,me,Se){for(var Ue=!1,Ke=me;--Ke>=0&&Se[Ke]==="\\";)Ue=!Ue;return Ue?"|":" |"}),re=Ce.split(/ \|/),se=0;if(re.length>be)re.splice(be);else for(;re.length<be;)re.push("");for(;se<re.length;se++)re[se]=re[se].trim().replace(/\\\|/g,"|");return re}function B(Re,be,Ce){var re=Re.length;if(re===0)return"";for(var se=0;se<re;){var he=Re.charAt(re-se-1);if(he===be&&!Ce)se++;else if(he!==be&&Ce)se++;else break}return Re.substr(0,re-se)}function F(Re,be){if(Re.indexOf(be[1])===-1)return-1;for(var Ce=Re.length,re=0,se=0;se<Ce;se++)if(Re[se]==="\\")se++;else if(Re[se]===be[0])re++;else if(Re[se]===be[1]&&(re--,re<0))return se;return-1}function _(Re){Re&&Re.sanitize&&!Re.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 M={escape:o,unescape:s,edit:R,cleanUrl:D,resolveUrl:f,noopTest:w,merge:b,splitCells:y,rtrim:B,findClosingBracket:F,checkSanitizeDeprecation:_},I=z.defaults,m=M.rtrim,W=M.splitCells,$=M.escape,ae=M.findClosingBracket;function ue(Re,be,Ce){var re=be.href,se=be.title?$(be.title):null,he=Re[1].replace(/\\([\[\]])/g,"$1");return Re[0].charAt(0)!=="!"?{type:"link",raw:Ce,href:re,title:se,text:he}:{type:"image",raw:Ce,href:re,title:se,text:$(he)}}function Oe(Re,be){var Ce=Re.match(/^(\s+)(?:```)/);if(Ce===null)return be;var re=Ce[1];return be.split(`
|
|
`).map(function(se){var he=se.match(/^\s+/);if(he===null)return se;var me=he[0];return me.length>=re.length?se.slice(re.length):se}).join(`
|
|
`)}var ve=function(){function Re(Ce){this.options=Ce||I}var be=Re.prototype;return be.space=function(re){var se=this.rules.block.newline.exec(re);if(se)return se[0].length>1?{type:"space",raw:se[0]}:{raw:`
|
|
`}},be.code=function(re,se){var he=this.rules.block.code.exec(re);if(he){var me=se[se.length-1];if(me&&me.type==="paragraph")return{raw:he[0],text:he[0].trimRight()};var Se=he[0].replace(/^ {4}/gm,"");return{type:"code",raw:he[0],codeBlockStyle:"indented",text:this.options.pedantic?Se:m(Se,`
|
|
`)}}},be.fences=function(re){var se=this.rules.block.fences.exec(re);if(se){var he=se[0],me=Oe(he,se[3]||"");return{type:"code",raw:he,lang:se[2]?se[2].trim():se[2],text:me}}},be.heading=function(re){var se=this.rules.block.heading.exec(re);if(se)return{type:"heading",raw:se[0],depth:se[1].length,text:se[2]}},be.nptable=function(re){var se=this.rules.block.nptable.exec(re);if(se){var he={type:"table",header:W(se[1].replace(/^ *| *\| *$/g,"")),align:se[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:se[3]?se[3].replace(/\n$/,"").split(`
|
|
`):[],raw:se[0]};if(he.header.length===he.align.length){var me=he.align.length,Se;for(Se=0;Se<me;Se++)/^ *-+: *$/.test(he.align[Se])?he.align[Se]="right":/^ *:-+: *$/.test(he.align[Se])?he.align[Se]="center":/^ *:-+ *$/.test(he.align[Se])?he.align[Se]="left":he.align[Se]=null;for(me=he.cells.length,Se=0;Se<me;Se++)he.cells[Se]=W(he.cells[Se],he.header.length);return he}}},be.hr=function(re){var se=this.rules.block.hr.exec(re);if(se)return{type:"hr",raw:se[0]}},be.blockquote=function(re){var se=this.rules.block.blockquote.exec(re);if(se){var he=se[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:se[0],text:he}}},be.list=function(re){var se=this.rules.block.list.exec(re);if(se){for(var he=se[0],me=se[2],Se=me.length>1,Ue=me[me.length-1]===")",Ke={type:"list",raw:he,ordered:Se,start:Se?+me.slice(0,-1):"",loose:!1,items:[]},ot=se[0].match(this.rules.block.item),mt=!1,ft,wt,St,dt,Bt,Lt,qt,Qt=ot.length,It=0;It<Qt;It++)ft=ot[It],he=ft,wt=ft.length,ft=ft.replace(/^ *([*+-]|\d+[.)]) */,""),~ft.indexOf(`
|
|
`)&&(wt-=ft.length,ft=this.options.pedantic?ft.replace(/^ {1,4}/gm,""):ft.replace(new RegExp("^ {1,"+wt+"}","gm"),"")),It!==Qt-1&&(St=this.rules.block.bullet.exec(ot[It+1])[0],(Se?St.length===1||!Ue&&St[St.length-1]===")":St.length>1||this.options.smartLists&&St!==me)&&(dt=ot.slice(It+1).join(`
|
|
`),Ke.raw=Ke.raw.substring(0,Ke.raw.length-dt.length),It=Qt-1)),Bt=mt||/\n\n(?!\s*$)/.test(ft),It!==Qt-1&&(mt=ft.charAt(ft.length-1)===`
|
|
`,Bt||(Bt=mt)),Bt&&(Ke.loose=!0),Lt=/^\[[ xX]\] /.test(ft),qt=void 0,Lt&&(qt=ft[1]!==" ",ft=ft.replace(/^\[[ xX]\] +/,"")),Ke.items.push({type:"list_item",raw:he,task:Lt,checked:qt,loose:Bt,text:ft});return Ke}},be.html=function(re){var se=this.rules.block.html.exec(re);if(se)return{type:this.options.sanitize?"paragraph":"html",raw:se[0],pre:!this.options.sanitizer&&(se[1]==="pre"||se[1]==="script"||se[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(se[0]):$(se[0]):se[0]}},be.def=function(re){var se=this.rules.block.def.exec(re);if(se){se[3]&&(se[3]=se[3].substring(1,se[3].length-1));var he=se[1].toLowerCase().replace(/\s+/g," ");return{tag:he,raw:se[0],href:se[2],title:se[3]}}},be.table=function(re){var se=this.rules.block.table.exec(re);if(se){var he={type:"table",header:W(se[1].replace(/^ *| *\| *$/g,"")),align:se[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:se[3]?se[3].replace(/\n$/,"").split(`
|
|
`):[]};if(he.header.length===he.align.length){he.raw=se[0];var me=he.align.length,Se;for(Se=0;Se<me;Se++)/^ *-+: *$/.test(he.align[Se])?he.align[Se]="right":/^ *:-+: *$/.test(he.align[Se])?he.align[Se]="center":/^ *:-+ *$/.test(he.align[Se])?he.align[Se]="left":he.align[Se]=null;for(me=he.cells.length,Se=0;Se<me;Se++)he.cells[Se]=W(he.cells[Se].replace(/^ *\| *| *\| *$/g,""),he.header.length);return he}}},be.lheading=function(re){var se=this.rules.block.lheading.exec(re);if(se)return{type:"heading",raw:se[0],depth:se[2].charAt(0)==="="?1:2,text:se[1]}},be.paragraph=function(re){var se=this.rules.block.paragraph.exec(re);if(se)return{type:"paragraph",raw:se[0],text:se[1].charAt(se[1].length-1)===`
|
|
`?se[1].slice(0,-1):se[1]}},be.text=function(re,se){var he=this.rules.block.text.exec(re);if(he){var me=se[se.length-1];return me&&me.type==="text"?{raw:he[0],text:he[0]}:{type:"text",raw:he[0],text:he[0]}}},be.escape=function(re){var se=this.rules.inline.escape.exec(re);if(se)return{type:"escape",raw:se[0],text:$(se[1])}},be.tag=function(re,se,he){var me=this.rules.inline.tag.exec(re);if(me)return!se&&/^<a /i.test(me[0])?se=!0:se&&/^<\/a>/i.test(me[0])&&(se=!1),!he&&/^<(pre|code|kbd|script)(\s|>)/i.test(me[0])?he=!0:he&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(me[0])&&(he=!1),{type:this.options.sanitize?"text":"html",raw:me[0],inLink:se,inRawBlock:he,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):$(me[0]):me[0]}},be.link=function(re){var se=this.rules.inline.link.exec(re);if(se){var he=ae(se[2],"()");if(he>-1){var me=se[0].indexOf("!")===0?5:4,Se=me+se[1].length+he;se[2]=se[2].substring(0,he),se[0]=se[0].substring(0,Se).trim(),se[3]=""}var Ue=se[2],Ke="";if(this.options.pedantic){var ot=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ue);ot?(Ue=ot[1],Ke=ot[3]):Ke=""}else Ke=se[3]?se[3].slice(1,-1):"";Ue=Ue.trim().replace(/^<([\s\S]*)>$/,"$1");var mt=ue(se,{href:Ue&&Ue.replace(this.rules.inline._escapes,"$1"),title:Ke&&Ke.replace(this.rules.inline._escapes,"$1")},se[0]);return mt}},be.reflink=function(re,se){var he;if((he=this.rules.inline.reflink.exec(re))||(he=this.rules.inline.nolink.exec(re))){var me=(he[2]||he[1]).replace(/\s+/g," ");if(me=se[me.toLowerCase()],!me||!me.href){var Se=he[0].charAt(0);return{type:"text",raw:Se,text:Se}}var Ue=ue(he,me,he[0]);return Ue}},be.strong=function(re,se,he){he===void 0&&(he="");var me=this.rules.inline.strong.start.exec(re);if(me&&(!me[1]||me[1]&&(he===""||this.rules.inline.punctuation.exec(he)))){se=se.slice(-1*re.length);var Se=me[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Se.lastIndex=0;for(var Ue;(me=Se.exec(se))!=null;)if(Ue=this.rules.inline.strong.middle.exec(se.slice(0,me.index+3)),Ue)return{type:"strong",raw:re.slice(0,Ue[0].length),text:re.slice(2,Ue[0].length-2)}}},be.em=function(re,se,he){he===void 0&&(he="");var me=this.rules.inline.em.start.exec(re);if(me&&(!me[1]||me[1]&&(he===""||this.rules.inline.punctuation.exec(he)))){se=se.slice(-1*re.length);var Se=me[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Se.lastIndex=0;for(var Ue;(me=Se.exec(se))!=null;)if(Ue=this.rules.inline.em.middle.exec(se.slice(0,me.index+2)),Ue)return{type:"em",raw:re.slice(0,Ue[0].length),text:re.slice(1,Ue[0].length-1)}}},be.codespan=function(re){var se=this.rules.inline.code.exec(re);if(se){var he=se[2].replace(/\n/g," "),me=/[^ ]/.test(he),Se=he.startsWith(" ")&&he.endsWith(" ");return me&&Se&&(he=he.substring(1,he.length-1)),he=$(he,!0),{type:"codespan",raw:se[0],text:he}}},be.br=function(re){var se=this.rules.inline.br.exec(re);if(se)return{type:"br",raw:se[0]}},be.del=function(re){var se=this.rules.inline.del.exec(re);if(se)return{type:"del",raw:se[0],text:se[1]}},be.autolink=function(re,se){var he=this.rules.inline.autolink.exec(re);if(he){var me,Se;return he[2]==="@"?(me=$(this.options.mangle?se(he[1]):he[1]),Se="mailto:"+me):(me=$(he[1]),Se=me),{type:"link",raw:he[0],text:me,href:Se,tokens:[{type:"text",raw:me,text:me}]}}},be.url=function(re,se){var he;if(he=this.rules.inline.url.exec(re)){var me,Se;if(he[2]==="@")me=$(this.options.mangle?se(he[0]):he[0]),Se="mailto:"+me;else{var Ue;do Ue=he[0],he[0]=this.rules.inline._backpedal.exec(he[0])[0];while(Ue!==he[0]);me=$(he[0]),he[1]==="www."?Se="http://"+me:Se=me}return{type:"link",raw:he[0],text:me,href:Se,tokens:[{type:"text",raw:me,text:me}]}}},be.inlineText=function(re,se,he){var me=this.rules.inline.text.exec(re);if(me){var Se;return se?Se=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):$(me[0]):me[0]:Se=$(this.options.smartypants?he(me[0]):me[0]),{type:"text",raw:me[0],text:Se}}},Re}(),Ee=M.noopTest,xe=M.edit,Ie=M.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:Ee,table:Ee,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=xe(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=xe(de.item,"gm").replace(/bull/g,de.bullet).getRegex(),de.list=xe(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=xe(de.html,"i").replace("comment",de._comment).replace("tag",de._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),de.paragraph=xe(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=xe(de.blockquote).replace("paragraph",de.paragraph).getRegex(),de.normal=Ie({},de),de.gfm=Ie({},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=xe(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=xe(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=Ie({},de.normal,{html:xe(`^ *(?: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:Ee,paragraph:xe(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 ce={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ee,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:Ee,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ce._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ce.punctuation=xe(ce.punctuation).replace(/punctuation/g,ce._punctuation).getRegex(),ce._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ce._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ce.em.start=xe(ce.em.start).replace(/punctuation/g,ce._punctuation).getRegex(),ce.em.middle=xe(ce.em.middle).replace(/punctuation/g,ce._punctuation).replace(/overlapSkip/g,ce._overlapSkip).getRegex(),ce.em.endAst=xe(ce.em.endAst,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.em.endUnd=xe(ce.em.endUnd,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.start=xe(ce.strong.start).replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.middle=xe(ce.strong.middle).replace(/punctuation/g,ce._punctuation).replace(/blockSkip/g,ce._blockSkip).getRegex(),ce.strong.endAst=xe(ce.strong.endAst,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.endUnd=xe(ce.strong.endUnd,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.blockSkip=xe(ce._blockSkip,"g").getRegex(),ce.overlapSkip=xe(ce._overlapSkip,"g").getRegex(),ce._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ce._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ce._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,ce.autolink=xe(ce.autolink).replace("scheme",ce._scheme).replace("email",ce._email).getRegex(),ce._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ce.tag=xe(ce.tag).replace("comment",de._comment).replace("attribute",ce._attribute).getRegex(),ce._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ce._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ce._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ce.link=xe(ce.link).replace("label",ce._label).replace("href",ce._href).replace("title",ce._title).getRegex(),ce.reflink=xe(ce.reflink).replace("label",ce._label).getRegex(),ce.reflinkSearch=xe(ce.reflinkSearch,"g").replace("reflink",ce.reflink).replace("nolink",ce.nolink).getRegex(),ce.normal=Ie({},ce),ce.pedantic=Ie({},ce.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:xe(/^!?\[(label)\]\((.*?)\)/).replace("label",ce._label).getRegex(),reflink:xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ce._label).getRegex()}),ce.gfm=Ie({},ce.normal,{escape:xe(ce.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),ce.gfm.url=xe(ce.gfm.url,"i").replace("email",ce.gfm._extended_email).getRegex(),ce.breaks=Ie({},ce.gfm,{br:xe(ce.br).replace("{2,}","*").getRegex(),text:xe(ce.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ie={block:de,inline:ce},fe=z.defaults,le=ie.block,ke=ie.inline;function Ne(Re){return Re.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 Ae(Re){var be="",Ce,re,se=Re.length;for(Ce=0;Ce<se;Ce++)re=Re.charCodeAt(Ce),Math.random()>.5&&(re="x"+re.toString(16)),be+="&#"+re+";";return be}var Le=function(){function Re(Ce){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ce||fe,this.options.tokenizer=this.options.tokenizer||new ve,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var re={block:le.normal,inline:ke.normal};this.options.pedantic?(re.block=le.pedantic,re.inline=ke.pedantic):this.options.gfm&&(re.block=le.gfm,this.options.breaks?re.inline=ke.breaks:re.inline=ke.gfm),this.tokenizer.rules=re}Re.lex=function(re,se){var he=new Re(se);return he.lex(re)};var be=Re.prototype;return be.lex=function(re){return re=re.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(re,this.tokens,!0),this.inline(this.tokens),this.tokens},be.blockTokens=function(re,se,he){se===void 0&&(se=[]),he===void 0&&(he=!0),re=re.replace(/^ +$/gm,"");for(var me,Se,Ue,Ke;re;){if(me=this.tokenizer.space(re)){re=re.substring(me.raw.length),me.type&&se.push(me);continue}if(me=this.tokenizer.code(re,se)){re=re.substring(me.raw.length),me.type?se.push(me):(Ke=se[se.length-1],Ke.raw+=`
|
|
`+me.raw,Ke.text+=`
|
|
`+me.text);continue}if(me=this.tokenizer.fences(re)){re=re.substring(me.raw.length),se.push(me);continue}if(me=this.tokenizer.heading(re)){re=re.substring(me.raw.length),se.push(me);continue}if(me=this.tokenizer.nptable(re)){re=re.substring(me.raw.length),se.push(me);continue}if(me=this.tokenizer.hr(re)){re=re.substring(me.raw.length),se.push(me);continue}if(me=this.tokenizer.blockquote(re)){re=re.substring(me.raw.length),me.tokens=this.blockTokens(me.text,[],he),se.push(me);continue}if(me=this.tokenizer.list(re)){for(re=re.substring(me.raw.length),Ue=me.items.length,Se=0;Se<Ue;Se++)me.items[Se].tokens=this.blockTokens(me.items[Se].text,[],!1);se.push(me);continue}if(me=this.tokenizer.html(re)){re=re.substring(me.raw.length),se.push(me);continue}if(he&&(me=this.tokenizer.def(re))){re=re.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(re)){re=re.substring(me.raw.length),se.push(me);continue}if(me=this.tokenizer.lheading(re)){re=re.substring(me.raw.length),se.push(me);continue}if(he&&(me=this.tokenizer.paragraph(re))){re=re.substring(me.raw.length),se.push(me);continue}if(me=this.tokenizer.text(re,se)){re=re.substring(me.raw.length),me.type?se.push(me):(Ke=se[se.length-1],Ke.raw+=`
|
|
`+me.raw,Ke.text+=`
|
|
`+me.text);continue}if(re){var ot="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(ot);break}else throw new Error(ot)}}return se},be.inline=function(re){var se,he,me,Se,Ue,Ke,ot=re.length;for(se=0;se<ot;se++){Ke=re[se];switch(Ke.type){case"paragraph":case"text":case"heading":{Ke.tokens=[],this.inlineTokens(Ke.text,Ke.tokens);break}case"table":{for(Ke.tokens={header:[],cells:[]},Se=Ke.header.length,he=0;he<Se;he++)Ke.tokens.header[he]=[],this.inlineTokens(Ke.header[he],Ke.tokens.header[he]);for(Se=Ke.cells.length,he=0;he<Se;he++)for(Ue=Ke.cells[he],Ke.tokens.cells[he]=[],me=0;me<Ue.length;me++)Ke.tokens.cells[he][me]=[],this.inlineTokens(Ue[me],Ke.tokens.cells[he][me]);break}case"blockquote":{this.inline(Ke.tokens);break}case"list":{for(Se=Ke.items.length,he=0;he<Se;he++)this.inline(Ke.items[he].tokens);break}}}return re},be.inlineTokens=function(re,se,he,me,Se){se===void 0&&(se=[]),he===void 0&&(he=!1),me===void 0&&(me=!1),Se===void 0&&(Se="");var Ue,Ke=re,ot;if(this.tokens.links){var mt=Object.keys(this.tokens.links);if(mt.length>0)for(;(ot=this.tokenizer.rules.inline.reflinkSearch.exec(Ke))!=null;)mt.includes(ot[0].slice(ot[0].lastIndexOf("[")+1,-1))&&(Ke=Ke.slice(0,ot.index)+"["+"a".repeat(ot[0].length-2)+"]"+Ke.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ot=this.tokenizer.rules.inline.blockSkip.exec(Ke))!=null;)Ke=Ke.slice(0,ot.index)+"["+"a".repeat(ot[0].length-2)+"]"+Ke.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;re;){if(Ue=this.tokenizer.escape(re)){re=re.substring(Ue.raw.length),se.push(Ue);continue}if(Ue=this.tokenizer.tag(re,he,me)){re=re.substring(Ue.raw.length),he=Ue.inLink,me=Ue.inRawBlock,se.push(Ue);continue}if(Ue=this.tokenizer.link(re)){re=re.substring(Ue.raw.length),Ue.type==="link"&&(Ue.tokens=this.inlineTokens(Ue.text,[],!0,me)),se.push(Ue);continue}if(Ue=this.tokenizer.reflink(re,this.tokens.links)){re=re.substring(Ue.raw.length),Ue.type==="link"&&(Ue.tokens=this.inlineTokens(Ue.text,[],!0,me)),se.push(Ue);continue}if(Ue=this.tokenizer.strong(re,Ke,Se)){re=re.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],he,me),se.push(Ue);continue}if(Ue=this.tokenizer.em(re,Ke,Se)){re=re.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],he,me),se.push(Ue);continue}if(Ue=this.tokenizer.codespan(re)){re=re.substring(Ue.raw.length),se.push(Ue);continue}if(Ue=this.tokenizer.br(re)){re=re.substring(Ue.raw.length),se.push(Ue);continue}if(Ue=this.tokenizer.del(re)){re=re.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],he,me),se.push(Ue);continue}if(Ue=this.tokenizer.autolink(re,Ae)){re=re.substring(Ue.raw.length),se.push(Ue);continue}if(!he&&(Ue=this.tokenizer.url(re,Ae))){re=re.substring(Ue.raw.length),se.push(Ue);continue}if(Ue=this.tokenizer.inlineText(re,me,Ne)){re=re.substring(Ue.raw.length),Se=Ue.raw.slice(-1),se.push(Ue);continue}if(re){var ft="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(ft);break}else throw new Error(ft)}}return se},J(Re,null,[{key:"rules",get:function(){return{block:le,inline:ke}}}]),Re}(),Fe=z.defaults,oe=M.cleanUrl,ge=M.escape,we=function(){function Re(Ce){this.options=Ce||Fe}var be=Re.prototype;return be.code=function(re,se,he){var me=(se||"").match(/\S*/)[0];if(this.options.highlight){var Se=this.options.highlight(re,me);Se!=null&&Se!==re&&(he=!0,re=Se)}return me?'<pre><code class="'+this.options.langPrefix+ge(me,!0)+'">'+(he?re:ge(re,!0))+`</code></pre>
|
|
`:"<pre><code>"+(he?re:ge(re,!0))+`</code></pre>
|
|
`},be.blockquote=function(re){return`<blockquote>
|
|
`+re+`</blockquote>
|
|
`},be.html=function(re){return re},be.heading=function(re,se,he,me){return this.options.headerIds?"<h"+se+' id="'+this.options.headerPrefix+me.slug(he)+'">'+re+"</h"+se+`>
|
|
`:"<h"+se+">"+re+"</h"+se+`>
|
|
`},be.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},be.list=function(re,se,he){var me=se?"ol":"ul",Se=se&&he!==1?' start="'+he+'"':"";return"<"+me+Se+`>
|
|
`+re+"</"+me+`>
|
|
`},be.listitem=function(re){return"<li>"+re+`</li>
|
|
`},be.checkbox=function(re){return"<input "+(re?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},be.paragraph=function(re){return"<p>"+re+`</p>
|
|
`},be.table=function(re,se){return se&&(se="<tbody>"+se+"</tbody>"),`<table>
|
|
<thead>
|
|
`+re+`</thead>
|
|
`+se+`</table>
|
|
`},be.tablerow=function(re){return`<tr>
|
|
`+re+`</tr>
|
|
`},be.tablecell=function(re,se){var he=se.header?"th":"td",me=se.align?"<"+he+' align="'+se.align+'">':"<"+he+">";return me+re+"</"+he+`>
|
|
`},be.strong=function(re){return"<strong>"+re+"</strong>"},be.em=function(re){return"<em>"+re+"</em>"},be.codespan=function(re){return"<code>"+re+"</code>"},be.br=function(){return this.options.xhtml?"<br/>":"<br>"},be.del=function(re){return"<del>"+re+"</del>"},be.link=function(re,se,he){if(re=oe(this.options.sanitize,this.options.baseUrl,re),re===null)return he;var me='<a href="'+ge(re)+'"';return se&&(me+=' title="'+se+'"'),me+=">"+he+"</a>",me},be.image=function(re,se,he){if(re=oe(this.options.sanitize,this.options.baseUrl,re),re===null)return he;var me='<img src="'+re+'" alt="'+he+'"';return se&&(me+=' title="'+se+'"'),me+=this.options.xhtml?"/>":">",me},be.text=function(re){return re},Re}(),De=function(){function Re(){}var be=Re.prototype;return be.strong=function(re){return re},be.em=function(re){return re},be.codespan=function(re){return re},be.del=function(re){return re},be.html=function(re){return re},be.text=function(re){return re},be.link=function(re,se,he){return""+he},be.image=function(re,se,he){return""+he},be.br=function(){return""},Re}(),je=function(){function Re(){this.seen={}}var be=Re.prototype;return be.slug=function(re){var se=re.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(se)){var he=se;do this.seen[he]++,se=he+"-"+this.seen[he];while(this.seen.hasOwnProperty(se))}return this.seen[se]=0,se},Re}(),Ve=z.defaults,Je=M.unescape,Xe=function(){function Re(Ce){this.options=Ce||Ve,this.options.renderer=this.options.renderer||new we,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new De,this.slugger=new je}Re.parse=function(re,se){var he=new Re(se);return he.parse(re)};var be=Re.prototype;return be.parse=function(re,se){se===void 0&&(se=!0);var he="",me,Se,Ue,Ke,ot,mt,ft,wt,St,dt,Bt,Lt,qt,Qt,It,Cr,zr,yt,Lr=re.length;for(me=0;me<Lr;me++){dt=re[me];switch(dt.type){case"space":continue;case"hr":{he+=this.renderer.hr();continue}case"heading":{he+=this.renderer.heading(this.parseInline(dt.tokens),dt.depth,Je(this.parseInline(dt.tokens,this.textRenderer)),this.slugger);continue}case"code":{he+=this.renderer.code(dt.text,dt.lang,dt.escaped);continue}case"table":{for(wt="",ft="",Ke=dt.header.length,Se=0;Se<Ke;Se++)ft+=this.renderer.tablecell(this.parseInline(dt.tokens.header[Se]),{header:!0,align:dt.align[Se]});for(wt+=this.renderer.tablerow(ft),St="",Ke=dt.cells.length,Se=0;Se<Ke;Se++){for(mt=dt.tokens.cells[Se],ft="",ot=mt.length,Ue=0;Ue<ot;Ue++)ft+=this.renderer.tablecell(this.parseInline(mt[Ue]),{header:!1,align:dt.align[Ue]});St+=this.renderer.tablerow(ft)}he+=this.renderer.table(wt,St);continue}case"blockquote":{St=this.parse(dt.tokens),he+=this.renderer.blockquote(St);continue}case"list":{for(Bt=dt.ordered,Lt=dt.start,qt=dt.loose,Ke=dt.items.length,St="",Se=0;Se<Ke;Se++)It=dt.items[Se],Cr=It.checked,zr=It.task,Qt="",It.task&&(yt=this.renderer.checkbox(Cr),qt?It.tokens.length>0&&It.tokens[0].type==="text"?(It.tokens[0].text=yt+" "+It.tokens[0].text,It.tokens[0].tokens&&It.tokens[0].tokens.length>0&&It.tokens[0].tokens[0].type==="text"&&(It.tokens[0].tokens[0].text=yt+" "+It.tokens[0].tokens[0].text)):It.tokens.unshift({type:"text",text:yt}):Qt+=yt),Qt+=this.parse(It.tokens,qt),St+=this.renderer.listitem(Qt,zr,Cr);he+=this.renderer.list(St,Bt,Lt);continue}case"html":{he+=this.renderer.html(dt.text);continue}case"paragraph":{he+=this.renderer.paragraph(this.parseInline(dt.tokens));continue}case"text":{for(St=dt.tokens?this.parseInline(dt.tokens):dt.text;me+1<Lr&&re[me+1].type==="text";)dt=re[++me],St+=`
|
|
`+(dt.tokens?this.parseInline(dt.tokens):dt.text);he+=se?this.renderer.paragraph(St):St;continue}default:{var bt='Token with "'+dt.type+'" type was not found.';if(this.options.silent){console.error(bt);return}else throw new Error(bt)}}}return he},be.parseInline=function(re,se){se=se||this.renderer;var he="",me,Se,Ue=re.length;for(me=0;me<Ue;me++){Se=re[me];switch(Se.type){case"escape":{he+=se.text(Se.text);break}case"html":{he+=se.html(Se.text);break}case"link":{he+=se.link(Se.href,Se.title,this.parseInline(Se.tokens,se));break}case"image":{he+=se.image(Se.href,Se.title,Se.text);break}case"strong":{he+=se.strong(this.parseInline(Se.tokens,se));break}case"em":{he+=se.em(this.parseInline(Se.tokens,se));break}case"codespan":{he+=se.codespan(Se.text);break}case"br":{he+=se.br();break}case"del":{he+=se.del(this.parseInline(Se.tokens,se));break}case"text":{he+=se.text(Se.text);break}default:{var Ke='Token with "'+Se.type+'" type was not found.';if(this.options.silent){console.error(Ke);return}else throw new Error(Ke)}}}return he},Re}(),et=M.merge,Ze=M.checkSanitizeDeprecation,rt=M.escape,Be=z.getDefaults,ut=z.changeDefaults,it=z.defaults;function He(Re,be,Ce){if(typeof Re=="undefined"||Re===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Re!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Re)+", string expected");if(typeof be=="function"&&(Ce=be,be=null),be=et({},He.defaults,be||{}),Ze(be),Ce){var re=be.highlight,se;try{se=Le.lex(Re,be)}catch(Ue){return Ce(Ue)}var he=function(Ke){var ot;if(!Ke)try{ot=Xe.parse(se,be)}catch(mt){Ke=mt}return be.highlight=re,Ke?Ce(Ke):Ce(null,ot)};if(!re||re.length<3)return he();if(delete be.highlight,!se.length)return he();var me=0;He.walkTokens(se,function(Ue){Ue.type==="code"&&(me++,setTimeout(function(){re(Ue.text,Ue.lang,function(Ke,ot){if(Ke)return he(Ke);ot!=null&&ot!==Ue.text&&(Ue.text=ot,Ue.escaped=!0),me--,me===0&&he()})},0))}),me===0&&he();return}try{var Se=Le.lex(Re,be);return be.walkTokens&&He.walkTokens(Se,be.walkTokens),Xe.parse(Se,be)}catch(Ue){if(Ue.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,be.silent)return"<p>An error occurred:</p><pre>"+rt(Ue.message+"",!0)+"</pre>";throw Ue}}He.options=He.setOptions=function(Re){return et(He.defaults,Re),ut(He.defaults),He},He.getDefaults=Be,He.defaults=it,He.use=function(Re){var be=et({},Re);if(Re.renderer&&function(){var re=He.defaults.renderer||new we,se=function(Se){var Ue=re[Se];re[Se]=function(){for(var Ke=arguments.length,ot=new Array(Ke),mt=0;mt<Ke;mt++)ot[mt]=arguments[mt];var ft=Re.renderer[Se].apply(re,ot);return ft===!1&&(ft=Ue.apply(re,ot)),ft}};for(var he in Re.renderer)se(he);be.renderer=re}(),Re.tokenizer&&function(){var re=He.defaults.tokenizer||new ve,se=function(Se){var Ue=re[Se];re[Se]=function(){for(var Ke=arguments.length,ot=new Array(Ke),mt=0;mt<Ke;mt++)ot[mt]=arguments[mt];var ft=Re.tokenizer[Se].apply(re,ot);return ft===!1&&(ft=Ue.apply(re,ot)),ft}};for(var he in Re.tokenizer)se(he);be.tokenizer=re}(),Re.walkTokens){var Ce=He.defaults.walkTokens;be.walkTokens=function(re){Re.walkTokens(re),Ce&&Ce(re)}}He.setOptions(be)},He.walkTokens=function(Re,be){for(var Ce=j(Re),re;!(re=Ce()).done;){var se=re.value;be(se);switch(se.type){case"table":{for(var he=j(se.tokens.header),me;!(me=he()).done;){var Se=me.value;He.walkTokens(Se,be)}for(var Ue=j(se.tokens.cells),Ke;!(Ke=Ue()).done;)for(var ot=Ke.value,mt=j(ot),ft;!(ft=mt()).done;){var wt=ft.value;He.walkTokens(wt,be)}break}case"list":{He.walkTokens(se.items,be);break}default:se.tokens&&He.walkTokens(se.tokens,be)}}},He.Parser=Xe,He.parser=Xe.parse,He.Renderer=we,He.TextRenderer=De,He.Lexer=Le,He.lexer=Le.lex,He.Tokenizer=ve,He.Slugger=je,He.parse=He;var We=He;return We})},ELLl:function(nt,ye,Q){(function(ne){ne(Q("VrN/"))})(function(ne){var J={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},P=ne.Pos;ne.defineOption("autoCloseBrackets",!1,function(h,c,o){o&&o!=ne.Init&&(h.removeKeyMap(j),h.state.closeBrackets=null),c&&(U(Y(c,"pairs")),h.state.closeBrackets=c,h.addKeyMap(j))});function Y(h,c){return c=="pairs"&&typeof h=="string"?h:typeof h=="object"&&h[c]!=null?h[c]:J[c]}var j={Backspace:r,Enter:L};function U(h){for(var c=0;c<h.length;c++){var o=h.charAt(c),l="'"+o+"'";j[l]||(j[l]=z(o))}}U(J.pairs+"`");function z(h){return function(c){return g(c,h)}}function H(h){var c=h.state.closeBrackets;if(!c||c.override)return c;var o=h.getModeAt(h.getCursor());return o.closeBrackets||c}function r(h){var c=H(h);if(!c||h.getOption("disableInput"))return ne.Pass;for(var o=Y(c,"pairs"),l=h.listSelections(),s=0;s<l.length;s++){if(!l[s].empty())return ne.Pass;var a=p(h,l[s].head);if(!a||o.indexOf(a)%2!=0)return ne.Pass}for(var s=l.length-1;s>=0;s--){var R=l[s].head;h.replaceRange("",P(R.line,R.ch-1),P(R.line,R.ch+1),"+delete")}}function L(h){var c=H(h),o=c&&Y(c,"explode");if(!o||h.getOption("disableInput"))return ne.Pass;for(var l=h.listSelections(),s=0;s<l.length;s++){if(!l[s].empty())return ne.Pass;var a=p(h,l[s].head);if(!a||o.indexOf(a)%2!=0)return ne.Pass}h.operation(function(){var R=h.lineSeparator()||`
|
|
`;h.replaceSelection(R+R,null),h.execCommand("goCharLeft"),l=h.listSelections();for(var E=0;E<l.length;E++){var S=l[E].head.line;h.indentLine(S,null,!0),h.indentLine(S+1,null,!0)}})}function v(h){var c=ne.cmpPos(h.anchor,h.head)>0;return{anchor:new P(h.anchor.line,h.anchor.ch+(c?-1:1)),head:new P(h.head.line,h.head.ch+(c?1:-1))}}function g(h,c){var o=H(h);if(!o||h.getOption("disableInput"))return ne.Pass;var l=Y(o,"pairs"),s=l.indexOf(c);if(s==-1)return ne.Pass;for(var a=Y(o,"closeBefore"),R=Y(o,"triples"),E=l.charAt(s+1)==c,S=h.listSelections(),D=s%2==0,A,O=0;O<S.length;O++){var C=S[O],x=C.head,f,w=h.getRange(x,P(x.line,x.ch+1));if(D&&!C.empty())f="surround";else if((E||!D)&&w==c)E&&u(h,x)?f="both":R.indexOf(c)>=0&&h.getRange(x,P(x.line,x.ch+3))==c+c+c?f="skipThree":f="skip";else if(E&&x.ch>1&&R.indexOf(c)>=0&&h.getRange(P(x.line,x.ch-2),x)==c+c){if(x.ch>2&&/\bstring/.test(h.getTokenTypeAt(P(x.line,x.ch-2))))return ne.Pass;f="addFour"}else if(E){var b=x.ch==0?" ":h.getRange(P(x.line,x.ch-1),x);if(!ne.isWordChar(w)&&b!=c&&!ne.isWordChar(b))f="both";else return ne.Pass}else if(D&&(w.length===0||/\s/.test(w)||a.indexOf(w)>-1))f="both";else return ne.Pass;if(!A)A=f;else if(A!=f)return ne.Pass}var y=s%2?l.charAt(s-1):c,B=s%2?c:l.charAt(s+1);h.operation(function(){if(A=="skip")h.execCommand("goCharRight");else if(A=="skipThree")for(var F=0;F<3;F++)h.execCommand("goCharRight");else if(A=="surround"){for(var _=h.getSelections(),F=0;F<_.length;F++)_[F]=y+_[F]+B;h.replaceSelections(_,"around"),_=h.listSelections().slice();for(var F=0;F<_.length;F++)_[F]=v(_[F]);h.setSelections(_)}else A=="both"?(h.replaceSelection(y+B,null),h.triggerElectric(y+B),h.execCommand("goCharLeft")):A=="addFour"&&(h.replaceSelection(y+y+y+y,"before"),h.execCommand("goCharRight"))})}function p(h,c){var o=h.getRange(P(c.line,c.ch-1),P(c.line,c.ch+1));return o.length==2?o:null}function u(h,c){var o=h.getTokenAt(P(c.line,c.ch+1));return/\bstring/.test(o.type)&&o.start==c.ch&&(c.ch==0||!/\bstring/.test(h.getTokenTypeAt(c)))}})},FWmy:function(nt,ye,Q){"use strict";Q.d(ye,"a",function(){return ne});function ne(J,P){if(!J)throw new Error(P?`Assertion failed (${P})`:"Assertion Failed")}},GfqC:function(nt,ye,Q){"use strict";var ne=Q("q1tI"),J=Q.n(ne),P=Q("TSYQ"),Y=Q.n(P);function j(M,I){var m="cannot "+M.method+" "+M.action+" "+I.status+"'",W=new Error(m);return W.status=I.status,W.method=M.method,W.url=M.action,W}function U(M){var I=M.responseText||M.response;if(!I)return I;try{return JSON.parse(I)}catch(m){return I}}function z(M){var I=new XMLHttpRequest;M.onProgress&&I.upload&&(I.upload.onprogress=function(ae){ae.total>0&&(ae.percent=ae.loaded/ae.total*100),M.onProgress(ae)});var m=new FormData;M.data&&Object.keys(M.data).forEach(function($){var ae=M.data[$];if(Array.isArray(ae)){ae.forEach(function(ue){m.append($+"[]",ue)});return}m.append($,M.data[$])}),M.file instanceof Blob?m.append(M.filename,M.file,M.file.name):m.append(M.filename,M.file),I.onerror=function(ae){M.onError(ae)},I.onload=function(){return I.status<200||I.status>=300?M.onError(j(M,I),U(I)):M.onSuccess(U(I),I)},I.open(M.method,M.action,!0),M.withCredentials&&"withCredentials"in I&&(I.withCredentials=!0);var W=M.headers||{};return W["X-Requested-With"]!==null&&I.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(W).forEach(function($){W[$]!==null&&I.setRequestHeader($,W[$])}),I.send(m),{abort:function(){I.abort()}}}var H=+new Date,r=0;function L(){return"rc-upload-"+H+"-"+ ++r}function v(M,I){return M.indexOf(I,M.length-I.length)!==-1}var g=function(M,I){if(M&&I){var m=Array.isArray(I)?I:I.split(","),W=M.name||"",$=M.type||"",ae=$.replace(/\/.*$/,"");return m.some(function(ue){var Oe=ue.trim();return Oe.charAt(0)==="."?v(W.toLowerCase(),Oe.toLowerCase()):/\/\*$/.test(Oe)?ae===Oe.replace(/\/.*$/,""):$===Oe})}return!0};function p(M,I){var m=M.createReader(),W=[];function $(){m.readEntries(function(ae){var ue=Array.prototype.slice.apply(ae);W=W.concat(ue);var Oe=!ue.length;Oe?I(W):$()})}$()}var u=function(I,m,W){var $=function ae(ue,Oe){Oe=Oe||"",ue.isFile?ue.file(function(ve){W(ve)&&(ue.fullPath&&!ve.webkitRelativePath&&(Object.defineProperties(ve,{webkitRelativePath:{writable:!0}}),ve.webkitRelativePath=ue.fullPath.replace(/^\//,""),Object.defineProperties(ve,{webkitRelativePath:{writable:!1}})),m([ve]))}):ue.isDirectory&&p(ue,function(ve){ve.forEach(function(Ee){ae(Ee,""+Oe+ue.name+"/")})})};I.forEach(function(ae){$(ae.webkitGetAsEntry())})},h=u,c=Object.assign||function(M){for(var I=1;I<arguments.length;I++){var m=arguments[I];for(var W in m)Object.prototype.hasOwnProperty.call(m,W)&&(M[W]=m[W])}return M},o=function(){function M(I,m){var W=[],$=!0,ae=!1,ue=void 0;try{for(var Oe=I[Symbol.iterator](),ve;!($=(ve=Oe.next()).done)&&!(W.push(ve.value),m&&W.length===m);$=!0);}catch(Ee){ae=!0,ue=Ee}finally{try{!$&&Oe.return&&Oe.return()}finally{if(ae)throw ue}}return W}return function(I,m){if(Array.isArray(I))return I;if(Symbol.iterator in Object(I))return M(I,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function M(I,m){for(var W=0;W<m.length;W++){var $=m[W];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(I,$.key,$)}}return function(I,m,W){return m&&M(I.prototype,m),W&&M(I,W),I}}();function s(M,I,m){return I in M?Object.defineProperty(M,I,{value:m,enumerable:!0,configurable:!0,writable:!0}):M[I]=m,M}function a(M,I){var m={};for(var W in M){if(I.indexOf(W)>=0)continue;if(!Object.prototype.hasOwnProperty.call(M,W))continue;m[W]=M[W]}return m}function R(M,I){if(!(M instanceof I))throw new TypeError("Cannot call a class as a function")}function E(M,I){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:M}function S(M,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);M.prototype=Object.create(I&&I.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(M,I):M.__proto__=I)}var D=function(I){return Object.keys(I).reduce(function(m,W){return(W.substr(0,5)==="data-"||W.substr(0,5)==="aria-"||W==="role")&&(m[W]=I[W]),m},{})},A=function(M){S(I,M);function I(){var m,W,$,ae;R(this,I);for(var ue=arguments.length,Oe=Array(ue),ve=0;ve<ue;ve++)Oe[ve]=arguments[ve];return ae=(W=($=E(this,(m=I.__proto__||Object.getPrototypeOf(I)).call.apply(m,[this].concat(Oe))),$),$.state={uid:L()},$.reqs={},$.onChange=function(Ee){var xe=Ee.target.files;$.uploadFiles(xe),$.reset()},$.onClick=function(Ee){var xe=$.fileInput;if(!xe)return;var Ie=$.props,de=Ie.children,ce=Ie.onClick;de&&de.type==="button"&&(xe.parentNode.focus(),xe.parentNode.querySelector("button").blur()),xe.click(),ce&&ce(Ee)},$.onKeyDown=function(Ee){Ee.key==="Enter"&&$.onClick()},$.onFileDrop=function(Ee){var xe=$.props.multiple;if(Ee.preventDefault(),Ee.type==="dragover")return;if($.props.directory)h(Array.prototype.slice.call(Ee.dataTransfer.items),$.uploadFiles,function(de){return g(de,$.props.accept)});else{var Ie=Array.prototype.slice.call(Ee.dataTransfer.files).filter(function(de){return g(de,$.props.accept)});xe===!1&&(Ie=Ie.slice(0,1)),$.uploadFiles(Ie)}},$.uploadFiles=function(Ee){var xe=Array.prototype.slice.call(Ee);xe.map(function(Ie){return Ie.uid=L(),Ie}).forEach(function(Ie){$.upload(Ie,xe)})},$.saveFileInput=function(Ee){$.fileInput=Ee},W),E($,ae)}return l(I,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(W,$){var ae=this,ue=this.props;if(!ue.beforeUpload)return setTimeout(function(){return ae.post(W)},0);var Oe=ue.beforeUpload(W,$);Oe&&Oe.then?Oe.then(function(ve){var Ee=Object.prototype.toString.call(ve);return Ee==="[object File]"||Ee==="[object Blob]"?ae.post(ve):ae.post(W)}).catch(function(ve){console.log(ve)}):Oe!==!1&&setTimeout(function(){return ae.post(W)},0);return}},{key:"post",value:function(W){var $=this;if(!this._isMounted)return;var ae=this.props,ue=ae.onStart,Oe=ae.onProgress,ve=ae.transformFile,Ee=ve===void 0?function(xe){return xe}:ve;new Promise(function(xe){var Ie=ae.action;return typeof Ie=="function"&&(Ie=Ie(W)),xe(Ie)}).then(function(xe){var Ie=W.uid,de=ae.customRequest||z,ce=Promise.resolve(Ee(W)).then(function(ie){var fe=ae.data;return typeof fe=="function"&&(fe=fe(ie)),Promise.all([ie,fe])}).catch(function(ie){console.error(ie)});ce.then(function(ie){var fe=o(ie,2),le=fe[0],ke=fe[1],Ne={action:xe,filename:ae.name,data:ke,file:le,headers:ae.headers,withCredentials:ae.withCredentials,method:ae.method||"post",onProgress:Oe?function(Ae){Oe(Ae,W)}:null,onSuccess:function(Le,Fe){delete $.reqs[Ie],ae.onSuccess(Le,W,Fe)},onError:function(Le,Fe){delete $.reqs[Ie],ae.onError(Le,Fe,W)}};ue(W),$.reqs[Ie]=de(Ne)})})}},{key:"reset",value:function(){this.setState({uid:L()})}},{key:"abort",value:function(W){var $=this.reqs;if(W){var ae=W;W&&W.uid&&(ae=W.uid),$[ae]&&$[ae].abort&&$[ae].abort(),delete $[ae]}else Object.keys($).forEach(function(ue){$[ue]&&$[ue].abort&&$[ue].abort(),delete $[ue]})}},{key:"render",value:function(){var W,$=this.props,ae=$.component,ue=$.prefixCls,Oe=$.className,ve=$.disabled,Ee=$.id,xe=$.style,Ie=$.multiple,de=$.accept,ce=$.children,ie=$.directory,fe=$.openFileDialogOnClick,le=$.onMouseEnter,ke=$.onMouseLeave,Ne=a($,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),Ae=Y()((W={},s(W,ue,!0),s(W,ue+"-disabled",ve),s(W,Oe,Oe),W)),Le=ve?{}:{onClick:fe?this.onClick:function(){},onKeyDown:fe?this.onKeyDown:function(){},onMouseEnter:le,onMouseLeave:ke,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return J.a.createElement(ae,c({},Le,{className:Ae,role:"button",style:xe}),J.a.createElement("input",c({},D(Ne),{id:Ee,type:"file",ref:this.saveFileInput,onClick:function(oe){return oe.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:de,directory:ie?"directory":null,webkitdirectory:ie?"webkitdirectory":null,multiple:Ie,onChange:this.onChange})),ce)}}]),I}(ne.Component),O=A,C=Object.assign||function(M){for(var I=1;I<arguments.length;I++){var m=arguments[I];for(var W in m)Object.prototype.hasOwnProperty.call(m,W)&&(M[W]=m[W])}return M},x=function(){function M(I,m){for(var W=0;W<m.length;W++){var $=m[W];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(I,$.key,$)}}return function(I,m,W){return m&&M(I.prototype,m),W&&M(I,W),I}}();function f(M,I){if(!(M instanceof I))throw new TypeError("Cannot call a class as a function")}function w(M,I){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:M}function b(M,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);M.prototype=Object.create(I&&I.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(M,I):M.__proto__=I)}function y(){}var B=function(M){b(I,M);function I(){var m,W,$,ae;f(this,I);for(var ue=arguments.length,Oe=Array(ue),ve=0;ve<ue;ve++)Oe[ve]=arguments[ve];return ae=(W=($=w(this,(m=I.__proto__||Object.getPrototypeOf(I)).call.apply(m,[this].concat(Oe))),$),$.saveUploader=function(Ee){$.uploader=Ee},W),w($,ae)}return x(I,[{key:"abort",value:function(W){this.uploader.abort(W)}},{key:"render",value:function(){return J.a.createElement(O,C({},this.props,{ref:this.saveUploader}))}}]),I}(ne.Component);B.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:y,onError:y,onSuccess:y,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var F=B,_=ye.a=F},HmJG:function(nt,ye,Q){},JYp7:function(nt,ye,Q){"use strict";Q.d(ye,"a",function(){return ne});var ne;(function(J){function P(a){return a&&typeof a=="object"&&typeof a[Symbol.iterator]=="function"}J.is=P;const Y=Object.freeze([]);function j(){return Y}J.empty=j;function*U(a){yield a}J.single=U;function z(a){return a||Y}J.from=z;function H(a){return!a||a[Symbol.iterator]().next().done===!0}J.isEmpty=H;function r(a){return a[Symbol.iterator]().next().value}J.first=r;function L(a,R){for(const E of a)if(R(E))return!0;return!1}J.some=L;function v(a,R){for(const E of a)if(R(E))return E;return}J.find=v;function*g(a,R){for(const E of a)R(E)&&(yield E)}J.filter=g;function*p(a,R){let E=0;for(const S of a)yield R(S,E++)}J.map=p;function*u(...a){for(const R of a)for(const E of R)yield E}J.concat=u;function*h(a){for(const R of a)for(const E of R)yield E}J.concatNested=h;function c(a,R,E){let S=E;for(const D of a)S=R(S,D);return S}J.reduce=c;function*o(a,R,E=a.length){for(R<0&&(R+=a.length),E<0?E+=a.length:E>a.length&&(E=a.length);R<E;R++)yield a[R]}J.slice=o;function l(a,R=Number.POSITIVE_INFINITY){const E=[];if(R===0)return[E,a];const S=a[Symbol.iterator]();for(let D=0;D<R;D++){const A=S.next();if(A.done)return[E,J.empty()];E.push(A.value)}return[E,{[Symbol.iterator](){return S}}]}J.consume=l;function s(a,R,E=(S,D)=>S===D){const S=a[Symbol.iterator](),D=R[Symbol.iterator]();for(;;){const A=S.next(),O=D.next();if(A.done!==O.done)return!1;if(A.done)return!0;if(!E(A.value,O.value))return!1}}J.equals=s})(ne||(ne={}))},LdHM:function(nt,ye,Q){"use strict";Q.d(ye,"b",function(){return a}),Q.d(ye,"a",function(){return E});var ne=Q("1OyB"),J=Q("vuIU"),P=Q("Ji7U"),Y=Q("LK+K"),j=Q("q1tI"),U=Q("rePB"),z=Q("Ff2n"),H=Q("ODXe"),r=Q("4IlW"),L=Q("bX4T"),v=Q("YrtM"),g=Q("TSYQ"),p=Q.n(g),u=Q("+nKL"),h=Q("8OUc"),c=function(W,$){var ae=W.prefixCls,ue=W.id,Oe=W.flattenOptions,ve=W.childrenAsData,Ee=W.values,xe=W.searchValue,Ie=W.multiple,de=W.defaultActiveFirstOption,ce=W.height,ie=W.itemHeight,fe=W.notFoundContent,le=W.open,ke=W.menuItemSelectedIcon,Ne=W.virtual,Ae=W.onSelect,Le=W.onToggleOpen,Fe=W.onActiveValue,oe=W.onScroll,ge=W.onMouseEnter,we="".concat(ae,"-item"),De=Object(v.a)(function(){return Oe},[le,Oe],function(We,Re){return Re[0]&&We[1]!==Re[1]}),je=j.useRef(null),Ve=function(Re){Re.preventDefault()},Je=function(Re){je.current&&je.current.scrollTo({index:Re})},Xe=function(Re){for(var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ce=De.length,re=0;re<Ce;re+=1){var se=(Re+re*be+Ce)%Ce,he=De[se],me=he.group,Se=he.data;if(!me&&!Se.disabled)return se}return-1},et=j.useState(function(){return Xe(0)}),Ze=Object(H.a)(et,2),rt=Ze[0],Be=Ze[1],ut=function(Re){Be(Re);var be=De[Re];if(!be){Fe(null,-1);return}Fe(be.data.value,Re)};j.useEffect(function(){ut(de!==!1?Xe(0):-1)},[De.length,xe]),j.useEffect(function(){var We=setTimeout(function(){if(!Ie&&le&&Ee.size===1){var Re=Array.from(Ee)[0],be=De.findIndex(function(Ce){var re=Ce.data;return re.value===Re});ut(be),Je(be)}});return function(){return clearTimeout(We)}},[le]);var it=function(Re){Re!==void 0&&Ae(Re,{selected:!Ee.has(Re)}),Ie||Le(!1)};if(j.useImperativeHandle($,function(){return{onKeyDown:function(Re){var be=Re.which;switch(be){case r.a.UP:case r.a.DOWN:{var Ce=0;if(be===r.a.UP?Ce=-1:be===r.a.DOWN&&(Ce=1),Ce!==0){var re=Xe(rt+Ce,Ce);Je(re),ut(re)}break}case r.a.ENTER:{var se=De[rt];se&&!se.data.disabled?it(se.data.value):it(void 0),le&&Re.preventDefault();break}case r.a.ESC:Le(!1)}},onKeyUp:function(){},scrollTo:function(Re){Je(Re)}}}),De.length===0)return j.createElement("div",{role:"listbox",id:"".concat(ue,"_list"),className:"".concat(we,"-empty"),onMouseDown:Ve},fe);function He(We){var Re=De[We];if(!Re)return null;var be=Re.data||{},Ce=be.value,re=be.label,se=be.children,he=Object(L.a)(be,!0),me=ve?se:re;return Re?j.createElement("div",Object.assign({"aria-label":typeof me=="string"?me:null},he,{key:We,role:"option",id:"".concat(ue,"_list_").concat(We),"aria-selected":Ee.has(Ce)}),Ce):null}return j.createElement(j.Fragment,null,j.createElement("div",{role:"listbox",id:"".concat(ue,"_list"),style:{height:0,width:0,overflow:"hidden"}},He(rt-1),He(rt),He(rt+1)),j.createElement(u.a,{itemKey:"key",ref:je,data:De,height:ce,itemHeight:ie,fullHeight:!1,onMouseDown:Ve,onScroll:oe,virtual:Ne,onMouseEnter:ge},function(We,Re){var be,Ce=We.group,re=We.groupOption,se=We.data,he=se.label,me=se.key;if(Ce)return j.createElement("div",{className:p()(we,"".concat(we,"-group"))},he!==void 0?he:me);var Se=se.disabled,Ue=se.value,Ke=se.title,ot=se.children,mt=se.style,ft=se.className,wt=Object(z.a)(se,["disabled","value","title","children","style","className"]),St=Ee.has(Ue),dt="".concat(we,"-option"),Bt=p()(we,dt,ft,(be={},Object(U.a)(be,"".concat(dt,"-grouped"),re),Object(U.a)(be,"".concat(dt,"-active"),rt===Re&&!Se),Object(U.a)(be,"".concat(dt,"-disabled"),Se),Object(U.a)(be,"".concat(dt,"-selected"),St),be)),Lt=ve?ot:he,qt=!ke||typeof ke=="function"||St;return j.createElement("div",Object.assign({},wt,{"aria-selected":St,className:Bt,title:Ke,onMouseMove:function(){if(rt===Re||Se)return;ut(Re)},onClick:function(){Se||it(Ue)},style:mt}),j.createElement("div",{className:"".concat(dt,"-content")},Lt||Ue),j.isValidElement(ke)||St,qt&&j.createElement(h.a,{className:"".concat(we,"-option-state"),customizeIcon:ke,customizeIconProps:{isSelected:St}},St?"\u2713":null))}))},o=j.forwardRef(c);o.displayName="OptionList";var l=o,s=function(){return null};s.isSelectOption=!0;var a=s,R=function(){return null};R.isSelectOptGroup=!0;var E=R,S=Q("VTBJ"),D=Q("Zm9Q");function A(m){var W=m.key,$=m.props,ae=$.children,ue=$.value,Oe=Object(z.a)($,["children","value"]);return Object(S.a)({key:W,value:ue!==void 0?ue:W,children:ae},Oe)}function O(m){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(D.a)(m).map(function($,ae){if(!j.isValidElement($)||!$.type)return null;var ue=$.type.isSelectOptGroup,Oe=$.key,ve=$.props,Ee=ve.children,xe=Object(z.a)(ve,["children"]);return W||!ue?A($):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(Oe===null?ae:Oe,"__"),label:Oe},xe),{},{options:O(Ee)})}).filter(function($){return $})}var C=Q("2Qr1"),x=Q("qNPg"),f=Q("U8pU"),w=Q("Kwbf"),b=Q("WKfj");function y(m){var W=m.mode,$=m.options,ae=m.children,ue=m.backfill,Oe=m.allowClear,ve=m.placeholder,Ee=m.getInputElement,xe=m.showSearch,Ie=m.onSearch,de=m.defaultOpen,ce=m.autoFocus,ie=m.labelInValue,fe=m.value,le=m.inputValue,ke=m.optionLabelProp,Ne=W==="multiple"||W==="tags",Ae=xe!==void 0?xe:Ne||W==="combobox",Le=$||O(ae);if(Object(w.a)(W!=="tags"||Le.every(function(we){return!we.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),W==="tags"||W==="combobox"){var Fe=Le.some(function(we){return we.options?we.options.some(function(De){return typeof("value"in De?De.value:De.key)=="number"}):typeof("value"in we?we.value:we.key)=="number"});Object(w.a)(!Fe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(w.a)(W!=="combobox"||!ke,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(w.a)(W==="combobox"||!ue,"`backfill` only works with `combobox` mode."),Object(w.a)(W==="combobox"||!Ee,"`getInputElement` only work with `combobox` mode."),Object(w.b)(W!=="combobox"||!Ee||!Oe||!ve,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ie&&!Ae&&W!=="combobox"&&W!=="tags"&&Object(w.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(w.b)(!de||ce,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),fe!=null){var oe=Object(b.d)(fe);Object(w.a)(!ie||oe.every(function(we){return Object(f.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(w.a)(!Ne||Array.isArray(fe),"`value` should be array when `mode` is `multiple` or `tags`")}if(ae){var ge=null;Object(D.a)(ae).some(function(we){if(!j.isValidElement(we)||!we.type)return!1;var De=we.type;if(De.isSelectOption)return!1;if(De.isSelectOptGroup){var je=Object(D.a)(we.props.children).every(function(Ve){return!j.isValidElement(Ve)||!we.type||Ve.type.isSelectOption?!0:(ge=Ve.type,!1)});return!je}return ge=De,!0}),ge&&Object(w.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ge.displayName||ge.name||ge,"`.")),Object(w.a)(le===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var B=y,F=Object(x.a)({prefixCls:"rc-select",components:{optionList:l},convertChildrenToData:O,flattenOptions:C.d,getLabeledValue:C.e,filterOptions:C.b,isValueDisabled:C.g,findValueOption:C.c,warningProps:B,fillOptionsWithMissingValue:C.a}),_=function(m){Object(P.a)($,m);var W=Object(Y.a)($);function $(){var ae;return Object(ne.a)(this,$),ae=W.apply(this,arguments),ae.selectRef=j.createRef(),ae.focus=function(){ae.selectRef.current.focus()},ae.blur=function(){ae.selectRef.current.blur()},ae}return Object(J.a)($,[{key:"render",value:function(){return j.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),$}(j.Component);_.Option=a,_.OptGroup=E;var M=_,I=ye.c=M},M8RZ:function(nt,ye,Q){"use strict";Q.d(ye,"a",function(){return r});var ne=Q("fWQN"),J=Q("mtLc"),P=Q("yKVA"),Y=Q("879j"),j=Q("q1tI"),U=Q.n(j),z=Q("i8i4"),H=Q.n(z),r=function(L){Object(P.a)(g,L);var v=Object(Y.a)(g);function g(p){var u;Object(ne.a)(this,g),u=v.call(this,p);var h=window.document;return u.node=h.createElement("div"),h.body.appendChild(u.node),u}return Object(J.a)(g,[{key:"render",value:function(){var u=this.props.children;return Object(z.createPortal)(u,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),g}(U.a.Component)},MI8n:function(nt,ye,Q){"use strict";Q.d(ye,"c",function(){return j}),Q.d(ye,"b",function(){return r}),Q.d(ye,"e",function(){return L}),Q.d(ye,"a",function(){return v}),Q.d(ye,"d",function(){return g}),Q.d(ye,"f",function(){return p});var ne=Q("/cxE"),J=Q("pmY6"),P=Q("24hK"),Y=Q("5Y4S"),j;(function(u){u.None=()=>J.a.None;function h(y){return(B,F=null,_)=>{let M=!1,I;return I=y(m=>M?void 0:(I?I.dispose():M=!0,B.call(F,m)),null,_),M&&I.dispose(),I}}u.once=h;function c(y,B){return E((F,_=null,M)=>y(I=>F.call(_,B(I)),null,M))}u.map=c;function o(y,B){return E((F,_=null,M)=>y(I=>{B(I),F.call(_,I)},null,M))}u.forEach=o;function l(y,B){return E((F,_=null,M)=>y(I=>B(I)&&F.call(_,I),null,M))}u.filter=l;function s(y){return y}u.signal=s;function a(...y){return(B,F=null,_)=>Object(J.e)(...y.map(M=>M(I=>B.call(F,I),null,_)))}u.any=a;function R(y,B,F){let _=F;return c(y,M=>(_=B(_,M),_))}u.reduce=R;function E(y){let B;const F=new r({onFirstListenerAdd(){B=y(F.fire,F)},onLastListenerRemove(){B.dispose()}});return F.event}function S(y,B,F=100,_=!1,M){let I,m,W,$=0;const ae=new r({leakWarningThreshold:M,onFirstListenerAdd(){I=y(ue=>{$++,m=B(m,ue),_&&!W&&(ae.fire(m),m=void 0),clearTimeout(W),W=setTimeout(()=>{const Oe=m;m=void 0,W=void 0,(!_||$>1)&&ae.fire(Oe),$=0},F)})},onLastListenerRemove(){I.dispose()}});return ae.event}u.debounce=S;function D(y,B=(F,_)=>F===_){let F=!0,_;return l(y,M=>{const I=F||!B(M,_);return F=!1,_=M,I})}u.latch=D;function A(y,B){return[u.filter(y,B),u.filter(y,F=>!B(F))]}u.split=A;function O(y,B=!1,F=[]){let _=F.slice(),M=y(W=>{_?_.push(W):m.fire(W)});const I=()=>{_&&_.forEach(W=>m.fire(W)),_=null},m=new r({onFirstListenerAdd(){M||(M=y(W=>m.fire(W)))},onFirstListenerDidAdd(){_&&(B?setTimeout(I):I())},onLastListenerRemove(){M&&M.dispose(),M=null}});return m.event}u.buffer=O;class C{constructor(y){this.event=y}map(y){return new C(c(this.event,y))}forEach(y){return new C(o(this.event,y))}filter(y){return new C(l(this.event,y))}reduce(y,B){return new C(R(this.event,y,B))}latch(){return new C(D(this.event))}debounce(y,B=100,F=!1,_){return new C(S(this.event,y,B,F,_))}on(y,B,F){return this.event(y,B,F)}once(y,B,F){return h(this.event)(y,B,F)}}function x(y){return new C(y)}u.chain=x;function f(y,B,F=_=>_){const _=(...W)=>m.fire(F(...W)),M=()=>y.on(B,_),I=()=>y.removeListener(B,_),m=new r({onFirstListenerAdd:M,onLastListenerRemove:I});return m.event}u.fromNodeEventEmitter=f;function w(y,B,F=_=>_){const _=(...W)=>m.fire(F(...W)),M=()=>y.addEventListener(B,_),I=()=>y.removeEventListener(B,_),m=new r({onFirstListenerAdd:M,onLastListenerRemove:I});return m.event}u.fromDOMEventEmitter=w;function b(y){return new Promise(B=>h(y)(B))}u.toPromise=b})(j||(j={}));class U{constructor(u){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${u}_${U._idPool++}`}start(u){this._stopWatch=new Y.a(!0),this._listenerCount=u}stop(){if(this._stopWatch){const u=this._stopWatch.elapsed();this._elapsedOverall+=u,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${u.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}U._idPool=0;let z=-1;class H{constructor(u,h=Math.random().toString(18).slice(2,5)){this.customThreshold=u,this.name=h,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(u){let h=z;if(typeof this.customThreshold=="number"&&(h=this.customThreshold),h<=0||u<h)return;this._stacks||(this._stacks=new Map);const c=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),o=this._stacks.get(c)||0;if(this._stacks.set(c,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=h*.5;let l,s=0;for(const[a,R]of this._stacks)(!l||s<R)&&(l=a,s=R);console.warn(`[${this.name}] potential listener LEAK detected, having ${u} listeners already. MOST frequent listener (${s}):`),console.warn(l)}return()=>{const l=this._stacks.get(c)||0;this._stacks.set(c,l-1)}}}class r{constructor(u){var h;this._disposed=!1,this._options=u,this._leakageMon=z>0?new H(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((h=this._options)===null||h===void 0?void 0:h._profName)?new U(this._options._profName):void 0}get event(){return this._event||(this._event=(u,h,c)=>{var o;this._listeners||(this._listeners=new P.a);const l=this._listeners.isEmpty();l&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const s=this._listeners.push(h?[u,h]:u);l&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,u,h);const a=(o=this._leakageMon)===null||o===void 0?void 0:o.check(this._listeners.size),R=Object(J.i)(()=>{if(a&&a(),!this._disposed&&(s(),this._options&&this._options.onLastListenerRemove)){const E=this._listeners&&!this._listeners.isEmpty();E||this._options.onLastListenerRemove(this)}});return c instanceof J.b?c.add(R):Array.isArray(c)&&c.push(R),R}),this._event}fire(u){var h,c;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new P.a);for(let o of this._listeners)this._deliveryQueue.push([o,u]);for((h=this._perfMon)===null||h===void 0||h.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[o,l]=this._deliveryQueue.shift();try{typeof o=="function"?o.call(void 0,l):o[0].call(o[1],l)}catch(s){Object(ne.f)(s)}}(c=this._perfMon)===null||c===void 0||c.stop()}}dispose(){var u,h,c,o,l;this._disposed||(this._disposed=!0,(u=this._listeners)===null||u===void 0||u.clear(),(h=this._deliveryQueue)===null||h===void 0||h.clear(),(o=(c=this._options)===null||c===void 0?void 0:c.onLastListenerRemove)===null||o===void 0||o.call(c),(l=this._leakageMon)===null||l===void 0||l.dispose())}}class L extends r{constructor(u){super(u);this._isPaused=0,this._eventQueue=new P.a,this._mergeFn=u==null?void 0:u.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const u=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(u))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(u){this._listeners&&(this._isPaused!==0?this._eventQueue.push(u):super.fire(u))}}class v extends L{constructor(u){var h;super(u);this._delay=(h=u.delay)!==null&&h!==void 0?h:100}fire(u){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(u)}}class g{constructor(){this.buffers=[]}wrapEvent(u){return(h,c,o)=>u(l=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>h.call(c,l)):h.call(c,l)},void 0,o)}bufferEvents(u){const h=[];this.buffers.push(h);const c=u();return this.buffers.pop(),h.forEach(o=>o()),c}}class p{constructor(){this.listening=!1,this.inputEvent=j.None,this.inputEventListener=J.a.None,this.emitter=new r({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(u){this.inputEvent=u,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=u(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(nt,ye,Q){"use strict";(function(ne,J){Q.d(ye,"b",function(){return c}),Q.d(ye,"i",function(){return a}),Q.d(ye,"f",function(){return R}),Q.d(ye,"d",function(){return E}),Q.d(ye,"g",function(){return S}),Q.d(ye,"h",function(){return D}),Q.d(ye,"c",function(){return A}),Q.d(ye,"k",function(){return O}),Q.d(ye,"j",function(){return C}),Q.d(ye,"a",function(){return x}),Q.d(ye,"e",function(){return b});var P;const Y="en";let j=!1,U=!1,z=!1,H=!1,r=!1,L=!1,v=!1,g,p=Y,u,h;const c=typeof self=="object"?self:typeof ne=="object"?ne:{};let o;typeof c.vscode!="undefined"&&typeof c.vscode.process!="undefined"?o=c.vscode.process:typeof J!="undefined"&&(o=J);const l=typeof((P=o==null?void 0:o.versions)===null||P===void 0?void 0:P.electron)=="string"&&o.type==="renderer";if(typeof navigator=="object"&&!l)h=navigator.userAgent,j=h.indexOf("Windows")>=0,U=h.indexOf("Macintosh")>=0,v=(h.indexOf("Macintosh")>=0||h.indexOf("iPad")>=0||h.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,z=h.indexOf("Linux")>=0,L=!0,g=navigator.language,p=g;else if(typeof o=="object"){j=o.platform==="win32",U=o.platform==="darwin",z=o.platform==="linux",H=z&&!!o.env.SNAP&&!!o.env.SNAP_REVISION,g=Y,p=Y;const y=o.env.VSCODE_NLS_CONFIG;if(y)try{const B=JSON.parse(y),F=B.availableLanguages["*"];g=B.locale,p=F||Y,u=B._translationsConfigFile}catch(B){}r=!0}else console.error("Unable to resolve platform.");let s=0;U?s=1:j?s=3:z&&(s=2);const a=j,R=U,E=z,S=r,D=L,A=v,O=h,C=function(){if(c.setImmediate)return c.setImmediate.bind(c);if(typeof c.postMessage=="function"&&!c.importScripts){let F=[];c.addEventListener("message",M=>{if(M.data&&M.data.vscodeSetImmediateId)for(let I=0,m=F.length;I<m;I++){const W=F[I];if(W.id===M.data.vscodeSetImmediateId){F.splice(I,1),W.callback();return}}});let _=0;return M=>{const I=++_;F.push({id:I,callback:M}),c.postMessage({vscodeSetImmediateId:I},"*")}}if(typeof(o==null?void 0:o.nextTick)=="function")return o.nextTick.bind(o);const B=Promise.resolve();return F=>B.then(F)}(),x=U||v?2:j?1:3;let f=!0,w=!1;function b(){if(!w){w=!0;const y=new Uint8Array(2);y[0]=1,y[1]=2;const B=new Uint16Array(y.buffer);f=B[0]===(2<<8)+1}return f}}).call(this,Q("IyRk"),Q("Q2Ig"))},N0LK:function(nt,ye,Q){"use strict";Q.d(ye,"C",function(){return ne}),Q.d(ye,"v",function(){return P}),Q.d(ye,"s",function(){return Y}),Q.d(ye,"t",function(){return j}),Q.d(ye,"U",function(){return U}),Q.d(ye,"J",function(){return z}),Q.d(ye,"O",function(){return H}),Q.d(ye,"p",function(){return r}),Q.d(ye,"T",function(){return L}),Q.d(ye,"q",function(){return v}),Q.d(ye,"N",function(){return g}),Q.d(ye,"M",function(){return p}),Q.d(ye,"Q",function(){return u}),Q.d(ye,"u",function(){return h}),Q.d(ye,"x",function(){return c}),Q.d(ye,"I",function(){return o}),Q.d(ye,"f",function(){return l}),Q.d(ye,"h",function(){return s}),Q.d(ye,"g",function(){return a}),Q.d(ye,"i",function(){return R}),Q.d(ye,"G",function(){return E}),Q.d(ye,"H",function(){return S}),Q.d(ye,"r",function(){return D}),Q.d(ye,"R",function(){return A}),Q.d(ye,"d",function(){return O}),Q.d(ye,"e",function(){return C}),Q.d(ye,"E",function(){return x}),Q.d(ye,"F",function(){return f}),Q.d(ye,"j",function(){return w}),Q.d(ye,"z",function(){return b}),Q.d(ye,"K",function(){return B}),Q.d(ye,"L",function(){return F}),Q.d(ye,"m",function(){return M}),Q.d(ye,"k",function(){return m}),Q.d(ye,"A",function(){return $}),Q.d(ye,"a",function(){return ae}),Q.d(ye,"n",function(){return ue}),Q.d(ye,"l",function(){return Oe}),Q.d(ye,"D",function(){return ve}),Q.d(ye,"B",function(){return Ee}),Q.d(ye,"b",function(){return xe}),Q.d(ye,"S",function(){return Ie}),Q.d(ye,"o",function(){return de}),Q.d(ye,"P",function(){return ce}),Q.d(ye,"w",function(){return ie}),Q.d(ye,"c",function(){return fe}),Q.d(ye,"y",function(){return Ne});function ne(oe){return!oe||typeof oe!="string"?!0:oe.trim().length===0}const J=/{(\d+)}/g;function P(oe,...ge){return ge.length===0?oe:oe.replace(J,function(we,De){const je=parseInt(De,10);return isNaN(je)||je<0||je>=ge.length?we:ge[je]})}function Y(oe){return oe.replace(/[<>&]/g,function(ge){switch(ge){case"<":return"<";case">":return">";case"&":return"&";default:return ge}})}function j(oe){return oe.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function U(oe,ge=" "){const we=z(oe,ge);return H(we,ge)}function z(oe,ge){if(!oe||!ge)return oe;const we=ge.length;if(we===0||oe.length===0)return oe;let De=0;for(;oe.indexOf(ge,De)===De;)De=De+we;return oe.substring(De)}function H(oe,ge){if(!oe||!ge)return oe;const we=ge.length,De=oe.length;if(we===0||De===0)return oe;let je=De,Ve=-1;for(;!(Ve=oe.lastIndexOf(ge,je-1),Ve===-1||Ve+we!==je);){if(Ve===0)return"";je=Ve}return oe.substring(0,je)}function r(oe){return oe.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function L(oe){return oe.replace(/\*/g,"")}function v(oe,ge,we={}){if(!oe)throw new Error("Cannot create regex from empty string");ge||(oe=j(oe)),we.wholeWord&&(/\B/.test(oe.charAt(0))||(oe="\\b"+oe),/\B/.test(oe.charAt(oe.length-1))||(oe=oe+"\\b"));let De="";return we.global&&(De+="g"),we.matchCase||(De+="i"),we.multiline&&(De+="m"),we.unicode&&(De+="u"),new RegExp(oe,De)}function g(oe){if(oe.source==="^"||oe.source==="^$"||oe.source==="$"||oe.source==="^\\s*$")return!1;const ge=oe.exec("");return!!(ge&&oe.lastIndex===0)}function p(oe){return(oe.global?"g":"")+(oe.ignoreCase?"i":"")+(oe.multiline?"m":"")+(oe.unicode?"u":"")}function u(oe){return oe.split(/\r\n|\r|\n/)}function h(oe){for(let ge=0,we=oe.length;ge<we;ge++){const De=oe.charCodeAt(ge);if(De!==32&&De!==9)return ge}return-1}function c(oe,ge=0,we=oe.length){for(let De=ge;De<we;De++){const je=oe.charCodeAt(De);if(je!==32&&je!==9)return oe.substring(ge,De)}return oe.substring(ge,we)}function o(oe,ge=oe.length-1){for(let we=ge;we>=0;we--){const De=oe.charCodeAt(we);if(De!==32&&De!==9)return we}return-1}function l(oe,ge){return oe<ge?-1:oe>ge?1:0}function s(oe,ge,we=0,De=oe.length,je=0,Ve=ge.length){for(;we<De&&je<Ve;we++,je++){let et=oe.charCodeAt(we),Ze=ge.charCodeAt(je);if(et<Ze)return-1;if(et>Ze)return 1}const Je=De-we,Xe=Ve-je;return Je<Xe?-1:Je>Xe?1:0}function a(oe,ge){return R(oe,ge,0,oe.length,0,ge.length)}function R(oe,ge,we=0,De=oe.length,je=0,Ve=ge.length){for(;we<De&&je<Ve;we++,je++){let et=oe.charCodeAt(we),Ze=ge.charCodeAt(je);if(et===Ze)continue;if(et>=128||Ze>=128)return s(oe.toLowerCase(),ge.toLowerCase(),we,De,je,Ve);E(et)&&(et-=32),E(Ze)&&(Ze-=32);const rt=et-Ze;if(rt===0)continue;return rt}const Je=De-we,Xe=Ve-je;return Je<Xe?-1:Je>Xe?1:0}function E(oe){return oe>=97&&oe<=122}function S(oe){return oe>=65&&oe<=90}function D(oe,ge){return oe.length===ge.length&&R(oe,ge)===0}function A(oe,ge){const we=ge.length;return ge.length>oe.length?!1:R(oe,ge,0,we)===0}function O(oe,ge){let we,De=Math.min(oe.length,ge.length);for(we=0;we<De;we++)if(oe.charCodeAt(we)!==ge.charCodeAt(we))return we;return De}function C(oe,ge){let we,De=Math.min(oe.length,ge.length);const je=oe.length-1,Ve=ge.length-1;for(we=0;we<De;we++)if(oe.charCodeAt(je-we)!==ge.charCodeAt(Ve-we))return we;return De}function x(oe){return 55296<=oe&&oe<=56319}function f(oe){return 56320<=oe&&oe<=57343}function w(oe,ge){return(oe-55296<<10)+(ge-56320)+65536}function b(oe,ge,we){const De=oe.charCodeAt(we);if(x(De)&&we+1<ge){const je=oe.charCodeAt(we+1);if(f(je))return w(De,je)}return De}function y(oe,ge){const we=oe.charCodeAt(ge-1);if(f(we)&&ge>1){const De=oe.charCodeAt(ge-2);if(x(De))return w(De,we)}return we}function B(oe,ge){const we=le.getInstance(),De=ge,je=oe.length,Ve=b(oe,je,ge);ge+=Ve>=65536?2:1;let Je=we.getGraphemeBreakType(Ve);for(;ge<je;){const Xe=b(oe,je,ge),et=we.getGraphemeBreakType(Xe);if(fe(Je,et))break;ge+=Xe>=65536?2:1,Je=et}return ge-De}function F(oe,ge){const we=le.getInstance(),De=ge,je=y(oe,ge);ge-=je>=65536?2:1;let Ve=we.getGraphemeBreakType(je);for(;ge>0;){const Je=y(oe,ge),Xe=we.getGraphemeBreakType(Je);if(fe(Xe,Ve))break;ge-=Je>=65536?2:1,Ve=Xe}return De-ge}const _=/(?:[\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 M(oe){return _.test(oe)}const I=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function m(oe){return I.test(oe)}const W=/^[\t\n\r\x20-\x7E]*$/;function $(oe){return W.test(oe)}const ae=/[\u2028\u2029]/;function ue(oe){return ae.test(oe)}function Oe(oe){for(let ge=0,we=oe.length;ge<we;ge++)if(ve(oe.charCodeAt(ge)))return!0;return!1}function ve(oe){return oe=+oe,oe>=11904&&oe<=55215||oe>=63744&&oe<=64255||oe>=65281&&oe<=65374}function Ee(oe){return oe>=127462&&oe<=127487||oe===8986||oe===8987||oe===9200||oe===9203||oe>=9728&&oe<=10175||oe===11088||oe===11093||oe>=127744&&oe<=128591||oe>=128640&&oe<=128764||oe>=128992&&oe<=129003||oe>=129280&&oe<=129535||oe>=129648&&oe<=129750}const xe=String.fromCharCode(65279);function Ie(oe){return!!(oe&&oe.length>0&&oe.charCodeAt(0)===65279)}function de(oe,ge=!1){return oe?(ge&&(oe=oe.replace(/\\./g,"")),oe.toLowerCase()!==oe):!1}function ce(oe){const ge=90-65+1;return oe=oe%(2*ge),oe<ge?String.fromCharCode(97+oe):String.fromCharCode(65+oe-ge)}function ie(oe){const ge=le.getInstance();return ge.getGraphemeBreakType(oe)}function fe(oe,ge){return oe===0?ge!==5&&ge!==7:oe===2&&ge===3?!1:oe===4||oe===2||oe===3||(ge===4||ge===2||ge===3)?!0:oe===8&&(ge===8||ge===9||ge===11||ge===12)||((oe===11||oe===9)&&(ge===9||ge===10)||((oe===12||oe===10)&&ge===10||(ge===5||ge===13||(ge===7||(oe===1||oe===13&&ge===14)))))?!1:!(oe===6&&ge===6)}class le{constructor(){this._data=ke()}static getInstance(){return le._INSTANCE||(le._INSTANCE=new le),le._INSTANCE}getGraphemeBreakType(oe){if(oe<32)return oe===10?3:oe===13?2:4;if(oe<127)return 0;const ge=this._data,we=ge.length/3;let De=1;for(;De<=we;)if(oe<ge[3*De])De=2*De;else if(oe>ge[3*De+1])De=2*De+1;else return ge[3*De+2];return 0}}le._INSTANCE=null;function ke(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function Ne(oe,ge){if(oe===0)return 0;const we=Ae(oe,ge);if(we!==void 0)return we;const De=y(ge,oe);return oe-=Le(De),oe}function Ae(oe,ge){let we=y(ge,oe);for(oe-=Le(we);Fe(we)||we===65039||we===8419;){if(oe===0)return;we=y(ge,oe),oe-=Le(we)}if(!Ee(we))return;if(oe>=0){const De=y(ge,oe);De===8205&&(oe-=Le(De))}return oe}function Le(oe){return oe>=65536?2:1}function Fe(oe){return 127995<=oe&&oe<=127999}},Ot1p:function(nt,ye,Q){"use strict";var ne=Q("2qtc"),J=Q("kLXV"),P=Q("rAM+"),Y=Q("miYZ"),j=Q("tsqr"),U=Q("9og8"),z=Q("tJVT"),H=Q("jrin"),r=Q("WmNS"),L=Q.n(r),v=Q("q1tI"),g=Q.n(v),p=Q("VrN/"),u=Q.n(p),h=Q("bdgK"),c=Q("p77/"),o=Q("Bd2K"),l=Q("ELLl"),s=Q("19Vz"),a=Q("lZu9"),R=Q("+NIl"),E=Q("kSUc"),S=Q("9Bee"),D=function(Se){var Ue=Se.value,Ke=Ue===void 0?"":Ue,ot=Se.className,mt=Se.showTextOnly,ft=Se.showLines,wt=Se.style,St=wt===void 0?{}:wt,dt=Object(v.useMemo)(function(){return""},[Ke]);return g.a.createElement(g.a.Fragment,null,g.a.createElement("div",{dangerouslySetInnerHTML:{__html:dt}}))},A=Q("0Owb"),O=Q("dejd"),C=Q("C+DQ"),x=Q("1vsH"),f=Q("m3rI"),w=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function b(Se){var Ue=Se.onActionCallback,Ke=Se.title,ot=Se.icon,mt=Se.actionName,ft=Se.className,wt=ft===void 0?"":ft,St=Se.children;function dt(){Ue(mt)}return g.a.createElement("a",{title:Ke,className:wt,onClick:dt},g.a.createElement("i",{className:"md-iconfont ".concat(ot)}),St)}var y=function(Se){var Ue=Se.watch,Ke=Se.showNullButton,ot=Se.onActionCallback,mt=Se.fullScreen,ft=Se.insertTemp,wt=Se.hidetoolBar,St=Se.uuid,dt=Se.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(x.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(x.F)("_educoder_session"),"&key=").concat(St,"&api=").concat(encodeURIComponent(f.a.PROXY_SERVER)));var Bt=[].concat(w,[{title:"".concat(Ue?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ue?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return g.a.createElement("ul",{className:"markdown-toolbar-container"},!wt&&Bt.map(function(Lt,qt){return g.a.createElement("li",{key:qt},Lt.actionName?g.a.createElement(b,Object(A.a)({},Lt,{onActionCallback:ot})):g.a.createElement("span",{className:"v-line"}))}),Ke?g.a.createElement("li",null,g.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ot},g.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ft&&g.a.createElement("li",null,g.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ft),onActionCallback:ot},g.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),g.a.createElement("li",{className:"btn-full-screen"},g.a.createElement(b,{icon:"".concat(mt?"icon-shrink":"icon-enlarge"),title:mt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ot})))},B=Q("M8RZ"),F=Q("+L6B"),_=Q("2/Rp"),M=Q("y8nQ"),I=Q("Vl3Y"),m=Q("5NDa"),W=Q("5rEg"),$={labelCol:{span:4},wrapperCol:{span:20}},ae=function(Se){var Ue=Se.callback,Ke=Se.onCancel;function ot(mt){Ue(mt)}return g.a.createElement(I.a,Object(A.a)({},$,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ot}),g.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},g.a.createElement(W.a,null)),g.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},g.a.createElement(W.a,null)),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(_.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(_.a,{type:"ghost",onClick:Ke},"\u53D6\u6D88")))},ue=Q("7ahc"),Oe=Q("HmJG"),ve=Q("BjJ7"),Ee=I.a.useForm,xe={width:280,marginRight:10},Ie={labelCol:{span:5},wrapperCol:{span:19}},de=function(Se){var Ue=Se.callback,Ke=Se.onCancel,ot=Ee(),mt=Object(z.a)(ot,1),ft=mt[0];function wt(Bt){Ue(Bt)}function St(Bt,Lt){if(Bt.status===-1){j.b.error(Bt.message);return}ft.setFieldsValue({src:"/api/attachments/".concat(Bt.id),type:Lt.type})}function dt(Bt){var Lt=Bt.target.files[0];ie(Lt,St)}return g.a.createElement(I.a,Object(A.a)({form:ft},Ie,{className:"upload-image-panel",onFinish:wt}),g.a.createElement(I.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},g.a.createElement("div",{className:"flex-container"},g.a.createElement(I.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},g.a.createElement(W.a,{style:xe})),g.a.createElement(ce,{onFileChange:dt}))),g.a.createElement(I.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},g.a.createElement(W.a,{style:{width:264}})),g.a.createElement(I.a.Item,{style:{textAlign:"right"}},g.a.createElement(_.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(_.a,{type:"ghost",onClick:Ke},"\u53D6\u6D88")))};function ce(Se){var Ue=Se.onFileChange;return g.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",g.a.createElement("input",{type:"file",onChange:Ue}))}function ie(Se,Ue){if(!Se)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ke=new FormData;Ke.append("editormd-image-file",Se),Ke.append("file_param_name","editormd-image-file"),Ke.append("byxhr","true");var ot=new window.XMLHttpRequest;ot.withCredentials=!0,ot.addEventListener("load",function(mt){Ue(JSON.parse(mt.target.responseText),Se)},!1),ot.addEventListener("error",function(mt){console.error(mt)},!1),ot.open("POST","".concat(ve.a,"/api/attachments.json")),ot.send(Ke)}var fe=Q("giR+"),le=Q("fyUT"),ke=Q("7Kak"),Ne=Q("9yH6"),Ae=Ne.a.Group,Le={margin:"0 8px"},Fe=function(Se){var Ue=Se.callback,Ke=Se.onCancel;function ot(mt){Ue(mt)}return g.a.createElement(I.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ot},g.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},g.a.createElement("span",{style:Le},"\u5355\u5143\u683C\u6570\uFF1A"),g.a.createElement("span",{style:Le},"\u884C\u6570"),g.a.createElement(I.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},g.a.createElement(le.a,null)),g.a.createElement("span",{style:Le},"\u5217\u6570"),g.a.createElement(I.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},g.a.createElement(le.a,null))),g.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},g.a.createElement("span",{style:Le},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),g.a.createElement(I.a.Item,{name:"align"},g.a.createElement(Ae,null,g.a.createElement(Ne.a,{value:"default"},g.a.createElement("i",{className:"fa fa-align-justify"})),g.a.createElement(Ne.a,{value:"left"},g.a.createElement("i",{className:"fa fa-align-left"})),g.a.createElement(Ne.a,{value:"center"},g.a.createElement("i",{className:"fa fa-align-center"})),g.a.createElement(Ne.a,{value:"right"},g.a.createElement("i",{className:"fa fa-align-right"}))))),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(_.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(_.a,{type:"ghost",onClick:Ke},"\u53D6\u6D88")))},oe=Q("ErOA"),ge=Q("7Cbv"),we="link",De="upload-image",je="code-block",Ve="add-table",Je="------------",Xe={default:Je,left:":".concat(Je),center:":".concat(Je,":"),right:"".concat(Je,":")},et=Q("9VGf"),Ze,rt;function Be(){}var ut=0,it=1e4,He="\u2581",We=`
|
|
**\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 Re(Se){return/^\d+$/.test(Se)?"".concat(Se,"px"):Se}var be=navigator.platform.toUpperCase().indexOf("MAC")>=0,Ce=be?"Cmd":"Ctrl",re=["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"],se=(Ze={},Object(H.a)(Ze,Ce+"-B","bold"),Object(H.a)(Ze,Ce+"-I","italic"),Ze),he=(rt={},Object(H.a)(rt,we,"\u6DFB\u52A0\u94FE\u63A5"),Object(H.a)(rt,je,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(H.a)(rt,De,"\u6DFB\u52A0\u6587\u4EF6"),Object(H.a)(rt,Ve,"\u6DFB\u52A0\u8868\u683C"),rt),me=ye.a=function(Se){var Ue=Se.defaultValue,Ke=Ue===void 0?"":Ue,ot=Se.onChange,mt=Se.width,ft=mt===void 0?"100%":mt,wt=Se.height,St=wt===void 0?400:wt,dt=Se.miniToolbar,Bt=dt===void 0?!1:dt,Lt=Se.isFocus,qt=Lt===void 0?!1:Lt,Qt=Se.watch,It=Se.insertTemp,Cr=Se.mode,zr=Cr===void 0?"markdown":Cr,yt=Se.id,Lr=yt===void 0?"markdown-editor-id":yt,bt=Se.showResizeBar,xt=bt===void 0?!1:bt,Ft=Se.noStorage,tr=Ft===void 0?!1:Ft,dr=Se.showNullButton,Pt=dr===void 0?!1:dr,ct=Se.hidetoolBar,Br=ct===void 0?!1:ct,Vt=Se.fullScreen,Jt=Vt===void 0?!1:Vt,Ot=Se.onBlur,lr=Se.onCMBeforeChange,Ir=Se.onFullScreen,Yr=Se.className,Qe=Yr===void 0?"":Yr,Ct=Se.disablePaste,mn=Ct===void 0?!1:Ct,gn=Se.placeholder,vn=gn===void 0?"":gn,yn=Se.values,X=yn===void 0?"":yn,T=Object(v.useState)(null),k=Object(z.a)(T,2),G=k[0],ee=k[1],V=Object(v.useState)(Ke),Te=Object(z.a)(V,2),ze=Te[0],tt=Te[1],pt=Object(v.useState)(Qt),Ye=Object(z.a)(pt,2),_t=Ye[0],jt=Ye[1],$t=Object(v.useState)(Jt),jr=Object(z.a)($t,2),Er=jr[0],xr=jr[1],Qr=Object(v.useState)(""),Dn=Object(z.a)(Qr,2),cr=Dn[0],Kr=Dn[1],un=Object(v.useState)(0),hn=Object(z.a)(un,2),Hr=hn[0],kn=hn[1],bn=Object(v.useState)(St),Kn=Object(z.a)(bn,2),Vn=Kn[0],Zr=Kn[1],$r=Object(v.useState)(!1),_n=Object(z.a)($r,2),di=_n[0],En=_n[1],nr=Object(v.useRef)(Object(ge.a)()),Ht=Object(v.useRef)(!1),yr=Object(v.useRef)(),kt=Object(v.useRef)(),ar=Object(v.useRef)(),zt=Object(v.useRef)(),nn=Object(v.useRef)(),fr=function(){var gt=Object(U.a)(L.a.mark(function At(){var Et,Dt;return L.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:return Xt.next=2,Object(oe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:nr.current}});case 2:Dt=Xt.sent,Dt!=null&&(Et=Dt.attachments)!==null&&Et!==void 0&&Et.length&&(console.log("cm:",G,kt),Dt.attachments.map(function(Nt){Nt.content_type.indexOf("image")>-1?G.replaceSelection(".concat(Nt.content_type,")")):Nt.content_type.indexOf("video")>-1?G.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Nt.content_type.indexOf("pdf")>-1?G.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Nt.id,"?type=").concat(Nt.content_type,'&disposition=inline" target="_blank">').concat(Nt.name,"</a>")):G.replaceSelection("[".concat(Nt.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(Nt.id,"?type=").concat(Nt.content_type,")"))}));case 4:case"end":return Xt.stop()}},At)}));return function(){return gt.apply(this,arguments)}}();Object(v.useEffect)(function(){tt(X),G==null||G.setValue(X)},[X]),Object(v.useEffect)(function(){Ir==null||Ir(Er)},[Er]),Object(v.useEffect)(function(){if(kt.current){var gt=u.a.fromTextArea(kt.current,{mode:zr,lineNumbers:!Bt,lineWrapping:!0,value:Ke,autoCloseTags:!0,autoCloseBrackets:!0});qt&>.focus();function At(Et,Dt){if(mn){Dt.preventDefault();return}var Ut=Dt.clipboardData;if(Ut){var Xt=Ut.types.toString(),Nt=Ut.items;if(Xt==="Files"||Ut.types.indexOf("Files")>-1){if(Dt.preventDefault(),zr=="stex")return;try{var ur,Dr=Nt[1];((ur=Nt[0])===null||ur===void 0?void 0:ur.kind)==="file"&&(Dr=Nt[0]);var Mt=Dr.getAsFile(),dn=Mt.name.split(".").pop();ie(Mt,function(Wt){if(Wt.id){var kr,Tr,Jr;(Mt==null||((kr=Mt.type)===null||kr===void 0)?void 0:kr.indexOf("image"))>-1?gt.replaceSelection(".concat(Wt.content_type,")")):(Mt==null||((Tr=Mt.type)===null||Tr===void 0)?void 0:Tr.indexOf("video"))>-1?gt.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Wt.id,'"></video>')):(Mt==null||((Jr=Mt.type)===null||Jr===void 0)?void 0:Jr.indexOf("pdf"))>-1?gt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Mt.type,'&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):re.includes(dn)?gt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Wt.id,'?type=office&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):gt.replaceSelection("[".concat(Mt.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}else(Wt==null?void 0:Wt.status)===401&&(document.location.href="/user/login")})}catch(Wt){j.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return gt.on("paste",At),gt.on("dragleave",function(Et,Dt){ar.current.classList.remove("mouse-hover-md")}),gt.on("dragover",function(Et,Dt){ar.current.classList.add("mouse-hover-md")}),gt.on("drop",function(Et,Dt){ar.current.classList.add("mouse-hover-md");var Ut;if(Ut=Dt.dataTransfer.files,Ut.length>0){Dt.preventDefault(),Dt.stopPropagation();for(var Xt=function(Dr){var Mt=Ut[Dr],dn=Mt.name.split(".").pop();ie(Mt,function(Wt){if(Wt.id){var kr,Tr,Jr;(Mt==null||((kr=Mt.type)===null||kr===void 0)?void 0:kr.indexOf("image"))>-1?gt.replaceSelection(".concat(Wt.content_type,")")):(Mt==null||((Tr=Mt.type)===null||Tr===void 0)?void 0:Tr.indexOf("video"))>-1?gt.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Wt.id,'"></video>')):(Mt==null||((Jr=Mt.type)===null||Jr===void 0)?void 0:Jr.indexOf("pdf"))>-1?gt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Mt.type,'&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):re.includes(dn)?gt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Wt.id,'?type=office&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):gt.replaceSelection("[".concat(Mt.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}else(Wt==null?void 0:Wt.status)===401&&(document.location.href="/user/login")})},Nt=0;Nt<Ut.length;Nt++)Xt(Nt)}}),ee(gt),function(){gt.off("paste",At)}}},[]);var Ar=Object(v.useCallback)(function(){if(ar.current)try{}catch(gt){console.log(gt,"---- to set md editor body height")}},[Vn,ar,Er]);Object(v.useEffect)(function(){function gt(){var Et=new h.default(function(Dt){var Ut=Object(P.a)(Dt),Xt;try{for(Ut.s();!(Xt=Ut.n()).done;){var Nt=Xt.value;(Nt.target.offsetHeight>0||Nt.target.offsetWidth>0)&&(Ar(),G.setSize("100%","100%"),G.refresh())}}catch(ur){Ut.e(ur)}finally{Ut.f()}});return Et.observe(kt.current.parentElement),Et}if(G){var At=gt();return function(){At.unobserve(kt.current.parentElement)}}},[G,Ar]),Object(v.useEffect)(function(){if(G){for(var gt=[],At=function(){var Nt=Dt[Et];Ut=Object(z.a)(Nt,2);var ur=Ut[0],Dr=Ut[1],Mt=Object(H.a)({},ur,function(){Xn(Dr)});gt.push(Mt),G.addKeyMap(Mt)},Et=0,Dt=Object.entries(se);Et<Dt.length;Et++){var Ut;At()}return yr.current=setInterval(function(){Ht.current&&fr()},4e3),function(){clearInterval(yr.current);var Xt=Object(P.a)(gt),Nt;try{for(Xt.s();!(Nt=Xt.n()).done;){var ur=Nt.value;G.removeKeyMap(ur)}}catch(Dr){Xt.e(Dr)}finally{Xt.f()}}}},[G]),Object(v.useEffect)(function(){Jt!==Er&&xr(Jt)},[Jt]),Object(et.a)(function(){if(!tr&&Hr>0){var gt=new Date().getTime(),At=window.sessionStorage.getItem(Lr);gt>=Hr+it&&(!At||At!==ze)&&(window.sessionStorage.setItem(Lr,ze),En(!0))}},it),Object(v.useEffect)(function(){jt(Qt)},[G,Qt]),Object(v.useEffect)(function(){G&&(qt&&G.focus())},[G,qt]),Object(v.useEffect)(function(){if(_t&&G){var gt=G.getScrollerElement();function At(Et){var Dt=Et.target;if(nn.current){var Ut=Dt.scrollTop/Dt.scrollHeight;nn.current.scrollTop=nn.current.scrollHeight*Ut}}return gt.addEventListener("scroll",At),function(){gt.removeEventListener("scroll",At)}}},[G,_t]),Object(v.useEffect)(function(){if(G&&lr){function gt(At,Et){lr(At,Et)}return G.on("beforeChange",gt),function(){G.off("beforeChange",gt)}}},[G,lr]),Object(v.useEffect)(function(){if(G&&Ot){function gt(){Ot(G.getValue())}return G.on("blur",gt),function(){G.off("blur",gt)}}},[G,Ot]),Object(v.useEffect)(function(){if(G){function gt(At){var Et=At.getValue();tt(Et),kn(new Date().getTime()),At.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ot&&ot(Et)}return G.on("change",gt),function(){G.off("change",gt)}}},[G,ot]),Object(v.useEffect)(function(){G&&(Ke==null?(G.setValue(""),tt("")):Ke!==G.getValue()&&(G.setValue(Ke),tt(Ke),G.setCursor(G.lineCount(),0)))},[G,Ke]);var Xn=Object(v.useCallback)(function(gt){var At=G.getCursor(),Et=G.getSelection(),Dt=Et.split(`
|
|
`);switch(gt){case"bold":return G.replaceSelection("**"+Et+"**"),Et===""&&G.setCursor(At.line,At.ch+2),G.focus();case"italic":return G.replaceSelection("*"+Et+"*"),Et===""&&G.setCursor(At.line,At.ch+1),G.focus();case"code":return G.replaceSelection("`"+Et+"`"),Et===""&&G.setCursor(At.line,At.ch+1),G.focus();case"inline-latex":return G.replaceSelection("`$$"+Et+"$$`"),Et===""&&G.setCursor(At.line,At.ch+3),G.focus();case"latex":return G.replaceSelection("```latex\n"+Et+"\n```"),G.setCursor(At.line+1,Et.length+1),G.focus();case"line-break":return G.replaceSelection(`<br/>
|
|
`),G.focus();case"list-ul":return Et===""?G.replaceSelection("- "+Et):G.replaceSelection(Dt.map(function(Ut){return Ut===""?"":"- ".concat(Ut)}).join(`
|
|
`)),G.focus();case"list-ol":return Et===""?G.replaceSelection("1. "+Et):G.replaceSelection(Dt.map(function(Ut,Xt){return Ut===""?"":"".concat(Xt+1,". ").concat(Ut)}).join(`
|
|
`)),G.focus();case"add-null-ch":return Et===""&&G.setCursor(At.line,At.ch+1),G.replaceSelection(He),G.focus();case"inster-template-1":return Et===""&&G.setCursor(At.line,At.ch),G.replaceSelection(We),G.focus();case"eraser":return G.setValue(""),G.focus();case"trigger-watch":return jt(!_t),G.focus();case"trigger-full-screen":return xr(!Er),G.focus();case we:Kr(we);return;case je:Kr(je);return;case De:Kr(De);return;case Ve:Kr(Ve);return;default:throw new Error}},[G,_t,Er]),xn=Object(v.useCallback)(function(gt){Kr("");switch(cr){case we:var At=gt.title,Et=gt.link;return G.replaceSelection("[".concat(At,"](").concat(Et,")")),G.focus();case je:var Dt=gt.language,Ut=gt.content;return G.replaceSelection(["```"+Dt,Ut,"```"].join(`
|
|
`)),G.focus();case De:var Xt=gt.src,Nt=gt.alt;return Nt?G.replaceSelection(".concat(Xt,' "').concat(Nt,'" )')):G.replaceSelection("")),G.focus();case Ve:for(var ur=gt.row,Dr=gt.col,Mt=gt.align,dn=`
|
|
`,Wt=0;Wt<ur;Wt++){for(var kr=[],Tr=[],Jr=0;Jr<Dr;Jr++)Wt===1&&Tr.push(Xe[Mt]),kr.push(" ");Wt===1&&(dn+="| ".concat(Tr.join(" | "),` |
|
|
`)),dn+="| ".concat(kr.join(Dr===1?"":" | "),` |
|
|
`)}return G.replaceSelection(dn+`
|
|
`),G.focus();default:throw new Error}},[G,cr]),ci=Object(v.useMemo)(function(){switch(cr){case we:return g.a.createElement(ae,{callback:xn,onCancel:Tn});case je:return g.a.createElement(ue.b,{callback:xn,onCancel:Tn});case De:return g.a.createElement(de,{callback:xn,onCancel:Tn});case Ve:return g.a.createElement(Fe,{callback:xn,onCancel:Tn});default:return null}},[cr]);function Tn(){Kr("")}Object(v.useEffect)(function(){if(zt.current){var gt=zt.current,At=!1,Et=0;function Dt(Nt){At=!0,Et=Nt.pageY}function Ut(){At=!1}function Xt(Nt){if(At){var ur=Nt.pageY-Et;ur<0&&(ur=0),ur>300&&(ur=300);var Dr=St+ur+"px";Zr(Dr)}}return gt.addEventListener("mousedown",Dt),document.addEventListener("mousemove",Xt),document.addEventListener("mouseup",Ut),function(){gt.removeEventListener("mousedown",Dt),document.removeEventListener("mousemove",Xt),document.removeEventListener("mouseup",Ut)}}},[G,zt]),Object(v.useEffect)(function(){Zr(St)},[St]);var an=Re(ft),fi=Re(Vn),qr={width:an,height:fi},pi=Object(v.useMemo)(function(){if(Hr){var gt=new Date(Hr),At=gt.getHours(),Et=gt.getMinutes(),Dt=gt.getSeconds();return At=At<10?"0"+At:At,Et=Et<10?"0"+Et:Et,Dt=Dt<10?"0"+Dt:Dt,"".concat(At,":").concat(Et,":").concat(Dt)}return 0},[Hr]);function ji(){window.sessionStorage.removeItem(Lr),En(!1),kn(0)}function Mn(){En(!1),kn(0),G.setValue(window.sessionStorage.getItem(Lr))}function ua(gt,At){var Et=G.getValue();Et=Et.replace(gt,At),tt(Et),G==null||G.setValue(Et)}return g.a.createElement(v.Fragment,null,g.a.createElement("div",{className:"markdown-editor-wrapper",ref:ar},g.a.createElement("div",{className:"markdown-editor-container ".concat(Qe," ").concat(_t?"on-preview":""," ").concat(Bt?"mini":""," ").concat(Er?"full-screen":""),style:qr},g.a.createElement(y,{insertTemp:It,watch:_t,fullScreen:Er,showNullButton:Pt,onActionCallback:Xn,hidetoolBar:Br,uuid:nr.current,setOpenPhones:function(){Ht.current=!0}}),g.a.createElement("div",{className:"markdown-editor-body"},g.a.createElement("div",{className:"codemirror-container"},g.a.createElement("textarea",{ref:kt,placeholder:vn})),_t?g.a.createElement("div",{ref:nn,className:"preview-container"},zr==="stex"&&g.a.createElement(D,{value:ze}),zr!=="stex"&&g.a.createElement(S.a,{edit:!0,value:ze,replaces:ua})):null))),xt?g.a.createElement("a",{ref:zt,className:"editor-resize"}):null,g.a.createElement(B.a,null,he[cr]?g.a.createElement(J.a,{centered:!0,title:he[cr],visible:!0,onCancel:Tn,footer:null,className:"markdown-popup-form"},ci):null))}},SJMd:function(nt,ye){/**
|
|
* @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 Q,ne,J,P=!1,Y,j;window.PR_SHOULD_USE_CONTINUATION=!0;var U,z;(function(){var H=window,r=["break,continue,do,else,for,if,return,while"],L=[r,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],v=[L,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],g=[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"],u=[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",c=[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",l=[r,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],s=[r,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],a=[r,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=[g,u,p,c,o,l,s,a],E=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,S="str",D="kwd",A="com",O="typ",C="lit",x="pun",f="pln",w="tag",b="dec",y="src",B="atn",F="atv",_="nocode",M="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function I(Ae){for(var Le=0,Fe=!1,oe=!1,ge=0,we=Ae.length;ge<we;++ge){var De=Ae[ge];if(De.ignoreCase)oe=!0;else if(/[a-z]/i.test(De.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Fe=!0,oe=!1;break}}var je={b:8,t:9,n:10,v:11,f:12,r:13};function Ve(rt){var Be=rt.charCodeAt(0);if(Be!==92)return Be;var ut=rt.charAt(1);return Be=je[ut],Be||("0"<=ut&&ut<="7"?parseInt(rt.substring(1),8):ut==="u"||ut==="x"?parseInt(rt.substring(2),16):rt.charCodeAt(1))}function Je(rt){if(rt<32)return(rt<16?"\\x0":"\\x")+rt.toString(16);var Be=String.fromCharCode(rt);return Be==="\\"||Be==="-"||Be==="]"||Be==="^"?"\\"+Be:Be}function Xe(rt){var Be=rt.substring(1,rt.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),ut=[],it=Be[0]==="^",He=["["];it&&He.push("^");for(var We=it?1:0,Re=Be.length;We<Re;++We){var be=Be[We];if(/\\[bdsw]/i.test(be))He.push(be);else{var Ce=Ve(be),re;We+2<Re&&Be[We+1]==="-"?(re=Ve(Be[We+2]),We+=2):re=Ce,ut.push([Ce,re]),re<65||Ce>122||(re<65||Ce>90||ut.push([Math.max(65,Ce)|32,Math.min(re,90)|32]),re<97||Ce>122||ut.push([Math.max(97,Ce)&~32,Math.min(re,122)&~32]))}}ut.sort(function(Se,Ue){return Se[0]-Ue[0]||Ue[1]-Se[1]});for(var se=[],he=[],We=0;We<ut.length;++We){var me=ut[We];me[0]<=he[1]+1?he[1]=Math.max(he[1],me[1]):se.push(he=me)}for(var We=0;We<se.length;++We){var me=se[We];He.push(Je(me[0])),me[1]>me[0]&&(me[1]+1>me[0]&&He.push("-"),He.push(Je(me[1])))}return He.push("]"),He.join("")}function et(rt){for(var Be=rt.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),ut=Be.length,it=[],He=0,We=0;He<ut;++He){var Re=Be[He];if(Re==="(")++We;else if(Re.charAt(0)==="\\"){var be=+Re.substring(1);be&&(be<=We?it[be]=-1:Be[He]=Je(be))}}for(var He=1;He<it.length;++He)it[He]===-1&&(it[He]=++Le);for(var He=0,We=0;He<ut;++He){var Re=Be[He];if(Re==="(")++We,it[We]||(Be[He]="(?:");else if(Re.charAt(0)==="\\"){var be=+Re.substring(1);be&&be<=We&&(Be[He]="\\"+it[be])}}for(var He=0;He<ut;++He)Be[He]==="^"&&Be[He+1]!=="^"&&(Be[He]="");if(rt.ignoreCase&&Fe)for(var He=0;He<ut;++He){var Re=Be[He],Ce=Re.charAt(0);Re.length>=2&&Ce==="["?Be[He]=Xe(Re):Ce!=="\\"&&(Be[He]=Re.replace(/[a-zA-Z]/g,function(he){var me=he.charCodeAt(0);return"["+String.fromCharCode(me&~32,me|32)+"]"}))}return Be.join("")}for(var Ze=[],ge=0,we=Ae.length;ge<we;++ge){var De=Ae[ge];if(De.global||De.multiline)throw new Error(""+De);Ze.push("(?:"+et(De)+")")}return new RegExp(Ze.join("|"),oe?"gi":"g")}function m(Ae,Le){var Fe=/(?:^|\s)nocode(?:\s|$)/,oe=[],ge=0,we=[],De=0;function je(Ve){var Je=Ve.nodeType;if(Je==1){if(Fe.test(Ve.className))return;for(var Xe=Ve.firstChild;Xe;Xe=Xe.nextSibling)je(Xe);var et=Ve.nodeName.toLowerCase();(et==="br"||et==="li")&&(oe[De]=`
|
|
`,we[De<<1]=ge++,we[De++<<1|1]=Ve)}else if(Je==3||Je==4){var Ze=Ve.nodeValue;Ze.length&&(Le?Ze=Ze.replace(/\r\n?/g,`
|
|
`):Ze=Ze.replace(/[ \t\r\n]+/g," "),oe[De]=Ze,we[De<<1]=ge,ge+=Ze.length,we[De++<<1|1]=Ve)}}return je(Ae),{sourceCode:oe.join("").replace(/\n$/,""),spans:we}}function W(Ae,Le,Fe,oe,ge){if(!Fe)return;var we={sourceNode:Ae,pre:1,langExtension:null,numberLines:null,sourceCode:Fe,spans:null,basePos:Le,decorations:null};oe(we),ge.push.apply(ge,we.decorations)}var $=/\S/;function ae(Ae){for(var Le=void 0,Fe=Ae.firstChild;Fe;Fe=Fe.nextSibling){var oe=Fe.nodeType;Le=oe===1?Le?Ae:Fe:oe===3&&$.test(Fe.nodeValue)?Ae:Le}return Le===Ae?void 0:Le}function ue(Ae,Le){var Fe={},oe;(function(){for(var De=Ae.concat(Le),je=[],Ve={},Je=0,Xe=De.length;Je<Xe;++Je){var et=De[Je],Ze=et[3];if(Ze)for(var rt=Ze.length;--rt>=0;)Fe[Ze.charAt(rt)]=et;var Be=et[1],ut=""+Be;Ve.hasOwnProperty(ut)||(je.push(Be),Ve[ut]=null)}je.push(/[\0-\uffff]/),oe=I(je)})();var ge=Le.length,we=function(De){for(var je=De.sourceCode,Ve=De.basePos,Je=De.sourceNode,Xe=[Ve,f],et=0,Ze=je.match(oe)||[],rt={},Be=0,ut=Ze.length;Be<ut;++Be){var it=Ze[Be],He=rt[it],We=void 0,Re;if(typeof He=="string")Re=!1;else{var be=Fe[it.charAt(0)];if(be)We=it.match(be[1]),He=be[0];else{for(var Ce=0;Ce<ge;++Ce)if(be=Le[Ce],We=it.match(be[1]),We){He=be[0];break}We||(He=f)}Re=He.length>=5&&He.substring(0,5)==="lang-",Re&&!(We&&typeof We[1]=="string")&&(Re=!1,He=y),Re||(rt[it]=He)}var re=et;if(et+=it.length,!Re)Xe.push(Ve+re,He);else{var se=We[1],he=it.indexOf(se),me=he+se.length;We[2]&&(me=it.length-We[2].length,he=me-se.length);var Se=He.substring(5);W(Je,Ve+re,it.substring(0,he),we,Xe),W(Je,Ve+re+he,se,ce(Se,se),Xe),W(Je,Ve+re+me,it.substring(me),we,Xe)}}De.decorations=Xe};return we}function Oe(Ae){var Le=[],Fe=[];Ae.tripleQuotedStrings?Le.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ae.multiLineStrings?Le.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Le.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ae.verbatimStrings&&Fe.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var oe=Ae.hashComments;oe&&(Ae.cStyleComments?(oe>1?Le.push([A,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Le.push([A,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Fe.push([S,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Le.push([A,/^#[^\r\n]*/,null,"#"])),Ae.cStyleComments&&(Fe.push([A,/^\/\/[^\r\n]*/,null]),Fe.push([A,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ge=Ae.regexLiterals;if(ge){var we=ge>1?"":`
|
|
\r`,De=we?".":"[\\S\\s]",je="/(?=[^/*"+we+"])(?:[^/\\x5B\\x5C"+we+"]|\\x5C"+De+"|\\x5B(?:[^\\x5C\\x5D"+we+"]|\\x5C"+De+")*(?:\\x5D|$))+/";Fe.push(["lang-regex",RegExp("^"+M+"("+je+")")])}var Ve=Ae.types;Ve&&Fe.push([O,Ve]);var Je=(""+Ae.keywords).replace(/^ | $/g,"");Je.length&&Fe.push([D,new RegExp("^(?:"+Je.replace(/[\s,]+/g,"|")+")\\b"),null]),Le.push([f,/^\s+/,null,` \r
|
|
\xA0`]);var Xe="^.[^\\s\\w.$@'\"`/\\\\]*";return Ae.regexLiterals&&(Xe+="(?!s*/)"),Fe.push([C,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[f,/^[a-z_$][a-z_$@0-9]*/i,null],[C,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[f,/^\\[\s\S]?/,null],[x,new RegExp(Xe),null]),ue(Le,Fe)}var ve=Oe({keywords:R,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ee(Ae,Le,Fe){for(var oe=/(?:^|\s)nocode(?:\s|$)/,ge=/\r\n?|\n/,we=Ae.ownerDocument,De=we.createElement("li");Ae.firstChild;)De.appendChild(Ae.firstChild);var je=[De];function Ve(Be){var ut=Be.nodeType;if(ut==1&&!oe.test(Be.className))if(Be.nodeName==="br")Je(Be),Be.parentNode&&Be.parentNode.removeChild(Be);else for(var it=Be.firstChild;it;it=it.nextSibling)Ve(it);else if((ut==3||ut==4)&&Fe){var He=Be.nodeValue,We=He.match(ge);if(We){var Re=He.substring(0,We.index);Be.nodeValue=Re;var be=He.substring(We.index+We[0].length);if(be){var Ce=Be.parentNode;Ce.insertBefore(we.createTextNode(be),Be.nextSibling)}Je(Be),Re||Be.parentNode.removeChild(Be)}}}function Je(Be){for(;!Be.nextSibling;)if(Be=Be.parentNode,!Be)return;function ut(We,Re){var be=Re?We.cloneNode(!1):We,Ce=We.parentNode;if(Ce){var re=ut(Ce,1),se=We.nextSibling;re.appendChild(be);for(var he=se;he;he=se)se=he.nextSibling,re.appendChild(he)}return be}for(var it=ut(Be.nextSibling,0),He;(He=it.parentNode)&&He.nodeType===1;)it=He;je.push(it)}for(var Xe=0;Xe<je.length;++Xe)Ve(je[Xe]);Le===(Le|0)&&je[0].setAttribute("value",Le);var et=we.createElement("ol");et.className="linenums";for(var Ze=Math.max(0,Le-1|0)||0,Xe=0,rt=je.length;Xe<rt;++Xe)De=je[Xe],De.className="L"+(Xe+Ze)%10,De.firstChild||De.appendChild(we.createTextNode("\xA0")),et.appendChild(De);Ae.appendChild(et)}function xe(Ae){var Le=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Le=Le&&+Le[1]<=8;var Fe=/\n/g,oe=Ae.sourceCode,ge=oe.length,we=0,De=Ae.spans,je=De.length,Ve=0,Je=Ae.decorations,Xe=Je.length,et=0;Je[Xe]=ge;var Ze,rt;for(rt=Ze=0;rt<Xe;)Je[rt]!==Je[rt+2]?(Je[Ze++]=Je[rt++],Je[Ze++]=Je[rt++]):rt+=2;for(Xe=Ze,rt=Ze=0;rt<Xe;){for(var Be=Je[rt],ut=Je[rt+1],it=rt+2;it+2<=Xe&&Je[it+1]===ut;)it+=2;Je[Ze++]=Be,Je[Ze++]=ut,rt=it}Xe=Je.length=Ze;var He=Ae.sourceNode,We="";He&&(We=He.style.display,He.style.display="none");try{for(var Re=null;Ve<je;){var be=De[Ve],Ce=De[Ve+2]||ge,re=Je[et+2]||ge,it=Math.min(Ce,re),se=De[Ve+1],he;if(se.nodeType!==1&&(he=oe.substring(we,it))){Le&&(he=he.replace(Fe,"\r")),se.nodeValue=he;var me=se.ownerDocument,Se=me.createElement("span");Se.className=Je[et+1];var Ue=se.parentNode;Ue.replaceChild(Se,se),Se.appendChild(se),we<Ce&&(De[Ve+1]=se=me.createTextNode(oe.substring(it,Ce)),Ue.insertBefore(se,Se.nextSibling))}we=it,we>=Ce&&(Ve+=2),we>=re&&(et+=2)}}finally{He&&(He.style.display=We)}}var Ie={};function de(Ae,Le){for(var Fe=Le.length;--Fe>=0;){var oe=Le[Fe];Ie.hasOwnProperty(oe)?H.console&&console.warn("cannot override language handler %s",oe):Ie[oe]=Ae}}function ce(Ae,Le){return Ae&&Ie.hasOwnProperty(Ae)||(Ae=/^\s*</.test(Le)?"default-markup":"default-code"),Ie[Ae]}de(ve,["default-code"]),de(ue([],[[f,/^[^<?]+/],[b,/^<!\w[^>]*(?:>|$)/],[A,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[x,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),de(ue([[f,/^[\s]+/,null,` \r
|
|
`],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[w,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[B,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[x,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),de(ue([],[[F,/^[\s\S]+/]]),["uq.val"]),de(Oe({keywords:g,hashComments:!0,cStyleComments:!0,types:E}),["c","cc","cpp","cxx","cyc","m"]),de(Oe({keywords:"null,true,false"}),["json"]),de(Oe({keywords:u,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:E}),["cs"]),de(Oe({keywords:p,cStyleComments:!0}),["java"]),de(Oe({keywords:a,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),de(Oe({keywords:l,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),de(Oe({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),de(Oe({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),de(Oe({keywords:c,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),de(Oe({keywords:h,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),de(ue([],[[S,/^[\s\S]+/]]),["regex"]);function ie(Ae){var Le=Ae.langExtension;try{var Fe=m(Ae.sourceNode,Ae.pre),oe=Fe.sourceCode;Ae.sourceCode=oe,Ae.spans=Fe.spans,Ae.basePos=0,ce(Le,oe)(Ae),xe(Ae)}catch(ge){H.console&&console.log(ge&&ge.stack||ge)}}function fe(Ae,Le,Fe){var oe=Fe||!1,ge=Le||null,we=document.createElement("div");we.innerHTML="<pre>"+Ae+"</pre>",we=we.firstChild,oe&&Ee(we,oe,!0);var De={langExtension:ge,numberLines:oe,sourceNode:we,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ie(De),we.innerHTML}function le(Ae,Le){var Fe=Le||document.body,oe=Fe.ownerDocument||document;function ge(be){return Fe.getElementsByTagName(be)}for(var we=[ge("pre"),ge("code"),ge("xmp")],De=[],je=0;je<we.length;++je)for(var Ve=0,Je=we[je].length;Ve<Je;++Ve)De.push(we[je][Ve]);we=null;var Xe=Date;Xe.now||(Xe={now:function(){return+new Date}});var et=0,Ze=/\blang(?:uage)?-([\w.]+)(?!\S)/,rt=/\bprettyprint\b/,Be=/\bprettyprinted\b/,ut=/pre|xmp/i,it=/^code$/i,He=/^(?:pre|code|xmp)$/i,We={};function Re(){for(var be=H.PR_SHOULD_USE_CONTINUATION?Xe.now()+250:Infinity;et<De.length&&Xe.now()<be;et++){for(var Ce=De[et],re=We,se=Ce;se=se.previousSibling;){var he=se.nodeType,me=(he===7||he===8)&&se.nodeValue;if(me?!/^\??prettify\b/.test(me):he!==3||/\S/.test(se.nodeValue))break;if(me){re={},me.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Qt,It,Cr){re[It]=Cr});break}}var Se=Ce.className;if((re!==We||rt.test(Se))&&!Be.test(Se)){for(var Ue=!1,Ke=Ce.parentNode;Ke;Ke=Ke.parentNode){var ot=Ke.tagName;if(He.test(ot)&&Ke.className&&rt.test(Ke.className)){Ue=!0;break}}if(!Ue){Ce.className+=" prettyprinted";var mt=re.lang;if(!mt){mt=Se.match(Ze);var ft;!mt&&(ft=ae(Ce))&&it.test(ft.tagName)&&(mt=ft.className.match(Ze)),mt&&(mt=mt[1])}var wt;if(ut.test(Ce.tagName))wt=1;else{var St=Ce.currentStyle,dt=oe.defaultView,Bt=St?St.whiteSpace:dt&&dt.getComputedStyle?dt.getComputedStyle(Ce,null).getPropertyValue("white-space"):0;wt=Bt&&Bt.substring(0,3)==="pre"}var Lt=re.linenums;(Lt=Lt==="true"||+Lt)||(Lt=Se.match(/\blinenums\b(?::(\d+))?/),Lt=Lt?Lt[1]&&Lt[1].length?+Lt[1]:!0:!1),Lt&&Ee(Ce,Lt,wt);var qt={langExtension:mt,sourceNode:Ce,numberLines:Lt,pre:wt,sourceCode:null,basePos:null,spans:null,decorations:null};ie(qt)}}}et<De.length?H.setTimeout(Re,250):typeof Ae=="function"&&Ae()}Re()}var ke=H.PR={createSimpleLexer:ue,registerLangHandler:de,sourceDecorator:Oe,PR_ATTRIB_NAME:B,PR_ATTRIB_VALUE:F,PR_COMMENT:A,PR_DECLARATION:b,PR_KEYWORD:D,PR_LITERAL:C,PR_NOCODE:_,PR_PLAIN:f,PR_PUNCTUATION:x,PR_SOURCE:y,PR_STRING:S,PR_TAG:w,PR_TYPE:O,prettyPrintOne:P?H.prettyPrintOne=fe:U=fe,prettyPrint:z=P?H.prettyPrint=le:z=le},Ne=H.define;typeof Ne=="function"&&Ne.amd&&Ne("google-code-prettify",[],function(){return ke})})()},T8No:function(nt,ye,Q){"use strict";Q.d(ye,"a",function(){return z}),Q.d(ye,"e",function(){return H}),Q.d(ye,"c",function(){return x}),Q.d(ye,"b",function(){return f}),Q.d(ye,"d",function(){return w}),Q.d(ye,"f",function(){return B});var ne=Q("MNsG"),J=Q("N0LK"),P=Q("Cg/j");let Y=ne.k||"";const j=new Map;j.set("false",!1),j.set("true",!0),j.set("isMac",ne.f),j.set("isLinux",ne.d),j.set("isWindows",ne.i),j.set("isWeb",ne.h),j.set("isMacNative",ne.f&&!ne.h),j.set("isEdge",Y.indexOf("Edg/")>=0),j.set("isFirefox",Y.indexOf("Firefox")>=0),j.set("isChrome",Y.indexOf("Chrome")>=0),j.set("isSafari",Y.indexOf("Safari")>=0);const U=Object.prototype.hasOwnProperty;class z{static has(_){return g.create(_)}static equals(_,M){return p.create(_,M)}static regex(_,M){return S.create(_,M)}static not(_){return o.create(_)}static and(..._){return O.create(_,null)}static or(..._){return C.create(_,null,!0)}static deserialize(_,M=!1){return _?this._deserializeOrExpression(_,M):void 0}static _deserializeOrExpression(_,M){let I=_.split("||");return C.create(I.map(m=>this._deserializeAndExpression(m,M)),null,!0)}static _deserializeAndExpression(_,M){let I=_.split("&&");return O.create(I.map(m=>this._deserializeOne(m,M)),null)}static _deserializeOne(_,M){if(_=_.trim(),_.indexOf("!=")>=0){let I=_.split("!=");return c.create(I[0].trim(),this._deserializeValue(I[1],M))}if(_.indexOf("==")>=0){let I=_.split("==");return p.create(I[0].trim(),this._deserializeValue(I[1],M))}if(_.indexOf("=~")>=0){let I=_.split("=~");return S.create(I[0].trim(),this._deserializeRegexValue(I[1],M))}if(_.indexOf(" in ")>=0){let I=_.split(" in ");return u.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(_)){const I=_.split(">=");return a.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(_)){const I=_.split(">");return s.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(_)){const I=_.split("<=");return E.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(_)){const I=_.split("<");return R.create(I[0].trim(),I[1].trim())}return/^\!\s*/.test(_)?o.create(_.substr(1).trim()):g.create(_)}static _deserializeValue(_,M){if(_=_.trim(),_==="true")return!0;if(_==="false")return!1;let I=/^'([^']*)'$/.exec(_);return I?I[1].trim():_}static _deserializeRegexValue(_,M){if(Object(J.C)(_)){if(M)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let I=_.indexOf("/"),m=_.lastIndexOf("/");if(I===m||I<0){if(M)throw new Error(`bad regexp-value '${_}', missing /-enclosure`);return console.warn(`bad regexp-value '${_}', missing /-enclosure`),null}let W=_.slice(I+1,m),$=_[m+1]==="i"?"i":"";try{return new RegExp(W,$)}catch(ae){if(M)throw new Error(`bad regexp-value '${_}', parse error: ${ae}`);return console.warn(`bad regexp-value '${_}', parse error: ${ae}`),null}}}function H(_,M){const I=_?_.substituteConstants():void 0,m=M?M.substituteConstants():void 0;return!I&&!m?!0:!I||!m?!1:I.equals(m)}function r(_,M){return _.cmp(M)}class L{constructor(){this.type=0}cmp(_){return this.type-_.type}equals(_){return _.type===this.type}substituteConstants(){return this}evaluate(_){return!1}serialize(){return"false"}keys(){return[]}negate(){return v.INSTANCE}}L.INSTANCE=new L;class v{constructor(){this.type=1}cmp(_){return this.type-_.type}equals(_){return _.type===this.type}substituteConstants(){return this}evaluate(_){return!0}serialize(){return"true"}keys(){return[]}negate(){return L.INSTANCE}}v.INSTANCE=new v;class g{constructor(_,M){this.key=_,this.negated=M,this.type=2}static create(_,M=null){const I=j.get(_);return typeof I=="boolean"?I?v.INSTANCE:L.INSTANCE:new g(_,M)}cmp(_){return _.type!==this.type?this.type-_.type:b(this.key,_.key)}equals(_){return _.type===this.type?this.key===_.key:!1}substituteConstants(){const _=j.get(this.key);return typeof _=="boolean"?_?v.INSTANCE:L.INSTANCE:this}evaluate(_){return!!_.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(_,M,I){this.key=_,this.value=M,this.negated=I,this.type=4}static create(_,M,I=null){if(typeof M=="boolean")return M?g.create(_,I):o.create(_,I);const m=j.get(_);if(typeof m=="boolean"){const W=m?"true":"false";return M===W?v.INSTANCE:L.INSTANCE}return new p(_,M,I)}cmp(_){return _.type!==this.type?this.type-_.type:y(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){const _=j.get(this.key);if(typeof _=="boolean"){const M=_?"true":"false";return this.value===M?v.INSTANCE:L.INSTANCE}return this}evaluate(_){return _.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 u{constructor(_,M){this.key=_,this.valueKey=M,this.type=10,this.negated=null}static create(_,M){return new u(_,M)}cmp(_){return _.type!==this.type?this.type-_.type:y(this.key,this.valueKey,_.key,_.valueKey)}equals(_){return _.type===this.type?this.key===_.key&&this.valueKey===_.valueKey:!1}substituteConstants(){return this}evaluate(_){const M=_.getValue(this.valueKey),I=_.getValue(this.key);return Array.isArray(M)?M.indexOf(I)>=0:typeof I=="string"&&typeof M=="object"&&M!==null?U.call(M,I):!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(_){this._actual=_,this.type=11}static create(_){return new h(_)}cmp(_){return _.type!==this.type?this.type-_.type:this._actual.cmp(_._actual)}equals(_){return _.type===this.type?this._actual.equals(_._actual):!1}substituteConstants(){return this}evaluate(_){return!this._actual.evaluate(_)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class c{constructor(_,M,I){this.key=_,this.value=M,this.negated=I,this.type=5}static create(_,M,I=null){if(typeof M=="boolean")return M?o.create(_,I):g.create(_,I);const m=j.get(_);if(typeof m=="boolean"){const W=m?"true":"false";return M===W?L.INSTANCE:v.INSTANCE}return new c(_,M,I)}cmp(_){return _.type!==this.type?this.type-_.type:y(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){const _=j.get(this.key);if(typeof _=="boolean"){const M=_?"true":"false";return this.value===M?L.INSTANCE:v.INSTANCE}return this}evaluate(_){return _.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(_,M){this.key=_,this.negated=M,this.type=3}static create(_,M=null){const I=j.get(_);return typeof I=="boolean"?I?L.INSTANCE:v.INSTANCE:new o(_,M)}cmp(_){return _.type!==this.type?this.type-_.type:b(this.key,_.key)}equals(_){return _.type===this.type?this.key===_.key:!1}substituteConstants(){const _=j.get(this.key);return typeof _=="boolean"?_?L.INSTANCE:v.INSTANCE:this}evaluate(_){return!_.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=g.create(this.key,this)),this.negated}}function l(_,M){if(typeof _=="string"){const I=parseFloat(_);isNaN(I)||(_=I)}return typeof _=="string"||typeof _=="number"?M(_):L.INSTANCE}class s{constructor(_,M,I){this.key=_,this.value=M,this.negated=I,this.type=12}static create(_,M,I=null){return l(M,m=>new s(_,m,I))}cmp(_){return _.type!==this.type?this.type-_.type:y(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=E.create(this.key,this.value,this)),this.negated}}class a{constructor(_,M,I){this.key=_,this.value=M,this.negated=I,this.type=13}static create(_,M,I=null){return l(M,m=>new a(_,m,I))}cmp(_){return _.type!==this.type?this.type-_.type:y(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=R.create(this.key,this.value,this)),this.negated}}class R{constructor(_,M,I){this.key=_,this.value=M,this.negated=I,this.type=14}static create(_,M,I=null){return l(M,m=>new R(_,m,I))}cmp(_){return _.type!==this.type?this.type-_.type:y(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.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 E{constructor(_,M,I){this.key=_,this.value=M,this.negated=I,this.type=15}static create(_,M,I=null){return l(M,m=>new E(_,m,I))}cmp(_){return _.type!==this.type?this.type-_.type:y(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.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 S{constructor(_,M){this.key=_,this.regexp=M,this.type=7,this.negated=null}static create(_,M){return new S(_,M)}cmp(_){if(_.type!==this.type)return this.type-_.type;if(this.key<_.key)return-1;if(this.key>_.key)return 1;const M=this.regexp?this.regexp.source:"",I=_.regexp?_.regexp.source:"";return M<I?-1:M>I?1:0}equals(_){if(_.type===this.type){const M=this.regexp?this.regexp.source:"",I=_.regexp?_.regexp.source:"";return this.key===_.key&&M===I}return!1}substituteConstants(){return this}evaluate(_){let M=_.getValue(this.key);return this.regexp?this.regexp.test(M):!1}serialize(){const _=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${_}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=D.create(this)),this.negated}}class D{constructor(_){this._actual=_,this.type=8}static create(_){return new D(_)}cmp(_){return _.type!==this.type?this.type-_.type:this._actual.cmp(_._actual)}equals(_){return _.type===this.type?this._actual.equals(_._actual):!1}substituteConstants(){return this}evaluate(_){return!this._actual.evaluate(_)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function A(_){let M=null;for(let I=0,m=_.length;I<m;I++){const W=_[I].substituteConstants();if(_[I]!==W&&M===null){M=[];for(let $=0;$<I;$++)M[$]=_[$]}M!==null&&(M[I]=W)}return M===null?_:M}class O{constructor(_,M){this.expr=_,this.negated=M,this.type=6}static create(_,M){return O._normalizeArr(_,M)}cmp(_){if(_.type!==this.type)return this.type-_.type;if(this.expr.length<_.expr.length)return-1;if(this.expr.length>_.expr.length)return 1;for(let M=0,I=this.expr.length;M<I;M++){const m=r(this.expr[M],_.expr[M]);if(m!==0)return m}return 0}equals(_){if(_.type===this.type){if(this.expr.length!==_.expr.length)return!1;for(let M=0,I=this.expr.length;M<I;M++)if(!this.expr[M].equals(_.expr[M]))return!1;return!0}return!1}substituteConstants(){const _=A(this.expr);return _===this.expr?this:O.create(_,this.negated)}evaluate(_){for(let M=0,I=this.expr.length;M<I;M++)if(!this.expr[M].evaluate(_))return!1;return!0}static _normalizeArr(_,M){const I=[];let m=!1;for(const W of _){if(!W)continue;if(W.type===1){m=!0;continue}if(W.type===0)return L.INSTANCE;if(W.type===6){I.push(...W.expr);continue}I.push(W)}if(I.length===0&&m)return v.INSTANCE;if(I.length===0)return;if(I.length===1)return I[0];I.sort(r);for(let W=1;W<I.length;W++)I[W-1].equals(I[W])&&(I.splice(W,1),W--);if(I.length===1)return I[0];for(;I.length>1;){const W=I[I.length-1];if(W.type!==9)break;I.pop();const $=I.pop(),ae=I.length===0,ue=C.create(W.expr.map(Oe=>O.create([Oe,$],null)),null,ae);ue&&(I.push(ue),I.sort(r))}return I.length===1?I[0]:new O(I,M)}serialize(){return this.expr.map(_=>_.serialize()).join(" && ")}keys(){const _=[];for(let M of this.expr)_.push(...M.keys());return _}negate(){if(!this.negated){const _=[];for(let M of this.expr)_.push(M.negate());this.negated=C.create(_,this,!0)}return this.negated}}class C{constructor(_,M){this.expr=_,this.negated=M,this.type=9}static create(_,M,I){return C._normalizeArr(_,M,I)}cmp(_){if(_.type!==this.type)return this.type-_.type;if(this.expr.length<_.expr.length)return-1;if(this.expr.length>_.expr.length)return 1;for(let M=0,I=this.expr.length;M<I;M++){const m=r(this.expr[M],_.expr[M]);if(m!==0)return m}return 0}equals(_){if(_.type===this.type){if(this.expr.length!==_.expr.length)return!1;for(let M=0,I=this.expr.length;M<I;M++)if(!this.expr[M].equals(_.expr[M]))return!1;return!0}return!1}substituteConstants(){const _=A(this.expr);return _===this.expr?this:C.create(_,this.negated,!1)}evaluate(_){for(let M=0,I=this.expr.length;M<I;M++)if(this.expr[M].evaluate(_))return!0;return!1}static _normalizeArr(_,M,I){let m=[],W=!1;if(_){for(let $=0,ae=_.length;$<ae;$++){const ue=_[$];if(!ue)continue;if(ue.type===0){W=!0;continue}if(ue.type===1)return v.INSTANCE;if(ue.type===9){m=m.concat(ue.expr);continue}m.push(ue)}if(m.length===0&&W)return L.INSTANCE;m.sort(r)}if(m.length===0)return;if(m.length===1)return m[0];for(let $=1;$<m.length;$++)m[$-1].equals(m[$])&&(m.splice($,1),$--);if(m.length===1)return m[0];if(I){for(let $=0;$<m.length;$++)for(let ae=$+1;ae<m.length;ae++)B(m[$],m[ae])&&(m.splice(ae,1),ae--);if(m.length===1)return m[0]}return new C(m,M)}serialize(){return this.expr.map(_=>_.serialize()).join(" || ")}keys(){const _=[];for(let M of this.expr)_.push(...M.keys());return _}negate(){if(!this.negated){let _=[];for(let M of this.expr)_.push(M.negate());for(;_.length>1;){const M=_.shift(),I=_.shift(),m=[];for(const $ of F(M))for(const ae of F(I))m.push(O.create([$,ae],null));const W=_.length===0;_.unshift(C.create(m,null,W))}this.negated=_[0]}return this.negated}}class x extends g{constructor(_,M,I){super(_,null);this._defaultValue=M,typeof I=="object"?x._info.push(Object.assign(Object.assign({},I),{key:_})):I!==!0&&x._info.push({key:_,description:I,type:M!=null?typeof M:void 0})}static all(){return x._info.values()}bindTo(_){return _.createKey(this.key,this._defaultValue)}getValue(_){return _.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(_){return p.create(this.key,_)}}x._info=[];const f=Object(P.c)("contextKeyService"),w="setContext";function b(_,M){return _<M?-1:_>M?1:0}function y(_,M,I,m){return _<I?-1:_>I?1:M<m?-1:M>m?1:0}function B(_,M){if(M.type===6&&_.type!==9&&_.type!==6){for(const W of M.expr)if(_.equals(W))return!0}const I=_.negate(),m=F(I).concat(F(M));m.sort(r);for(let W=0;W<m.length;W++){const $=m[W],ae=$.negate();for(let ue=W+1;ue<m.length;ue++){const Oe=m[ue];if(ae.equals(Oe))return!0}}return!1}function F(_){return _.type===9?_.expr:[_]}},TXwP:function(nt,ye,Q){var ne,J;(function(){var P;(function(){"use strict";var j=[,,function(r){function L(p){this.__parent=p,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}L.prototype.clone_empty=function(){var p=new L(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},L.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},L.prototype.has_match=function(p){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(p))return!0;return!1},L.prototype.set_indent=function(p,u){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=u||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 u=p.lastIndexOf(`
|
|
`);u!==-1?this.__character_count=p.length-u: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,u){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)),u=u||"",p.indent_level>0&&(u=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}v.prototype.get_indent_size=function(p,u){var h=this.__base_string_length;return u=u||0,p<0&&(h=0),h+=p*this.__indent_size,h+=u,h},v.prototype.get_indent_string=function(p,u){var h=this.__base_string;return u=u||0,p<0&&(p=0,h=""),u+=p*this.__indent_size,this.__ensure_cache(u),h+=this.__cache[u],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,u=0,h="";this.__indent_size&&p>=this.__indent_size&&(u=Math.floor(p/this.__indent_size),p-=u*this.__indent_size,h=new Array(u+1).join(this.__indent_string)),p&&(h+=new Array(p+1).join(" ")),this.__cache.push(h)};function g(p,u){this.__indent_cache=new v(p,u),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()}g.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},g.prototype.get_line_number=function(){return this.__lines.length},g.prototype.get_indent_string=function(p,u){return this.__indent_cache.get_indent_string(p,u)},g.prototype.get_indent_size=function(p,u){return this.__indent_cache.get_indent_size(p,u)},g.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},g.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},g.prototype.get_code=function(p){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
|
|
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var h=this.__lines.join(`
|
|
`);return p!==`
|
|
`&&(h=h.replace(/[\n]/g,p)),h},g.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},g.prototype.set_indent=function(p,u){return p=p||0,u=u||0,this.next_line.set_indent(p,u),this.__lines.length>1?(this.current_line.set_indent(p,u),!0):(this.current_line.set_indent(),!1)},g.prototype.add_raw_token=function(p){for(var u=0;u<p.newlines;u++)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},g.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()},g.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(" "))},g.prototype.remove_indent=function(p){for(var u=this.__lines.length;p<u;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},g.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},g.prototype.just_added_newline=function(){return this.current_line.is_empty()},g.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},g.prototype.ensure_empty_line_above=function(p,u){for(var h=this.__lines.length-2;h>=0;){var c=this.__lines[h];if(c.is_empty())break;if(c.item(0).indexOf(p)!==0&&c.item(-1)!==u){this.__lines.splice(h+1,0,new L(this)),this.previous_line=this.__lines[this.__lines.length-2];break}h--}},r.exports.Output=g},,,,function(r){function L(p,u){this.raw_options=v(p,u),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}L.prototype._get_array=function(p,u){var h=this.raw_options[p],c=u||[];return typeof h=="object"?h!==null&&typeof h.concat=="function"&&(c=h.concat()):typeof h=="string"&&(c=h.split(/[^a-zA-Z0-9_\/\-]+/)),c},L.prototype._get_boolean=function(p,u){var h=this.raw_options[p],c=h===void 0?!!u:!!h;return c},L.prototype._get_characters=function(p,u){var h=this.raw_options[p],c=u||"";return typeof h=="string"&&(c=h.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),c},L.prototype._get_number=function(p,u){var h=this.raw_options[p];u=parseInt(u,10),isNaN(u)&&(u=0);var c=parseInt(h,10);return isNaN(c)&&(c=u),c},L.prototype._get_selection=function(p,u,h){var c=this._get_selection_list(p,u,h);if(c.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[p]+"'");return c[0]},L.prototype._get_selection_list=function(p,u,h){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(h=h||[u[0]],!this._is_valid_selection(h,u))throw new Error("Invalid Default Value!");var c=this._get_array(p,h);if(!this._is_valid_selection(c,u))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[p]+"'");return c},L.prototype._is_valid_selection=function(p,u){return p.length&&u.length&&!p.some(function(h){return u.indexOf(h)===-1})};function v(p,u){var h={};p=g(p);var c;for(c in p)c!==u&&(h[c]=p[c]);if(u&&p[u])for(c in p[u])h[c]=p[u][c];return h}function g(p){var u={},h;for(h in p){var c=h.replace(/-/g,"_");u[c]=p[h]}return u}r.exports.Options=L,r.exports.normalizeOpts=g,r.exports.mergeOpts=v},,function(r){var L=RegExp.prototype.hasOwnProperty("sticky");function v(g){this.__input=g||"",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 g=null;return this.hasNext()&&(g=this.__input.charAt(this.__position),this.__position+=1),g},v.prototype.peek=function(g){var p=null;return g=g||0,g+=this.__position,g>=0&&g<this.__input_length&&(p=this.__input.charAt(g)),p},v.prototype.__match=function(g,p){g.lastIndex=p;var u=g.exec(this.__input);return u&&!(L&&g.sticky)&&(u.index!==p&&(u=null)),u},v.prototype.test=function(g,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(g,p):!1},v.prototype.testChar=function(g,p){var u=this.peek(p);return g.lastIndex=0,u!==null&&g.test(u)},v.prototype.match=function(g){var p=this.__match(g,this.__position);return p?this.__position+=p[0].length:p=null,p},v.prototype.read=function(g,p,u){var h="",c;return g&&(c=this.match(g),c&&(h+=c[0])),p&&(c||!g)&&(h+=this.readUntil(p,u)),h},v.prototype.readUntil=function(g,p){var u="",h=this.__position;g.lastIndex=this.__position;var c=g.exec(this.__input);return c?(h=c.index,p&&(h+=c[0].length)):h=this.__input_length,u=this.__input.substring(this.__position,h),this.__position=h,u},v.prototype.readUntilAfter=function(g){return this.readUntil(g,!0)},v.prototype.get_regexp=function(g,p){var u=null,h="g";return p&&L&&(h="y"),typeof g=="string"&&g!==""?u=new RegExp(g,h):g&&(u=new RegExp(g.source,h)),u},v.prototype.get_literal_regexp=function(g){return RegExp(g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(g){var p=this.__position,u=this.readUntilAfter(g);return this.__position=p,u},v.prototype.lookBack=function(g){var p=this.__position-1;return p>=g.length&&this.__input.substring(p-g.length,p).toLowerCase()===g},r.exports.InputScanner=v},,,,,function(r){function L(v,g){v=typeof v=="string"?v:v.source,g=typeof g=="string"?g:g.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+g,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+g,"g")}L.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var g={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(v);p;)g[p[1]]=p[2],p=this.__directive_pattern.exec(v);return g},L.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=L},,function(r,L,v){var g=v(16).Beautifier,p=v(17).Options;function u(h,c){var o=new g(h,c);return o.beautify()}r.exports=u,r.exports.defaultOptions=function(){return new p}},function(r,L,v){var g=v(17).Options,p=v(2).Output,u=v(8).InputScanner,h=v(13).Directives,c=new h(/\/\*/,/\*\//),o=/\r\n|[\r\n]/,l=/\r\n|[\r\n]/g,s=/\s/,a=/(?:\s|\n)+/g,R=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,E=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function S(D,A){this._source_text=D||"",this._options=new g(A),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}S.prototype.eatString=function(D){var A="";for(this._ch=this._input.next();this._ch;){if(A+=this._ch,this._ch==="\\")A+=this._input.next();else if(D.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return A},S.prototype.eatWhitespace=function(D){for(var A=s.test(this._input.peek()),O=0;s.test(this._input.peek());)this._ch=this._input.next(),D&&this._ch===`
|
|
`&&((O===0||O<this._options.max_preserve_newlines)&&(O++,this._output.add_new_line(!0)));return A},S.prototype.foundNestedPseudoClass=function(){for(var D=0,A=1,O=this._input.peek(A);O;){if(O==="{")return!0;if(O==="(")D+=1;else if(O===")"){if(D===0)return!1;D-=1}else if(O===";"||O==="}")return!1;A++,O=this._input.peek(A)}return!1},S.prototype.print_string=function(D){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(D)},S.prototype.preserveSingleSpace=function(D){D&&(this._output.space_before_token=!0)},S.prototype.indent=function(){this._indentLevel++},S.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},S.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var D=this._source_text,A=this._options.eol;A==="auto"&&(A=`
|
|
`,D&&o.test(D||"")&&(A=D.match(o)[0])),D=D.replace(l,`
|
|
`);var O=D.match(/^[\t ]*/)[0];this._output=new p(this._options,O),this._input=new u(D),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var C=0,x=!1,f=!1,w=!1,b=!1,y=!1,B=!1,F=this._ch,_=!1,M,I,m;M=this._input.read(a),I=M!=="",m=F,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),F=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var W=this._input.read(R),$=c.get_directives(W);$&&$.ignore==="start"&&(W+=c.readIgnored(this._input)),this.print_string(W),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(E)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(I),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ae=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ae.match(/[ :]$/)&&(ae=this.eatString(": ").replace(/\s$/,""),this.print_string(ae),this._output.space_before_token=!0),ae=ae.replace(/\s$/,""),ae==="extend"?b=!0:ae==="import"&&(y=!0),ae in this.NESTED_AT_RULE?(this._nestedLevel+=1,ae in this.CONDITIONAL_GROUP_RULE&&(w=!0)):!x&&C===0&&ae.indexOf(":")!==-1&&(f=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(I),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")f&&(f=!1,this.outdent()),w?(w=!1,x=this._indentLevel>=this._nestedLevel):x=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&x&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(m==="("?this._output.space_before_token=!1:m!==","&&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(),m==="{"&&this._output.trim(!0),y=!1,b=!1,f&&(this.outdent(),f=!1),this.print_string(this._ch),x=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var ue=0;ue<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ue++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ue])){_=!0;break}(x||w)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!b&&C===0?(this.print_string(":"),f||(f=!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 Oe=m==='"'||m==="'";this.preserveSingleSpace(Oe||I),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")_=!1,C===0?(f&&(this.outdent(),f=!1),b=!1,y=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),C++,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(")")),C&&(C--,this.outdent()));else{var ve=!1;this._input.lookBack("with")&&(ve=!0),this.preserveSingleSpace(I||ve),this.print_string(this._ch),f&&m==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),B=!0):(this.eatWhitespace(),C++,this.indent())}else if(this._ch===")")C&&(C--,this.outdent()),B&&this._input.peek()===";"&&this._options.selector_separator_newline&&(B=!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&&(!f||B)&&C===0&&!y&&!b?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!f&&C===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(I),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 Ee=m==='"'||m==="'";this.preserveSingleSpace(Ee||I),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&_&&this._output.add_new_line()}var xe=this._output.get_code(A);return xe},r.exports.Beautifier=S},function(r,L,v){var g=v(6).Options;function p(u){g.call(this,u,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var h=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||h;var c=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var o=0;o<c.length;o++)c[o]!=="expand"?this.brace_style="collapse":this.brace_style=c[o]}p.prototype=new g,r.exports.Options=p}],U={};function z(r){var L=U[r];if(L!==void 0)return L.exports;var v=U[r]={exports:{}};return j[r](v,v.exports,z),v.exports}var H=z(15);P=H})();var Y=P;!(ne=[],J=function(){return{css_beautify:Y}}.apply(ye,ne),J!==void 0&&(nt.exports=J))})()},Vhoy:function(nt,ye,Q){"use strict";Q.d(ye,"d",function(){return Y}),Q.d(ye,"e",function(){return j}),Q.d(ye,"c",function(){return U}),Q.d(ye,"b",function(){return z}),Q.d(ye,"a",function(){return H});var ne=Q("MI8n");class J{constructor(){this._icons=new Map,this._onDidRegister=new ne.b}add(r){const L=this._icons.get(r.id);L?r.description?L.description=r.description:console.error(`Duplicate registration of codicon ${r.id}`):(this._icons.set(r.id,r),this._onDidRegister.fire(r))}get(r){return this._icons.get(r)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const P=new J,Y=P;function j(r,L){return new z(r,L)}function U(r){return r?r.replace(/\$\((.*?)\)/g,(L,v)=>` ${v} `).trim():""}class z{constructor(r,L,v){this.id=r,this.definition=L,this.description=v,P.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var H;(function(r){r.iconNameSegment="[A-Za-z0-9]+",r.iconNameExpression="[A-Za-z0-9\\-]+",r.iconModifierExpression="~[A-Za-z]+";const L=new RegExp(`^(${r.iconNameExpression})(${r.iconModifierExpression})?$`);function v(u){if(u instanceof z)return["codicon","codicon-"+u.id];const h=L.exec(u.id);if(!h)return v(z.error);let[,c,o]=h;const l=["codicon","codicon-"+c];return o&&l.push("codicon-modifier-"+o.substr(1)),l}r.asClassNameArray=v;function g(u){return v(u).join(" ")}r.asClassName=g;function p(u){return"."+v(u).join(".")}r.asCSSSelector=p})(H||(H={})),function(r){r.add=new r("add",{fontCharacter:"\\ea60"}),r.plus=new r("plus",r.add.definition),r.gistNew=new r("gist-new",r.add.definition),r.repoCreate=new r("repo-create",r.add.definition),r.lightbulb=new r("lightbulb",{fontCharacter:"\\ea61"}),r.lightBulb=new r("light-bulb",{fontCharacter:"\\ea61"}),r.repo=new r("repo",{fontCharacter:"\\ea62"}),r.repoDelete=new r("repo-delete",{fontCharacter:"\\ea62"}),r.gistFork=new r("gist-fork",{fontCharacter:"\\ea63"}),r.repoForked=new r("repo-forked",{fontCharacter:"\\ea63"}),r.gitPullRequest=new r("git-pull-request",{fontCharacter:"\\ea64"}),r.gitPullRequestAbandoned=new r("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),r.recordKeys=new r("record-keys",{fontCharacter:"\\ea65"}),r.keyboard=new r("keyboard",{fontCharacter:"\\ea65"}),r.tag=new r("tag",{fontCharacter:"\\ea66"}),r.tagAdd=new r("tag-add",{fontCharacter:"\\ea66"}),r.tagRemove=new r("tag-remove",{fontCharacter:"\\ea66"}),r.person=new r("person",{fontCharacter:"\\ea67"}),r.personFollow=new r("person-follow",{fontCharacter:"\\ea67"}),r.personOutline=new r("person-outline",{fontCharacter:"\\ea67"}),r.personFilled=new r("person-filled",{fontCharacter:"\\ea67"}),r.gitBranch=new r("git-branch",{fontCharacter:"\\ea68"}),r.gitBranchCreate=new r("git-branch-create",{fontCharacter:"\\ea68"}),r.gitBranchDelete=new r("git-branch-delete",{fontCharacter:"\\ea68"}),r.sourceControl=new r("source-control",{fontCharacter:"\\ea68"}),r.mirror=new r("mirror",{fontCharacter:"\\ea69"}),r.mirrorPublic=new r("mirror-public",{fontCharacter:"\\ea69"}),r.star=new r("star",{fontCharacter:"\\ea6a"}),r.starAdd=new r("star-add",{fontCharacter:"\\ea6a"}),r.starDelete=new r("star-delete",{fontCharacter:"\\ea6a"}),r.starEmpty=new r("star-empty",{fontCharacter:"\\ea6a"}),r.comment=new r("comment",{fontCharacter:"\\ea6b"}),r.commentAdd=new r("comment-add",{fontCharacter:"\\ea6b"}),r.alert=new r("alert",{fontCharacter:"\\ea6c"}),r.warning=new r("warning",{fontCharacter:"\\ea6c"}),r.search=new r("search",{fontCharacter:"\\ea6d"}),r.searchSave=new r("search-save",{fontCharacter:"\\ea6d"}),r.logOut=new r("log-out",{fontCharacter:"\\ea6e"}),r.signOut=new r("sign-out",{fontCharacter:"\\ea6e"}),r.logIn=new r("log-in",{fontCharacter:"\\ea6f"}),r.signIn=new r("sign-in",{fontCharacter:"\\ea6f"}),r.eye=new r("eye",{fontCharacter:"\\ea70"}),r.eyeUnwatch=new r("eye-unwatch",{fontCharacter:"\\ea70"}),r.eyeWatch=new r("eye-watch",{fontCharacter:"\\ea70"}),r.circleFilled=new r("circle-filled",{fontCharacter:"\\ea71"}),r.primitiveDot=new r("primitive-dot",{fontCharacter:"\\ea71"}),r.closeDirty=new r("close-dirty",{fontCharacter:"\\ea71"}),r.debugBreakpoint=new r("debug-breakpoint",{fontCharacter:"\\ea71"}),r.debugBreakpointDisabled=new r("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),r.debugHint=new r("debug-hint",{fontCharacter:"\\ea71"}),r.primitiveSquare=new r("primitive-square",{fontCharacter:"\\ea72"}),r.edit=new r("edit",{fontCharacter:"\\ea73"}),r.pencil=new r("pencil",{fontCharacter:"\\ea73"}),r.info=new r("info",{fontCharacter:"\\ea74"}),r.issueOpened=new r("issue-opened",{fontCharacter:"\\ea74"}),r.gistPrivate=new r("gist-private",{fontCharacter:"\\ea75"}),r.gitForkPrivate=new r("git-fork-private",{fontCharacter:"\\ea75"}),r.lock=new r("lock",{fontCharacter:"\\ea75"}),r.mirrorPrivate=new r("mirror-private",{fontCharacter:"\\ea75"}),r.close=new r("close",{fontCharacter:"\\ea76"}),r.removeClose=new r("remove-close",{fontCharacter:"\\ea76"}),r.x=new r("x",{fontCharacter:"\\ea76"}),r.repoSync=new r("repo-sync",{fontCharacter:"\\ea77"}),r.sync=new r("sync",{fontCharacter:"\\ea77"}),r.clone=new r("clone",{fontCharacter:"\\ea78"}),r.desktopDownload=new r("desktop-download",{fontCharacter:"\\ea78"}),r.beaker=new r("beaker",{fontCharacter:"\\ea79"}),r.microscope=new r("microscope",{fontCharacter:"\\ea79"}),r.vm=new r("vm",{fontCharacter:"\\ea7a"}),r.deviceDesktop=new r("device-desktop",{fontCharacter:"\\ea7a"}),r.file=new r("file",{fontCharacter:"\\ea7b"}),r.fileText=new r("file-text",{fontCharacter:"\\ea7b"}),r.more=new r("more",{fontCharacter:"\\ea7c"}),r.ellipsis=new r("ellipsis",{fontCharacter:"\\ea7c"}),r.kebabHorizontal=new r("kebab-horizontal",{fontCharacter:"\\ea7c"}),r.mailReply=new r("mail-reply",{fontCharacter:"\\ea7d"}),r.reply=new r("reply",{fontCharacter:"\\ea7d"}),r.organization=new r("organization",{fontCharacter:"\\ea7e"}),r.organizationFilled=new r("organization-filled",{fontCharacter:"\\ea7e"}),r.organizationOutline=new r("organization-outline",{fontCharacter:"\\ea7e"}),r.newFile=new r("new-file",{fontCharacter:"\\ea7f"}),r.fileAdd=new r("file-add",{fontCharacter:"\\ea7f"}),r.newFolder=new r("new-folder",{fontCharacter:"\\ea80"}),r.fileDirectoryCreate=new r("file-directory-create",{fontCharacter:"\\ea80"}),r.trash=new r("trash",{fontCharacter:"\\ea81"}),r.trashcan=new r("trashcan",{fontCharacter:"\\ea81"}),r.history=new r("history",{fontCharacter:"\\ea82"}),r.clock=new r("clock",{fontCharacter:"\\ea82"}),r.folder=new r("folder",{fontCharacter:"\\ea83"}),r.fileDirectory=new r("file-directory",{fontCharacter:"\\ea83"}),r.symbolFolder=new r("symbol-folder",{fontCharacter:"\\ea83"}),r.logoGithub=new r("logo-github",{fontCharacter:"\\ea84"}),r.markGithub=new r("mark-github",{fontCharacter:"\\ea84"}),r.github=new r("github",{fontCharacter:"\\ea84"}),r.terminal=new r("terminal",{fontCharacter:"\\ea85"}),r.console=new r("console",{fontCharacter:"\\ea85"}),r.repl=new r("repl",{fontCharacter:"\\ea85"}),r.zap=new r("zap",{fontCharacter:"\\ea86"}),r.symbolEvent=new r("symbol-event",{fontCharacter:"\\ea86"}),r.error=new r("error",{fontCharacter:"\\ea87"}),r.stop=new r("stop",{fontCharacter:"\\ea87"}),r.variable=new r("variable",{fontCharacter:"\\ea88"}),r.symbolVariable=new r("symbol-variable",{fontCharacter:"\\ea88"}),r.array=new r("array",{fontCharacter:"\\ea8a"}),r.symbolArray=new r("symbol-array",{fontCharacter:"\\ea8a"}),r.symbolModule=new r("symbol-module",{fontCharacter:"\\ea8b"}),r.symbolPackage=new r("symbol-package",{fontCharacter:"\\ea8b"}),r.symbolNamespace=new r("symbol-namespace",{fontCharacter:"\\ea8b"}),r.symbolObject=new r("symbol-object",{fontCharacter:"\\ea8b"}),r.symbolMethod=new r("symbol-method",{fontCharacter:"\\ea8c"}),r.symbolFunction=new r("symbol-function",{fontCharacter:"\\ea8c"}),r.symbolConstructor=new r("symbol-constructor",{fontCharacter:"\\ea8c"}),r.symbolBoolean=new r("symbol-boolean",{fontCharacter:"\\ea8f"}),r.symbolNull=new r("symbol-null",{fontCharacter:"\\ea8f"}),r.symbolNumeric=new r("symbol-numeric",{fontCharacter:"\\ea90"}),r.symbolNumber=new r("symbol-number",{fontCharacter:"\\ea90"}),r.symbolStructure=new r("symbol-structure",{fontCharacter:"\\ea91"}),r.symbolStruct=new r("symbol-struct",{fontCharacter:"\\ea91"}),r.symbolParameter=new r("symbol-parameter",{fontCharacter:"\\ea92"}),r.symbolTypeParameter=new r("symbol-type-parameter",{fontCharacter:"\\ea92"}),r.symbolKey=new r("symbol-key",{fontCharacter:"\\ea93"}),r.symbolText=new r("symbol-text",{fontCharacter:"\\ea93"}),r.symbolReference=new r("symbol-reference",{fontCharacter:"\\ea94"}),r.goToFile=new r("go-to-file",{fontCharacter:"\\ea94"}),r.symbolEnum=new r("symbol-enum",{fontCharacter:"\\ea95"}),r.symbolValue=new r("symbol-value",{fontCharacter:"\\ea95"}),r.symbolRuler=new r("symbol-ruler",{fontCharacter:"\\ea96"}),r.symbolUnit=new r("symbol-unit",{fontCharacter:"\\ea96"}),r.activateBreakpoints=new r("activate-breakpoints",{fontCharacter:"\\ea97"}),r.archive=new r("archive",{fontCharacter:"\\ea98"}),r.arrowBoth=new r("arrow-both",{fontCharacter:"\\ea99"}),r.arrowDown=new r("arrow-down",{fontCharacter:"\\ea9a"}),r.arrowLeft=new r("arrow-left",{fontCharacter:"\\ea9b"}),r.arrowRight=new r("arrow-right",{fontCharacter:"\\ea9c"}),r.arrowSmallDown=new r("arrow-small-down",{fontCharacter:"\\ea9d"}),r.arrowSmallLeft=new r("arrow-small-left",{fontCharacter:"\\ea9e"}),r.arrowSmallRight=new r("arrow-small-right",{fontCharacter:"\\ea9f"}),r.arrowSmallUp=new r("arrow-small-up",{fontCharacter:"\\eaa0"}),r.arrowUp=new r("arrow-up",{fontCharacter:"\\eaa1"}),r.bell=new r("bell",{fontCharacter:"\\eaa2"}),r.bold=new r("bold",{fontCharacter:"\\eaa3"}),r.book=new r("book",{fontCharacter:"\\eaa4"}),r.bookmark=new r("bookmark",{fontCharacter:"\\eaa5"}),r.debugBreakpointConditionalUnverified=new r("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),r.debugBreakpointConditional=new r("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),r.debugBreakpointConditionalDisabled=new r("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),r.debugBreakpointDataUnverified=new r("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),r.debugBreakpointData=new r("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),r.debugBreakpointDataDisabled=new r("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),r.debugBreakpointLogUnverified=new r("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),r.debugBreakpointLog=new r("debug-breakpoint-log",{fontCharacter:"\\eaab"}),r.debugBreakpointLogDisabled=new r("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),r.briefcase=new r("briefcase",{fontCharacter:"\\eaac"}),r.broadcast=new r("broadcast",{fontCharacter:"\\eaad"}),r.browser=new r("browser",{fontCharacter:"\\eaae"}),r.bug=new r("bug",{fontCharacter:"\\eaaf"}),r.calendar=new r("calendar",{fontCharacter:"\\eab0"}),r.caseSensitive=new r("case-sensitive",{fontCharacter:"\\eab1"}),r.check=new r("check",{fontCharacter:"\\eab2"}),r.checklist=new r("checklist",{fontCharacter:"\\eab3"}),r.chevronDown=new r("chevron-down",{fontCharacter:"\\eab4"}),r.dropDownButton=new r("drop-down-button",r.chevronDown.definition),r.chevronLeft=new r("chevron-left",{fontCharacter:"\\eab5"}),r.chevronRight=new r("chevron-right",{fontCharacter:"\\eab6"}),r.chevronUp=new r("chevron-up",{fontCharacter:"\\eab7"}),r.chromeClose=new r("chrome-close",{fontCharacter:"\\eab8"}),r.chromeMaximize=new r("chrome-maximize",{fontCharacter:"\\eab9"}),r.chromeMinimize=new r("chrome-minimize",{fontCharacter:"\\eaba"}),r.chromeRestore=new r("chrome-restore",{fontCharacter:"\\eabb"}),r.circleOutline=new r("circle-outline",{fontCharacter:"\\eabc"}),r.debugBreakpointUnverified=new r("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),r.circleSlash=new r("circle-slash",{fontCharacter:"\\eabd"}),r.circuitBoard=new r("circuit-board",{fontCharacter:"\\eabe"}),r.clearAll=new r("clear-all",{fontCharacter:"\\eabf"}),r.clippy=new r("clippy",{fontCharacter:"\\eac0"}),r.closeAll=new r("close-all",{fontCharacter:"\\eac1"}),r.cloudDownload=new r("cloud-download",{fontCharacter:"\\eac2"}),r.cloudUpload=new r("cloud-upload",{fontCharacter:"\\eac3"}),r.code=new r("code",{fontCharacter:"\\eac4"}),r.collapseAll=new r("collapse-all",{fontCharacter:"\\eac5"}),r.colorMode=new r("color-mode",{fontCharacter:"\\eac6"}),r.commentDiscussion=new r("comment-discussion",{fontCharacter:"\\eac7"}),r.compareChanges=new r("compare-changes",{fontCharacter:"\\eafd"}),r.creditCard=new r("credit-card",{fontCharacter:"\\eac9"}),r.dash=new r("dash",{fontCharacter:"\\eacc"}),r.dashboard=new r("dashboard",{fontCharacter:"\\eacd"}),r.database=new r("database",{fontCharacter:"\\eace"}),r.debugContinue=new r("debug-continue",{fontCharacter:"\\eacf"}),r.debugDisconnect=new r("debug-disconnect",{fontCharacter:"\\ead0"}),r.debugPause=new r("debug-pause",{fontCharacter:"\\ead1"}),r.debugRestart=new r("debug-restart",{fontCharacter:"\\ead2"}),r.debugStart=new r("debug-start",{fontCharacter:"\\ead3"}),r.debugStepInto=new r("debug-step-into",{fontCharacter:"\\ead4"}),r.debugStepOut=new r("debug-step-out",{fontCharacter:"\\ead5"}),r.debugStepOver=new r("debug-step-over",{fontCharacter:"\\ead6"}),r.debugStop=new r("debug-stop",{fontCharacter:"\\ead7"}),r.debug=new r("debug",{fontCharacter:"\\ead8"}),r.deviceCameraVideo=new r("device-camera-video",{fontCharacter:"\\ead9"}),r.deviceCamera=new r("device-camera",{fontCharacter:"\\eada"}),r.deviceMobile=new r("device-mobile",{fontCharacter:"\\eadb"}),r.diffAdded=new r("diff-added",{fontCharacter:"\\eadc"}),r.diffIgnored=new r("diff-ignored",{fontCharacter:"\\eadd"}),r.diffModified=new r("diff-modified",{fontCharacter:"\\eade"}),r.diffRemoved=new r("diff-removed",{fontCharacter:"\\eadf"}),r.diffRenamed=new r("diff-renamed",{fontCharacter:"\\eae0"}),r.diff=new r("diff",{fontCharacter:"\\eae1"}),r.discard=new r("discard",{fontCharacter:"\\eae2"}),r.editorLayout=new r("editor-layout",{fontCharacter:"\\eae3"}),r.emptyWindow=new r("empty-window",{fontCharacter:"\\eae4"}),r.exclude=new r("exclude",{fontCharacter:"\\eae5"}),r.extensions=new r("extensions",{fontCharacter:"\\eae6"}),r.eyeClosed=new r("eye-closed",{fontCharacter:"\\eae7"}),r.fileBinary=new r("file-binary",{fontCharacter:"\\eae8"}),r.fileCode=new r("file-code",{fontCharacter:"\\eae9"}),r.fileMedia=new r("file-media",{fontCharacter:"\\eaea"}),r.filePdf=new r("file-pdf",{fontCharacter:"\\eaeb"}),r.fileSubmodule=new r("file-submodule",{fontCharacter:"\\eaec"}),r.fileSymlinkDirectory=new r("file-symlink-directory",{fontCharacter:"\\eaed"}),r.fileSymlinkFile=new r("file-symlink-file",{fontCharacter:"\\eaee"}),r.fileZip=new r("file-zip",{fontCharacter:"\\eaef"}),r.files=new r("files",{fontCharacter:"\\eaf0"}),r.filter=new r("filter",{fontCharacter:"\\eaf1"}),r.flame=new r("flame",{fontCharacter:"\\eaf2"}),r.foldDown=new r("fold-down",{fontCharacter:"\\eaf3"}),r.foldUp=new r("fold-up",{fontCharacter:"\\eaf4"}),r.fold=new r("fold",{fontCharacter:"\\eaf5"}),r.folderActive=new r("folder-active",{fontCharacter:"\\eaf6"}),r.folderOpened=new r("folder-opened",{fontCharacter:"\\eaf7"}),r.gear=new r("gear",{fontCharacter:"\\eaf8"}),r.gift=new r("gift",{fontCharacter:"\\eaf9"}),r.gistSecret=new r("gist-secret",{fontCharacter:"\\eafa"}),r.gist=new r("gist",{fontCharacter:"\\eafb"}),r.gitCommit=new r("git-commit",{fontCharacter:"\\eafc"}),r.gitCompare=new r("git-compare",{fontCharacter:"\\eafd"}),r.gitMerge=new r("git-merge",{fontCharacter:"\\eafe"}),r.githubAction=new r("github-action",{fontCharacter:"\\eaff"}),r.githubAlt=new r("github-alt",{fontCharacter:"\\eb00"}),r.globe=new r("globe",{fontCharacter:"\\eb01"}),r.grabber=new r("grabber",{fontCharacter:"\\eb02"}),r.graph=new r("graph",{fontCharacter:"\\eb03"}),r.gripper=new r("gripper",{fontCharacter:"\\eb04"}),r.heart=new r("heart",{fontCharacter:"\\eb05"}),r.home=new r("home",{fontCharacter:"\\eb06"}),r.horizontalRule=new r("horizontal-rule",{fontCharacter:"\\eb07"}),r.hubot=new r("hubot",{fontCharacter:"\\eb08"}),r.inbox=new r("inbox",{fontCharacter:"\\eb09"}),r.issueClosed=new r("issue-closed",{fontCharacter:"\\eba4"}),r.issueReopened=new r("issue-reopened",{fontCharacter:"\\eb0b"}),r.issues=new r("issues",{fontCharacter:"\\eb0c"}),r.italic=new r("italic",{fontCharacter:"\\eb0d"}),r.jersey=new r("jersey",{fontCharacter:"\\eb0e"}),r.json=new r("json",{fontCharacter:"\\eb0f"}),r.kebabVertical=new r("kebab-vertical",{fontCharacter:"\\eb10"}),r.key=new r("key",{fontCharacter:"\\eb11"}),r.law=new r("law",{fontCharacter:"\\eb12"}),r.lightbulbAutofix=new r("lightbulb-autofix",{fontCharacter:"\\eb13"}),r.linkExternal=new r("link-external",{fontCharacter:"\\eb14"}),r.link=new r("link",{fontCharacter:"\\eb15"}),r.listOrdered=new r("list-ordered",{fontCharacter:"\\eb16"}),r.listUnordered=new r("list-unordered",{fontCharacter:"\\eb17"}),r.liveShare=new r("live-share",{fontCharacter:"\\eb18"}),r.loading=new r("loading",{fontCharacter:"\\eb19"}),r.location=new r("location",{fontCharacter:"\\eb1a"}),r.mailRead=new r("mail-read",{fontCharacter:"\\eb1b"}),r.mail=new r("mail",{fontCharacter:"\\eb1c"}),r.markdown=new r("markdown",{fontCharacter:"\\eb1d"}),r.megaphone=new r("megaphone",{fontCharacter:"\\eb1e"}),r.mention=new r("mention",{fontCharacter:"\\eb1f"}),r.milestone=new r("milestone",{fontCharacter:"\\eb20"}),r.mortarBoard=new r("mortar-board",{fontCharacter:"\\eb21"}),r.move=new r("move",{fontCharacter:"\\eb22"}),r.multipleWindows=new r("multiple-windows",{fontCharacter:"\\eb23"}),r.mute=new r("mute",{fontCharacter:"\\eb24"}),r.noNewline=new r("no-newline",{fontCharacter:"\\eb25"}),r.note=new r("note",{fontCharacter:"\\eb26"}),r.octoface=new r("octoface",{fontCharacter:"\\eb27"}),r.openPreview=new r("open-preview",{fontCharacter:"\\eb28"}),r.package_=new r("package",{fontCharacter:"\\eb29"}),r.paintcan=new r("paintcan",{fontCharacter:"\\eb2a"}),r.pin=new r("pin",{fontCharacter:"\\eb2b"}),r.play=new r("play",{fontCharacter:"\\eb2c"}),r.run=new r("run",{fontCharacter:"\\eb2c"}),r.plug=new r("plug",{fontCharacter:"\\eb2d"}),r.preserveCase=new r("preserve-case",{fontCharacter:"\\eb2e"}),r.preview=new r("preview",{fontCharacter:"\\eb2f"}),r.project=new r("project",{fontCharacter:"\\eb30"}),r.pulse=new r("pulse",{fontCharacter:"\\eb31"}),r.question=new r("question",{fontCharacter:"\\eb32"}),r.quote=new r("quote",{fontCharacter:"\\eb33"}),r.radioTower=new r("radio-tower",{fontCharacter:"\\eb34"}),r.reactions=new r("reactions",{fontCharacter:"\\eb35"}),r.references=new r("references",{fontCharacter:"\\eb36"}),r.refresh=new r("refresh",{fontCharacter:"\\eb37"}),r.regex=new r("regex",{fontCharacter:"\\eb38"}),r.remoteExplorer=new r("remote-explorer",{fontCharacter:"\\eb39"}),r.remote=new r("remote",{fontCharacter:"\\eb3a"}),r.remove=new r("remove",{fontCharacter:"\\eb3b"}),r.replaceAll=new r("replace-all",{fontCharacter:"\\eb3c"}),r.replace=new r("replace",{fontCharacter:"\\eb3d"}),r.repoClone=new r("repo-clone",{fontCharacter:"\\eb3e"}),r.repoForcePush=new r("repo-force-push",{fontCharacter:"\\eb3f"}),r.repoPull=new r("repo-pull",{fontCharacter:"\\eb40"}),r.repoPush=new r("repo-push",{fontCharacter:"\\eb41"}),r.report=new r("report",{fontCharacter:"\\eb42"}),r.requestChanges=new r("request-changes",{fontCharacter:"\\eb43"}),r.rocket=new r("rocket",{fontCharacter:"\\eb44"}),r.rootFolderOpened=new r("root-folder-opened",{fontCharacter:"\\eb45"}),r.rootFolder=new r("root-folder",{fontCharacter:"\\eb46"}),r.rss=new r("rss",{fontCharacter:"\\eb47"}),r.ruby=new r("ruby",{fontCharacter:"\\eb48"}),r.saveAll=new r("save-all",{fontCharacter:"\\eb49"}),r.saveAs=new r("save-as",{fontCharacter:"\\eb4a"}),r.save=new r("save",{fontCharacter:"\\eb4b"}),r.screenFull=new r("screen-full",{fontCharacter:"\\eb4c"}),r.screenNormal=new r("screen-normal",{fontCharacter:"\\eb4d"}),r.searchStop=new r("search-stop",{fontCharacter:"\\eb4e"}),r.server=new r("server",{fontCharacter:"\\eb50"}),r.settingsGear=new r("settings-gear",{fontCharacter:"\\eb51"}),r.settings=new r("settings",{fontCharacter:"\\eb52"}),r.shield=new r("shield",{fontCharacter:"\\eb53"}),r.smiley=new r("smiley",{fontCharacter:"\\eb54"}),r.sortPrecedence=new r("sort-precedence",{fontCharacter:"\\eb55"}),r.splitHorizontal=new r("split-horizontal",{fontCharacter:"\\eb56"}),r.splitVertical=new r("split-vertical",{fontCharacter:"\\eb57"}),r.squirrel=new r("squirrel",{fontCharacter:"\\eb58"}),r.starFull=new r("star-full",{fontCharacter:"\\eb59"}),r.starHalf=new r("star-half",{fontCharacter:"\\eb5a"}),r.symbolClass=new r("symbol-class",{fontCharacter:"\\eb5b"}),r.symbolColor=new r("symbol-color",{fontCharacter:"\\eb5c"}),r.symbolConstant=new r("symbol-constant",{fontCharacter:"\\eb5d"}),r.symbolEnumMember=new r("symbol-enum-member",{fontCharacter:"\\eb5e"}),r.symbolField=new r("symbol-field",{fontCharacter:"\\eb5f"}),r.symbolFile=new r("symbol-file",{fontCharacter:"\\eb60"}),r.symbolInterface=new r("symbol-interface",{fontCharacter:"\\eb61"}),r.symbolKeyword=new r("symbol-keyword",{fontCharacter:"\\eb62"}),r.symbolMisc=new r("symbol-misc",{fontCharacter:"\\eb63"}),r.symbolOperator=new r("symbol-operator",{fontCharacter:"\\eb64"}),r.symbolProperty=new r("symbol-property",{fontCharacter:"\\eb65"}),r.wrench=new r("wrench",{fontCharacter:"\\eb65"}),r.wrenchSubaction=new r("wrench-subaction",{fontCharacter:"\\eb65"}),r.symbolSnippet=new r("symbol-snippet",{fontCharacter:"\\eb66"}),r.tasklist=new r("tasklist",{fontCharacter:"\\eb67"}),r.telescope=new r("telescope",{fontCharacter:"\\eb68"}),r.textSize=new r("text-size",{fontCharacter:"\\eb69"}),r.threeBars=new r("three-bars",{fontCharacter:"\\eb6a"}),r.thumbsdown=new r("thumbsdown",{fontCharacter:"\\eb6b"}),r.thumbsup=new r("thumbsup",{fontCharacter:"\\eb6c"}),r.tools=new r("tools",{fontCharacter:"\\eb6d"}),r.triangleDown=new r("triangle-down",{fontCharacter:"\\eb6e"}),r.triangleLeft=new r("triangle-left",{fontCharacter:"\\eb6f"}),r.triangleRight=new r("triangle-right",{fontCharacter:"\\eb70"}),r.triangleUp=new r("triangle-up",{fontCharacter:"\\eb71"}),r.twitter=new r("twitter",{fontCharacter:"\\eb72"}),r.unfold=new r("unfold",{fontCharacter:"\\eb73"}),r.unlock=new r("unlock",{fontCharacter:"\\eb74"}),r.unmute=new r("unmute",{fontCharacter:"\\eb75"}),r.unverified=new r("unverified",{fontCharacter:"\\eb76"}),r.verified=new r("verified",{fontCharacter:"\\eb77"}),r.versions=new r("versions",{fontCharacter:"\\eb78"}),r.vmActive=new r("vm-active",{fontCharacter:"\\eb79"}),r.vmOutline=new r("vm-outline",{fontCharacter:"\\eb7a"}),r.vmRunning=new r("vm-running",{fontCharacter:"\\eb7b"}),r.watch=new r("watch",{fontCharacter:"\\eb7c"}),r.whitespace=new r("whitespace",{fontCharacter:"\\eb7d"}),r.wholeWord=new r("whole-word",{fontCharacter:"\\eb7e"}),r.window=new r("window",{fontCharacter:"\\eb7f"}),r.wordWrap=new r("word-wrap",{fontCharacter:"\\eb80"}),r.zoomIn=new r("zoom-in",{fontCharacter:"\\eb81"}),r.zoomOut=new r("zoom-out",{fontCharacter:"\\eb82"}),r.listFilter=new r("list-filter",{fontCharacter:"\\eb83"}),r.listFlat=new r("list-flat",{fontCharacter:"\\eb84"}),r.listSelection=new r("list-selection",{fontCharacter:"\\eb85"}),r.selection=new r("selection",{fontCharacter:"\\eb85"}),r.listTree=new r("list-tree",{fontCharacter:"\\eb86"}),r.debugBreakpointFunctionUnverified=new r("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),r.debugBreakpointFunction=new r("debug-breakpoint-function",{fontCharacter:"\\eb88"}),r.debugBreakpointFunctionDisabled=new r("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),r.debugStackframeActive=new r("debug-stackframe-active",{fontCharacter:"\\eb89"}),r.debugStackframeDot=new r("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),r.debugStackframe=new r("debug-stackframe",{fontCharacter:"\\eb8b"}),r.debugStackframeFocused=new r("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),r.debugBreakpointUnsupported=new r("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),r.symbolString=new r("symbol-string",{fontCharacter:"\\eb8d"}),r.debugReverseContinue=new r("debug-reverse-continue",{fontCharacter:"\\eb8e"}),r.debugStepBack=new r("debug-step-back",{fontCharacter:"\\eb8f"}),r.debugRestartFrame=new r("debug-restart-frame",{fontCharacter:"\\eb90"}),r.callIncoming=new r("call-incoming",{fontCharacter:"\\eb92"}),r.callOutgoing=new r("call-outgoing",{fontCharacter:"\\eb93"}),r.menu=new r("menu",{fontCharacter:"\\eb94"}),r.expandAll=new r("expand-all",{fontCharacter:"\\eb95"}),r.feedback=new r("feedback",{fontCharacter:"\\eb96"}),r.groupByRefType=new r("group-by-ref-type",{fontCharacter:"\\eb97"}),r.ungroupByRefType=new r("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),r.account=new r("account",{fontCharacter:"\\eb99"}),r.bellDot=new r("bell-dot",{fontCharacter:"\\eb9a"}),r.debugConsole=new r("debug-console",{fontCharacter:"\\eb9b"}),r.library=new r("library",{fontCharacter:"\\eb9c"}),r.output=new r("output",{fontCharacter:"\\eb9d"}),r.runAll=new r("run-all",{fontCharacter:"\\eb9e"}),r.syncIgnored=new r("sync-ignored",{fontCharacter:"\\eb9f"}),r.pinned=new r("pinned",{fontCharacter:"\\eba0"}),r.githubInverted=new r("github-inverted",{fontCharacter:"\\eba1"}),r.debugAlt=new r("debug-alt",{fontCharacter:"\\eb91"}),r.serverProcess=new r("server-process",{fontCharacter:"\\eba2"}),r.serverEnvironment=new r("server-environment",{fontCharacter:"\\eba3"}),r.pass=new r("pass",{fontCharacter:"\\eba4"}),r.stopCircle=new r("stop-circle",{fontCharacter:"\\eba5"}),r.playCircle=new r("play-circle",{fontCharacter:"\\eba6"}),r.record=new r("record",{fontCharacter:"\\eba7"}),r.debugAltSmall=new r("debug-alt-small",{fontCharacter:"\\eba8"}),r.vmConnect=new r("vm-connect",{fontCharacter:"\\eba9"}),r.cloud=new r("cloud",{fontCharacter:"\\ebaa"}),r.merge=new r("merge",{fontCharacter:"\\ebab"}),r.exportIcon=new r("export",{fontCharacter:"\\ebac"}),r.graphLeft=new r("graph-left",{fontCharacter:"\\ebad"}),r.magnet=new r("magnet",{fontCharacter:"\\ebae"}),r.notebook=new r("notebook",{fontCharacter:"\\ebaf"}),r.redo=new r("redo",{fontCharacter:"\\ebb0"}),r.checkAll=new r("check-all",{fontCharacter:"\\ebb1"}),r.pinnedDirty=new r("pinned-dirty",{fontCharacter:"\\ebb2"}),r.passFilled=new r("pass-filled",{fontCharacter:"\\ebb3"}),r.circleLargeFilled=new r("circle-large-filled",{fontCharacter:"\\ebb4"}),r.circleLargeOutline=new r("circle-large-outline",{fontCharacter:"\\ebb5"}),r.combine=new r("combine",{fontCharacter:"\\ebb6"}),r.gather=new r("gather",{fontCharacter:"\\ebb6"}),r.table=new r("table",{fontCharacter:"\\ebb7"}),r.variableGroup=new r("variable-group",{fontCharacter:"\\ebb8"}),r.typeHierarchy=new r("type-hierarchy",{fontCharacter:"\\ebb9"}),r.typeHierarchySub=new r("type-hierarchy-sub",{fontCharacter:"\\ebba"}),r.typeHierarchySuper=new r("type-hierarchy-super",{fontCharacter:"\\ebbb"}),r.gitPullRequestCreate=new r("git-pull-request-create",{fontCharacter:"\\ebbc"}),r.runAbove=new r("run-above",{fontCharacter:"\\ebbd"}),r.runBelow=new r("run-below",{fontCharacter:"\\ebbe"}),r.notebookTemplate=new r("notebook-template",{fontCharacter:"\\ebbf"}),r.debugRerun=new r("debug-rerun",{fontCharacter:"\\ebc0"}),r.workspaceTrusted=new r("workspace-trusted",{fontCharacter:"\\ebc1"}),r.workspaceUntrusted=new r("workspace-untrusted",{fontCharacter:"\\ebc2"}),r.workspaceUnspecified=new r("workspace-unspecified",{fontCharacter:"\\ebc3"}),r.terminalCmd=new r("terminal-cmd",{fontCharacter:"\\ebc4"}),r.terminalDebian=new r("terminal-debian",{fontCharacter:"\\ebc5"}),r.terminalLinux=new r("terminal-linux",{fontCharacter:"\\ebc6"}),r.terminalPowershell=new r("terminal-powershell",{fontCharacter:"\\ebc7"}),r.terminalTmux=new r("terminal-tmux",{fontCharacter:"\\ebc8"}),r.terminalUbuntu=new r("terminal-ubuntu",{fontCharacter:"\\ebc9"}),r.terminalBash=new r("terminal-bash",{fontCharacter:"\\ebca"}),r.arrowSwap=new r("arrow-swap",{fontCharacter:"\\ebcb"}),r.copy=new r("copy",{fontCharacter:"\\ebcc"}),r.personAdd=new r("person-add",{fontCharacter:"\\ebcd"}),r.filterFilled=new r("filter-filled",{fontCharacter:"\\ebce"}),r.wand=new r("wand",{fontCharacter:"\\ebcf"}),r.debugLineByLine=new r("debug-line-by-line",{fontCharacter:"\\ebd0"}),r.inspect=new r("inspect",{fontCharacter:"\\ebd1"}),r.layers=new r("layers",{fontCharacter:"\\ebd2"}),r.layersDot=new r("layers-dot",{fontCharacter:"\\ebd3"}),r.layersActive=new r("layers-active",{fontCharacter:"\\ebd4"}),r.compass=new r("compass",{fontCharacter:"\\ebd5"}),r.compassDot=new r("compass-dot",{fontCharacter:"\\ebd6"}),r.compassActive=new r("compass-active",{fontCharacter:"\\ebd7"}),r.azure=new r("azure",{fontCharacter:"\\ebd8"}),r.issueDraft=new r("issue-draft",{fontCharacter:"\\ebd9"}),r.gitPullRequestClosed=new r("git-pull-request-closed",{fontCharacter:"\\ebda"}),r.gitPullRequestDraft=new r("git-pull-request-draft",{fontCharacter:"\\ebdb"}),r.debugAll=new r("debug-all",{fontCharacter:"\\ebdc"}),r.debugCoverage=new r("debug-coverage",{fontCharacter:"\\ebdd"}),r.runErrors=new r("run-errors",{fontCharacter:"\\ebde"}),r.folderLibrary=new r("folder-library",{fontCharacter:"\\ebdf"}),r.debugContinueSmall=new r("debug-continue-small",{fontCharacter:"\\ebe0"}),r.beakerStop=new r("beaker-stop",{fontCharacter:"\\ebe1"}),r.graphLine=new r("graph-line",{fontCharacter:"\\ebe2"}),r.graphScatter=new r("graph-scatter",{fontCharacter:"\\ebe3"}),r.pieChart=new r("pie-chart",{fontCharacter:"\\ebe4"}),r.bracket=new r("bracket",r.json.definition),r.bracketDot=new r("bracket-dot",{fontCharacter:"\\ebe5"}),r.bracketError=new r("bracket-error",{fontCharacter:"\\ebe6"}),r.lockSmall=new r("lock-small",{fontCharacter:"\\ebe7"}),r.azureDevops=new r("azure-devops",{fontCharacter:"\\ebe8"}),r.verifiedFilled=new r("verified-filled",{fontCharacter:"\\ebe9"})}(z||(z={}))},"VrN/":function(nt,ye,Q){(function(ne,J){nt.exports=J()})(this,function(){"use strict";var ne=navigator.userAgent,J=navigator.platform,P=/gecko\/\d/i.test(ne),Y=/MSIE \d/.test(ne),j=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ne),U=/Edge\/(\d+)/.exec(ne),z=Y||j||U,H=z&&(Y?document.documentMode||6:+(U||j)[1]),r=!U&&/WebKit\//.test(ne),L=r&&/Qt\/\d+\.\d+/.test(ne),v=!U&&/Chrome\//.test(ne),g=/Opera\//.test(ne),p=/Apple Computer/.test(navigator.vendor),u=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ne),h=/PhantomJS/.test(ne),c=!U&&/AppleWebKit/.test(ne)&&/Mobile\/\w+/.test(ne),o=/Android/.test(ne),l=c||o||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ne),s=c||/Mac/.test(J),a=/\bCrOS\b/.test(ne),R=/win/i.test(J),E=g&&ne.match(/Version\/(\d*\.\d*)/);E&&(E=Number(E[1])),E&&E>=15&&(g=!1,r=!0);var S=s&&(L||g&&(E==null||E<12.11)),D=P||z&&H>=9;function A(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var O=function(e,t){var i=e.className,n=A(t).exec(i);if(n){var d=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(d?n[1]+d:"")}};function C(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function x(e,t){return C(e).appendChild(t)}function f(e,t,i,n){var d=document.createElement(e);if(i&&(d.className=i),n&&(d.style.cssText=n),typeof t=="string")d.appendChild(document.createTextNode(t));else if(t)for(var N=0;N<t.length;++N)d.appendChild(t[N]);return d}function w(e,t,i,n){var d=f(e,t,i,n);return d.setAttribute("role","presentation"),d}var b;document.createRange?b=function(e,t,i,n){var d=document.createRange();return d.setEnd(n||e,i),d.setStart(e,t),d}:b=function(e,t,i){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(d){return n}return n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",t),n};function y(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function B(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function F(e,t){var i=e.className;A(t).test(i)||(e.className+=(i?" ":"")+t)}function _(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!A(i[n]).test(t)&&(t+=" "+i[n]);return t}var M=function(e){e.select()};c?M=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:z&&(M=function(e){try{e.select()}catch(t){}});function I(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function m(e,t,i){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(i!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function W(e,t,i,n,d){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var N=n||0,K=d||0;;){var Z=e.indexOf(" ",N);if(Z<0||Z>=t)return K+(t-N);K+=Z-N,K+=i-K%i,N=Z+1}}var $=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};$.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},$.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function ae(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var ue=50,Oe={toString:function(){return"CodeMirror.Pass"}},ve={scroll:!1},Ee={origin:"*mouse"},xe={origin:"+move"};function Ie(e,t,i){for(var n=0,d=0;;){var N=e.indexOf(" ",n);N==-1&&(N=e.length);var K=N-n;if(N==e.length||d+K>=t)return n+Math.min(K,t-d);if(d+=N-n,d+=i-d%i,n=N+1,d>=t)return n}}var de=[""];function ce(e){for(;de.length<=e;)de.push(ie(de)+" ");return de[e]}function ie(e){return e[e.length-1]}function fe(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function le(e,t,i){for(var n=0,d=i(t);n<e.length&&i(e[n])<=d;)n++;e.splice(n,0,t)}function ke(){}function Ne(e,t){var i;return Object.create?i=Object.create(e):(ke.prototype=e,i=new ke),t&&m(t,i),i}var Ae=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Le(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ae.test(e))}function Fe(e,t){return t?t.source.indexOf("\\w")>-1&&Le(e)?!0:t.test(e):Le(e)}function oe(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 De(e,t,i){for(;(i<0?t>0:t<e.length)&&we(e.charAt(t));)t+=i;return t}function je(e,t,i){for(var n=t>i?-1:1;;){if(t==i)return t;var d=(t+i)/2,N=n<0?Math.ceil(d):Math.floor(d);if(N==t)return e(N)?t:i;e(N)?i=N:t=N+n}}function Ve(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var d=!1,N=0;N<e.length;++N){var K=e[N];(K.from<i&&K.to>t||t==i&&K.to==t)&&(n(Math.max(K.from,t),Math.min(K.to,i),K.level==1?"rtl":"ltr",N),d=!0)}d||n(t,i,"ltr")}var Je=null;function Xe(e,t,i){var n;Je=null;for(var d=0;d<e.length;++d){var N=e[d];if(N.from<t&&N.to>t)return d;N.to==t&&(N.from!=N.to&&i=="before"?n=d:Je=d),N.from==t&&(N.from!=N.to&&i!="before"?n=d:Je=d)}return n!=null?n:Je}var et=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(te){return te<=247?e.charAt(te):1424<=te&&te<=1524?"R":1536<=te&&te<=1785?t.charAt(te-1536):1774<=te&&te<=2220?"r":8192<=te&&te<=8203?"w":te==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,d=/[stwN]/,N=/[LRr]/,K=/[Lb1n]/,Z=/[1n]/;function q(te,pe,_e){this.level=te,this.from=pe,this.to=_e}return function(te,pe){var _e=pe=="ltr"?"L":"R";if(te.length==0||pe=="ltr"&&!n.test(te))return!1;for(var Pe=te.length,Me=[],Ge=0;Ge<Pe;++Ge)Me.push(i(te.charCodeAt(Ge)));for(var $e=0,qe=_e;$e<Pe;++$e){var at=Me[$e];at=="m"?Me[$e]=qe:qe=at}for(var lt=0,st=_e;lt<Pe;++lt){var ht=Me[lt];ht=="1"&&st=="r"?Me[lt]="n":N.test(ht)&&(st=ht,ht=="r"&&(Me[lt]="R"))}for(var Tt=1,vt=Me[0];Tt<Pe-1;++Tt){var Rt=Me[Tt];Rt=="+"&&vt=="1"&&Me[Tt+1]=="1"?Me[Tt]="1":Rt==","&&vt==Me[Tt+1]&&(vt=="1"||vt=="n")&&(Me[Tt]=vt),vt=Rt}for(var Yt=0;Yt<Pe;++Yt){var gr=Me[Yt];if(gr==",")Me[Yt]="N";else if(gr=="%"){var er=void 0;for(er=Yt+1;er<Pe&&Me[er]=="%";++er);for(var Gr=Yt&&Me[Yt-1]=="!"||er<Pe&&Me[er]=="1"?"1":"N",Nr=Yt;Nr<er;++Nr)Me[Nr]=Gr;Yt=er-1}}for(var sr=0,Fr=_e;sr<Pe;++sr){var _r=Me[sr];Fr=="L"&&_r=="1"?Me[sr]="L":N.test(_r)&&(Fr=_r)}for(var hr=0;hr<Pe;++hr)if(d.test(Me[hr])){var or=void 0;for(or=hr+1;or<Pe&&d.test(Me[or]);++or);for(var rr=(hr?Me[hr-1]:_e)=="L",Ur=(or<Pe?Me[or]:_e)=="L",ui=rr==Ur?rr?"L":"R":_e,In=hr;In<or;++In)Me[In]=ui;hr=or-1}for(var Sr=[],ln,vr=0;vr<Pe;)if(K.test(Me[vr])){var Va=vr;for(++vr;vr<Pe&&K.test(Me[vr]);++vr);Sr.push(new q(0,Va,vr))}else{var pn=vr,Gn=Sr.length,zn=pe=="rtl"?1:0;for(++vr;vr<Pe&&Me[vr]!="L";++vr);for(var Rr=pn;Rr<vr;)if(Z.test(Me[Rr])){pn<Rr&&(Sr.splice(Gn,0,new q(1,pn,Rr)),Gn+=zn);var hi=Rr;for(++Rr;Rr<vr&&Z.test(Me[Rr]);++Rr);Sr.splice(Gn,0,new q(2,hi,Rr)),Gn+=zn,pn=Rr}else++Rr;pn<vr&&Sr.splice(Gn,0,new q(1,pn,vr))}return pe=="ltr"&&(Sr[0].level==1&&(ln=te.match(/^\s+/))&&(Sr[0].from=ln[0].length,Sr.unshift(new q(0,0,ln[0].length))),ie(Sr).level==1&&(ln=te.match(/\s+$/))&&(ie(Sr).to-=ln[0].length,Sr.push(new q(0,Pe-ln[0].length,Pe)))),pe=="rtl"?Sr.reverse():Sr}}();function Ze(e,t){var i=e.order;return i==null&&(i=e.order=et(e.text,t)),i}var rt=[],Be=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||rt).concat(i)}};function ut(e,t){return e._handlers&&e._handlers[t]||rt}function it(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var n=e._handlers,d=n&&n[t];if(d){var N=ae(d,i);N>-1&&(n[t]=d.slice(0,N).concat(d.slice(N+1)))}}}function He(e,t){var i=ut(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),d=0;d<i.length;++d)i[d].apply(null,n)}function We(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),He(e,i||t.type,e,t),he(t)||t.codemirrorIgnore}function Re(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)ae(i,t[n])==-1&&i.push(t[n])}function be(e,t){return ut(e,t).length>0}function Ce(e){e.prototype.on=function(t,i){Be(this,t,i)},e.prototype.off=function(t,i){it(this,t,i)}}function re(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function se(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function he(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function me(e){re(e),se(e)}function Se(e){return e.target||e.srcElement}function Ue(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 Ke=function(){if(z&&H<9)return!1;var e=f("div");return"draggable"in e||"dragDrop"in e}(),ot;function mt(e){if(ot==null){var t=f("span","\u200B");x(e,f("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(ot=t.offsetWidth<=1&&t.offsetHeight>2&&!(z&&H<8))}var i=ot?f("span","\u200B"):f("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var ft;function wt(e){if(ft!=null)return ft;var t=x(e,document.createTextNode("A\u062EA")),i=b(t,0,1).getBoundingClientRect(),n=b(t,1,2).getBoundingClientRect();return C(e),!i||i.left==i.right?!1:ft=n.right-i.right<3}var St=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var d=e.indexOf(`
|
|
`,t);d==-1&&(d=e.length);var N=e.slice(t,e.charAt(d-1)=="\r"?d-1:d),K=N.indexOf("\r");K!=-1?(i.push(N.slice(0,K)),t+=K+1):(i.push(N),t=d+1)}return i}:function(e){return e.split(/\r\n?|\n/)},dt=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(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Bt=function(){var e=f("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Lt=null;function qt(e){if(Lt!=null)return Lt;var t=x(e,f("span","x")),i=t.getBoundingClientRect(),n=b(t,0,1).getBoundingClientRect();return Lt=Math.abs(i.left-n.left)>1}var Qt={},It={};function Cr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Qt[e]=t}function zr(e,t){It[e]=t}function yt(e){if(typeof e=="string"&&It.hasOwnProperty(e))e=It[e];else if(e&&typeof e.name=="string"&&It.hasOwnProperty(e.name)){var t=It[e.name];typeof t=="string"&&(t={name:t}),e=Ne(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return yt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return yt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Lr(e,t){t=yt(t);var i=Qt[t.name];if(!i)return Lr(e,"text/plain");var n=i(e,t);if(bt.hasOwnProperty(t.name)){var d=bt[t.name];for(var N in d){if(!d.hasOwnProperty(N))continue;n.hasOwnProperty(N)&&(n["_"+N]=n[N]),n[N]=d[N]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var K in t.modeProps)n[K]=t.modeProps[K];return n}var bt={};function xt(e,t){var i=bt.hasOwnProperty(e)?bt[e]:bt[e]={};m(t,i)}function Ft(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var d=t[n];d instanceof Array&&(d=d.concat([])),i[n]=d}return i}function tr(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function dr(e,t,i){return e.startState?e.startState(t,i):!0}var Pt=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};Pt.prototype.eol=function(){return this.pos>=this.string.length},Pt.prototype.sol=function(){return this.pos==this.lineStart},Pt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Pt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Pt.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},Pt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Pt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Pt.prototype.skipToEnd=function(){this.pos=this.string.length},Pt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Pt.prototype.backUp=function(e){this.pos-=e},Pt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=W(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},Pt.prototype.indentation=function(){return W(this.string,null,this.tabSize)-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},Pt.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(K){return i?K.toLowerCase():K},d=this.string.substr(this.pos,e.length);if(n(d)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var N=this.string.slice(this.pos).match(e);return N&&N.index>0?null:(N&&t!==!1&&(this.pos+=N[0].length),N)}},Pt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Pt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Pt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Pt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ct(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 i=e;!i.lines;)for(var n=0;;++n){var d=i.children[n],N=d.chunkSize();if(t<N){i=d;break}t-=N}return i.lines[t]}function Br(e,t,i){var n=[],d=t.line;return e.iter(t.line,i.line+1,function(N){var K=N.text;d==i.line&&(K=K.slice(0,i.ch)),d==t.line&&(K=K.slice(t.ch)),n.push(K),++d}),n}function Vt(e,t,i){var n=[];return e.iter(t,i,function(d){n.push(d.text)}),n}function Jt(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function Ot(e){if(e.parent==null)return null;for(var t=e.parent,i=ae(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var d=0;!(n.children[d]==t);++d)i+=n.children[d].chunkSize();return i+t.first}function lr(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var d=e.children[n],N=d.height;if(t<N){e=d;continue e}t-=N,i+=d.chunkSize()}return i}while(!e.lines);for(var K=0;K<e.lines.length;++K){var Z=e.lines[K],q=Z.height;if(t<q)break;t-=q}return i+K}function Ir(e,t){return t>=e.first&&t<e.first+e.size}function Yr(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Qe(e,t,i){if(i===void 0&&(i=null),!(this instanceof Qe))return new Qe(e,t,i);this.line=e,this.ch=t,this.sticky=i}function Ct(e,t){return e.line-t.line||e.ch-t.ch}function mn(e,t){return e.sticky==t.sticky&&Ct(e,t)==0}function gn(e){return Qe(e.line,e.ch)}function vn(e,t){return Ct(e,t)<0?t:e}function yn(e,t){return Ct(e,t)<0?e:t}function X(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function T(e,t){if(t.line<e.first)return Qe(e.first,0);var i=e.first+e.size-1;return t.line>i?Qe(i,ct(e,i).text.length):k(t,ct(e,t.line).text.length)}function k(e,t){var i=e.ch;return i==null||i>t?Qe(e.line,t):i<0?Qe(e.line,0):e}function G(e,t){for(var i=[],n=0;n<t.length;n++)i[n]=T(e,t[n]);return i}var ee=function(e,t){this.state=e,this.lookAhead=t},V=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};V.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},V.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},V.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},V.fromSaved=function(e,t,i){return t instanceof ee?new V(e,Ft(e.mode,t.state),i,t.lookAhead):new V(e,Ft(e.mode,t),i)},V.prototype.save=function(e){var t=e!==!1?Ft(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ee(t,this.maxLookAhead):t};function Te(e,t,i,n){var d=[e.state.modeGen],N={};Er(e,t.text,e.doc.mode,i,function(te,pe){return d.push(te,pe)},N,n);for(var K=i.state,Z=function(te){i.baseTokens=d;var pe=e.state.overlays[te],_e=1,Pe=0;i.state=!0,Er(e,t.text,pe.mode,i,function(Me,Ge){for(var $e=_e;Pe<Me;){var qe=d[_e];qe>Me&&d.splice(_e,1,Me,d[_e+1],qe),_e+=2,Pe=Math.min(Me,qe)}if(!Ge)return;if(pe.opaque)d.splice($e,_e-$e,Me,"overlay "+Ge),_e=$e+2;else for(;$e<_e;$e+=2){var at=d[$e+1];d[$e+1]=(at?at+" ":"")+"overlay "+Ge}},N),i.state=K,i.baseTokens=null,i.baseTokenPos=1},q=0;q<e.state.overlays.length;++q)Z(q);return{styles:d,classes:N.bgClass||N.textClass?N:null}}function ze(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=tt(e,Ot(t)),d=t.text.length>e.options.maxHighlightLength&&Ft(e.doc.mode,n.state),N=Te(e,t,n);d&&(n.state=d),t.stateAfter=n.save(!d),t.styles=N.styles,N.classes?t.styleClasses=N.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function tt(e,t,i){var n=e.doc,d=e.display;if(!n.mode.startState)return new V(n,!0,t);var N=xr(e,t,i),K=N>n.first&&ct(n,N-1).stateAfter,Z=K?V.fromSaved(n,K,N):new V(n,dr(n.mode),N);return n.iter(N,t,function(q){pt(e,q.text,Z);var te=Z.line;q.stateAfter=te==t-1||te%5==0||te>=d.viewFrom&&te<d.viewTo?Z.save():null,Z.nextLine()}),i&&(n.modeFrontier=Z.line),Z}function pt(e,t,i,n){var d=e.doc.mode,N=new Pt(t,e.options.tabSize,i);for(N.start=N.pos=n||0,t==""&&Ye(d,i.state);!N.eol();)_t(d,N,i.state),N.start=N.pos}function Ye(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=tr(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function _t(e,t,i,n){for(var d=0;d<10;d++){n&&(n[0]=tr(e,i).mode);var N=e.token(t,i);if(t.pos>t.start)return N}throw new Error("Mode "+e.name+" failed to advance stream.")}var jt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function $t(e,t,i,n){var d=e.doc,N=d.mode,K;t=T(d,t);var Z=ct(d,t.line),q=tt(e,t.line,i),te=new Pt(Z.text,e.options.tabSize,q),pe;for(n&&(pe=[]);(n||te.pos<t.ch)&&!te.eol();)te.start=te.pos,K=_t(N,te,q.state),n&&pe.push(new jt(te,K,Ft(d.mode,q.state)));return n?pe:new jt(te,K,q.state)}function jr(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var n=i[1]?"bgClass":"textClass";t[n]==null?t[n]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+i[2])}return e}function Er(e,t,i,n,d,N,K){var Z=i.flattenSpans;Z==null&&(Z=e.options.flattenSpans);var q=0,te=null,pe=new Pt(t,e.options.tabSize,n),_e,Pe=e.options.addModeClass&&[null];for(t==""&&jr(Ye(i,n.state),N);!pe.eol();){if(pe.pos>e.options.maxHighlightLength?(Z=!1,K&&pt(e,t,n,pe.pos),pe.pos=t.length,_e=null):_e=jr(_t(i,pe,n.state,Pe),N),Pe){var Me=Pe[0].name;Me&&(_e="m-"+(_e?Me+" "+_e:Me))}if(!Z||te!=_e){for(;q<pe.start;)q=Math.min(pe.start,q+5e3),d(q,te);te=_e}pe.start=pe.pos}for(;q<pe.pos;){var Ge=Math.min(pe.pos,q+5e3);d(Ge,te),q=Ge}}function xr(e,t,i){for(var n,d,N=e.doc,K=i?-1:t-(e.doc.mode.innerMode?1e3:100),Z=t;Z>K;--Z){if(Z<=N.first)return N.first;var q=ct(N,Z-1),te=q.stateAfter;if(te&&(!i||Z+(te instanceof ee?te.lookAhead:0)<=N.modeFrontier))return Z;var pe=W(q.text,null,e.options.tabSize);(d==null||n>pe)&&(d=Z-1,n=pe)}return d}function Qr(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,n=t-1;n>i;n--){var d=ct(e,n).stateAfter;if(d&&(!(d instanceof ee)||n+d.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Dn=!1,cr=!1;function Kr(){Dn=!0}function un(){cr=!0}function hn(e,t,i){this.marker=e,this.from=t,this.to=i}function Hr(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function kn(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function bn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Kn(e,t,i){var n;if(e)for(var d=0;d<e.length;++d){var N=e[d],K=N.marker,Z=N.from==null||(K.inclusiveLeft?N.from<=t:N.from<t);if(Z||N.from==t&&K.type=="bookmark"&&(!i||!N.marker.insertLeft)){var q=N.to==null||(K.inclusiveRight?N.to>=t:N.to>t);(n||(n=[])).push(new hn(K,N.from,q?null:N.to))}}return n}function Vn(e,t,i){var n;if(e)for(var d=0;d<e.length;++d){var N=e[d],K=N.marker,Z=N.to==null||(K.inclusiveRight?N.to>=t:N.to>t);if(Z||N.from==t&&K.type=="bookmark"&&(!i||N.marker.insertLeft)){var q=N.from==null||(K.inclusiveLeft?N.from<=t:N.from<t);(n||(n=[])).push(new hn(K,q?null:N.from-t,N.to==null?null:N.to-t))}}return n}function Zr(e,t){if(t.full)return null;var i=Ir(e,t.from.line)&&ct(e,t.from.line).markedSpans,n=Ir(e,t.to.line)&&ct(e,t.to.line).markedSpans;if(!i&&!n)return null;var d=t.from.ch,N=t.to.ch,K=Ct(t.from,t.to)==0,Z=Kn(i,d,K),q=Vn(n,N,K),te=t.text.length==1,pe=ie(t.text).length+(te?d:0);if(Z)for(var _e=0;_e<Z.length;++_e){var Pe=Z[_e];if(Pe.to==null){var Me=Hr(q,Pe.marker);Me?te&&(Pe.to=Me.to==null?null:Me.to+pe):Pe.to=d}}if(q)for(var Ge=0;Ge<q.length;++Ge){var $e=q[Ge];if($e.to!=null&&($e.to+=pe),$e.from==null){var qe=Hr(Z,$e.marker);qe||($e.from=pe,te&&(Z||(Z=[])).push($e))}else $e.from+=pe,te&&(Z||(Z=[])).push($e)}Z&&(Z=$r(Z)),q&&q!=Z&&(q=$r(q));var at=[Z];if(!te){var lt=t.text.length-2,st;if(lt>0&&Z)for(var ht=0;ht<Z.length;++ht)Z[ht].to==null&&(st||(st=[])).push(new hn(Z[ht].marker,null,null));for(var Tt=0;Tt<lt;++Tt)at.push(st);at.push(q)}return at}function $r(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function _n(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(Me){if(Me.markedSpans)for(var Ge=0;Ge<Me.markedSpans.length;++Ge){var $e=Me.markedSpans[Ge].marker;$e.readOnly&&(!n||ae(n,$e)==-1)&&(n||(n=[])).push($e)}}),!n)return null;for(var d=[{from:t,to:i}],N=0;N<n.length;++N)for(var K=n[N],Z=K.find(0),q=0;q<d.length;++q){var te=d[q];if(Ct(te.to,Z.from)<0||Ct(te.from,Z.to)>0)continue;var pe=[q,1],_e=Ct(te.from,Z.from),Pe=Ct(te.to,Z.to);(_e<0||!K.inclusiveLeft&&!_e)&&pe.push({from:te.from,to:Z.from}),(Pe>0||!K.inclusiveRight&&!Pe)&&pe.push({from:Z.to,to:te.to}),d.splice.apply(d,pe),q+=pe.length-3}return d}function di(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function En(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function nr(e){return e.inclusiveLeft?-1:0}function Ht(e){return e.inclusiveRight?1:0}function yr(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),d=t.find(),N=Ct(n.from,d.from)||nr(e)-nr(t);if(N)return-N;var K=Ct(n.to,d.to)||Ht(e)-Ht(t);return K||t.id-e.id}function kt(e,t){var i=cr&&e.markedSpans,n;if(i)for(var d=void 0,N=0;N<i.length;++N)d=i[N],d.marker.collapsed&&(t?d.from:d.to)==null&&(!n||yr(n,d.marker)<0)&&(n=d.marker);return n}function ar(e){return kt(e,!0)}function zt(e){return kt(e,!1)}function nn(e,t){var i=cr&&e.markedSpans,n;if(i)for(var d=0;d<i.length;++d){var N=i[d];N.marker.collapsed&&(N.from==null||N.from<t)&&(N.to==null||N.to>t)&&(!n||yr(n,N.marker)<0)&&(n=N.marker)}return n}function fr(e,t,i,n,d){var N=ct(e,t),K=cr&&N.markedSpans;if(K)for(var Z=0;Z<K.length;++Z){var q=K[Z];if(!q.marker.collapsed)continue;var te=q.marker.find(0),pe=Ct(te.from,i)||nr(q.marker)-nr(d),_e=Ct(te.to,n)||Ht(q.marker)-Ht(d);if(pe>=0&&_e<=0||pe<=0&&_e>=0)continue;if(pe<=0&&(q.marker.inclusiveRight&&d.inclusiveLeft?Ct(te.to,i)>=0:Ct(te.to,i)>0)||pe>=0&&(q.marker.inclusiveRight&&d.inclusiveLeft?Ct(te.from,n)<=0:Ct(te.from,n)<0))return!0}}function Ar(e){for(var t;t=ar(e);)e=t.find(-1,!0).line;return e}function Xn(e){for(var t;t=zt(e);)e=t.find(1,!0).line;return e}function xn(e){for(var t,i;t=zt(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function ci(e,t){var i=ct(e,t),n=Ar(i);return i==n?t:Ot(n)}function Tn(e,t){if(t>e.lastLine())return t;var i=ct(e,t),n;if(!an(e,i))return t;for(;n=zt(i);)i=n.find(1,!0).line;return Ot(i)+1}function an(e,t){var i=cr&&t.markedSpans;if(i)for(var n=void 0,d=0;d<i.length;++d){if(n=i[d],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&fi(e,t,n))return!0}}function fi(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return fi(e,n.line,Hr(n.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var d=void 0,N=0;N<t.markedSpans.length;++N)if(d=t.markedSpans[N],d.marker.collapsed&&!d.marker.widgetNode&&d.from==i.to&&(d.to==null||d.to!=i.from)&&(d.marker.inclusiveLeft||i.marker.inclusiveRight)&&fi(e,t,d))return!0}function qr(e){e=Ar(e);for(var t=0,i=e.parent,n=0;n<i.lines.length;++n){var d=i.lines[n];if(d==e)break;t+=d.height}for(var N=i.parent;N;i=N,N=i.parent)for(var K=0;K<N.children.length;++K){var Z=N.children[K];if(Z==i)break;t+=Z.height}return t}function pi(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=ar(n);){var d=i.find(0,!0);n=d.from.line,t+=d.from.ch-d.to.ch}for(n=e;i=zt(n);){var N=i.find(0,!0);t-=n.text.length-N.from.ch,n=N.to.line,t+=n.text.length-N.to.ch}return t}function ji(e){var t=e.display,i=e.doc;t.maxLine=ct(i,i.first),t.maxLineLength=pi(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var d=pi(n);d>t.maxLineLength&&(t.maxLineLength=d,t.maxLine=n)})}var Mn=function(e,t,i){this.text=e,En(this,t),this.height=i?i(this):1};Mn.prototype.lineNo=function(){return Ot(this)},Ce(Mn);function ua(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),di(e),En(e,i);var d=n?n(e):1;d!=e.height&&Jt(e,d)}function gt(e){e.parent=null,di(e)}var At={},Et={};function Dt(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Et:At;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Ut(e,t){var i=w("span",null,null,r?"padding-right: .1px":null),n={pre:w("pre",[i],"CodeMirror-line"),content:i,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 N=d?t.rest[d-1]:t.line,K=void 0;n.pos=0,n.addToken=Nt,wt(e.display.measure)&&(K=Ze(N,e.doc.direction))&&(n.addToken=Dr(n.addToken,K)),n.map=[];var Z=t!=e.display.externalMeasured&&Ot(N);dn(N,n,ze(e,N,Z)),N.styleClasses&&(N.styleClasses.bgClass&&(n.bgClass=_(N.styleClasses.bgClass,n.bgClass||"")),N.styleClasses.textClass&&(n.textClass=_(N.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(mt(e.display.measure))),d==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(r){var q=n.content.lastChild;(/\bcm-tab\b/.test(q.className)||q.querySelector&&q.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return He(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=_(n.pre.className,n.textClass||"")),n}function Xt(e){var t=f("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Nt(e,t,i,n,d,N,K){if(!t)return;var Z=e.splitSpaces?ur(t,e.trailingSpace):t,q=e.cm.state.specialChars,te=!1,pe;if(!q.test(t))e.col+=t.length,pe=document.createTextNode(Z),e.map.push(e.pos,e.pos+t.length,pe),z&&H<9&&(te=!0),e.pos+=t.length;else{pe=document.createDocumentFragment();for(var _e=0;;){q.lastIndex=_e;var Pe=q.exec(t),Me=Pe?Pe.index-_e:t.length-_e;if(Me){var Ge=document.createTextNode(Z.slice(_e,_e+Me));z&&H<9?pe.appendChild(f("span",[Ge])):pe.appendChild(Ge),e.map.push(e.pos,e.pos+Me,Ge),e.col+=Me,e.pos+=Me}if(!Pe)break;_e+=Me+1;var $e=void 0;if(Pe[0]==" "){var qe=e.cm.options.tabSize,at=qe-e.col%qe;$e=pe.appendChild(f("span",ce(at),"cm-tab")),$e.setAttribute("role","presentation"),$e.setAttribute("cm-text"," "),e.col+=at}else Pe[0]=="\r"||Pe[0]==`
|
|
`?($e=pe.appendChild(f("span",Pe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),$e.setAttribute("cm-text",Pe[0]),e.col+=1):($e=e.cm.options.specialCharPlaceholder(Pe[0]),$e.setAttribute("cm-text",Pe[0]),z&&H<9?pe.appendChild(f("span",[$e])):pe.appendChild($e),e.col+=1);e.map.push(e.pos,e.pos+1,$e),e.pos++}}if(e.trailingSpace=Z.charCodeAt(t.length-1)==32,i||n||d||te||N||K){var lt=i||"";n&&(lt+=n),d&&(lt+=d);var st=f("span",[pe],lt,N);if(K)for(var ht in K)K.hasOwnProperty(ht)&&ht!="style"&&ht!="class"&&st.setAttribute(ht,K[ht]);return e.content.appendChild(st)}e.content.appendChild(pe)}function ur(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",d=0;d<e.length;d++){var N=e.charAt(d);N==" "&&i&&(d==e.length-1||e.charCodeAt(d+1)==32)&&(N="\xA0"),n+=N,i=N==" "}return n}function Dr(e,t){return function(i,n,d,N,K,Z,q){d=d?d+" cm-force-border":"cm-force-border";for(var te=i.pos,pe=te+n.length;;){for(var _e=void 0,Pe=0;Pe<t.length&&!(_e=t[Pe],_e.to>te&&_e.from<=te);Pe++);if(_e.to>=pe)return e(i,n,d,N,K,Z,q);e(i,n.slice(0,_e.to-te),d,N,null,Z,q),N=null,n=n.slice(_e.to-te),te=_e.to}}}function Mt(e,t,i,n){var d=!n&&i.widgetNode;d&&e.map.push(e.pos,e.pos+t,d),!n&&e.cm.display.input.needsContentAttribute&&(d||(d=e.content.appendChild(document.createElement("span"))),d.setAttribute("cm-marker",i.id)),d&&(e.cm.display.input.setUneditable(d),e.content.appendChild(d)),e.pos+=t,e.trailingSpace=!1}function dn(e,t,i){var n=e.markedSpans,d=e.text,N=0;if(!n){for(var K=1;K<i.length;K+=2)t.addToken(t,d.slice(N,N=i[K]),Dt(i[K+1],t.cm.options));return}for(var Z=d.length,q=0,te=1,pe="",_e,Pe,Me=0,Ge,$e,qe,at,lt;;){if(Me==q){Ge=$e=qe=Pe="",lt=null,at=null,Me=Infinity;for(var st=[],ht=void 0,Tt=0;Tt<n.length;++Tt){var vt=n[Tt],Rt=vt.marker;if(Rt.type=="bookmark"&&vt.from==q&&Rt.widgetNode)st.push(Rt);else if(vt.from<=q&&(vt.to==null||vt.to>q||Rt.collapsed&&vt.to==q&&vt.from==q)){if(vt.to!=null&&vt.to!=q&&Me>vt.to&&(Me=vt.to,$e=""),Rt.className&&(Ge+=" "+Rt.className),Rt.css&&(Pe=(Pe?Pe+";":"")+Rt.css),Rt.startStyle&&vt.from==q&&(qe+=" "+Rt.startStyle),Rt.endStyle&&vt.to==Me&&(ht||(ht=[])).push(Rt.endStyle,vt.to),Rt.title&&((lt||(lt={})).title=Rt.title),Rt.attributes)for(var Yt in Rt.attributes)(lt||(lt={}))[Yt]=Rt.attributes[Yt];Rt.collapsed&&(!at||yr(at.marker,Rt)<0)&&(at=vt)}else vt.from>q&&Me>vt.from&&(Me=vt.from)}if(ht)for(var gr=0;gr<ht.length;gr+=2)ht[gr+1]==Me&&($e+=" "+ht[gr]);if(!at||at.from==q)for(var er=0;er<st.length;++er)Mt(t,0,st[er]);if(at&&(at.from||0)==q){if(Mt(t,(at.to==null?Z+1:at.to)-q,at.marker,at.from==null),at.to==null)return;at.to==q&&(at=!1)}}if(q>=Z)break;for(var Gr=Math.min(Z,Me);;){if(pe){var Nr=q+pe.length;if(!at){var sr=Nr>Gr?pe.slice(0,Gr-q):pe;t.addToken(t,sr,_e?_e+Ge:Ge,qe,q+sr.length==Me?$e:"",Pe,lt)}if(Nr>=Gr){pe=pe.slice(Gr-q),q=Gr;break}q=Nr,qe=""}pe=d.slice(N,N=i[te++]),_e=Dt(i[te++],t.cm.options)}}}function Wt(e,t,i){this.line=t,this.rest=xn(t),this.size=this.rest?Ot(ie(this.rest))-i+1:1,this.node=this.text=null,this.hidden=an(e,t)}function kr(e,t,i){for(var n=[],d,N=t;N<i;N=d){var K=new Wt(e.doc,ct(e.doc,N),N);d=N+K.size,n.push(K)}return n}var Tr=null;function Jr(e){Tr?Tr.ops.push(e):e.ownsGroup=Tr={ops:[e],delayedCallbacks:[]}}function Lo(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var n=0;n<e.ops.length;n++){var d=e.ops[n];if(d.cursorActivityHandlers)for(;d.cursorActivityCalled<d.cursorActivityHandlers.length;)d.cursorActivityHandlers[d.cursorActivityCalled++].call(null,d.cm)}}while(i<t.length)}function Io(e,t){var i=e.ownsGroup;if(!i)return;try{Lo(i)}finally{Tr=null,t(i)}}var mi=null;function br(e,t){var i=ut(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),d;Tr?d=Tr.delayedCallbacks:mi?d=mi:(d=mi=[],setTimeout(Do,0));for(var N=function(Z){d.push(function(){return i[Z].apply(null,n)})},K=0;K<i.length;++K)N(K)}function Do(){var e=mi;mi=null;for(var t=0;t<e.length;++t)e[t]()}function Ya(e,t,i,n){for(var d=0;d<t.changes.length;d++){var N=t.changes[d];N=="text"?Mo(e,t):N=="gutter"?Ja(e,t,i,n):N=="class"?ha(e,t):N=="widget"&&Po(e,t,n)}t.changes=null}function gi(e){return e.node==e.text&&(e.node=f("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),z&&H<8&&(e.node.style.zIndex=2)),e.node}function ko(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var n=gi(t);t.background=n.insertBefore(f("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function $a(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Ut(e,t)}function Mo(e,t){var i=t.text.className,n=$a(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,ha(e,t)):i&&(t.text.className=i)}function ha(e,t){ko(e,t),t.line.wrapClass?gi(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function Ja(e,t,i,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var d=gi(t);t.gutterBackground=f("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),d.insertBefore(t.gutterBackground,t.text)}var N=t.line.gutterMarkers;if(e.options.lineNumbers||N){var K=gi(t),Z=t.gutter=f("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(Z),K.insertBefore(Z,t.text),t.line.gutterClass&&(Z.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!N||!N["CodeMirror-linenumbers"])&&(t.lineNumber=Z.appendChild(f("div",Yr(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),N)for(var q=0;q<e.display.gutterSpecs.length;++q){var te=e.display.gutterSpecs[q].className,pe=N.hasOwnProperty(te)&&N[te];pe&&Z.appendChild(f("div",[pe],"CodeMirror-gutter-elt","left: "+n.gutterLeft[te]+"px; width: "+n.gutterWidth[te]+"px"))}}}function Po(e,t,i){t.alignable&&(t.alignable=null);for(var n=A("CodeMirror-linewidget"),d=t.node.firstChild,N=void 0;d;d=N)N=d.nextSibling,n.test(d.className)&&t.node.removeChild(d);Qa(e,t,i)}function No(e,t,i,n){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,i,n),Qa(e,t,n),t.node}function Qa(e,t,i){if(Za(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)Za(e,t.rest[n],t,i,!1)}function Za(e,t,i,n,d){if(!t.widgets)return;for(var N=gi(i),K=0,Z=t.widgets;K<Z.length;++K){var q=Z[K],te=f("div",[q.node],"CodeMirror-linewidget"+(q.className?" "+q.className:""));q.handleMouseEvents||te.setAttribute("cm-ignore-events","true"),Fo(q,te,i,n),e.display.input.setUneditable(te),d&&q.above?N.insertBefore(te,i.gutter||i.text):N.appendChild(te),br(q,"redraw")}}function Fo(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var d=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(d-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=d+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function vi(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!y(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),x(t.display.measure,f("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function cn(e,t){for(var i=Se(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Hi(e){return e.lineSpace.offsetTop}function da(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function qa(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=x(e.measure,f("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function sn(e){return ue-e.display.nativeBarWidth}function Pn(e){return e.display.scroller.clientWidth-sn(e)-e.display.barWidth}function ca(e){return e.display.scroller.clientHeight-sn(e)-e.display.barHeight}function Uo(e,t,i){var n=e.options.lineWrapping,d=n&&Pn(e);if(!t.measure.heights||n&&t.measure.width!=d){var N=t.measure.heights=[];if(n){t.measure.width=d;for(var K=t.text.firstChild.getClientRects(),Z=0;Z<K.length-1;Z++){var q=K[Z],te=K[Z+1];Math.abs(q.bottom-te.bottom)>2&&N.push((q.bottom+te.top)/2-i.top)}}N.push(i.bottom-i.top)}}function es(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var d=0;d<e.rest.length;d++)if(Ot(e.rest[d])>i)return{map:e.measure.maps[d],cache:e.measure.caches[d],before:!0}}function Bo(e,t){t=Ar(t);var i=Ot(t),n=e.display.externalMeasured=new Wt(e.doc,t,i);n.lineN=i;var d=n.built=Ut(e,n);return n.text=d.pre,x(e.display.lineMeasure,d.pre),n}function ts(e,t,i,n){return on(e,Yn(e,t),i,n)}function fa(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Un(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Yn(e,t){var i=Ot(t),n=fa(e,i);n&&!n.text?n=null:n&&n.changes&&(Ya(e,n,i,ba(e)),e.curOp.forceUpdate=!0),n||(n=Bo(e,t));var d=es(n,t,i);return{line:t,view:n,rect:null,map:d.map,cache:d.cache,before:d.before,hasHeights:!1}}function on(e,t,i,n,d){t.before&&(i=-1);var N=i+(n||""),K;return t.cache.hasOwnProperty(N)?K=t.cache[N]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Uo(e,t.view,t.rect),t.hasHeights=!0),K=Ho(e,t,i,n),K.bogus||(t.cache[N]=K)),{left:K.left,right:K.right,top:d?K.rtop:K.top,bottom:d?K.rbottom:K.bottom}}var rs={left:0,right:0,top:0,bottom:0};function ns(e,t,i){for(var n,d,N,K,Z,q,te=0;te<e.length;te+=3)if(Z=e[te],q=e[te+1],t<Z?(d=0,N=1,K="left"):t<q?(d=t-Z,N=d+1):(te==e.length-3||t==q&&e[te+3]>t)&&(N=q-Z,d=N-1,t>=q&&(K="right")),d!=null){if(n=e[te+2],Z==q&&i==(n.insertLeft?"left":"right")&&(K=i),i=="left"&&d==0)for(;te&&e[te-2]==e[te-3]&&e[te-1].insertLeft;)n=e[(te-=3)+2],K="left";if(i=="right"&&d==q-Z)for(;te<e.length-3&&e[te+3]==e[te+4]&&!e[te+5].insertLeft;)n=e[(te+=3)+2],K="right";break}return{node:n,start:d,end:N,collapse:K,coverStart:Z,coverEnd:q}}function jo(e,t){var i=rs;if(t=="left")for(var n=0;n<e.length&&!((i=e[n]).left!=i.right);n++);else for(var d=e.length-1;d>=0&&!((i=e[d]).left!=i.right);d--);return i}function Ho(e,t,i,n){var d=ns(t.map,i,n),N=d.node,K=d.start,Z=d.end,q=d.collapse,te;if(N.nodeType==3){for(var pe=0;pe<4;pe++){for(;K&&we(t.line.text.charAt(d.coverStart+K));)--K;for(;d.coverStart+Z<d.coverEnd&&we(t.line.text.charAt(d.coverStart+Z));)++Z;if(z&&H<9&&K==0&&Z==d.coverEnd-d.coverStart?te=N.parentNode.getBoundingClientRect():te=jo(b(N,K,Z).getClientRects(),n),te.left||te.right||K==0)break;Z=K,K=K-1,q="right"}z&&H<11&&(te=Wo(e.display.measure,te))}else{K>0&&(q=n="right");var _e;e.options.lineWrapping&&(_e=N.getClientRects()).length>1?te=_e[n=="right"?_e.length-1:0]:te=N.getBoundingClientRect()}if(z&&H<9&&!K&&(!te||!te.left&&!te.right)){var Pe=N.parentNode.getClientRects()[0];Pe?te={left:Pe.left,right:Pe.left+Jn(e.display),top:Pe.top,bottom:Pe.bottom}:te=rs}for(var Me=te.top-t.rect.top,Ge=te.bottom-t.rect.top,$e=(Me+Ge)/2,qe=t.view.measure.heights,at=0;at<qe.length-1&&!($e<qe[at]);at++);var lt=at?qe[at-1]:0,st=qe[at],ht={left:(q=="right"?te.right:te.left)-t.rect.left,right:(q=="left"?te.left:te.right)-t.rect.left,top:lt,bottom:st};return!te.left&&!te.right&&(ht.bogus=!0),e.options.singleCursorHeightPerLine||(ht.rtop=Me,ht.rbottom=Ge),ht}function Wo(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!qt(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*n,bottom:t.bottom*n}}function is(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,C(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)is(e.display.view[t])}function yi(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 i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=vi(e.widgets[i]));return t}function Wi(e,t,i,n,d){if(!d){var N=pa(t);i.top+=N,i.bottom+=N}if(n=="line")return i;n||(n="local");var K=qr(t);if(n=="local"?K+=Hi(e.display):K-=e.display.viewOffset,n=="page"||n=="window"){var Z=e.display.lineSpace.getBoundingClientRect();K+=Z.top+(n=="window"?0:os());var q=Z.left+(n=="window"?0:ss());i.left+=q,i.right+=q}return i.top+=K,i.bottom+=K,i}function ls(e,t,i){if(i=="div")return t;var n=t.left,d=t.top;if(i=="page")n-=ss(),d-=os();else if(i=="local"||!i){var N=e.display.sizer.getBoundingClientRect();n+=N.left,d+=N.top}var K=e.display.lineSpace.getBoundingClientRect();return{left:n-K.left,top:d-K.top}}function ma(e,t,i,n,d){return n||(n=ct(e.doc,t.line)),Wi(e,n,ts(e,n,t.ch,d),i)}function en(e,t,i,n,d,N){n=n||ct(e.doc,t.line),d||(d=Yn(e,n));function K(Ge,$e){var qe=on(e,d,Ge,$e?"right":"left",N);return $e?qe.left=qe.right:qe.right=qe.left,Wi(e,n,qe,i)}var Z=Ze(n,e.doc.direction),q=t.ch,te=t.sticky;if(q>=n.text.length?(q=n.text.length,te="before"):q<=0&&(q=0,te="after"),!Z)return K(te=="before"?q-1:q,te=="before");function pe(Ge,$e,qe){var at=Z[$e],lt=at.level==1;return K(qe?Ge-1:Ge,lt!=qe)}var _e=Xe(Z,q,te),Pe=Je,Me=pe(q,_e,te=="before");return Pe!=null&&(Me.other=pe(q,Pe,te!="before")),Me}function us(e,t){var i=0;t=T(e.doc,t),e.options.lineWrapping||(i=Jn(e.display)*t.ch);var n=ct(e.doc,t.line),d=qr(n)+Hi(e.display);return{left:i,right:i,top:d,bottom:d+n.height}}function ga(e,t,i,n,d){var N=Qe(e,t,i);return N.xRel=d,n&&(N.outside=n),N}function va(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return ga(n.first,0,null,-1,-1);var d=lr(n,i),N=n.first+n.size-1;if(d>N)return ga(n.first+n.size-1,ct(n,N).text.length,null,1,1);t<0&&(t=0);for(var K=ct(n,d);;){var Z=Go(e,K,d,t,i),q=nn(K,Z.ch+(Z.xRel>0||Z.outside>0?1:0));if(!q)return Z;var te=q.find(1);if(te.line==d)return te;K=ct(n,d=te.line)}}function hs(e,t,i,n){n-=pa(t);var d=t.text.length,N=je(function(K){return on(e,i,K-1).bottom<=n},d,0);return d=je(function(K){return on(e,i,K).top>n},N,d),{begin:N,end:d}}function ds(e,t,i,n){i||(i=Yn(e,t));var d=Wi(e,t,on(e,i,n),"line").top;return hs(e,t,i,d)}function ya(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function Go(e,t,i,n,d){d-=qr(t);var N=Yn(e,t),K=pa(t),Z=0,q=t.text.length,te=!0,pe=Ze(t,e.doc.direction);if(pe){var _e=(e.options.lineWrapping?Ko:zo)(e,t,i,N,pe,n,d);te=_e.level!=1,Z=te?_e.from:_e.to-1,q=te?_e.to:_e.from-1}var Pe=null,Me=null,Ge=je(function(Tt){var vt=on(e,N,Tt);return vt.top+=K,vt.bottom+=K,ya(vt,n,d,!1)?(vt.top<=d&&vt.left<=n&&(Pe=Tt,Me=vt),!0):!1},Z,q),$e,qe,at=!1;if(Me){var lt=n-Me.left<Me.right-n,st=lt==te;Ge=Pe+(st?0:1),qe=st?"after":"before",$e=lt?Me.left:Me.right}else{!te&&(Ge==q||Ge==Z)&&Ge++,qe=Ge==0?"after":Ge==t.text.length?"before":on(e,N,Ge-(te?1:0)).bottom+K<=d==te?"after":"before";var ht=en(e,Qe(i,Ge,qe),"line",t,N);$e=ht.left,at=d<ht.top?-1:d>=ht.bottom?1:0}return Ge=De(t.text,Ge,1),ga(i,Ge,qe,at,n-$e)}function zo(e,t,i,n,d,N,K){var Z=je(function(_e){var Pe=d[_e],Me=Pe.level!=1;return ya(en(e,Qe(i,Me?Pe.to:Pe.from,Me?"before":"after"),"line",t,n),N,K,!0)},0,d.length-1),q=d[Z];if(Z>0){var te=q.level!=1,pe=en(e,Qe(i,te?q.from:q.to,te?"after":"before"),"line",t,n);ya(pe,N,K,!0)&&pe.top>K&&(q=d[Z-1])}return q}function Ko(e,t,i,n,d,N,K){var Z=hs(e,t,n,K),q=Z.begin,te=Z.end;/\s/.test(t.text.charAt(te-1))&&te--;for(var pe=null,_e=null,Pe=0;Pe<d.length;Pe++){var Me=d[Pe];if(Me.from>=te||Me.to<=q)continue;var Ge=Me.level!=1,$e=on(e,n,Ge?Math.min(te,Me.to)-1:Math.max(q,Me.from)).right,qe=$e<N?N-$e+1e9:$e-N;(!pe||_e>qe)&&(pe=Me,_e=qe)}return pe||(pe=d[d.length-1]),pe.from<q&&(pe={from:q,to:pe.to,level:pe.level}),pe.to>te&&(pe={from:pe.from,to:te,level:pe.level}),pe}var Nn;function $n(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Nn==null){Nn=f("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Nn.appendChild(document.createTextNode("x")),Nn.appendChild(f("br"));Nn.appendChild(document.createTextNode("x"))}x(e.measure,Nn);var i=Nn.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),C(e.measure),i||1}function Jn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=f("span","xxxxxxxxxx"),i=f("pre",[t],"CodeMirror-line-like");x(e.measure,i);var n=t.getBoundingClientRect(),d=(n.right-n.left)/10;return d>2&&(e.cachedCharWidth=d),d||10}function ba(e){for(var t=e.display,i={},n={},d=t.gutters.clientLeft,N=t.gutters.firstChild,K=0;N;N=N.nextSibling,++K){var Z=e.display.gutterSpecs[K].className;i[Z]=N.offsetLeft+N.clientLeft+d,n[Z]=N.clientWidth}return{fixedPos:_a(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function _a(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function cs(e){var t=$n(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/Jn(e.display)-3);return function(d){if(an(e.doc,d))return 0;var N=0;if(d.widgets)for(var K=0;K<d.widgets.length;K++)d.widgets[K].height&&(N+=d.widgets[K].height);return i?N+(Math.ceil(d.text.length/n)||1)*t:N+t}}function Ea(e){var t=e.doc,i=cs(e);t.iter(function(n){var d=i(n);d!=n.height&&Jt(n,d)})}function Fn(e,t,i,n){var d=e.display;if(!i&&Se(t).getAttribute("cm-not-content")=="true")return null;var N,K,Z=d.lineSpace.getBoundingClientRect();try{N=t.clientX-Z.left,K=t.clientY-Z.top}catch(_e){return null}var q=va(e,N,K),te;if(n&&q.xRel>0&&(te=ct(e.doc,q.line).text).length==q.ch){var pe=W(te,te.length,e.options.tabSize)-te.length;q=Qe(q.line,Math.max(0,Math.round((N-qa(e.display).left)/Jn(e.display))-pe))}return q}function Un(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,n=0;n<i.length;n++)if(t-=i[n].size,t<0)return n}function Mr(e,t,i,n){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),n||(n=0);var d=e.display;if(n&&i<d.viewTo&&(d.updateLineNumbers==null||d.updateLineNumbers>t)&&(d.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=d.viewTo)cr&&ci(e.doc,t)<d.viewTo&&Sn(e);else if(i<=d.viewFrom)cr&&Tn(e.doc,i+n)>d.viewFrom?Sn(e):(d.viewFrom+=n,d.viewTo+=n);else if(t<=d.viewFrom&&i>=d.viewTo)Sn(e);else if(t<=d.viewFrom){var N=Gi(e,i,i+n,1);N?(d.view=d.view.slice(N.index),d.viewFrom=N.lineN,d.viewTo+=n):Sn(e)}else if(i>=d.viewTo){var K=Gi(e,t,t,-1);K?(d.view=d.view.slice(0,K.index),d.viewTo=K.lineN):Sn(e)}else{var Z=Gi(e,t,t,-1),q=Gi(e,i,i+n,1);Z&&q?(d.view=d.view.slice(0,Z.index).concat(kr(e,Z.lineN,q.lineN)).concat(d.view.slice(q.index)),d.viewTo+=n):Sn(e)}var te=d.externalMeasured;te&&(i<te.lineN?te.lineN+=n:t<te.lineN+te.size&&(d.externalMeasured=null))}function wn(e,t,i){e.curOp.viewChanged=!0;var n=e.display,d=e.display.externalMeasured;if(d&&t>=d.lineN&&t<d.lineN+d.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var N=n.view[Un(e,t)];if(N.node==null)return;var K=N.changes||(N.changes=[]);ae(K,i)==-1&&K.push(i)}function Sn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gi(e,t,i,n){var d=Un(e,t),N,K=e.display.view;if(!cr||i==e.doc.first+e.doc.size)return{index:d,lineN:i};for(var Z=e.display.viewFrom,q=0;q<d;q++)Z+=K[q].size;if(Z!=t){if(n>0){if(d==K.length-1)return null;N=Z+K[d].size-t,d++}else N=Z-t;t+=N,i+=N}for(;ci(e.doc,i)!=i;){if(d==(n<0?0:K.length-1))return null;i+=n*K[d-(n<0?1:0)].size,d+=n}return{index:d,lineN:i}}function Vo(e,t,i){var n=e.display,d=n.view;d.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=kr(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=kr(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Un(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(kr(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,Un(e,i)))),n.viewTo=i}function fs(e){for(var t=e.display.view,i=0,n=0;n<t.length;n++){var d=t[n];!d.hidden&&(!d.node||d.changes)&&++i}return i}function bi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ps(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},d=n.cursors=document.createDocumentFragment(),N=n.selection=document.createDocumentFragment(),K=0;K<i.sel.ranges.length;K++){if(!t&&K==i.sel.primIndex)continue;var Z=i.sel.ranges[K];if(Z.from().line>=e.display.viewTo||Z.to().line<e.display.viewFrom)continue;var q=Z.empty();(q||e.options.showCursorWhenSelecting)&&ms(e,Z.head,d),q||Xo(e,Z,N)}return n}function ms(e,t,i){var n=en(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),d=i.appendChild(f("div","\xA0","CodeMirror-cursor"));if(d.style.left=n.left+"px",d.style.top=n.top+"px",d.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var N=i.appendChild(f("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));N.style.display="",N.style.left=n.other.left+"px",N.style.top=n.other.top+"px",N.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function zi(e,t){return e.top-t.top||e.left-t.left}function Xo(e,t,i){var n=e.display,d=e.doc,N=document.createDocumentFragment(),K=qa(e.display),Z=K.left,q=Math.max(n.sizerWidth,Pn(e)-n.sizer.offsetLeft)-K.right,te=d.direction=="ltr";function pe(st,ht,Tt,vt){ht<0&&(ht=0),ht=Math.round(ht),vt=Math.round(vt),N.appendChild(f("div",null,"CodeMirror-selected","position: absolute; left: "+st+`px;
|
|
top: `+ht+"px; width: "+(Tt==null?q-st:Tt)+`px;
|
|
height: `+(vt-ht)+"px"))}function _e(st,ht,Tt){var vt=ct(d,st),Rt=vt.text.length,Yt,gr;function er(sr,Fr){return ma(e,Qe(st,sr),"div",vt,Fr)}function Gr(sr,Fr,_r){var hr=ds(e,vt,null,sr),or=Fr=="ltr"==(_r=="after")?"left":"right",rr=_r=="after"?hr.begin:hr.end-(/\s/.test(vt.text.charAt(hr.end-1))?2:1);return er(rr,or)[or]}var Nr=Ze(vt,d.direction);return Ve(Nr,ht||0,Tt==null?Rt:Tt,function(sr,Fr,_r,hr){var or=_r=="ltr",rr=er(sr,or?"left":"right"),Ur=er(Fr-1,or?"right":"left"),ui=ht==null&&sr==0,In=Tt==null&&Fr==Rt,Sr=hr==0,ln=!Nr||hr==Nr.length-1;if(Ur.top-rr.top<=3){var vr=(te?ui:In)&&Sr,Va=(te?In:ui)&&ln,pn=vr?Z:(or?rr:Ur).left,Gn=Va?q:(or?Ur:rr).right;pe(pn,rr.top,Gn-pn,rr.bottom)}else{var zn,Rr,hi,Xa;or?(zn=te&&ui&&Sr?Z:rr.left,Rr=te?q:Gr(sr,_r,"before"),hi=te?Z:Gr(Fr,_r,"after"),Xa=te&&In&&ln?q:Ur.right):(zn=te?Gr(sr,_r,"before"):Z,Rr=!te&&ui&&Sr?q:rr.right,hi=!te&&In&&ln?Z:Ur.left,Xa=te?Gr(Fr,_r,"after"):q),pe(zn,rr.top,Rr-zn,rr.bottom),rr.bottom<Ur.top&&pe(Z,rr.bottom,null,Ur.top),pe(hi,Ur.top,Xa-hi,Ur.bottom)}(!Yt||zi(rr,Yt)<0)&&(Yt=rr),zi(Ur,Yt)<0&&(Yt=Ur),(!gr||zi(rr,gr)<0)&&(gr=rr),zi(Ur,gr)<0&&(gr=Ur)}),{start:Yt,end:gr}}var Pe=t.from(),Me=t.to();if(Pe.line==Me.line)_e(Pe.line,Pe.ch,Me.ch);else{var Ge=ct(d,Pe.line),$e=ct(d,Me.line),qe=Ar(Ge)==Ar($e),at=_e(Pe.line,Pe.ch,qe?Ge.text.length+1:null).end,lt=_e(Me.line,qe?0:null,Me.ch).start;qe&&(at.top<lt.top-2?(pe(at.right,at.top,null,at.bottom),pe(Z,lt.top,lt.left,lt.bottom)):pe(at.right,at.top,lt.left-at.right,at.bottom)),at.bottom<lt.top&&pe(Z,at.bottom,null,lt.top)}i.appendChild(N)}function xa(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Qn(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function gs(e){e.state.focused||(e.display.input.focus(),Ta(e))}function vs(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Qn(e))},100)}function Ta(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(He(e,"focus",e,t),e.state.focused=!0,F(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),r&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),xa(e)}function Qn(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(He(e,"blur",e,t),e.state.focused=!1,O(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Ki(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var d=t.view[n],N=e.options.lineWrapping,K=void 0,Z=0;if(d.hidden)continue;if(z&&H<8){var q=d.node.offsetTop+d.node.offsetHeight;K=q-i,i=q}else{var te=d.node.getBoundingClientRect();K=te.bottom-te.top,!N&&d.text.firstChild&&(Z=d.text.firstChild.getBoundingClientRect().right-te.left-1)}var pe=d.line.height-K;if((pe>.005||pe<-.005)&&(Jt(d.line,K),ys(d.line),d.rest))for(var _e=0;_e<d.rest.length;_e++)ys(d.rest[_e]);if(Z>e.display.sizerWidth){var Pe=Math.ceil(Z/Jn(e.display));Pe>e.display.maxLineLength&&(e.display.maxLineLength=Pe,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 i=e.widgets[t],n=i.node.parentNode;n&&(i.height=n.offsetHeight)}}function Vi(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-Hi(e));var d=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,N=lr(t,n),K=lr(t,d);if(i&&i.ensure){var Z=i.ensure.from.line,q=i.ensure.to.line;Z<N?(N=Z,K=lr(t,qr(ct(t,Z))+e.wrapper.clientHeight)):Math.min(q,t.lastLine())>=K&&(N=lr(t,qr(ct(t,q))-e.wrapper.clientHeight),K=q)}return{from:N,to:Math.max(K,N+1)}}function Yo(e,t){if(We(e,"scrollCursorIntoView"))return;var i=e.display,n=i.sizer.getBoundingClientRect(),d=null;if(t.top+n.top<0?d=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(d=!1),d!=null&&!h){var N=f("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-i.viewOffset-Hi(e.display))+`px;
|
|
height: `+(t.bottom-t.top+sn(e)+i.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(N),N.scrollIntoView(d),e.display.lineSpace.removeChild(N)}}function $o(e,t,i,n){n==null&&(n=0);var d;!e.options.lineWrapping&&t==i&&(t=t.ch?Qe(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?Qe(t.line,t.ch+1,"before"):t);for(var N=0;N<5;N++){var K=!1,Z=en(e,t),q=!i||i==t?Z:en(e,i);d={left:Math.min(Z.left,q.left),top:Math.min(Z.top,q.top)-n,right:Math.max(Z.left,q.left),bottom:Math.max(Z.bottom,q.bottom)+n};var te=wa(e,d),pe=e.doc.scrollTop,_e=e.doc.scrollLeft;if(te.scrollTop!=null&&(Ei(e,te.scrollTop),Math.abs(e.doc.scrollTop-pe)>1&&(K=!0)),te.scrollLeft!=null&&(Bn(e,te.scrollLeft),Math.abs(e.doc.scrollLeft-_e)>1&&(K=!0)),!K)break}return d}function Jo(e,t){var i=wa(e,t);i.scrollTop!=null&&Ei(e,i.scrollTop),i.scrollLeft!=null&&Bn(e,i.scrollLeft)}function wa(e,t){var i=e.display,n=$n(e.display);t.top<0&&(t.top=0);var d=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,N=ca(e),K={};t.bottom-t.top>N&&(t.bottom=t.top+N);var Z=e.doc.height+da(i),q=t.top<n,te=t.bottom>Z-n;if(t.top<d)K.scrollTop=q?0:t.top;else if(t.bottom>d+N){var pe=Math.min(t.top,(te?Z:t.bottom)-N);pe!=d&&(K.scrollTop=pe)}var _e=e.options.fixedGutter?0:i.gutters.offsetWidth,Pe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-_e,Me=Pn(e)-i.gutters.offsetWidth,Ge=t.right-t.left>Me;return Ge&&(t.right=t.left+Me),t.left<10?K.scrollLeft=0:t.left<Pe?K.scrollLeft=Math.max(0,t.left+_e-(Ge?0:10)):t.right>Me+Pe-3&&(K.scrollLeft=t.right+(Ge?0:10)-Me),K}function Sa(e,t){if(t==null)return;Xi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Zn(e){Xi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function _i(e,t,i){(t!=null||i!=null)&&Xi(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Qo(e,t){Xi(e),e.curOp.scrollToPos=t}function Xi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=us(e,t.from),n=us(e,t.to);bs(e,i,n,t.margin)}}function bs(e,t,i,n){var d=wa(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});_i(e,d.scrollLeft,d.scrollTop)}function Ei(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;P||Aa(e,{top:t}),_s(e,t,!0),P&&Aa(e),wi(e,100)}function _s(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Bn(e,t,i,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,Ss(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function xi(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+da(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:n,scrollHeight:n+sn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var jn=function(e,t,i){this.cm=i;var n=this.vert=f("div",[f("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),d=this.horiz=f("div",[f("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=d.tabIndex=-1,e(n),e(d),Be(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Be(d,"scroll",function(){d.clientWidth&&t(d.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,z&&H<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};jn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var d=e.viewHeight-(t?n: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=i?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var N=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+N)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?n:0,bottom:t?n:0}},jn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},jn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},jn.prototype.zeroWidthHack=function(){var e=s&&!u?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new $,this.disableVert=new $},jn.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function n(){var d=e.getBoundingClientRect(),N=i=="vert"?document.elementFromPoint(d.right-1,(d.top+d.bottom)/2):document.elementFromPoint((d.right+d.left)/2,d.bottom-1);N!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},jn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ti=function(){};Ti.prototype.update=function(){return{bottom:0,right:0}},Ti.prototype.setScrollLeft=function(){},Ti.prototype.setScrollTop=function(){},Ti.prototype.clear=function(){};function qn(e,t){t||(t=xi(e));var i=e.display.barWidth,n=e.display.barHeight;Es(e,t);for(var d=0;d<4&&i!=e.display.barWidth||n!=e.display.barHeight;d++)i!=e.display.barWidth&&e.options.lineWrapping&&Ki(e),Es(e,xi(e)),i=e.display.barWidth,n=e.display.barHeight}function Es(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var xs={native:jn,null:Ti};function Ts(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&O(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new xs[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Be(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?Bn(e,t):Ei(e,t)},e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}var Zo=0;function Hn(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Zo},Jr(e.curOp)}function Wn(e){var t=e.curOp;t&&Io(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;qo(i)})}function qo(e){for(var t=e.ops,i=0;i<t.length;i++)el(t[i]);for(var n=0;n<t.length;n++)tl(t[n]);for(var d=0;d<t.length;d++)rl(t[d]);for(var N=0;N<t.length;N++)nl(t[N]);for(var K=0;K<t.length;K++)il(t[K])}function el(e){var t=e.cm,i=t.display;sl(t),e.updateMaxLine&&ji(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Yi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ca(e.cm,e.update)}function rl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Ki(t),e.barMeasure=xi(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ts(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+sn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Pn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function nl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Bn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==B();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&qn(t,e.barMeasure),e.updatedDisplay&&Ra(t,e.barMeasure),e.selectionChanged&&xa(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&gs(e.cm)}function il(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&ws(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&_s(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Bn(t,e.scrollLeft,!0,!0),e.scrollToPos){var d=$o(t,T(n,e.scrollToPos.from),T(n,e.scrollToPos.to),e.scrollToPos.margin);Yo(t,d)}var N=e.maybeHiddenMarkers,K=e.maybeUnhiddenMarkers;if(N)for(var Z=0;Z<N.length;++Z)N[Z].lines.length||He(N[Z],"hide");if(K)for(var q=0;q<K.length;++q)K[q].lines.length&&He(K[q],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&He(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Wr(e,t){if(e.curOp)return t();Hn(e);try{return t()}finally{Wn(e)}}function pr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Hn(e);try{return t.apply(e,arguments)}finally{Wn(e)}}}function Or(e){return function(){if(this.curOp)return e.apply(this,arguments);Hn(this);try{return e.apply(this,arguments)}finally{Wn(this)}}}function mr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Hn(t);try{return e.apply(this,arguments)}finally{Wn(t)}}}function wi(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,I(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=tt(e,t.highlightFrontier),d=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(N){if(n.line>=e.display.viewFrom){var K=N.styles,Z=N.text.length>e.options.maxHighlightLength?Ft(t.mode,n.state):null,q=Te(e,N,n,!0);Z&&(n.state=Z),N.styles=q.styles;var te=N.styleClasses,pe=q.classes;pe?N.styleClasses=pe:te&&(N.styleClasses=null);for(var _e=!K||K.length!=N.styles.length||te!=pe&&(!te||!pe||te.bgClass!=pe.bgClass||te.textClass!=pe.textClass),Pe=0;!_e&&Pe<K.length;++Pe)_e=K[Pe]!=N.styles[Pe];_e&&d.push(n.line),N.stateAfter=n.save(),n.nextLine()}else N.text.length<=e.options.maxHighlightLength&&pt(e,N.text,n),N.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return wi(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),d.length&&Wr(e,function(){for(var N=0;N<d.length;N++)wn(e,d[N],"text")})}var Yi=function(e,t,i){var n=e.display;this.viewport=t,this.visible=Vi(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Pn(e),this.force=i,this.dims=ba(e),this.events=[]};Yi.prototype.signal=function(e,t){be(e,t)&&this.events.push(arguments)},Yi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)He.apply(null,this.events[e])};function sl(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=sn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=sn(e)+"px",t.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var t=B();if(!t||!y(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&y(e.display.lineDiv,n.anchorNode)&&(i.anchorNode=n.anchorNode,i.anchorOffset=n.anchorOffset,i.focusNode=n.focusNode,i.focusOffset=n.focusOffset)}return i}function ll(e){if(!e||!e.activeElt||e.activeElt==B())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&y(document.body,e.anchorNode)&&y(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function Ca(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return Sn(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&fs(e)==0)return!1;Cs(e)&&(Sn(e),t.dims=ba(e));var d=n.first+n.size,N=Math.max(t.visible.from-e.options.viewportMargin,n.first),K=Math.min(d,t.visible.to+e.options.viewportMargin);i.viewFrom<N&&N-i.viewFrom<20&&(N=Math.max(n.first,i.viewFrom)),i.viewTo>K&&i.viewTo-K<20&&(K=Math.min(d,i.viewTo)),cr&&(N=ci(e.doc,N),K=Tn(e.doc,K));var Z=N!=i.viewFrom||K!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Vo(e,N,K),i.viewOffset=qr(ct(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var q=fs(e);if(!Z&&q==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var te=ol(e);return q>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),q>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(te),C(i.cursorDiv),C(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,Z&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,wi(e,400)),i.updateLineNumbers=null,!0}function ws(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Pn(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+da(e.display)-ca(e),i.top)}),t.visible=Vi(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Vi(e.display,e.doc,i));if(!Ca(e,t))break;Ki(e);var d=xi(e);bi(e),qn(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 i=new Yi(e,t);if(Ca(e,i)){Ki(e),ws(e,i);var n=xi(e);bi(e),qn(e,n),Ra(e,n),i.finish()}}function ul(e,t,i){var n=e.display,d=e.options.lineNumbers,N=n.lineDiv,K=N.firstChild;function Z(Ge){var $e=Ge.nextSibling;return r&&s&&e.display.currentWheelTarget==Ge?Ge.style.display="none":Ge.parentNode.removeChild(Ge),$e}for(var q=n.view,te=n.viewFrom,pe=0;pe<q.length;pe++){var _e=q[pe];if(!_e.hidden)if(!_e.node||_e.node.parentNode!=N){var Pe=No(e,_e,te,i);N.insertBefore(Pe,K)}else{for(;K!=_e.node;)K=Z(K);var Me=d&&t!=null&&t<=te&&_e.lineNumber;_e.changes&&(ae(_e.changes,"gutter")>-1&&(Me=!1),Ya(e,_e,te,i)),Me&&(C(_e.lineNumber),_e.lineNumber.appendChild(document.createTextNode(Yr(e.options,te)))),K=_e.node.nextSibling}te+=_e.size}for(;K;)K=Z(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+sn(e)+"px"}function Ss(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=_a(t)-t.scroller.scrollLeft+e.doc.scrollLeft,d=t.gutters.offsetWidth,N=n+"px",K=0;K<i.length;K++)if(!i[K].hidden){e.options.fixedGutter&&(i[K].gutter&&(i[K].gutter.style.left=N),i[K].gutterBackground&&(i[K].gutterBackground.style.left=N));var Z=i[K].alignable;if(Z)for(var q=0;q<Z.length;q++)Z[q].style.left=N}e.options.fixedGutter&&(t.gutters.style.left=n+d+"px")}function Cs(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=Yr(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var d=n.measure.appendChild(f("div",[f("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),N=d.firstChild.offsetWidth,K=d.offsetWidth-N;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(N,n.lineGutter.offsetWidth-K)+1,n.lineNumWidth=n.lineNumInnerWidth+K,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Oa(e.display),!0}return!1}function La(e,t){for(var i=[],n=!1,d=0;d<e.length;d++){var N=e[d],K=null;if(typeof N!="string"&&(K=N.style,N=N.className),N=="CodeMirror-linenumbers")if(t)n=!0;else continue;i.push({className:N,style:K})}return t&&!n&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function As(e){var t=e.gutters,i=e.gutterSpecs;C(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var d=i[n],N=d.className,K=d.style,Z=t.appendChild(f("div",null,"CodeMirror-gutter "+N));K&&(Z.style.cssText=K),N=="CodeMirror-linenumbers"&&(e.lineGutter=Z,Z.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Oa(e)}function Si(e){As(e.display),Mr(e),Ss(e)}function hl(e,t,i,n){var d=this;this.input=i,d.scrollbarFiller=f("div",null,"CodeMirror-scrollbar-filler"),d.scrollbarFiller.setAttribute("cm-not-content","true"),d.gutterFiller=f("div",null,"CodeMirror-gutter-filler"),d.gutterFiller.setAttribute("cm-not-content","true"),d.lineDiv=w("div",null,"CodeMirror-code"),d.selectionDiv=f("div",null,null,"position: relative; z-index: 1"),d.cursorDiv=f("div",null,"CodeMirror-cursors"),d.measure=f("div",null,"CodeMirror-measure"),d.lineMeasure=f("div",null,"CodeMirror-measure"),d.lineSpace=w("div",[d.measure,d.lineMeasure,d.selectionDiv,d.cursorDiv,d.lineDiv],null,"position: relative; outline: none");var N=w("div",[d.lineSpace],"CodeMirror-lines");d.mover=f("div",[N],null,"position: relative"),d.sizer=f("div",[d.mover],"CodeMirror-sizer"),d.sizerWidth=null,d.heightForcer=f("div",null,null,"position: absolute; height: "+ue+"px; width: 1px;"),d.gutters=f("div",null,"CodeMirror-gutters"),d.lineGutter=null,d.scroller=f("div",[d.sizer,d.heightForcer,d.gutters],"CodeMirror-scroll"),d.scroller.setAttribute("tabIndex","-1"),d.wrapper=f("div",[d.scrollbarFiller,d.gutterFiller,d.scroller],"CodeMirror"),z&&H<8&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),!r&&!(P&&l)&&(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(n.gutters,n.lineNumbers),As(d),i.init(d)}var $i=0,Vr=null;z?Vr=-.53:P?Vr=15:v?Vr=-.7:p&&(Vr=-1/3);function Os(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function dl(e){var t=Os(e);return t.x*=Vr,t.y*=Vr,t}function Rs(e,t){var i=Os(t),n=i.x,d=i.y,N=e.display,K=N.scroller,Z=K.scrollWidth>K.clientWidth,q=K.scrollHeight>K.clientHeight;if(!(n&&Z||d&&q))return;if(d&&s&&r){e:for(var te=t.target,pe=N.view;te!=K;te=te.parentNode)for(var _e=0;_e<pe.length;_e++)if(pe[_e].node==te){e.display.currentWheelTarget=te;break e}}if(n&&!P&&!g&&Vr!=null){d&&q&&Ei(e,Math.max(0,K.scrollTop+d*Vr)),Bn(e,Math.max(0,K.scrollLeft+n*Vr)),(!d||d&&q)&&re(t),N.wheelStartX=null;return}if(d&&Vr!=null){var Pe=d*Vr,Me=e.doc.scrollTop,Ge=Me+N.wrapper.clientHeight;Pe<0?Me=Math.max(0,Me+Pe-50):Ge=Math.min(e.doc.height,Ge+Pe+50),Aa(e,{top:Me,bottom:Ge})}$i<20&&(N.wheelStartX==null?(N.wheelStartX=K.scrollLeft,N.wheelStartY=K.scrollTop,N.wheelDX=n,N.wheelDY=d,setTimeout(function(){if(N.wheelStartX==null)return;var $e=K.scrollLeft-N.wheelStartX,qe=K.scrollTop-N.wheelStartY,at=qe&&N.wheelDY&&qe/N.wheelDY||$e&&N.wheelDX&&$e/N.wheelDX;if(N.wheelStartX=N.wheelStartY=null,!at)return;Vr=(Vr*$i+at)/($i+1),++$i},200)):(N.wheelDX+=n,N.wheelDY+=d))}var Xr=function(e,t){this.ranges=e,this.primIndex=t};Xr.prototype.primary=function(){return this.ranges[this.primIndex]},Xr.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 i=this.ranges[t],n=e.ranges[t];if(!mn(i.anchor,n.anchor)||!mn(i.head,n.head))return!1}return!0},Xr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Gt(gn(this.ranges[t].anchor),gn(this.ranges[t].head));return new Xr(e,this.primIndex)},Xr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Xr.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(Ct(t,n.from())>=0&&Ct(e,n.to())<=0)return i}return-1};var Gt=function(e,t){this.anchor=e,this.head=t};Gt.prototype.from=function(){return yn(this.anchor,this.head)},Gt.prototype.to=function(){return vn(this.anchor,this.head)},Gt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function tn(e,t,i){var n=e&&e.options.selectionsMayTouch,d=t[i];t.sort(function(Pe,Me){return Ct(Pe.from(),Me.from())}),i=ae(t,d);for(var N=1;N<t.length;N++){var K=t[N],Z=t[N-1],q=Ct(Z.to(),K.from());if(n&&!K.empty()?q>0:q>=0){var te=yn(Z.from(),K.from()),pe=vn(Z.to(),K.to()),_e=Z.empty()?K.from()==K.head:Z.from()==Z.head;N<=i&&--i,t.splice(--N,2,new Gt(_e?pe:te,_e?te:pe))}}return new Xr(t,i)}function Cn(e,t){return new Xr([new Gt(e,t||e)],0)}function An(e){return e.text?Qe(e.from.line+e.text.length-1,ie(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ls(e,t){if(Ct(e,t.from)<0)return e;if(Ct(e,t.to)<=0)return An(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=An(t).ch-t.to.ch),Qe(i,n)}function Ia(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var d=e.sel.ranges[n];i.push(new Gt(Ls(d.anchor,t),Ls(d.head,t)))}return tn(e.cm,i,e.sel.primIndex)}function Is(e,t,i){return e.line==t.line?Qe(i.line,e.ch-t.ch+i.ch):Qe(i.line+(e.line-t.line),e.ch)}function cl(e,t,i){for(var n=[],d=Qe(e.first,0),N=d,K=0;K<t.length;K++){var Z=t[K],q=Is(Z.from,d,N),te=Is(An(Z),d,N);if(d=Z.to,N=te,i=="around"){var pe=e.sel.ranges[K],_e=Ct(pe.head,pe.anchor)<0;n[K]=new Gt(_e?te:q,_e?q:te)}else n[K]=new Gt(q,q)}return new Xr(n,e.sel.primIndex)}function Da(e){e.doc.mode=Lr(e.options,e.doc.modeOption),Ci(e)}function Ci(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,wi(e,100),e.state.modeGen++,e.curOp&&Mr(e)}function Ds(e,t){return t.from.ch==0&&t.to.ch==0&&ie(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ka(e,t,i,n){function d(lt){return i?i[lt]:null}function N(lt,st,ht){ua(lt,st,ht,n),br(lt,"change",lt,t)}function K(lt,st){for(var ht=[],Tt=lt;Tt<st;++Tt)ht.push(new Mn(te[Tt],d(Tt),n));return ht}var Z=t.from,q=t.to,te=t.text,pe=ct(e,Z.line),_e=ct(e,q.line),Pe=ie(te),Me=d(te.length-1),Ge=q.line-Z.line;if(t.full)e.insert(0,K(0,te.length)),e.remove(te.length,e.size-te.length);else if(Ds(e,t)){var $e=K(0,te.length-1);N(_e,_e.text,Me),Ge&&e.remove(Z.line,Ge),$e.length&&e.insert(Z.line,$e)}else if(pe==_e)if(te.length==1)N(pe,pe.text.slice(0,Z.ch)+Pe+pe.text.slice(q.ch),Me);else{var qe=K(1,te.length-1);qe.push(new Mn(Pe+pe.text.slice(q.ch),Me,n)),N(pe,pe.text.slice(0,Z.ch)+te[0],d(0)),e.insert(Z.line+1,qe)}else if(te.length==1)N(pe,pe.text.slice(0,Z.ch)+te[0]+_e.text.slice(q.ch),d(0)),e.remove(Z.line+1,Ge);else{N(pe,pe.text.slice(0,Z.ch)+te[0],d(0)),N(_e,Pe+_e.text.slice(q.ch),Me);var at=K(1,te.length-1);Ge>1&&e.remove(Z.line+1,Ge-1),e.insert(Z.line+1,at)}br(e,"change",e,t)}function On(e,t,i){function n(d,N,K){if(d.linked)for(var Z=0;Z<d.linked.length;++Z){var q=d.linked[Z];if(q.doc==N)continue;var te=K&&q.sharedHist;if(i&&!te)continue;t(q.doc,te),n(q.doc,d,te)}}n(e,null,!0)}function ks(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Ea(e),Da(e),Ms(e),e.options.lineWrapping||ji(e),e.options.mode=t.modeOption,Mr(e)}function Ms(e){(e.doc.direction=="rtl"?F:O)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Wr(e,function(){Ms(e),Mr(e)})}function Ji(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 i={from:gn(t.from),to:An(t),text:Br(e,t.from,t.to)};return Fs(e,i,t.from.line,t.to.line+1),On(e,function(n){return Fs(n,i,t.from.line,t.to.line+1)},!0),i}function Ps(e){for(;e.length;){var t=ie(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ps(e.done),ie(e.done);if(e.done.length&&!ie(e.done).ranges)return ie(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ie(e.done)}function Ns(e,t,i,n){var d=e.history;d.undone.length=0;var N=+new Date,K,Z;if((d.lastOp==n||d.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&d.lastModTime>N-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(K=pl(d,d.lastOp==n)))Z=ie(K.changes),Ct(t.from,t.to)==0&&Ct(t.from,Z.to)==0?Z.to=An(t):K.changes.push(Ma(e,t));else{var q=ie(d.done);for((!q||!q.ranges)&&Qi(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(i),d.generation=++d.maxGeneration,d.lastModTime=d.lastSelTime=N,d.lastOp=d.lastSelOp=n,d.lastOrigin=d.lastSelOrigin=t.origin,Z||He(e,"historyAdded")}function ml(e,t,i,n){var d=t.charAt(0);return d=="*"||d=="+"&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,n){var d=e.history,N=n&&n.origin;i==d.lastSelOp||N&&d.lastSelOrigin==N&&(d.lastModTime==d.lastSelTime&&d.lastOrigin==N||ml(e,N,ie(d.done),t))?d.done[d.done.length-1]=t:Qi(t,d.done),d.lastSelTime=+new Date,d.lastSelOrigin=N,d.lastSelOp=i,n&&n.clearRedo!==!1&&Ps(d.undone)}function Qi(e,t){var i=ie(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Fs(e,t,i,n){var d=t["spans_"+e.id],N=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(K){K.markedSpans&&((d||(d=t["spans_"+e.id]={}))[N]=K.markedSpans),++N})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var n=[],d=0;d<t.text.length;++d)n.push(vl(i[d]));return n}function Us(e,t){var i=yl(e,t),n=Zr(e,t);if(!i)return n;if(!n)return i;for(var d=0;d<i.length;++d){var N=i[d],K=n[d];if(N&&K){e:for(var Z=0;Z<K.length;++Z){for(var q=K[Z],te=0;te<N.length;++te)if(N[te].marker==q.marker)continue e;N.push(q)}}else K&&(i[d]=K)}return i}function ei(e,t,i){for(var n=[],d=0;d<e.length;++d){var N=e[d];if(N.ranges){n.push(i?Xr.prototype.deepCopy.call(N):N);continue}var K=N.changes,Z=[];n.push({changes:Z});for(var q=0;q<K.length;++q){var te=K[q],pe=void 0;if(Z.push({from:te.from,to:te.to,text:te.text}),t)for(var _e in te)(pe=_e.match(/^spans_(\d+)$/))&&(ae(t,Number(pe[1]))>-1&&(ie(Z)[_e]=te[_e],delete te[_e]))}}return n}function Pa(e,t,i,n){if(n){var d=e.anchor;if(i){var N=Ct(t,d)<0;N!=Ct(i,d)<0?(d=t,t=i):N!=Ct(t,i)<0&&(t=i)}return new Gt(d,t)}else return new Gt(i||t,t)}function Zi(e,t,i,n,d){d==null&&(d=e.cm&&(e.cm.display.shift||e.extend)),wr(e,new Xr([Pa(e.sel.primary(),t,i,d)],0),n)}function Bs(e,t,i){for(var n=[],d=e.cm&&(e.cm.display.shift||e.extend),N=0;N<e.sel.ranges.length;N++)n[N]=Pa(e.sel.ranges[N],t[N],null,d);var K=tn(e.cm,n,e.sel.primIndex);wr(e,K,i)}function Na(e,t,i,n){var d=e.sel.ranges.slice(0);d[t]=i,wr(e,tn(e.cm,d,e.sel.primIndex),n)}function js(e,t,i,n){wr(e,Cn(t,i),n)}function bl(e,t,i){var n={ranges:t.ranges,update:function(d){this.ranges=[];for(var N=0;N<d.length;N++)this.ranges[N]=new Gt(T(e,d[N].anchor),T(e,d[N].head))},origin:i&&i.origin};return He(e,"beforeSelectionChange",e,n),e.cm&&He(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?tn(e.cm,n.ranges,n.ranges.length-1):t}function Hs(e,t,i){var n=e.history.done,d=ie(n);d&&d.ranges?(n[n.length-1]=t,qi(e,t,i)):wr(e,t,i)}function wr(e,t,i){qi(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function qi(e,t,i){(be(e,"beforeSelectionChange")||e.cm&&be(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(Ct(t.primary().head,e.sel.primary().head)<0?-1:1);Ws(e,zs(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&Zn(e.cm)}function Ws(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Re(e.cm)),br(e,"cursorActivity",e)}function Gs(e){Ws(e,zs(e,e.sel,null,!1))}function zs(e,t,i,n){for(var d,N=0;N<t.ranges.length;N++){var K=t.ranges[N],Z=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[N],q=ea(e,K.anchor,Z&&Z.anchor,i,n),te=ea(e,K.head,Z&&Z.head,i,n);(d||q!=K.anchor||te!=K.head)&&(d||(d=t.ranges.slice(0,N)),d[N]=new Gt(q,te))}return d?tn(e.cm,d,t.primIndex):t}function ti(e,t,i,n,d){var N=ct(e,t.line);if(N.markedSpans)for(var K=0;K<N.markedSpans.length;++K){var Z=N.markedSpans[K],q=Z.marker,te="selectLeft"in q?!q.selectLeft:q.inclusiveLeft,pe="selectRight"in q?!q.selectRight:q.inclusiveRight;if((Z.from==null||(te?Z.from<=t.ch:Z.from<t.ch))&&(Z.to==null||(pe?Z.to>=t.ch:Z.to>t.ch))){if(d&&(He(q,"beforeCursorEnter"),q.explicitlyCleared))if(N.markedSpans){--K;continue}else break;if(!q.atomic)continue;if(i){var _e=q.find(n<0?1:-1),Pe=void 0;if((n<0?pe:te)&&(_e=Ks(e,_e,-n,_e&&_e.line==t.line?N:null)),_e&&_e.line==t.line&&(Pe=Ct(_e,i))&&(n<0?Pe<0:Pe>0))return ti(e,_e,t,n,d)}var Me=q.find(n<0?-1:1);return(n<0?te:pe)&&(Me=Ks(e,Me,n,Me.line==t.line?N:null)),Me?ti(e,Me,t,n,d):null}}return t}function ea(e,t,i,n,d){var N=n||1,K=ti(e,t,i,N,d)||!d&&ti(e,t,i,N,!0)||ti(e,t,i,-N,d)||!d&&ti(e,t,i,-N,!0);return K||(e.cantEdit=!0,Qe(e.first,0))}function Ks(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?T(e,Qe(t.line-1)):null:i>0&&t.ch==(n||ct(e,t.line)).text.length?t.line<e.first+e.size-1?Qe(t.line+1,0):null:new Qe(t.line,t.ch+i)}function Vs(e){e.setSelection(Qe(e.firstLine(),0),Qe(e.lastLine()),ve)}function Xs(e,t,i){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return i&&(n.update=function(d,N,K,Z){d&&(n.from=T(e,d)),N&&(n.to=T(e,N)),K&&(n.text=K),Z!==void 0&&(n.origin=Z)}),He(e,"beforeChange",e,n),e.cm&&He(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function ri(e,t,i){if(e.cm){if(!e.cm.curOp)return pr(e.cm,ri)(e,t,i);if(e.cm.state.suppressEdits)return}if((be(e,"beforeChange")||e.cm&&be(e.cm,"beforeChange"))&&(t=Xs(e,t,!0),!t))return;var n=Dn&&!i&&_n(e,t.from,t.to);if(n)for(var d=n.length-1;d>=0;--d)Ys(e,{from:n[d].from,to:n[d].to,text:d?[""]:t.text,origin:t.origin});else Ys(e,t)}function Ys(e,t){if(t.text.length==1&&t.text[0]==""&&Ct(t.from,t.to)==0)return;var i=Ia(e,t);Ns(e,t,i,e.cm?e.cm.curOp.id:NaN),Ai(e,t,i,Zr(e,t));var n=[];On(e,function(d,N){!N&&ae(n,d.history)==-1&&(Zs(d.history,t),n.push(d.history)),Ai(d,t,null,Zr(d,t))})}function ta(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var d=e.history,N,K=e.sel,Z=t=="undo"?d.done:d.undone,q=t=="undo"?d.undone:d.done,te=0;te<Z.length&&!(N=Z[te],i?N.ranges&&!N.equals(e.sel):!N.ranges);te++);if(te==Z.length)return;for(d.lastOrigin=d.lastSelOrigin=null;;)if(N=Z.pop(),N.ranges){if(Qi(N,q),i&&!N.equals(e.sel)){wr(e,N,{clearRedo:!1});return}K=N}else if(n){Z.push(N);return}else break;var pe=[];Qi(K,q),q.push({changes:pe,generation:d.generation}),d.generation=N.generation||++d.maxGeneration;for(var _e=be(e,"beforeChange")||e.cm&&be(e.cm,"beforeChange"),Pe=function($e){var qe=N.changes[$e];if(qe.origin=t,_e&&!Xs(e,qe,!1))return Z.length=0,{};pe.push(Ma(e,qe));var at=$e?Ia(e,qe):ie(Z);Ai(e,qe,at,Us(e,qe)),!$e&&e.cm&&e.cm.scrollIntoView({from:qe.from,to:An(qe)});var lt=[];On(e,function(st,ht){!ht&&ae(lt,st.history)==-1&&(Zs(st.history,qe),lt.push(st.history)),Ai(st,qe,null,Us(st,qe))})},Me=N.changes.length-1;Me>=0;--Me){var Ge=Pe(Me);if(Ge)return Ge.v}}function $s(e,t){if(t==0)return;if(e.first+=t,e.sel=new Xr(fe(e.sel.ranges,function(d){return new Gt(Qe(d.anchor.line+t,d.anchor.ch),Qe(d.head.line+t,d.head.ch))}),e.sel.primIndex),e.cm){Mr(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)wn(e.cm,n,"gutter")}}function Ai(e,t,i,n){if(e.cm&&!e.cm.curOp)return pr(e.cm,Ai)(e,t,i,n);if(t.to.line<e.first){$s(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var d=t.text.length-1-(e.first-t.from.line);$s(e,d),t={from:Qe(e.first,0),to:Qe(t.to.line+d,t.to.ch),text:[ie(t.text)],origin:t.origin}}var N=e.lastLine();t.to.line>N&&(t={from:t.from,to:Qe(N,ct(e,N).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Br(e,t.from,t.to),i||(i=Ia(e,t)),e.cm?_l(e.cm,t,n):ka(e,t,n),qi(e,i,ve),e.cantEdit&&ea(e,Qe(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,i){var n=e.doc,d=e.display,N=t.from,K=t.to,Z=!1,q=N.line;e.options.lineWrapping||(q=Ot(Ar(ct(n,N.line))),n.iter(q,K.line+1,function(Me){if(Me==d.maxLine)return Z=!0,!0})),n.sel.contains(t.from,t.to)>-1&&Re(e),ka(n,t,i,cs(e)),e.options.lineWrapping||(n.iter(q,N.line+t.text.length,function(Me){var Ge=pi(Me);Ge>d.maxLineLength&&(d.maxLine=Me,d.maxLineLength=Ge,d.maxLineChanged=!0,Z=!1)}),Z&&(e.curOp.updateMaxLine=!0)),Qr(n,N.line),wi(e,400);var te=t.text.length-(K.line-N.line)-1;t.full?Mr(e):N.line==K.line&&t.text.length==1&&!Ds(e.doc,t)?wn(e,N.line,"text"):Mr(e,N.line,K.line+1,te);var pe=be(e,"changes"),_e=be(e,"change");if(_e||pe){var Pe={from:N,to:K,text:t.text,removed:t.removed,origin:t.origin};_e&&br(e,"change",e,Pe),pe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Pe)}e.display.selForContextMenu=null}function ni(e,t,i,n,d){var N;n||(n=i),Ct(n,i)<0&&(N=[n,i],i=N[0],n=N[1]),typeof t=="string"&&(t=e.splitLines(t)),ri(e,{from:i,to:n,text:t,origin:d})}function Js(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Qs(e,t,i,n){for(var d=0;d<e.length;++d){var N=e[d],K=!0;if(N.ranges){N.copied||(N=e[d]=N.deepCopy(),N.copied=!0);for(var Z=0;Z<N.ranges.length;Z++)Js(N.ranges[Z].anchor,t,i,n),Js(N.ranges[Z].head,t,i,n);continue}for(var q=0;q<N.changes.length;++q){var te=N.changes[q];if(i<te.from.line)te.from=Qe(te.from.line+n,te.from.ch),te.to=Qe(te.to.line+n,te.to.ch);else if(t<=te.to.line){K=!1;break}}K||(e.splice(0,d+1),d=0)}}function Zs(e,t){var i=t.from.line,n=t.to.line,d=t.text.length-(n-i)-1;Qs(e.done,i,n,d),Qs(e.undone,i,n,d)}function Oi(e,t,i,n){var d=t,N=t;return typeof t=="number"?N=ct(e,X(e,t)):d=Ot(t),d==null?null:(n(N,d)&&e.cm&&wn(e.cm,d,i),N)}function Ri(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}Ri.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,n=e+t;i<n;++i){var d=this.lines[i];this.height-=d.height,gt(d),br(d,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,i){for(var n=e+t;e<n;++e)if(i(this.lines[e]))return!0}};function Li(e){this.children=e;for(var t=0,i=0,n=0;n<e.length;++n){var d=e[n];t+=d.chunkSize(),i+=d.height,d.parent=this}this.size=t,this.height=i,this.parent=null}Li.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],d=n.chunkSize();if(e<d){var N=Math.min(t,d-e),K=n.height;if(n.removeInner(e,N),this.height-=K-n.height,d==N&&(this.children.splice(i--,1),n.parent=null),(t-=N)==0)break;e=0}else e-=d}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ri))){var Z=[];this.collapse(Z),this.children=[new Ri(Z)],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,i){this.size+=t.length,this.height+=i;for(var n=0;n<this.children.length;++n){var d=this.children[n],N=d.chunkSize();if(e<=N){if(d.insertInner(e,t,i),d.lines&&d.lines.length>50){for(var K=d.lines.length%25+25,Z=K;Z<d.lines.length;){var q=new Ri(d.lines.slice(Z,Z+=25));d.height-=q.height,this.children.splice(++n,0,q),q.parent=this}d.lines=d.lines.slice(0,K),this.maybeSpill()}break}e-=N}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new Li(t);if(e.parent){e.size-=i.size,e.height-=i.height;var d=ae(e.parent.children,e);e.parent.children.splice(d+1,0,i)}else{var n=new Li(e.children);n.parent=e,e.children=[n,i],e=n}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;n<this.children.length;++n){var d=this.children[n],N=d.chunkSize();if(e<N){var K=Math.min(t,N-e);if(d.iterN(e,K,i))return!0;if((t-=K)==0)break;e=0}else e-=N}}};var Ii=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};Ii.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=Ot(i);if(n==null||!t)return;for(var d=0;d<t.length;++d)t[d]==this&&t.splice(d--,1);t.length||(i.widgets=null);var N=vi(this);Jt(i,Math.max(0,i.height-N)),e&&(Wr(e,function(){qs(e,i,-N),wn(e,n,"widget")}),br(e,"lineWidgetCleared",e,this,n))},Ii.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var d=vi(this)-t;if(!d)return;an(this.doc,n)||Jt(n,n.height+d),i&&Wr(i,function(){i.curOp.forceUpdate=!0,qs(i,n,d),br(i,"lineWidgetChanged",i,e,Ot(n))})},Ce(Ii);function qs(e,t,i){qr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Sa(e,i)}function El(e,t,i,n){var d=new Ii(e,i,n),N=e.cm;return N&&d.noHScroll&&(N.display.alignWidgets=!0),Oi(e,t,"widget",function(K){var Z=K.widgets||(K.widgets=[]);if(d.insertAt==null?Z.push(d):Z.splice(Math.min(Z.length-1,Math.max(0,d.insertAt)),0,d),d.line=K,N&&!an(e,K)){var q=qr(K)<e.scrollTop;Jt(K,K.height+vi(d)),q&&Sa(N,d.height),N.curOp.forceUpdate=!0}return!0}),N&&br(N,"lineWidgetAdded",N,d,typeof t=="number"?t:Ot(t)),d}var eo=0,Rn=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++eo};Rn.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Hn(e),be(this,"clear")){var i=this.find();i&&br(this,"clear",i.from,i.to)}for(var n=null,d=null,N=0;N<this.lines.length;++N){var K=this.lines[N],Z=Hr(K.markedSpans,this);e&&!this.collapsed?wn(e,Ot(K),"text"):e&&(Z.to!=null&&(d=Ot(K)),Z.from!=null&&(n=Ot(K))),K.markedSpans=kn(K.markedSpans,Z),Z.from==null&&this.collapsed&&!an(this.doc,K)&&e&&Jt(K,$n(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var q=0;q<this.lines.length;++q){var te=Ar(this.lines[q]),pe=pi(te);pe>e.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=pe,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Mr(e,n,d+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Gs(e.doc)),e&&br(e,"markerCleared",e,this,n,d),t&&Wn(e),this.parent&&this.parent.clear()},Rn.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,d=0;d<this.lines.length;++d){var N=this.lines[d],K=Hr(N.markedSpans,this);if(K.from!=null&&(i=Qe(t?N:Ot(N),K.from),e==-1))return i;if(K.to!=null&&(n=Qe(t?N:Ot(N),K.to),e==1))return n}return i&&{from:i,to:n}},Rn.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;Wr(n,function(){var d=t.line,N=Ot(t.line),K=fa(n,N);if(K&&(is(K),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!an(i.doc,d)&&i.height!=null){var Z=i.height;i.height=null;var q=vi(i)-Z;q&&Jt(d,d.height+q)}br(n,"markerChanged",n,e)})},Rn.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ae(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Rn.prototype.detachLine=function(e){if(this.lines.splice(ae(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Ce(Rn);function ii(e,t,i,n,d){if(n&&n.shared)return xl(e,t,i,n,d);if(e.cm&&!e.cm.curOp)return pr(e.cm,ii)(e,t,i,n,d);var N=new Rn(e,d),K=Ct(t,i);if(n&&m(n,N,!1),K>0||K==0&&N.clearWhenEmpty!==!1)return N;if(N.replacedWith&&(N.collapsed=!0,N.widgetNode=w("span",[N.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||N.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(N.widgetNode.insertLeft=!0)),N.collapsed){if(fr(e,t.line,t,i,N)||t.line!=i.line&&fr(e,i.line,t,i,N))throw new Error("Inserting collapsed marker partially overlapping an existing one");un()}N.addToHistory&&Ns(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var Z=t.line,q=e.cm,te;if(e.iter(Z,i.line+1,function(_e){q&&N.collapsed&&!q.options.lineWrapping&&Ar(_e)==q.display.maxLine&&(te=!0),N.collapsed&&Z!=t.line&&Jt(_e,0),bn(_e,new hn(N,Z==t.line?t.ch:null,Z==i.line?i.ch:null)),++Z}),N.collapsed&&e.iter(t.line,i.line+1,function(_e){an(e,_e)&&Jt(_e,0)}),N.clearOnEnter&&Be(N,"beforeCursorEnter",function(){return N.clear()}),N.readOnly&&(Kr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),N.collapsed&&(N.id=++eo,N.atomic=!0),q){if(te&&(q.curOp.updateMaxLine=!0),N.collapsed)Mr(q,t.line,i.line+1);else if(N.className||N.startStyle||N.endStyle||N.css||N.attributes||N.title)for(var pe=t.line;pe<=i.line;pe++)wn(q,pe,"text");N.atomic&&Gs(q.doc),br(q,"markerAdded",q,N)}return N}var Di=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};Di.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();br(this,"clear")},Di.prototype.find=function(e,t){return this.primary.find(e,t)},Ce(Di);function xl(e,t,i,n,d){n=m(n),n.shared=!1;var N=[ii(e,t,i,n,d)],K=N[0],Z=n.widgetNode;return On(e,function(q){Z&&(n.widgetNode=Z.cloneNode(!0)),N.push(ii(q,T(q,t),T(q,i),n,d));for(var te=0;te<q.linked.length;++te)if(q.linked[te].isParent)return;K=ie(N)}),new Di(N,K)}function to(e){return e.findMarks(Qe(e.first,0),e.clipPos(Qe(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var i=0;i<t.length;i++){var n=t[i],d=n.find(),N=e.clipPos(d.from),K=e.clipPos(d.to);if(Ct(N,K)){var Z=ii(e,N,K,n.primary,n.primary.type);n.markers.push(Z),Z.parent=n}}}function wl(e){for(var t=function(n){var d=e[n],N=[d.primary.doc];On(d.primary.doc,function(q){return N.push(q)});for(var K=0;K<d.markers.length;K++){var Z=d.markers[K];ae(N,Z.doc)==-1&&(Z.parent=null,d.markers.splice(K--,1))}},i=0;i<e.length;i++)t(i)}var Sl=0,Pr=function(e,t,i,n,d){if(!(this instanceof Pr))return new Pr(e,t,i,n,d);i==null&&(i=0),Li.call(this,[new Ri([new Mn("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var N=Qe(i,0);this.sel=Cn(N),this.history=new Ji(null),this.id=++Sl,this.modeOption=t,this.lineSep=n,this.direction=d=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ka(this,{from:N,to:N,text:e}),wr(this,Cn(N),ve)};Pr.prototype=Ne(Li.prototype,{constructor:Pr,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,n=0;n<t.length;++n)i+=t[n].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Vt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:mr(function(e){var t=Qe(this.first,0),i=this.first+this.size-1;ri(this,{from:t,to:Qe(i,ct(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&_i(this.cm,0,0),wr(this,Cn(t),ve)}),replaceRange:function(e,t,i,n){t=T(this,t),i=i?T(this,i):t,ni(this,e,t,i,n)},getRange:function(e,t,i){var n=Br(this,T(this,e),T(this,t));return i===!1?n:n.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Ir(this,e))return ct(this,e)},getLineNumber:function(e){return Ot(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ct(this,e)),Ar(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return T(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:mr(function(e,t,i){js(this,T(this,typeof e=="number"?Qe(e,t||0):e),null,i)}),setSelection:mr(function(e,t,i){js(this,T(this,e),T(this,t||e),i)}),extendSelection:mr(function(e,t,i){Zi(this,T(this,e),t&&T(this,t),i)}),extendSelections:mr(function(e,t){Bs(this,G(this,e),t)}),extendSelectionsBy:mr(function(e,t){var i=fe(this.sel.ranges,e);Bs(this,G(this,i),t)}),setSelections:mr(function(e,t,i){if(!e.length)return;for(var n=[],d=0;d<e.length;d++)n[d]=new Gt(T(this,e[d].anchor),T(this,e[d].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),wr(this,tn(this.cm,n,t),i)}),addSelection:mr(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new Gt(T(this,e),T(this,t||e))),wr(this,tn(this.cm,n,n.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,n=0;n<t.length;n++){var d=Br(this,t[n].from(),t[n].to());i=i?i.concat(d):d}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,n=0;n<i.length;n++){var d=Br(this,i[n].from(),i[n].to());e!==!1&&(d=d.join(e||this.lineSeparator())),t[n]=d}return t},replaceSelection:function(e,t,i){for(var n=[],d=0;d<this.sel.ranges.length;d++)n[d]=e;this.replaceSelections(n,t,i||"+input")},replaceSelections:mr(function(e,t,i){for(var n=[],d=this.sel,N=0;N<d.ranges.length;N++){var K=d.ranges[N];n[N]={from:K.from(),to:K.to(),text:this.splitLines(e[N]),origin:i}}for(var Z=t&&t!="end"&&cl(this,n,t),q=n.length-1;q>=0;q--)ri(this,n[q]);Z?Hs(this,Z):this.cm&&Zn(this.cm)}),undo:mr(function(){ta(this,"undo")}),redo:mr(function(){ta(this,"redo")}),undoSelection:mr(function(){ta(this,"undo",!0)}),redoSelection:mr(function(){ta(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var d=0;d<e.undone.length;d++)e.undone[d].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Ji(this.history.maxGeneration),On(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:ei(this.history.done),undone:ei(this.history.undone)}},setHistory:function(e){var t=this.history=new Ji(this.history.maxGeneration);t.done=ei(e.done.slice(0),null,!0),t.undone=ei(e.undone.slice(0),null,!0)},setGutterMarker:mr(function(e,t,i){return Oi(this,e,"gutter",function(n){var d=n.gutterMarkers||(n.gutterMarkers={});return d[t]=i,!i&&oe(d)&&(n.gutterMarkers=null),!0})}),clearGutter:mr(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&Oi(t,i,"gutter",function(){return i.gutterMarkers[e]=null,oe(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Ir(this,e))return null;if(t=e,e=ct(this,e),!e)return null}else if(t=Ot(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:mr(function(e,t,i){return Oi(this,e,t=="gutter"?"gutter":"class",function(n){var d=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[d])n[d]=i;else{if(A(i).test(n[d]))return!1;n[d]+=" "+i}return!0})}),removeLineClass:mr(function(e,t,i){return Oi(this,e,t=="gutter"?"gutter":"class",function(n){var d=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",N=n[d];if(N)if(i==null)n[d]=null;else{var K=N.match(A(i));if(!K)return!1;var Z=K.index+K[0].length;n[d]=N.slice(0,K.index)+(!K.index||Z==N.length?"":" ")+N.slice(Z)||null}else return!1;return!0})}),addLineWidget:mr(function(e,t,i){return El(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return ii(this,T(this,e),T(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=T(this,e),ii(this,e,e,i,"bookmark")},findMarksAt:function(e){e=T(this,e);var t=[],i=ct(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var d=i[n];(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,i){e=T(this,e),t=T(this,t);var n=[],d=e.line;return this.iter(e.line,t.line+1,function(N){var K=N.markedSpans;if(K)for(var Z=0;Z<K.length;Z++){var q=K[Z];!(q.to!=null&&d==e.line&&e.ch>=q.to||q.from==null&&d!=e.line||q.from!=null&&d==t.line&&q.from>=t.ch)&&(!i||i(q.marker))&&n.push(q.marker.parent||q.marker)}++d}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;n<i.length;++n)i[n].from!=null&&e.push(i[n].marker)}),e},posFromIndex:function(e){var t,i=this.first,n=this.lineSeparator().length;return this.iter(function(d){var N=d.text.length+n;if(N>e)return t=e,!0;e-=N,++i}),T(this,Qe(i,t))},indexFromPos:function(e){e=T(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+i}),t},copy:function(e){var t=new Pr(Vt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var n=new Pr(Vt(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(n,to(this)),n},unlinkDoc:function(e){if(e instanceof Zt&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(to(this));break}if(e.history==this.history){var n=[e.id];On(e,function(d){return n.push(d.id)},!0),e.history=new Ji(null),e.history.done=ei(this.history.done,n),e.history.undone=ei(this.history.undone,n)}},iterLinkedDocs:function(e){On(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):St(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:mr(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),Pr.prototype.eachLine=Pr.prototype.iter;var ro=0;function Cl(e){var t=this;if(no(t),We(t,e)||cn(t.display,e))return;re(e),z&&(ro=+new Date);var i=Fn(t,e,!0),n=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var d=n.length,N=Array(d),K=0,Z=function(){++K==d&&pr(t,function(){i=T(t.doc,i);var Me={from:i,to:i,text:t.doc.splitLines(N.filter(function(Ge){return Ge!=null}).join(t.doc.lineSeparator())),origin:"paste"};ri(t.doc,Me),Hs(t.doc,Cn(T(t.doc,i),T(t.doc,An(Me))))})()},q=function(Me,Ge){if(t.options.allowDropFileTypes&&ae(t.options.allowDropFileTypes,Me.type)==-1){Z();return}var $e=new FileReader;$e.onerror=function(){return Z()},$e.onload=function(){var qe=$e.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(qe)){Z();return}N[Ge]=qe,Z()},$e.readAsText(Me)},te=0;te<n.length;te++)q(n[te],te);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var pe=e.dataTransfer.getData("Text");if(pe){var _e;if(t.state.draggingText&&!t.state.draggingText.copy&&(_e=t.listSelections()),qi(t.doc,Cn(i,i)),_e)for(var Pe=0;Pe<_e.length;++Pe)ni(t.doc,"",_e[Pe].anchor,_e[Pe].head,"drag");t.replaceSelection(pe,"around","paste"),t.display.input.focus()}}catch(Me){}}}function Al(e,t){if(z&&(!e.state.draggingText||+new Date-ro<100)){me(t);return}if(We(e,t)||cn(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p){var i=f("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",g&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),g&&i.parentNode.removeChild(i)}}function Ol(e,t){var i=Fn(e,t);if(!i)return;var n=document.createDocumentFragment();ms(e,i,n),e.display.dragCursor||(e.display.dragCursor=f("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),x(e.display.dragCursor,n)}function no(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function io(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],n=0;n<t.length;n++){var d=t[n].CodeMirror;d&&i.push(d)}i.length&&i[0].operation(function(){for(var N=0;N<i.length;N++)e(i[N])})}var ao=!1;function Rl(){if(ao)return;Ll(),ao=!0}function Ll(){var e;Be(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,io(Il)},100))}),Be(window,"blur",function(){return io(Qn)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ln={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},ki=0;ki<10;ki++)Ln[ki+48]=Ln[ki+96]=String(ki);for(var ra=65;ra<=90;ra++)Ln[ra]=String.fromCharCode(ra);for(var Mi=1;Mi<=12;Mi++)Ln[Mi+111]=Ln[Mi+63235]="F"+Mi;var fn={};fn.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},fn.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},fn.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},fn.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},fn.default=s?fn.macDefault:fn.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,d,N,K=0;K<t.length-1;K++){var Z=t[K];if(/^(cmd|meta|m)$/i.test(Z))N=!0;else if(/^a(lt)?$/i.test(Z))i=!0;else if(/^(c|ctrl|control)$/i.test(Z))n=!0;else if(/^s(hift)?$/i.test(Z))d=!0;else throw new Error("Unrecognized modifier name: "+Z)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),N&&(e="Cmd-"+e),d&&(e="Shift-"+e),e}function kl(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(n=="..."){delete e[i];continue}for(var d=fe(i.split(" "),Dl),N=0;N<d.length;N++){var K=void 0,Z=void 0;N==d.length-1?(Z=d.join(" "),K=n):(Z=d.slice(0,N+1).join(" "),K="...");var q=t[Z];if(!q)t[Z]=K;else if(q!=K)throw new Error("Inconsistent bindings for "+Z)}delete e[i]}for(var te in t)e[te]=t[te];return e}function ai(e,t,i,n){t=na(t);var d=t.call?t.call(e,n):t[e];if(d===!1)return"nothing";if(d==="...")return"multi";if(d!=null&&i(d))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return ai(e,t.fallthrough,i,n);for(var N=0;N<t.fallthrough.length;N++){var K=ai(e,t.fallthrough[N],i,n);if(K)return K}}}function so(e){var t=typeof e=="string"?e:Ln[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function oo(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(S?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(S?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function lo(e,t){if(g&&e.keyCode==34&&e.char)return!1;var i=Ln[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),oo(i,e,t))}function na(e){return typeof e=="string"?fn[e]:e}function si(e,t){for(var i=e.doc.sel.ranges,n=[],d=0;d<i.length;d++){for(var N=t(i[d]);n.length&&Ct(N.from,ie(n).to)<=0;){var K=n.pop();if(Ct(K.from,N.from)<0){N.from=K.from;break}}n.push(N)}Wr(e,function(){for(var Z=n.length-1;Z>=0;Z--)ni(e.doc,"",n[Z].from,n[Z].to,"+delete");Zn(e)})}function Fa(e,t,i){var n=De(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Ua(e,t,i){var n=Fa(e,t.ch,i);return n==null?null:new Qe(t.line,n,i<0?"after":"before")}function Ba(e,t,i,n,d){if(e){t.doc.direction=="rtl"&&(d=-d);var N=Ze(i,t.doc.direction);if(N){var K=d<0?ie(N):N[0],Z=d<0==(K.level==1),q=Z?"after":"before",te;if(K.level>0||t.doc.direction=="rtl"){var pe=Yn(t,i);te=d<0?i.text.length-1:0;var _e=on(t,pe,te).top;te=je(function(Pe){return on(t,pe,Pe).top==_e},d<0==(K.level==1)?K.from:K.to-1,te),q=="before"&&(te=Fa(i,te,1))}else te=d<0?K.to:K.from;return new Qe(n,te,q)}}return new Qe(n,d<0?i.text.length:0,d<0?"before":"after")}function Ml(e,t,i,n){var d=Ze(t,e.doc.direction);if(!d)return Ua(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var N=Xe(d,i.ch,i.sticky),K=d[N];if(e.doc.direction=="ltr"&&K.level%2==0&&(n>0?K.to>i.ch:K.from<i.ch))return Ua(t,i,n);var Z=function(at,lt){return Fa(t,at instanceof Qe?at.ch:at,lt)},q,te=function(at){return e.options.lineWrapping?(q=q||Yn(e,t),ds(e,t,q,at)):{begin:0,end:t.text.length}},pe=te(i.sticky=="before"?Z(i,-1):i.ch);if(e.doc.direction=="rtl"||K.level==1){var _e=K.level==1==n<0,Pe=Z(i,_e?1:-1);if(Pe!=null&&(_e?Pe<=K.to&&Pe<=pe.end:Pe>=K.from&&Pe>=pe.begin)){var Me=_e?"before":"after";return new Qe(i.line,Pe,Me)}}var Ge=function(at,lt,st){for(var ht=function(Yt,gr){return gr?new Qe(i.line,Z(Yt,1),"before"):new Qe(i.line,Yt,"after")};at>=0&&at<d.length;at+=lt){var Tt=d[at],vt=lt>0==(Tt.level!=1),Rt=vt?st.begin:Z(st.end,-1);if(Tt.from<=Rt&&Rt<Tt.to)return ht(Rt,vt);if(Rt=vt?Tt.from:Z(Tt.to,-1),st.begin<=Rt&&Rt<st.end)return ht(Rt,vt)}},$e=Ge(N+n,n,pe);if($e)return $e;var qe=n>0?pe.end:Z(pe.begin,-1);return qe!=null&&!(n>0&&qe==t.text.length)&&($e=Ge(n>0?0:d.length-1,n,te(qe)),$e)?$e:null}var Pi={selectAll:Vs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ve)},killLine:function(e){return si(e,function(t){if(t.empty()){var i=ct(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:Qe(t.head.line+1,0)}:{from:t.head,to:Qe(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return si(e,function(t){return{from:Qe(t.from().line,0),to:T(e.doc,Qe(t.to().line+1,0))}})},delLineLeft:function(e){return si(e,function(t){return{from:Qe(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return si(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return si(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Qe(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Qe(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 i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},xe)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},xe)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return n.ch<e.getLine(n.line).search(/\S/)?ho(e,t.head):n},xe)},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=[],i=e.listSelections(),n=e.options.tabSize,d=0;d<i.length;d++){var N=i[d].from(),K=W(e.getLine(N.line),N.ch,n);t.push(ce(n-K%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Wr(e,function(){for(var t=e.listSelections(),i=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var d=t[n].head,N=ct(e.doc,d.line).text;if(N){if(d.ch==N.length&&(d=new Qe(d.line,d.ch-1)),d.ch>0)d=new Qe(d.line,d.ch+1),e.replaceRange(N.charAt(d.ch-1)+N.charAt(d.ch-2),Qe(d.line,d.ch-2),d,"+transpose");else if(d.line>e.doc.first){var K=ct(e.doc,d.line-1).text;K&&(d=new Qe(d.line,1),e.replaceRange(N.charAt(0)+e.doc.lineSeparator()+K.charAt(K.length-1),Qe(d.line-1,K.length-1),d,"+transpose"))}}i.push(new Gt(d,d))}e.setSelections(i)})},newlineAndIndent:function(e){return Wr(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Zn(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function uo(e,t){var i=ct(e.doc,t),n=Ar(i);return n!=i&&(t=Ot(n)),Ba(!0,e,n,t,1)}function Pl(e,t){var i=ct(e.doc,t),n=Xn(i);return n!=i&&(t=Ot(n)),Ba(!0,e,i,t,-1)}function ho(e,t){var i=uo(e,t.line),n=ct(e.doc,i.line),d=Ze(n,e.doc.direction);if(!d||d[0].level==0){var N=Math.max(i.ch,n.text.search(/\S/)),K=t.line==i.line&&t.ch<=N&&t.ch;return Qe(i.line,K?0:N,i.sticky)}return i}function ia(e,t,i){if(typeof t=="string"&&(t=Pi[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,d=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),d=t(e)!=Oe}finally{e.display.shift=n,e.state.suppressEdits=!1}return d}function Nl(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var d=ai(t,e.state.keyMaps[n],i,e);if(d)return d}return e.options.extraKeys&&ai(t,e.options.extraKeys,i,e)||ai(t,e.options.keyMap,i,e)}var Fl=new $;function Ni(e,t,i,n){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,i,n))return!0}return co(e,t,i,n)}function co(e,t,i,n){var d=Nl(e,t,n);return d=="multi"&&(e.state.keySeq=t),d=="handled"&&br(e,"keyHandled",e,t,i),(d=="handled"||d=="multi")&&(re(i),xa(e)),!!d}function fo(e,t){var i=lo(t,!0);return i?t.shiftKey&&!e.state.keySeq?Ni(e,"Shift-"+i,t,function(n){return ia(e,n,!0)})||Ni(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return ia(e,n)}):Ni(e,i,t,function(n){return ia(e,n)}):!1}function Ul(e,t,i){return Ni(e,"'"+i+"'",t,function(n){return ia(e,n,!0)})}var ja=null;function po(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=B(),We(t,e))return;z&&H<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=fo(t,e);g&&(ja=n?i:null,!n&&i==88&&!Bt&&(s?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),P&&!s&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;F(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(O(t,"CodeMirror-crosshair"),it(document,"keyup",i),it(document,"mouseover",i))}Be(document,"keyup",i),Be(document,"mouseover",i)}function mo(e){e.keyCode==16&&(this.doc.sel.shift=!1),We(this,e)}function go(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(cn(t.display,e)||We(t,e)||e.ctrlKey&&!e.altKey||s&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(g&&i==ja){ja=null,re(e);return}if(g&&(!e.which||e.which<10)&&fo(t,e))return;var d=String.fromCharCode(n==null?i:n);if(d=="\b")return;if(Ul(t,e,d))return;t.display.input.onKeyPress(e)}var jl=400,Ha=function(e,t,i){this.time=e,this.pos=t,this.button=i};Ha.prototype.compare=function(e,t,i){return this.time+jl>e&&Ct(t,this.pos)==0&&i==this.button};var Fi,Ui;function Hl(e,t){var i=+new Date;return Ui&&Ui.compare(i,e,t)?(Fi=Ui=null,"triple"):Fi&&Fi.compare(i,e,t)?(Ui=new Ha(i,e,t),Fi=null,"double"):(Fi=new Ha(i,e,t),Ui=null,"single")}function vo(e){var t=this,i=t.display;if(We(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,cn(i,e)){r||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Wa(t,e))return;var n=Fn(t,e),d=Ue(e),N=n?Hl(n,d):"single";if(window.focus(),d==1&&t.state.selectingText&&t.state.selectingText(e),n&&Wl(t,d,n,N,e))return;d==1?n?zl(t,n,N,e):Se(e)==i.scroller&&re(e):d==2?(n&&Zi(t.doc,n),setTimeout(function(){return i.input.focus()},20)):d==3&&(D?t.display.input.onContextMenu(e):vs(t))}function Wl(e,t,i,n,d){var N="Click";return n=="double"?N="Double"+N:n=="triple"&&(N="Triple"+N),N=(t==1?"Left":t==2?"Middle":"Right")+N,Ni(e,oo(N,d),d,function(K){if(typeof K=="string"&&(K=Pi[K]),!K)return!1;var Z=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Z=K(e,i)!=Oe}finally{e.state.suppressEdits=!1}return Z})}function Gl(e,t,i){var n=e.getOption("configureMouse"),d=n?n(e,t,i):{};if(d.unit==null){var N=a?i.shiftKey&&i.metaKey:i.altKey;d.unit=N?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(d.extend==null||e.doc.extend)&&(d.extend=e.doc.extend||i.shiftKey),d.addNew==null&&(d.addNew=s?i.metaKey:i.ctrlKey),d.moveOnDrag==null&&(d.moveOnDrag=!(s?i.altKey:i.ctrlKey)),d}function zl(e,t,i,n){z?setTimeout(I(gs,e),0):e.curOp.focus=B();var d=Gl(e,i,n),N=e.doc.sel,K;e.options.dragDrop&&Ke&&!e.isReadOnly()&&i=="single"&&(K=N.contains(t))>-1&&(Ct((K=N.ranges[K]).from(),t)<0||t.xRel>0)&&(Ct(K.to(),t)>0||t.xRel<0)?Kl(e,n,t,d):Vl(e,n,t,d)}function Kl(e,t,i,n){var d=e.display,N=!1,K=pr(e,function(te){r&&(d.scroller.draggable=!1),e.state.draggingText=!1,it(d.wrapper.ownerDocument,"mouseup",K),it(d.wrapper.ownerDocument,"mousemove",Z),it(d.scroller,"dragstart",q),it(d.scroller,"drop",K),N||(re(te),n.addNew||Zi(e.doc,i,null,null,n.extend),r&&!p||z&&H==9?setTimeout(function(){d.wrapper.ownerDocument.body.focus({preventScroll:!0}),d.input.focus()},20):d.input.focus())}),Z=function(te){N=N||Math.abs(t.clientX-te.clientX)+Math.abs(t.clientY-te.clientY)>=10},q=function(){return N=!0};r&&(d.scroller.draggable=!0),e.state.draggingText=K,K.copy=!n.moveOnDrag,d.scroller.dragDrop&&d.scroller.dragDrop(),Be(d.wrapper.ownerDocument,"mouseup",K),Be(d.wrapper.ownerDocument,"mousemove",Z),Be(d.scroller,"dragstart",q),Be(d.scroller,"drop",K),vs(e),setTimeout(function(){return d.input.focus()},20)}function yo(e,t,i){if(i=="char")return new Gt(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Gt(Qe(t.line,0),T(e.doc,Qe(t.line+1,0)));var n=i(e,t);return new Gt(n.from,n.to)}function Vl(e,t,i,n){var d=e.display,N=e.doc;re(t);var K,Z,q=N.sel,te=q.ranges;if(n.addNew&&!n.extend?(Z=N.sel.contains(i),Z>-1?K=te[Z]:K=new Gt(i,i)):(K=N.sel.primary(),Z=N.sel.primIndex),n.unit=="rectangle")n.addNew||(K=new Gt(i,i)),i=Fn(e,t,!0,!0),Z=-1;else{var pe=yo(e,i,n.unit);n.extend?K=Pa(K,pe.anchor,pe.head,n.extend):K=pe}n.addNew?Z==-1?(Z=te.length,wr(N,tn(e,te.concat([K]),Z),{scroll:!1,origin:"*mouse"})):te.length>1&&te[Z].empty()&&n.unit=="char"&&!n.extend?(wr(N,tn(e,te.slice(0,Z).concat(te.slice(Z+1)),0),{scroll:!1,origin:"*mouse"}),q=N.sel):Na(N,Z,K,Ee):(Z=0,wr(N,new Xr([K],0),Ee),q=N.sel);var _e=i;function Pe(st){if(Ct(_e,st)==0)return;if(_e=st,n.unit=="rectangle"){for(var ht=[],Tt=e.options.tabSize,vt=W(ct(N,i.line).text,i.ch,Tt),Rt=W(ct(N,st.line).text,st.ch,Tt),Yt=Math.min(vt,Rt),gr=Math.max(vt,Rt),er=Math.min(i.line,st.line),Gr=Math.min(e.lastLine(),Math.max(i.line,st.line));er<=Gr;er++){var Nr=ct(N,er).text,sr=Ie(Nr,Yt,Tt);Yt==gr?ht.push(new Gt(Qe(er,sr),Qe(er,sr))):Nr.length>sr&&ht.push(new Gt(Qe(er,sr),Qe(er,Ie(Nr,gr,Tt))))}ht.length||ht.push(new Gt(i,i)),wr(N,tn(e,q.ranges.slice(0,Z).concat(ht),Z),{origin:"*mouse",scroll:!1}),e.scrollIntoView(st)}else{var Fr=K,_r=yo(e,st,n.unit),hr=Fr.anchor,or;Ct(_r.anchor,hr)>0?(or=_r.head,hr=yn(Fr.from(),_r.anchor)):(or=_r.anchor,hr=vn(Fr.to(),_r.head));var rr=q.ranges.slice(0);rr[Z]=Xl(e,new Gt(T(N,hr),or)),wr(N,tn(e,rr,Z),Ee)}}var Me=d.wrapper.getBoundingClientRect(),Ge=0;function $e(st){var ht=++Ge,Tt=Fn(e,st,!0,n.unit=="rectangle");if(!Tt)return;if(Ct(Tt,_e)!=0){e.curOp.focus=B(),Pe(Tt);var vt=Vi(d,N);(Tt.line>=vt.to||Tt.line<vt.from)&&setTimeout(pr(e,function(){Ge==ht&&$e(st)}),150)}else{var Rt=st.clientY<Me.top?-20:st.clientY>Me.bottom?20:0;Rt&&setTimeout(pr(e,function(){if(Ge!=ht)return;d.scroller.scrollTop+=Rt,$e(st)}),50)}}function qe(st){e.state.selectingText=!1,Ge=Infinity,st&&(re(st),d.input.focus()),it(d.wrapper.ownerDocument,"mousemove",at),it(d.wrapper.ownerDocument,"mouseup",lt),N.history.lastSelOrigin=null}var at=pr(e,function(st){st.buttons===0||!Ue(st)?qe(st):$e(st)}),lt=pr(e,qe);e.state.selectingText=lt,Be(d.wrapper.ownerDocument,"mousemove",at),Be(d.wrapper.ownerDocument,"mouseup",lt)}function Xl(e,t){var i=t.anchor,n=t.head,d=ct(e.doc,i.line);if(Ct(i,n)==0&&i.sticky==n.sticky)return t;var N=Ze(d);if(!N)return t;var K=Xe(N,i.ch,i.sticky),Z=N[K];if(Z.from!=i.ch&&Z.to!=i.ch)return t;var q=K+(Z.from==i.ch==(Z.level!=1)?0:1);if(q==0||q==N.length)return t;var te;if(n.line!=i.line)te=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var pe=Xe(N,n.ch,n.sticky),_e=pe-K||(n.ch-i.ch)*(Z.level==1?-1:1);pe==q-1||pe==q?te=_e<0:te=_e>0}var Pe=N[q+(te?-1:0)],Me=te==(Pe.level==1),Ge=Me?Pe.from:Pe.to,$e=Me?"after":"before";return i.ch==Ge&&i.sticky==$e?t:new Gt(new Qe(i.line,Ge,$e),n)}function bo(e,t,i,n){var d,N;if(t.touches)d=t.touches[0].clientX,N=t.touches[0].clientY;else try{d=t.clientX,N=t.clientY}catch(Pe){return!1}if(d>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&re(t);var K=e.display,Z=K.lineDiv.getBoundingClientRect();if(N>Z.bottom||!be(e,i))return he(t);N-=Z.top-K.viewOffset;for(var q=0;q<e.display.gutterSpecs.length;++q){var te=K.gutters.childNodes[q];if(te&&te.getBoundingClientRect().right>=d){var pe=lr(e.doc,N),_e=e.display.gutterSpecs[q];return He(e,i,e,pe,_e.className,t),he(t)}}}function Wa(e,t){return bo(e,t,"gutterClick",!0)}function _o(e,t){if(cn(e.display,t)||Yl(e,t))return;if(We(e,t,"contextmenu"))return;D||e.display.input.onContextMenu(t)}function Yl(e,t){return be(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-"),yi(e)}var oi={toString:function(){return"CodeMirror.Init"}},xo={},aa={};function $l(e){var t=e.optionHandlers;function i(n,d,N,K){e.defaults[n]=d,N&&(t[n]=K?function(Z,q,te){te!=oi&&N(Z,q,te)}:N)}e.defineOption=i,e.Init=oi,i("value","",function(n,d){return n.setValue(d)},!0),i("mode",null,function(n,d){n.doc.modeOption=d,Da(n)},!0),i("indentUnit",2,Da,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){Ci(n),yi(n),Mr(n)},!0),i("lineSeparator",null,function(n,d){if(n.doc.lineSep=d,!d)return;var N=[],K=n.doc.first;n.doc.iter(function(q){for(var te=0;;){var pe=q.text.indexOf(d,te);if(pe==-1)break;te=pe+d.length,N.push(Qe(K,pe))}K++});for(var Z=N.length-1;Z>=0;Z--)ni(n.doc,d,N[Z],Qe(N[Z].line,N[Z].ch+d.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,d,N){n.state.specialChars=new RegExp(d.source+(d.test(" ")?"":"| "),"g"),N!=oi&&n.refresh()}),i("specialCharPlaceholder",Xt,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",l?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(n,d){return n.getInputField().spellcheck=d},!0),i("autocorrect",!1,function(n,d){return n.getInputField().autocorrect=d},!0),i("autocapitalize",!1,function(n,d){return n.getInputField().autocapitalize=d},!0),i("rtlMoveVisually",!R),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){Eo(n),Si(n)},!0),i("keyMap","default",function(n,d,N){var K=na(d),Z=N!=oi&&na(N);Z&&Z.detach&&Z.detach(n,K),K.attach&&K.attach(n,Z||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Ql,!0),i("gutters",[],function(n,d){n.display.gutterSpecs=La(d,n.options.lineNumbers),Si(n)},!0),i("fixedGutter",!0,function(n,d){n.display.gutters.style.left=d?_a(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return qn(n)},!0),i("scrollbarStyle","native",function(n){Ts(n),qn(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),i("lineNumbers",!1,function(n,d){n.display.gutterSpecs=La(n.options.gutters,d),Si(n)},!0),i("firstLineNumber",1,Si,!0),i("lineNumberFormatter",function(n){return n},Si,!0),i("showCursorWhenSelecting",!1,bi,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,d){d=="nocursor"&&(Qn(n),n.display.input.blur()),n.display.input.readOnlyChanged(d)}),i("screenReaderLabel",null,function(n,d){d=d===""?null:d,n.display.input.screenReaderLabelChanged(d)}),i("disableInput",!1,function(n,d){d||n.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,bi,!0),i("singleCursorHeightPerLine",!0,bi,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,Ci,!0),i("addModeClass",!1,Ci,!0),i("pollInterval",100),i("undoDepth",200,function(n,d){return n.doc.history.undoDepth=d}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,Ci,!0),i("moveInputWithCursor",!0,function(n,d){d||n.display.input.resetPosition()}),i("tabindex",null,function(n,d){return n.display.input.getField().tabIndex=d||""}),i("autofocus",null),i("direction","ltr",function(n,d){return n.doc.setDirection(d)},!0),i("phrases",null)}function Jl(e,t,i){var n=i&&i!=oi;if(!t!=!n){var d=e.display.dragFunctions,N=t?Be:it;N(e.display.scroller,"dragstart",d.start),N(e.display.scroller,"dragenter",d.enter),N(e.display.scroller,"dragover",d.over),N(e.display.scroller,"dragleave",d.leave),N(e.display.scroller,"drop",d.drop)}}function Ql(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(O(e.display.wrapper,"CodeMirror-wrap"),ji(e)),Ea(e),Mr(e),yi(e),setTimeout(function(){return qn(e)},100)}function Zt(e,t){var i=this;if(!(this instanceof Zt))return new Zt(e,t);this.options=t=t?m(t):{},m(xo,t,!1);var n=t.value;typeof n=="string"?n=new Pr(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var d=new Zt.inputStyles[t.inputStyle](this),N=this.display=new hl(e,n,d,t);N.wrapper.CodeMirror=this,Eo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ts(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new $,keySeq:null,specialChars:null},t.autofocus&&!l&&N.input.focus(),z&&H<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Zl(this),Rl(),Hn(this),this.curOp.forceUpdate=!0,ks(this,n),t.autofocus&&!l||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Ta(i)},20):Qn(this);for(var K in aa)aa.hasOwnProperty(K)&&aa[K](this,t[K],oi);Cs(this),t.finishInit&&t.finishInit(this);for(var Z=0;Z<Ga.length;++Z)Ga[Z](this);Wn(this),r&&t.lineWrapping&&getComputedStyle(N.lineDiv).textRendering=="optimizelegibility"&&(N.lineDiv.style.textRendering="auto")}Zt.defaults=xo,Zt.optionHandlers=aa;function Zl(e){var t=e.display;Be(t.scroller,"mousedown",pr(e,vo)),z&&H<11?Be(t.scroller,"dblclick",pr(e,function(q){if(We(e,q))return;var te=Fn(e,q);if(!te||Wa(e,q)||cn(e.display,q))return;re(q);var pe=e.findWordAt(te);Zi(e.doc,pe.anchor,pe.head)})):Be(t.scroller,"dblclick",function(q){return We(e,q)||re(q)}),Be(t.scroller,"contextmenu",function(q){return _o(e,q)}),Be(t.input.getField(),"contextmenu",function(q){t.scroller.contains(q.target)||_o(e,q)});var i,n={end:0};function d(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function N(q){if(q.touches.length!=1)return!1;var te=q.touches[0];return te.radiusX<=1&&te.radiusY<=1}function K(q,te){if(te.left==null)return!0;var pe=te.left-q.left,_e=te.top-q.top;return pe*pe+_e*_e>20*20}Be(t.scroller,"touchstart",function(q){if(!We(e,q)&&!N(q)&&!Wa(e,q)){t.input.ensurePolled(),clearTimeout(i);var te=+new Date;t.activeTouch={start:te,moved:!1,prev:te-n.end<=300?n:null},q.touches.length==1&&(t.activeTouch.left=q.touches[0].pageX,t.activeTouch.top=q.touches[0].pageY)}}),Be(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Be(t.scroller,"touchend",function(q){var te=t.activeTouch;if(te&&!cn(t,q)&&te.left!=null&&!te.moved&&new Date-te.start<300){var pe=e.coordsChar(t.activeTouch,"page"),_e;!te.prev||K(te,te.prev)?_e=new Gt(pe,pe):!te.prev.prev||K(te,te.prev.prev)?_e=e.findWordAt(pe):_e=new Gt(Qe(pe.line,0),T(e.doc,Qe(pe.line+1,0))),e.setSelection(_e.anchor,_e.head),e.focus(),re(q)}d()}),Be(t.scroller,"touchcancel",d),Be(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Ei(e,t.scroller.scrollTop),Bn(e,t.scroller.scrollLeft,!0),He(e,"scroll",e))}),Be(t.scroller,"mousewheel",function(q){return Rs(e,q)}),Be(t.scroller,"DOMMouseScroll",function(q){return Rs(e,q)}),Be(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(q){We(e,q)||me(q)},over:function(q){We(e,q)||(Ol(e,q),me(q))},start:function(q){return Al(e,q)},drop:pr(e,Cl),leave:function(q){We(e,q)||no(e)}};var Z=t.input.getField();Be(Z,"keyup",function(q){return mo.call(e,q)}),Be(Z,"keydown",pr(e,po)),Be(Z,"keypress",pr(e,go)),Be(Z,"focus",function(q){return Ta(e,q)}),Be(Z,"blur",function(q){return Qn(e,q)})}var Ga=[];Zt.defineInitHook=function(e){return Ga.push(e)};function Bi(e,t,i,n){var d=e.doc,N;i==null&&(i="add"),i=="smart"&&(d.mode.indent?N=tt(e,t).state:i="prev");var K=e.options.tabSize,Z=ct(d,t),q=W(Z.text,null,K);Z.stateAfter&&(Z.stateAfter=null);var te=Z.text.match(/^\s*/)[0],pe;if(!n&&!/\S/.test(Z.text))pe=0,i="not";else if(i=="smart"&&(pe=d.mode.indent(N,Z.text.slice(te.length),Z.text),pe==Oe||pe>150)){if(!n)return;i="prev"}i=="prev"?t>d.first?pe=W(ct(d,t-1).text,null,K):pe=0:i=="add"?pe=q+e.options.indentUnit:i=="subtract"?pe=q-e.options.indentUnit:typeof i=="number"&&(pe=q+i),pe=Math.max(0,pe);var _e="",Pe=0;if(e.options.indentWithTabs)for(var Me=Math.floor(pe/K);Me;--Me)Pe+=K,_e+=" ";if(Pe<pe&&(_e+=ce(pe-Pe)),_e!=te)return ni(d,_e,Qe(t,0),Qe(t,te.length),"+input"),Z.stateAfter=null,!0;for(var Ge=0;Ge<d.sel.ranges.length;Ge++){var $e=d.sel.ranges[Ge];if($e.head.line==t&&$e.head.ch<te.length){var qe=Qe(t,te.length);Na(d,Ge,new Gt(qe,qe));break}}}var rn=null;function sa(e){rn=e}function za(e,t,i,n,d){var N=e.doc;e.display.shift=!1,n||(n=N.sel);var K=+new Date-200,Z=d=="paste"||e.state.pasteIncoming>K,q=St(t),te=null;if(Z&&n.ranges.length>1)if(rn&&rn.text.join(`
|
|
`)==t){if(n.ranges.length%rn.text.length==0){te=[];for(var pe=0;pe<rn.text.length;pe++)te.push(N.splitLines(rn.text[pe]))}}else q.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(te=fe(q,function(at){return[at]}));for(var _e=e.curOp.updateInput,Pe=n.ranges.length-1;Pe>=0;Pe--){var Me=n.ranges[Pe],Ge=Me.from(),$e=Me.to();Me.empty()&&(i&&i>0?Ge=Qe(Ge.line,Ge.ch-i):e.state.overwrite&&!Z?$e=Qe($e.line,Math.min(ct(N,$e.line).text.length,$e.ch+ie(q).length)):Z&&rn&&rn.lineWise&&rn.text.join(`
|
|
`)==q.join(`
|
|
`)&&(Ge=$e=Qe(Ge.line,0)));var qe={from:Ge,to:$e,text:te?te[Pe%te.length]:q,origin:d||(Z?"paste":e.state.cutIncoming>K?"cut":"+input")};ri(e.doc,qe),br(e,"inputRead",e,qe)}t&&!Z&&wo(e,t),Zn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=_e),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function To(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Wr(t,function(){return za(t,i,0,null,"paste")}),!0}function wo(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,n=i.ranges.length-1;n>=0;n--){var d=i.ranges[n];if(d.head.ch>100||n&&i.ranges[n-1].head.line==d.head.line)continue;var N=e.getModeAt(d.head),K=!1;if(N.electricChars){for(var Z=0;Z<N.electricChars.length;Z++)if(t.indexOf(N.electricChars.charAt(Z))>-1){K=Bi(e,d.head.line,"smart");break}}else N.electricInput&&(N.electricInput.test(ct(e.doc,d.head.line).text.slice(0,d.head.ch))&&(K=Bi(e,d.head.line,"smart")));K&&br(e,"electricInput",e,d.head.line)}}function So(e){for(var t=[],i=[],n=0;n<e.doc.sel.ranges.length;n++){var d=e.doc.sel.ranges[n].head.line,N={anchor:Qe(d,0),head:Qe(d+1,0)};i.push(N),t.push(e.getRange(N.anchor,N.head))}return{text:t,ranges:i}}function Co(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ao(){var e=f("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=f("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return r?e.style.width="1000px":e.setAttribute("wrap","off"),c&&(e.style.border="1px solid black"),Co(e),t}function ql(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,d){var N=this.options,K=N[n];if(N[n]==d&&n!="mode")return;N[n]=d,t.hasOwnProperty(n)&&pr(this,t[n])(this,d,K),He(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,d){this.state.keyMaps[d?"push":"unshift"](na(n))},removeKeyMap:function(n){for(var d=this.state.keyMaps,N=0;N<d.length;++N)if(d[N]==n||d[N].name==n)return d.splice(N,1),!0},addOverlay:Or(function(n,d){var N=n.token?n:e.getMode(this.options,n);if(N.startState)throw new Error("Overlays may not be stateful.");le(this.state.overlays,{mode:N,modeSpec:n,opaque:d&&d.opaque,priority:d&&d.priority||0},function(K){return K.priority}),this.state.modeGen++,Mr(this)}),removeOverlay:Or(function(n){for(var d=this.state.overlays,N=0;N<d.length;++N){var K=d[N].modeSpec;if(K==n||typeof n=="string"&&K.name==n){d.splice(N,1),this.state.modeGen++,Mr(this);return}}}),indentLine:Or(function(n,d,N){typeof d!="string"&&typeof d!="number"&&(d==null?d=this.options.smartIndent?"smart":"prev":d=d?"add":"subtract"),Ir(this.doc,n)&&Bi(this,n,d,N)}),indentSelection:Or(function(n){for(var d=this.doc.sel.ranges,N=-1,K=0;K<d.length;K++){var Z=d[K];if(Z.empty())Z.head.line>N&&(Bi(this,Z.head.line,n,!0),N=Z.head.line,K==this.doc.sel.primIndex&&Zn(this));else{var q=Z.from(),te=Z.to(),pe=Math.max(N,q.line);N=Math.min(this.lastLine(),te.line-(te.ch?0:1))+1;for(var _e=pe;_e<N;++_e)Bi(this,_e,n);var Pe=this.doc.sel.ranges;q.ch==0&&d.length==Pe.length&&Pe[K].from().ch>0&&Na(this.doc,K,new Gt(q,Pe[K].to()),ve)}}}),getTokenAt:function(n,d){return $t(this,n,d)},getLineTokens:function(n,d){return $t(this,Qe(n),d,!0)},getTokenTypeAt:function(n){n=T(this.doc,n);var d=ze(this,ct(this.doc,n.line)),N=0,K=(d.length-1)/2,Z=n.ch,q;if(Z==0)q=d[2];else for(;;){var te=N+K>>1;if((te?d[te*2-1]:0)>=Z)K=te;else if(d[te*2+1]<Z)N=te+1;else{q=d[te*2+2];break}}var pe=q?q.indexOf("overlay "):-1;return pe<0?q:pe==0?null:q.slice(0,pe-1)},getModeAt:function(n){var d=this.doc.mode;return d.innerMode?e.innerMode(d,this.getTokenAt(n).state).mode:d},getHelper:function(n,d){return this.getHelpers(n,d)[0]},getHelpers:function(n,d){var N=[];if(!i.hasOwnProperty(d))return N;var K=i[d],Z=this.getModeAt(n);if(typeof Z[d]=="string")K[Z[d]]&&N.push(K[Z[d]]);else if(Z[d])for(var q=0;q<Z[d].length;q++){var te=K[Z[d][q]];te&&N.push(te)}else Z.helperType&&K[Z.helperType]?N.push(K[Z.helperType]):K[Z.name]&&N.push(K[Z.name]);for(var pe=0;pe<K._global.length;pe++){var _e=K._global[pe];_e.pred(Z,this)&&ae(N,_e.val)==-1&&N.push(_e.val)}return N},getStateAfter:function(n,d){var N=this.doc;return n=X(N,n==null?N.first+N.size-1:n),tt(this,n+1,d).state},cursorCoords:function(n,d){var N,K=this.doc.sel.primary();return n==null?N=K.head:typeof n=="object"?N=T(this.doc,n):N=n?K.from():K.to(),en(this,N,d||"page")},charCoords:function(n,d){return ma(this,T(this.doc,n),d||"page")},coordsChar:function(n,d){return n=ls(this,n,d||"page"),va(this,n.left,n.top)},lineAtHeight:function(n,d){return n=ls(this,{top:n,left:0},d||"page").top,lr(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,d,N){var K=!1,Z;if(typeof n=="number"){var q=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>q&&(n=q,K=!0),Z=ct(this.doc,n)}else Z=n;return Wi(this,Z,{top:0,left:0},d||"page",N||K).top+(K?this.doc.height-qr(Z):0)},defaultTextHeight:function(){return $n(this.display)},defaultCharWidth:function(){return Jn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,d,N,K,Z){var q=this.display;n=en(this,T(this.doc,n));var te=n.bottom,pe=n.left;if(d.style.position="absolute",d.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(d),q.sizer.appendChild(d),K=="over")te=n.top;else if(K=="above"||K=="near"){var _e=Math.max(q.wrapper.clientHeight,this.doc.height),Pe=Math.max(q.sizer.clientWidth,q.lineSpace.clientWidth);(K=="above"||n.bottom+d.offsetHeight>_e)&&n.top>d.offsetHeight?te=n.top-d.offsetHeight:n.bottom+d.offsetHeight<=_e&&(te=n.bottom),pe+d.offsetWidth>Pe&&(pe=Pe-d.offsetWidth)}d.style.top=te+"px",d.style.left=d.style.right="",Z=="right"?(pe=q.sizer.clientWidth-d.offsetWidth,d.style.right="0px"):(Z=="left"?pe=0:Z=="middle"&&(pe=(q.sizer.clientWidth-d.offsetWidth)/2),d.style.left=pe+"px"),N&&Jo(this,{left:pe,top:te,right:pe+d.offsetWidth,bottom:te+d.offsetHeight})},triggerOnKeyDown:Or(po),triggerOnKeyPress:Or(go),triggerOnKeyUp:mo,triggerOnMouseDown:Or(vo),execCommand:function(n){if(Pi.hasOwnProperty(n))return Pi[n].call(null,this)},triggerElectric:Or(function(n){wo(this,n)}),findPosH:function(n,d,N,K){var Z=1;d<0&&(Z=-1,d=-d);for(var q=T(this.doc,n),te=0;te<d&&!(q=Ka(this.doc,q,Z,N,K),q.hitSide);++te);return q},moveH:Or(function(n,d){var N=this;this.extendSelectionsBy(function(K){return N.display.shift||N.doc.extend||K.empty()?Ka(N.doc,K.head,n,d,N.options.rtlMoveVisually):n<0?K.from():K.to()},xe)}),deleteH:Or(function(n,d){var N=this.doc.sel,K=this.doc;N.somethingSelected()?K.replaceSelection("",null,"+delete"):si(this,function(Z){var q=Ka(K,Z.head,n,d,!1);return n<0?{from:q,to:Z.head}:{from:Z.head,to:q}})}),findPosV:function(n,d,N,K){var Z=1,q=K;d<0&&(Z=-1,d=-d);for(var te=T(this.doc,n),pe=0;pe<d;++pe){var _e=en(this,te,"div");if(q==null?q=_e.left:_e.left=q,te=Oo(this,_e,Z,N),te.hitSide)break}return te},moveV:Or(function(n,d){var N=this,K=this.doc,Z=[],q=!this.display.shift&&!K.extend&&K.sel.somethingSelected();if(K.extendSelectionsBy(function(pe){if(q)return n<0?pe.from():pe.to();var _e=en(N,pe.head,"div");pe.goalColumn!=null&&(_e.left=pe.goalColumn),Z.push(_e.left);var Pe=Oo(N,_e,n,d);return d=="page"&&pe==K.sel.primary()&&Sa(N,ma(N,Pe,"div").top-_e.top),Pe},xe),Z.length)for(var te=0;te<K.sel.ranges.length;te++)K.sel.ranges[te].goalColumn=Z[te]}),findWordAt:function(n){var d=this.doc,N=ct(d,n.line).text,K=n.ch,Z=n.ch;if(N){var q=this.getHelper(n,"wordChars");(n.sticky=="before"||Z==N.length)&&K?--K:++Z;for(var te=N.charAt(K),pe=Fe(te,q)?function(_e){return Fe(_e,q)}:/\s/.test(te)?function(_e){return/\s/.test(_e)}:function(_e){return!/\s/.test(_e)&&!Fe(_e)};K>0&&pe(N.charAt(K-1));)--K;for(;Z<N.length&&pe(N.charAt(Z));)++Z}return new Gt(Qe(n.line,K),Qe(n.line,Z))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?F(this.display.cursorDiv,"CodeMirror-overwrite"):O(this.display.cursorDiv,"CodeMirror-overwrite"),He(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==B()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Or(function(n,d){_i(this,n,d)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-sn(this)-this.display.barHeight,width:n.scrollWidth-sn(this)-this.display.barWidth,clientHeight:ca(this),clientWidth:Pn(this)}},scrollIntoView:Or(function(n,d){n==null?(n={from:this.doc.sel.primary().head,to:null},d==null&&(d=this.options.cursorScrollMargin)):typeof n=="number"?n={from:Qe(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=d||0,n.from.line!=null?Qo(this,n):bs(this,n.from,n.to,n.margin)}),setSize:Or(function(n,d){var N=this,K=function(q){return typeof q=="number"||/^\d+$/.test(String(q))?q+"px":q};n!=null&&(this.display.wrapper.style.width=K(n)),d!=null&&(this.display.wrapper.style.height=K(d)),this.options.lineWrapping&&as(this);var Z=this.display.viewFrom;this.doc.iter(Z,this.display.viewTo,function(q){if(q.widgets){for(var te=0;te<q.widgets.length;te++)if(q.widgets[te].noHScroll){wn(N,Z,"widget");break}}++Z}),this.curOp.forceUpdate=!0,He(this,"refresh",this)}),operation:function(n){return Wr(this,n)},startOperation:function(){return Hn(this)},endOperation:function(){return Wn(this)},refresh:Or(function(){var n=this.display.cachedTextHeight;Mr(this),this.curOp.forceUpdate=!0,yi(this),_i(this,this.doc.scrollLeft,this.doc.scrollTop),Oa(this.display),(n==null||Math.abs(n-$n(this.display))>.5||this.options.lineWrapping)&&Ea(this),He(this,"refresh",this)}),swapDoc:Or(function(n){var d=this.doc;return d.cm=null,this.state.selectingText&&this.state.selectingText(),ks(this,n),yi(this),this.display.input.reset(),_i(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,br(this,"swapDoc",this,d),d}),phrase:function(n){var d=this.options.phrases;return d&&Object.prototype.hasOwnProperty.call(d,n)?d[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ce(e),e.registerHelper=function(n,d,N){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][d]=N},e.registerGlobalHelper=function(n,d,N,K){e.registerHelper(n,d,K),i[n]._global.push({pred:N,val:K})}}function Ka(e,t,i,n,d){var N=t,K=i,Z=ct(e,t.line),q=d&&e.direction=="rtl"?-i:i;function te(){var lt=t.line+q;return lt<e.first||lt>=e.first+e.size?!1:(t=new Qe(lt,t.ch,t.sticky),Z=ct(e,lt))}function pe(lt){var st;if(n=="codepoint"){var ht=Z.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(ht)?st=null:st=new Qe(t.line,Math.max(0,Math.min(Z.text.length,t.ch+i*(ht>=55296&&ht<56320?2:1))),-i)}else d?st=Ml(e.cm,Z,t,i):st=Ua(Z,t,i);if(st==null)if(!lt&&te())t=Ba(d,e.cm,Z,t.line,q);else return!1;else t=st;return!0}if(n=="char"||n=="codepoint")pe();else if(n=="column")pe(!0);else if(n=="word"||n=="group")for(var _e=null,Pe=n=="group",Me=e.cm&&e.cm.getHelper(t,"wordChars"),Ge=!0;!(i<0&&!pe(!Ge));Ge=!1){var $e=Z.text.charAt(t.ch)||`
|
|
`,qe=Fe($e,Me)?"w":Pe&&$e==`
|
|
`?"n":!Pe||/\s/.test($e)?null:"p";if(Pe&&!Ge&&!qe&&(qe="s"),_e&&_e!=qe){i<0&&(i=1,pe(),t.sticky="after");break}if(qe&&(_e=qe),i>0&&!pe(!Ge))break}var at=ea(e,t,N,K,!0);return mn(N,at)&&(at.hitSide=!0),at}function Oo(e,t,i,n){var d=e.doc,N=t.left,K;if(n=="page"){var Z=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),q=Math.max(Z-.5*$n(e.display),3);K=(i>0?t.bottom:t.top)+i*q}else n=="line"&&(K=i>0?t.bottom+3:t.top-3);for(var te;!(te=va(e,N,K),!te.outside);){if(i<0?K<=0:K>=d.height){te.hitSide=!0;break}K+=i*5}return te}var Kt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new $,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Kt.prototype.init=function(e){var t=this,i=this,n=i.cm,d=i.div=e.lineDiv;Co(d,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function N(Z){for(var q=Z.target;q;q=q.parentNode){if(q==d)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(q.className))break}return!1}Be(d,"paste",function(Z){if(!N(Z)||We(n,Z)||To(Z,n))return;H<=11&&setTimeout(pr(n,function(){return t.updateFromDOM()}),20)}),Be(d,"compositionstart",function(Z){t.composing={data:Z.data,done:!1}}),Be(d,"compositionupdate",function(Z){t.composing||(t.composing={data:Z.data,done:!1})}),Be(d,"compositionend",function(Z){t.composing&&(Z.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Be(d,"touchstart",function(){return i.forceCompositionEnd()}),Be(d,"input",function(){t.composing||t.readFromDOMSoon()});function K(Z){if(!N(Z)||We(n,Z))return;if(n.somethingSelected())sa({lineWise:!1,text:n.getSelections()}),Z.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var q=So(n);sa({lineWise:!0,text:q.text}),Z.type=="cut"&&n.operation(function(){n.setSelections(q.ranges,0,ve),n.replaceSelection("",null,"cut")})}else return;if(Z.clipboardData){Z.clipboardData.clearData();var te=rn.text.join(`
|
|
`);if(Z.clipboardData.setData("Text",te),Z.clipboardData.getData("Text")==te){Z.preventDefault();return}}var pe=Ao(),_e=pe.firstChild;n.display.lineSpace.insertBefore(pe,n.display.lineSpace.firstChild),_e.value=rn.text.join(`
|
|
`);var Pe=document.activeElement;M(_e),setTimeout(function(){n.display.lineSpace.removeChild(pe),Pe.focus(),Pe==d&&i.showPrimarySelection()},50)}Be(d,"copy",K),Be(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,i=t.doc.sel.primary(),n=i.from(),d=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||d.line<t.display.viewFrom){e.removeAllRanges();return}var N=oa(t,e.anchorNode,e.anchorOffset),K=oa(t,e.focusNode,e.focusOffset);if(N&&!N.bad&&K&&!K.bad&&Ct(yn(N,K),n)==0&&Ct(vn(N,K),d)==0)return;var Z=t.display.view,q=n.line>=t.display.viewFrom&&Ro(t,n)||{node:Z[0].measure.map[2],offset:0},te=d.line<t.display.viewTo&&Ro(t,d);if(!te){var pe=Z[Z.length-1].measure,_e=pe.maps?pe.maps[pe.maps.length-1]:pe.map;te={node:_e[_e.length-1],offset:_e[_e.length-2]-_e[_e.length-3]}}if(!q||!te){e.removeAllRanges();return}var Pe=e.rangeCount&&e.getRangeAt(0),Me;try{Me=b(q.node,q.offset,te.offset,te.node)}catch(Ge){}Me&&(!P&&t.state.focused?(e.collapse(q.node,q.offset),Me.collapsed||(e.removeAllRanges(),e.addRange(Me))):(e.removeAllRanges(),e.addRange(Me)),Pe&&e.anchorNode==null?e.addRange(Pe):P&&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){x(this.cm.display.cursorDiv,e.cursors),x(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 y(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():Wr(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},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 i=oa(t,e.anchorNode,e.anchorOffset),n=oa(t,e.focusNode,e.focusOffset);i&&n&&Wr(t,function(){wr(t.doc,Cn(i,n),ve),(i.bad||n.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,i=e.doc.sel.primary(),n=i.from(),d=i.to();if(n.ch==0&&n.line>e.firstLine()&&(n=Qe(n.line-1,ct(e.doc,n.line-1).length)),d.ch==ct(e.doc,d.line).text.length&&d.line<e.lastLine()&&(d=Qe(d.line+1,0)),n.line<t.viewFrom||d.line>t.viewTo-1)return!1;var N,K,Z;n.line==t.viewFrom||(N=Un(e,n.line))==0?(K=Ot(t.view[0].line),Z=t.view[0].node):(K=Ot(t.view[N].line),Z=t.view[N-1].node.nextSibling);var q=Un(e,d.line),te,pe;if(q==t.view.length-1?(te=t.viewTo-1,pe=t.lineDiv.lastChild):(te=Ot(t.view[q+1].line)-1,pe=t.view[q+1].node.previousSibling),!Z)return!1;for(var _e=e.doc.splitLines(tu(e,Z,pe,K,te)),Pe=Br(e.doc,Qe(K,0),Qe(te,ct(e.doc,te).text.length));_e.length>1&&Pe.length>1;)if(ie(_e)==ie(Pe))_e.pop(),Pe.pop(),te--;else if(_e[0]==Pe[0])_e.shift(),Pe.shift(),K++;else break;for(var Me=0,Ge=0,$e=_e[0],qe=Pe[0],at=Math.min($e.length,qe.length);Me<at&&$e.charCodeAt(Me)==qe.charCodeAt(Me);)++Me;for(var lt=ie(_e),st=ie(Pe),ht=Math.min(lt.length-(_e.length==1?Me:0),st.length-(Pe.length==1?Me:0));Ge<ht&<.charCodeAt(lt.length-Ge-1)==st.charCodeAt(st.length-Ge-1);)++Ge;if(_e.length==1&&Pe.length==1&&K==n.line)for(;Me&&Me>n.ch&<.charCodeAt(lt.length-Ge-1)==st.charCodeAt(st.length-Ge-1);)Me--,Ge++;_e[_e.length-1]=lt.slice(0,lt.length-Ge).replace(/^\u200b+/,""),_e[0]=_e[0].slice(Me).replace(/\u200b+$/,"");var Tt=Qe(K,Me),vt=Qe(te,Pe.length?ie(Pe).length-Ge:0);if(_e.length>1||_e[0]||Ct(Tt,vt))return ni(e.doc,_e,Tt,vt,"+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())&&Wr(this.cm,function(){return Mr(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()||pr(this.cm,za)(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 i=fa(e,t.line);if(!i||i.hidden)return null;var n=ct(e.doc,t.line),d=es(i,n,t.line),N=Ze(n,e.doc.direction),K="left";if(N){var Z=Xe(N,t.ch);K=Z%2?"right":"left"}var q=ns(d.map,t.ch,K);return q.offset=q.collapse=="right"?q.end:q.start,q}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function li(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,d){var N="",K=!1,Z=e.doc.lineSeparator(),q=!1;function te(Me){return function(Ge){return Ge.id==Me}}function pe(){K&&(N+=Z,q&&(N+=Z),K=q=!1)}function _e(Me){Me&&(pe(),N+=Me)}function Pe(Me){if(Me.nodeType==1){var Ge=Me.getAttribute("cm-text");if(Ge){_e(Ge);return}var $e=Me.getAttribute("cm-marker"),qe;if($e){var at=e.findMarks(Qe(n,0),Qe(d+1,0),te(+$e));at.length&&(qe=at[0].find(0))&&_e(Br(e.doc,qe.from,qe.to).join(Z));return}if(Me.getAttribute("contenteditable")=="false")return;var lt=/^(pre|div|p|li|table|br)$/i.test(Me.nodeName);if(!/^br$/i.test(Me.nodeName)&&Me.textContent.length==0)return;lt&&pe();for(var st=0;st<Me.childNodes.length;st++)Pe(Me.childNodes[st]);/^(pre|p)$/i.test(Me.nodeName)&&(q=!0),lt&&(K=!0)}else Me.nodeType==3&&_e(Me.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Pe(t),t==i);)t=t.nextSibling,q=!1;return N}function oa(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return li(e.clipPos(Qe(e.display.viewTo-1)),!0);t=null,i=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var d=0;d<e.display.view.length;d++){var N=e.display.view[d];if(N.node==n)return ru(N,t,i)}}function ru(e,t,i){var n=e.text.firstChild,d=!1;if(!t||!y(n,t))return li(Qe(Ot(e.line),0),!0);if(t==n&&(d=!0,t=n.childNodes[i],i=0,!t)){var N=e.rest?ie(e.rest):e.line;return li(Qe(Ot(N),N.text.length),d)}var K=t.nodeType==3?t:null,Z=t;for(!K&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(K=t.firstChild,i&&(i=K.nodeValue.length));Z.parentNode!=n;)Z=Z.parentNode;var q=e.measure,te=q.maps;function pe(qe,at,lt){for(var st=-1;st<(te?te.length:0);st++)for(var ht=st<0?q.map:te[st],Tt=0;Tt<ht.length;Tt+=3){var vt=ht[Tt+2];if(vt==qe||vt==at){var Rt=Ot(st<0?e.line:e.rest[st]),Yt=ht[Tt]+lt;return(lt<0||vt!=qe)&&(Yt=ht[Tt+(lt?1:0)]),Qe(Rt,Yt)}}}var _e=pe(K,Z,i);if(_e)return li(_e,d);for(var Pe=Z.nextSibling,Me=K?K.nodeValue.length-i:0;Pe;Pe=Pe.nextSibling){if(_e=pe(Pe,Pe.firstChild,0),_e)return li(Qe(_e.line,_e.ch-Me),d);Me+=Pe.textContent.length}for(var Ge=Z.previousSibling,$e=i;Ge;Ge=Ge.previousSibling){if(_e=pe(Ge,Ge.firstChild,-1),_e)return li(Qe(_e.line,_e.ch+$e),d);$e+=Ge.textContent.length}}var ir=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new $,this.hasSelection=!1,this.composing=null};ir.prototype.init=function(e){var t=this,i=this,n=this.cm;this.createField(e);var d=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),c&&(d.style.width="0px"),Be(d,"input",function(){z&&H>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Be(d,"paste",function(K){if(We(n,K)||To(K,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function N(K){if(We(n,K))return;if(n.somethingSelected())sa({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var Z=So(n);sa({lineWise:!0,text:Z.text}),K.type=="cut"?n.setSelections(Z.ranges,null,ve):(i.prevInput="",d.value=Z.text.join(`
|
|
`),M(d))}else return;K.type=="cut"&&(n.state.cutIncoming=+new Date)}Be(d,"cut",N),Be(d,"copy",N),Be(e.scroller,"paste",function(K){if(cn(e,K)||We(n,K))return;if(!d.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var Z=new Event("paste");Z.clipboardData=K.clipboardData,d.dispatchEvent(Z)}),Be(e.lineSpace,"selectstart",function(K){cn(e,K)||re(K)}),Be(d,"compositionstart",function(){var K=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:K,range:n.markText(K,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Be(d,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},ir.prototype.createField=function(e){this.wrapper=Ao(),this.textarea=this.wrapper.firstChild},ir.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ir.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=ps(e);if(e.options.moveInputWithCursor){var d=en(e,i.sel.primary().head,"div"),N=t.wrapper.getBoundingClientRect(),K=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,d.top+K.top-N.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,d.left+K.left-N.left))}return n},ir.prototype.showSelection=function(e){var t=this.cm,i=t.display;x(i.cursorDiv,e.cursors),x(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ir.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&M(this.textarea),z&&H>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",z&&H>=9&&(this.hasSelection=null))},ir.prototype.getField=function(){return this.textarea},ir.prototype.supportsTouch=function(){return!1},ir.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!l||B()!=this.textarea))try{this.textarea.focus()}catch(e){}},ir.prototype.blur=function(){this.textarea.blur()},ir.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ir.prototype.receivedFocus=function(){this.slowPoll()},ir.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()})},ir.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},ir.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||dt(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var d=i.value;if(d==n&&!t.somethingSelected())return!1;if(z&&H>=9&&this.hasSelection===d||s&&/[\uf700-\uf7ff]/.test(d))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var N=d.charCodeAt(0);if(N==8203&&!n&&(n="\u200B"),N==8666)return this.reset(),this.cm.execCommand("undo")}for(var K=0,Z=Math.min(n.length,d.length);K<Z&&n.charCodeAt(K)==d.charCodeAt(K);)++K;return Wr(t,function(){za(t,d.slice(K),n.length-K,null,e.composing?"*compose":null),d.length>1e3||d.indexOf(`
|
|
`)>-1?i.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},ir.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ir.prototype.onKeyPress=function(){z&&H>=9&&(this.hasSelection=null),this.fastPoll()},ir.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,d=t.textarea;t.contextMenuPending&&t.contextMenuPending();var N=Fn(i,e),K=n.scroller.scrollTop;if(!N||g)return;var Z=i.options.resetSelectionOnContextMenu;Z&&i.doc.sel.contains(N)==-1&&pr(i,wr)(i.doc,Cn(N),ve);var q=d.style.cssText,te=t.wrapper.style.cssText,pe=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",d.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-pe.top-5)+"px; left: "+(e.clientX-pe.left-5)+`px;
|
|
z-index: 1000; background: `+(z?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var _e;r&&(_e=window.scrollY),n.input.focus(),r&&window.scrollTo(null,_e),n.input.reset(),i.somethingSelected()||(d.value=t.prevInput=" "),t.contextMenuPending=Me,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function Pe(){if(d.selectionStart!=null){var $e=i.somethingSelected(),qe="\u200B"+($e?d.value:"");d.value="\u21DA",d.value=qe,t.prevInput=$e?"":"\u200B",d.selectionStart=1,d.selectionEnd=qe.length,n.selForContextMenu=i.doc.sel}}function Me(){if(t.contextMenuPending!=Me)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=te,d.style.cssText=q,z&&H<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=K),d.selectionStart!=null){(!z||z&&H<9)&&Pe();var $e=0,qe=function(){n.selForContextMenu==i.doc.sel&&d.selectionStart==0&&d.selectionEnd>0&&t.prevInput=="\u200B"?pr(i,Vs)(i):$e++<10?n.detectingSelectAll=setTimeout(qe,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(qe,200)}}if(z&&H>=9&&Pe(),D){me(e);var Ge=function(){it(window,"mouseup",Ge),setTimeout(Me,20)};Be(window,"mouseup",Ge)}else setTimeout(Me,50)},ir.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ir.prototype.setUneditable=function(){},ir.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?m(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 i=B();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=Z.getValue()}var d;if(e.form&&(Be(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var N=e.form;d=N.submit;try{var K=N.submit=function(){n(),N.submit=d,N.submit(),N.submit=K}}catch(q){}}t.finishInit=function(q){q.save=n,q.getTextArea=function(){return e},q.toTextArea=function(){q.toTextArea=isNaN,n(),e.parentNode.removeChild(q.getWrapperElement()),e.style.display="",e.form&&(it(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=d))}},e.style.display="none";var Z=Zt(function(q){return e.parentNode.insertBefore(q,e.nextSibling)},t);return Z}function iu(e){e.off=it,e.on=Be,e.wheelEventPixels=dl,e.Doc=Pr,e.splitLines=St,e.countColumn=W,e.findColumn=Ie,e.isWordChar=Le,e.Pass=Oe,e.signal=He,e.Line=Mn,e.changeEnd=An,e.scrollbarModel=xs,e.Pos=Qe,e.cmpPos=Ct,e.modes=Qt,e.mimeModes=It,e.resolveMode=yt,e.getMode=Lr,e.modeExtensions=bt,e.extendMode=xt,e.copyState=Ft,e.startState=dr,e.innerMode=tr,e.commands=Pi,e.keyMap=fn,e.keyName=lo,e.isModifierKey=so,e.lookupKey=ai,e.normalizeKeyMap=kl,e.StringStream=Pt,e.SharedTextMarker=Di,e.TextMarker=Rn,e.LineWidget=Ii,e.e_preventDefault=re,e.e_stopPropagation=se,e.e_stop=me,e.addClass=F,e.contains=y,e.rmClass=O,e.keyNames=Ln}$l(Zt),ql(Zt);var au="iter insert remove copy getEditor constructor".split(" ");for(var la in Pr.prototype)Pr.prototype.hasOwnProperty(la)&&ae(au,la)<0&&(Zt.prototype[la]=function(e){return function(){return e.apply(this.doc,arguments)}}(Pr.prototype[la]));return Ce(Pr),Zt.inputStyles={textarea:ir,contenteditable:Kt},Zt.defineMode=function(e){!Zt.defaults.mode&&e!="null"&&(Zt.defaults.mode=e),Cr.apply(this,arguments)},Zt.defineMIME=zr,Zt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Zt.defineMIME("text/plain","null"),Zt.defineExtension=function(e,t){Zt.prototype[e]=t},Zt.defineDocExtension=function(e,t){Pr.prototype[e]=t},Zt.fromTextArea=nu,iu(Zt),Zt.version="5.58.2",Zt})},Y1PL:function(nt,ye,Q){"use strict";Q.r(ye),Q.d(ye,"ResizableTextArea",function(){return ae});var ne=Q("wx14"),J=Q("1OyB"),P=Q("vuIU"),Y=Q("Ji7U"),j=Q("LK+K"),U=Q("q1tI"),z=Q("VTBJ"),H=Q("rePB"),r=Q("Zm9Q"),L=Q("Kwbf"),v=Q("c+Xe"),g=Q("m+aA"),p=Q("bdgK"),u=new Map;function h(ve){ve.forEach(function(Ee){var xe,Ie=Ee.target;(xe=u.get(Ie))===null||xe===void 0||xe.forEach(function(de){return de(Ie)})})}var c=new p.default(h),o=null,l=null;function s(ve,Ee){u.has(ve)||(u.set(ve,new Set),c.observe(ve)),u.get(ve).add(Ee)}function a(ve,Ee){u.has(ve)&&(u.get(ve).delete(Ee),u.get(ve).size||(c.unobserve(ve),u.delete(ve)))}var R=function(ve){Object(Y.a)(xe,ve);var Ee=Object(j.a)(xe);function xe(){return Object(J.a)(this,xe),Ee.apply(this,arguments)}return Object(P.a)(xe,[{key:"render",value:function(){return this.props.children}}]),xe}(U.Component),E=U.createContext(null);function S(ve){var Ee=ve.children,xe=ve.onBatchResize,Ie=U.useRef(0),de=U.useRef([]),ce=U.useContext(E),ie=U.useCallback(function(fe,le,ke){Ie.current+=1;var Ne=Ie.current;de.current.push({size:fe,element:le,data:ke}),Promise.resolve().then(function(){Ne===Ie.current&&(xe==null||xe(de.current),de.current=[])}),ce==null||ce(fe,le,ke)},[xe,ce]);return U.createElement(E.Provider,{value:ie},Ee)}function D(ve){var Ee=ve.children,xe=ve.disabled,Ie=U.useRef(null),de=U.useRef(null),ce=U.useContext(E),ie=U.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),fe=U.isValidElement(Ee)&&Object(v.c)(Ee),le=fe?Ee.ref:null,ke=U.useMemo(function(){return Object(v.a)(le,Ie)},[le,Ie]),Ne=U.useRef(ve);Ne.current=ve;var Ae=U.useCallback(function(Le){var Fe=Ne.current,oe=Fe.onResize,ge=Fe.data,we=Le.getBoundingClientRect(),De=we.width,je=we.height,Ve=Le.offsetWidth,Je=Le.offsetHeight,Xe=Math.floor(De),et=Math.floor(je);if(ie.current.width!==Xe||ie.current.height!==et||ie.current.offsetWidth!==Ve||ie.current.offsetHeight!==Je){var Ze={width:Xe,height:et,offsetWidth:Ve,offsetHeight:Je};ie.current=Ze;var rt=Ve===Math.round(De)?De:Ve,Be=Je===Math.round(je)?je:Je,ut=Object(z.a)(Object(z.a)({},Ze),{},{offsetWidth:rt,offsetHeight:Be});ce==null||ce(ut,Le,ge),oe&&Promise.resolve().then(function(){oe(ut,Le)})}},[]);return U.useEffect(function(){var Le=Object(g.a)(Ie.current)||Object(g.a)(de.current);return Le&&!xe&&s(Le,Ae),function(){return a(Le,Ae)}},[Ie.current,xe]),U.createElement(R,{ref:de},fe?U.cloneElement(Ee,{ref:ke}):Ee)}var A="rc-observer-key";function O(ve){var Ee=ve.children,xe=Object(r.a)(Ee);return xe.map(function(Ie,de){var ce=(Ie==null?void 0:Ie.key)||"".concat(A,"-").concat(de);return U.createElement(D,Object(ne.a)({},ve,{key:ce}),Ie)})}O.Collection=S;var C=O,x=Q("bT9E"),f=Q("TSYQ"),w=Q.n(f),b=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important
|
|
`,y=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],B={},F;function _(ve){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,xe=ve.getAttribute("id")||ve.getAttribute("data-reactid")||ve.getAttribute("name");if(Ee&&B[xe])return B[xe];var Ie=window.getComputedStyle(ve),de=Ie.getPropertyValue("box-sizing")||Ie.getPropertyValue("-moz-box-sizing")||Ie.getPropertyValue("-webkit-box-sizing"),ce=parseFloat(Ie.getPropertyValue("padding-bottom"))+parseFloat(Ie.getPropertyValue("padding-top")),ie=parseFloat(Ie.getPropertyValue("border-bottom-width"))+parseFloat(Ie.getPropertyValue("border-top-width")),fe=y.map(function(ke){return"".concat(ke,":").concat(Ie.getPropertyValue(ke))}).join(";"),le={sizingStyle:fe,paddingSize:ce,borderSize:ie,boxSizing:de};return Ee&&xe&&(B[xe]=le),le}function M(ve){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,xe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ie=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;F||(F=document.createElement("textarea"),F.setAttribute("tab-index","-1"),F.setAttribute("aria-hidden","true"),document.body.appendChild(F)),ve.getAttribute("wrap")?F.setAttribute("wrap",ve.getAttribute("wrap")):F.removeAttribute("wrap");var de=_(ve,Ee),ce=de.paddingSize,ie=de.borderSize,fe=de.boxSizing,le=de.sizingStyle;F.setAttribute("style","".concat(le,";").concat(b)),F.value=ve.value||ve.placeholder||"";var ke=Number.MIN_SAFE_INTEGER,Ne=Number.MAX_SAFE_INTEGER,Ae=F.scrollHeight,Le;if(fe==="border-box"?Ae+=ie:fe==="content-box"&&(Ae-=ce),xe!==null||Ie!==null){F.value=" ";var Fe=F.scrollHeight-ce;xe!==null&&(ke=Fe*xe,fe==="border-box"&&(ke=ke+ce+ie),Ae=Math.max(ke,Ae)),Ie!==null&&(Ne=Fe*Ie,fe==="border-box"&&(Ne=Ne+ce+ie),Le=Ae>Ne?"":"hidden",Ae=Math.min(Ne,Ae))}return{height:Ae,minHeight:ke,maxHeight:Ne,overflowY:Le,resize:"none"}}var I=Q("Gytx"),m=Q.n(I),W;(function(ve){ve[ve.NONE=0]="NONE",ve[ve.RESIZING=1]="RESIZING",ve[ve.RESIZED=2]="RESIZED"})(W||(W={}));var $=function(ve){Object(Y.a)(xe,ve);var Ee=Object(j.a)(xe);function xe(Ie){var de;return Object(J.a)(this,xe),de=Ee.call(this,Ie),de.nextFrameActionId=void 0,de.resizeFrameId=void 0,de.textArea=void 0,de.saveTextArea=function(ce){de.textArea=ce},de.handleResize=function(ce){var ie=de.state.resizeStatus,fe=de.props,le=fe.autoSize,ke=fe.onResize;if(ie!==W.NONE)return;typeof ke=="function"&&ke(ce),le&&de.resizeOnNextFrame()},de.resizeOnNextFrame=function(){cancelAnimationFrame(de.nextFrameActionId),de.nextFrameActionId=requestAnimationFrame(de.resizeTextarea)},de.resizeTextarea=function(){var ce=de.props.autoSize;if(!ce||!de.textArea)return;var ie=ce.minRows,fe=ce.maxRows,le=M(de.textArea,!1,ie,fe);de.setState({textareaStyles:le,resizeStatus:W.RESIZING},function(){cancelAnimationFrame(de.resizeFrameId),de.resizeFrameId=requestAnimationFrame(function(){de.setState({resizeStatus:W.RESIZED},function(){de.resizeFrameId=requestAnimationFrame(function(){de.setState({resizeStatus:W.NONE}),de.fixFirefoxAutoScroll()})})})})},de.renderTextArea=function(){var ce=de.props,ie=ce.prefixCls,fe=ie===void 0?"rc-textarea":ie,le=ce.autoSize,ke=ce.onResize,Ne=ce.className,Ae=ce.disabled,Le=de.state,Fe=Le.textareaStyles,oe=Le.resizeStatus,ge=Object(x.a)(de.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),we=w()(fe,Ne,Object(H.a)({},"".concat(fe,"-disabled"),Ae));"value"in ge&&(ge.value=ge.value||"");var De=Object(z.a)(Object(z.a)(Object(z.a)({},de.props.style),Fe),oe===W.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return U.createElement(C,{onResize:de.handleResize,disabled:!(le||ke)},U.createElement("textarea",Object(ne.a)({},ge,{className:we,style:De,ref:de.saveTextArea})))},de.state={textareaStyles:{},resizeStatus:W.NONE},de}return Object(P.a)(xe,[{key:"componentDidUpdate",value:function(de){(de.value!==this.props.value||!m()(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,ce=this.textArea.selectionEnd;this.textArea.setSelectionRange(de,ce)}}catch(ie){}}},{key:"render",value:function(){return this.renderTextArea()}}]),xe}(U.Component),ae=$,ue=function(ve){Object(Y.a)(xe,ve);var Ee=Object(j.a)(xe);function xe(Ie){var de;Object(J.a)(this,xe),de=Ee.call(this,Ie),de.resizableTextArea=void 0,de.focus=function(){de.resizableTextArea.textArea.focus()},de.saveTextArea=function(ie){de.resizableTextArea=ie},de.handleChange=function(ie){var fe=de.props.onChange;de.setValue(ie.target.value,function(){de.resizableTextArea.resizeTextarea()}),fe&&fe(ie)},de.handleKeyDown=function(ie){var fe=de.props,le=fe.onPressEnter,ke=fe.onKeyDown;ie.keyCode===13&&le&&le(ie),ke&&ke(ie)};var ce=typeof Ie.value=="undefined"||Ie.value===null?Ie.defaultValue:Ie.value;return de.state={value:ce},de}return Object(P.a)(xe,[{key:"setValue",value:function(de,ce){"value"in this.props||this.setState({value:de},ce)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return U.createElement(ae,Object(ne.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}}]),xe}(U.Component),Oe=ye.default=ue},ZW9T:function(nt,ye,Q){"use strict";Q.d(ye,"a",function(){return I});var ne=Q("k1fw"),J=Q("oBTY"),P=Q("miYZ"),Y=Q("tsqr"),j=Q("rAM+"),U=Q("tJVT"),z=Q("PpiC"),H=Q("q1tI"),r=Q.n(H),L=Q("bdgK"),v=Q("9og8"),g=Q("WmNS"),p=Q.n(g),u={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},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"]},c={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(`
|
|
`)}]},l=Q("5VLF"),s=Q.n(l),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"]}},R=function(W,$){return $.map(function(ae){return{label:ae,kind:W.languages.CompletionItemKind.Keyword,insertText:ae}})},E=function(W){return Object.keys(a.tables).map(function($){return{label:$,kind:W.languages.CompletionItemKind.Variable,insertText:$}})},S=function(W,$){var ae=a.tables[W];return ae?ae.map(function(ue){return{label:ue,kind:$.languages.CompletionItemKind.Field,insertText:ue}}):[]};function D(m,W,$,ae,ue){var Oe=W.getWordUntilPosition($),ve={startLineNumber:$.lineNumber,endLineNumber:$.lineNumber,startColumn:Oe.startColumn,endColumn:Oe.endColumn},Ee=ae.map(function(xe){return{label:xe,kind:m.languages.CompletionItemKind.Keyword,insertText:xe,insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ve}});return ue.map(function(xe){Ee.push(Object(ne.a)(Object(ne.a)({},xe),{},{range:ve}))}),Ee}var A=function(m){a.languages.map(function(ue){return m.languages.registerDocumentFormattingEditProvider(ue,{provideDocumentFormattingEdits:function(ve,Ee,xe){return Object(v.a)(p.a.mark(function Ie(){var de;return p.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return de=s()(ve.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),ie.abrupt("return",[{range:ve.getFullModelRange(),text:de}]);case 2:case"end":return ie.stop()}},Ie)}))()}}),ue});var W=c.quickKey.map(function(ue){return{label:ue.label,kind:m.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),$=o.quickKey.map(function(ue){return{label:ue.label,kind:m.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ae=h.quickKey.map(function(ue){return{label:ue.label,kind:m.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet}});m.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Oe,ve){var Ee=Oe.getWordUntilPosition(ve),xe={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:Ee.startColumn,endColumn:Ee.endColumn},Ie=Oe.getLineContent(ve.lineNumber).substring(Ee.startColumn-2,Ee.endColumn);return{suggestions:[].concat(Object(J.a)(c.keywords.map(function(de){return{label:de,kind:m.languages.CompletionItemKind.Function,documentation:de,insertText:de,insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}})),Object(J.a)(c.quickKey.map(function(de){return{label:de.label,kind:m.languages.CompletionItemKind.Function,documentation:de.content,insertText:Ie.startsWith("#")?de.content.replace(/#/,""):de.content,insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}})))}}}),m.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Oe,ve){var Ee=Oe.getWordUntilPosition(ve),xe={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:Ee.startColumn,endColumn:Ee.endColumn};return{suggestions:Object(J.a)(u.keywords.map(function(Ie){return{label:Ie,kind:m.languages.CompletionItemKind.Function,documentation:Ie,insertText:Ie,insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}}))}}}),m.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Oe,ve){var Ee=Oe.getWordUntilPosition(ve),xe={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:Ee.startColumn,endColumn:Ee.endColumn},Ie=Oe.getLineContent(ve.lineNumber).substring(Ee.startColumn-2,Ee.endColumn);return{suggestions:[].concat(Object(J.a)(h.keywords.map(function(de){return{label:de,kind:m.languages.CompletionItemKind.Function,documentation:de,insertText:de,insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}})),Object(J.a)(h.quickKey.map(function(de){return{label:de.label,kind:m.languages.CompletionItemKind.Function,documentation:de.content,insertText:Ie.startsWith("#")?de.content.replace(/#/,""):de.content,insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}})))}}}),m.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Oe,ve){var Ee=Oe.getWordUntilPosition(ve),xe={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:Ee.startColumn,endColumn:Ee.endColumn},Ie=Oe.getLineContent(ve.lineNumber).substring(Ee.startColumn-2,Ee.endColumn);return{suggestions:[].concat(Object(J.a)(o.keywords.map(function(de){return{label:de,kind:m.languages.CompletionItemKind.Function,documentation:de,insertText:de,insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}})),Object(J.a)(o.quickKey.map(function(de){return{label:de.label,kind:m.languages.CompletionItemKind.Function,documentation:de.content,insertText:Ie.startsWith("#")?de.content.replace(/#/,""):de.content,insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}})))}}})},O="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",C=Q("fjLI"),x=Q("LvDl"),f=Q("+ua5");function w(m){return/^\d+$/.test(m)?"".concat(m,"px"):m}function b(){}var y=!1,B={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function F(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],W=m;if(Array.isArray(m)){for(var $=0;$<m.length;$++){var ae=B[m[$]];if(ae)return ae}return W[0]}return B[W]||W}var _=null,M=ye.b=function(m){var W=m.width,$=W===void 0?"100%":W,ae=m.height,ue=ae===void 0?"100%":ae,Oe=m.value,ve=m.language,Ee=ve===void 0?"javascript":ve,xe=m.style,Ie=xe===void 0?{}:xe,de=m.options,ce=de===void 0?{}:de,ie=m.overrideServices,fe=ie===void 0?{}:ie,le=m.theme,ke=le===void 0?"vs-dark":le,Ne=m.onEditBlur,Ae=m.onSave,Le=m.autoHeight,Fe=Le===void 0?!1:Le,oe=m.forbidCopy,ge=oe===void 0?!1:oe,we=m.onChange,De=we===void 0?b:we,je=m.editorDidMount,Ve=je===void 0?b:je,Je=m.onFocus,Xe=Je===void 0?b:Je,et=m.filename,Ze=et===void 0?"educoder.txt":et,rt=m.errorLine,Be=m.errorContent,ut=Be===void 0?"":Be,it=Object(z.a)(m,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),He=Object(H.useRef)(),We=Object(H.useRef)({}),Re=Object(H.useRef)(),be=Object(H.useRef)(),Ce=Object(H.useRef)(!1),re=Object(H.useRef)(),se=Object(H.useState)(!1),he=Object(U.a)(se,2),me=he[0],Se=he[1];function Ue(){var bt;return He.current&&(bt=new L.default(function(xt){var Ft=Object(j.a)(xt),tr;try{for(Ft.s();!(tr=Ft.n()).done;){var dr=tr.value;(dr.target.offsetHeight>0||dr.target.offsetWidth>0)&&We.current.instance.layout()}}catch(Pt){Ft.e(Pt)}finally{Ft.f()}}),bt.observe(He.current)),bt}function Ke(){Y.b.warn(decodeURIComponent(O))}var ot=function(){var xt=We.current.instance;if(Oe!=null&&xt&&me){var Ft=xt.getModel();Ft&&Oe!==Ft.getValue()&&(y=!0,Ft.setValue(Oe),xt.layout(),y=!1)}};Object(H.useEffect)(function(){be.current&&clearTimeout(be.current),be.current=setTimeout(function(){ot()},500)},[Oe,me,We.current]),Object(H.useEffect)(function(){if(rt&&We.current&&We.current.instance){var bt=We.current.instance;bt.changeViewZones(function(Ft){var tr=document.createElement("div");tr.style.padding="10px 20px",tr.style.width="calc(100% - 20px)",tr.className="my-error-line-wrp",tr.innerHTML=ut,Ft.addZone({afterLineNumber:rt||11,heightInLines:3,domNode:tr})});var xt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};bt.addOverlayWidget(xt),bt.revealPositionInCenter({lineNumber:20,column:1})}},[rt,We.current,me]);function mt(){var bt=We.current.instance;if(bt){var xt=bt.getSelection(),Ft=We.current.pastePos||{},tr=new _.Range(Ft.startLineNumber||xt.endLineNumber,Ft.startColumn||xt.endColumn,Ft.endLineNumber||xt.endLineNumber,Ft.endColumn||xt.endColumn);setTimeout(function(){bt.executeEdits("",[{range:tr,text:""}])},300)}}function ft(bt){(window.navigator.platform.match("Mac")?bt.metaKey:bt.ctrlKey)&&bt.keyCode==83&&(bt.preventDefault(),Ae())}var wt=function(){if(Fe&&We.current.instance){var xt=We.current.instance.getContentHeight();yt(xt<ue?ue:xt)}else yt(ue)};function St(bt){var xt=document.createEvent("MouseEvents");xt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),bt.dispatchEvent(xt)}function dt(bt,xt){var Ft=window.URL||window.webkitURL||window,tr=new Blob([xt]),dr=document.createElementNS("http://www.w3.org/1999/xhtml","a");dr.href=Ft.createObjectURL(tr),dr.download=bt,St(dr)}Object(H.useEffect)(function(){wt()},[wt]),Object(H.useEffect)(function(){He.current&&!me&&Promise.all([Q.e(15),Q.e(27)]).then(Q.t.bind(null,"M/lh",7)).then(function(bt){try{_=bt,We.current.instance=_.editor.create(He.current,{value:Oe,language:F(Ee),theme:ke,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},fe);var xt=We.current.instance,Ft=C.d._menuItems,tr=Object(J.a)(Ft).find(function(Vt){return Vt[0]._debugName=="EditorContext"}),dr=tr[1],Pt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],ct=function(Jt,Ot){var lr=Jt._first;do{var Ir,Yr,Qe=Ot.includes((Ir=lr.element)===null||Ir===void 0||((Yr=Ir.command)===null||Yr===void 0)?void 0:Yr.id);Qe&&Jt._remove(lr)}while(lr=lr.next)};if(Ve(xt,_),setTimeout(function(){wt(),We.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){dt(Ze||"educoder.txt",xt.getValue())}}),xt.getDomNode().addEventListener("input",function(){Re.current.autoFormat&&xt.getAction("editor.action.formatDocument").run()})},500),We.current.subscription=xt.onDidChangeModelContent(function(Vt){Ce.current?clearTimeout(re.current):(wt(),De(xt.getValue(),Vt)),re.current=setTimeout(function(){Ce.current=!1},500)}),window.Monaco||A(_,F(Ee)),ge&&(ct(dr,Pt),He.current.classList.add("noCopyPaste"),xt.onKeyDown(function(Vt){var Jt=Vt.keyCode,Ot=Vt.ctrlKey,lr=Vt.metaKey;(Jt===33||Jt===52)&&(lr||Ot)&&(Ke(),Vt.preventDefault())})),window.Monaco=_,Ne&&xt.onDidBlurEditorWidget(function(){Ne(xt.getValue())}),Xe&&xt.onDidFocusEditorText(function(){Xe(xt.getValue())}),ge){xt.addCommand(_.KeyMod.CtrlCmd|_.KeyCode.KEY_V,function(){return Ke(),null}),xt.onDidPaste(function(Vt){We.current.pastePos=Vt});try{window.addEventListener("paste",mt)}catch(Vt){}}var Br=Ue();return Se(!0),function(){var Vt=We.current.instance;Vt.dispose();var Jt=Vt.getModel();Jt&&Jt.dispose(),We.current.subscription&&We.current.subscription.dispose(),ge&&window.removeEventListener("paste",mt),Br.unobserve(He.current)}}catch(Vt){}})},[]),Object(H.useEffect)(function(){var bt=We.current.instance;if(bt&&me)return document.addEventListener("keydown",ft,!1),function(){document.removeEventListener("keydown",ft)}},[Ae,me]),Object(H.useEffect)(function(){var bt=We.current.instance;if(bt&&me){var xt=F(Ee);_.editor.setModelLanguage(bt.getModel(),xt),console.log("language:",Ee,bt.getModel(),xt)}},[Ee,me]),Object(H.useEffect)(function(){var bt=We.current.instance;bt&&me&&_.editor.setTheme(ke)},[ke,me]),Object(H.useEffect)(function(){var bt=We.current.instance;Re.current=ce,bt&&me&&(bt.updateOptions(Object(ne.a)({},ce)),setTimeout(function(){bt.getModel().updateOptions(Object(ne.a)({},ce))},200))},[JSON.stringify(ce),me]),Object(H.useEffect)(function(){var bt=We.current.instance;bt&&me&&bt.layout()},[$,ue,me]);var Bt=Object(H.useState)(w($)),Lt=Object(U.a)(Bt,2),qt=Lt[0],Qt=Lt[1],It=Object(H.useState)(w(ue)),Cr=Object(U.a)(It,2),zr=Cr[0],yt=Cr[1],Lr=Object(ne.a)(Object(ne.a)({},Ie),{},{width:qt,height:zr});return r.a.createElement("div",{className:"my-monaco-editor",ref:He,style:Lr})};function I(m){var W=m.width,$=W===void 0?"100%":W,ae=m.height,ue=ae===void 0?"100%":ae,Oe=m.original,ve=m.modified,Ee=m.language,xe=m.options,Ie=xe===void 0?{}:xe,de=Object(H.useRef)(),ce=Object(H.useState)(null),ie=Object(U.a)(ce,2),fe=ie[0],le=ie[1];function ke(Fe){var oe;return de.current&&(oe=new L.default(function(ge){var we=Object(j.a)(ge),De;try{for(we.s();!(De=we.n()).done;){var je=De.value;(je.target.offsetHeight>0||je.target.offsetWidth>0)&&Fe.layout()}}catch(Ve){we.e(Ve)}finally{we.f()}}),oe.observe(de.current)),oe}Object(H.useEffect)(function(){de.current&&Promise.all([Q.e(15),Q.e(27)]).then(Q.t.bind(null,"M/lh",7)).then(function(Fe){_=Fe;var oe=_.editor.createDiffEditor(de.current,Object(ne.a)(Object(ne.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Ie),{},{wordWrap:!0}));le(oe);var ge=ke(oe);return function(){oe.dispose();var we=oe.getModel();we&&we.dispose(),ge.unobserve(de.current)}})},[]),Object(H.useEffect)(function(){fe&&fe.setModel({original:_.editor.createModel(Oe,Ee),modified:_.editor.createModel(ve,Ee)})},[Oe,ve,Ee,fe]);var Ne=w($),Ae=w(ue),Le={width:Ne,height:Ae};return r.a.createElement("div",{className:"my-diff-editor",ref:de,style:Le})}},ZpRC:function(nt,ye,Q){"use strict";function ne(v){return typeof v=="object"&&v!=null&&v.nodeType===1}function J(v,g){return(!g||v!=="hidden")&&v!=="visible"&&v!=="clip"}function P(v,g){if(v.clientHeight<v.scrollHeight||v.clientWidth<v.scrollWidth){var p=getComputedStyle(v,null);return J(p.overflowY,g)||J(p.overflowX,g)||function(u){var h=function(c){if(!c.ownerDocument||!c.ownerDocument.defaultView)return null;try{return c.ownerDocument.defaultView.frameElement}catch(o){return null}}(u);return!!h&&(h.clientHeight<u.scrollHeight||h.clientWidth<u.scrollWidth)}(v)}return!1}function Y(v,g,p,u,h,c,o,l){return c<v&&o>g||c>v&&o<g?0:c<=v&&l<=p||o>=g&&l>=p?c-v-u:o>g&&l<p||c<v&&l>p?o-g+h:0}var j=function(v,g){var p=window,u=g.scrollMode,h=g.block,c=g.inline,o=g.boundary,l=g.skipOverflowHiddenElements,s=typeof o=="function"?o:function(Fe){return Fe!==o};if(!ne(v))throw new TypeError("Invalid target");for(var a=document.scrollingElement||document.documentElement,R=[],E=v;ne(E)&&s(E);){if((E=E.parentElement)===a){R.push(E);break}E!=null&&E===document.body&&P(E)&&!P(document.documentElement)||E!=null&&P(E,l)&&R.push(E)}for(var S=p.visualViewport?p.visualViewport.width:innerWidth,D=p.visualViewport?p.visualViewport.height:innerHeight,A=window.scrollX||pageXOffset,O=window.scrollY||pageYOffset,C=v.getBoundingClientRect(),x=C.height,f=C.width,w=C.top,b=C.right,y=C.bottom,B=C.left,F=h==="start"||h==="nearest"?w:h==="end"?y:w+x/2,_=c==="center"?B+f/2:c==="end"?b:B,M=[],I=0;I<R.length;I++){var m=R[I],W=m.getBoundingClientRect(),$=W.height,ae=W.width,ue=W.top,Oe=W.right,ve=W.bottom,Ee=W.left;if(u==="if-needed"&&w>=0&&B>=0&&y<=D&&b<=S&&w>=ue&&y<=ve&&B>=Ee&&b<=Oe)return M;var xe=getComputedStyle(m),Ie=parseInt(xe.borderLeftWidth,10),de=parseInt(xe.borderTopWidth,10),ce=parseInt(xe.borderRightWidth,10),ie=parseInt(xe.borderBottomWidth,10),fe=0,le=0,ke="offsetWidth"in m?m.offsetWidth-m.clientWidth-Ie-ce:0,Ne="offsetHeight"in m?m.offsetHeight-m.clientHeight-de-ie:0;if(a===m)fe=h==="start"?F:h==="end"?F-D:h==="nearest"?Y(O,O+D,D,de,ie,O+F,O+F+x,x):F-D/2,le=c==="start"?_:c==="center"?_-S/2:c==="end"?_-S:Y(A,A+S,S,Ie,ce,A+_,A+_+f,f),fe=Math.max(0,fe+O),le=Math.max(0,le+A);else{fe=h==="start"?F-ue-de:h==="end"?F-ve+ie+Ne:h==="nearest"?Y(ue,ve,$,de,ie+Ne,F,F+x,x):F-(ue+$/2)+Ne/2,le=c==="start"?_-Ee-Ie:c==="center"?_-(Ee+ae/2)+ke/2:c==="end"?_-Oe+ce+ke:Y(Ee,Oe,ae,Ie,ce+ke,_,_+f,f);var Ae=m.scrollLeft,Le=m.scrollTop;F+=Le-(fe=Math.max(0,Math.min(Le+fe,m.scrollHeight-$+Ne))),_+=Ae-(le=Math.max(0,Math.min(Ae+le,m.scrollWidth-ae+ke)))}M.push({el:m,top:fe,left:le})}return M};function U(v){return v===Object(v)&&Object.keys(v).length!==0}function z(v,g){g===void 0&&(g="auto");var p="scrollBehavior"in document.body.style;v.forEach(function(u){var h=u.el,c=u.top,o=u.left;h.scroll&&p?h.scroll({top:c,left:o,behavior:g}):(h.scrollTop=c,h.scrollLeft=o)})}function H(v){return v===!1?{block:"end",inline:"nearest"}:U(v)?v:{block:"start",inline:"nearest"}}function r(v,g){var p=!v.ownerDocument.documentElement.contains(v);if(U(g)&&typeof g.behavior=="function")return g.behavior(p?[]:j(v,g));if(p)return;var u=H(g);return z(j(v,u),u.behavior)}var L=ye.a=r},Zss7:function(nt,ye,Q){var ne;(function(J){var P=/^\s+/,Y=/\s+$/,j=0,U=J.round,z=J.min,H=J.max,r=J.random;function L(ie,fe){if(ie=ie||"",fe=fe||{},ie instanceof L)return ie;if(!(this instanceof L))return new L(ie,fe);var le=v(ie);this._originalInput=ie,this._r=le.r,this._g=le.g,this._b=le.b,this._a=le.a,this._roundA=U(100*this._a)/100,this._format=fe.format||le.format,this._gradientType=fe.gradientType,this._r<1&&(this._r=U(this._r)),this._g<1&&(this._g=U(this._g)),this._b<1&&(this._b=U(this._b)),this._ok=le.ok,this._tc_id=j++}L.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var ie=this.toRgb();return(ie.r*299+ie.g*587+ie.b*114)/1e3},getLuminance:function(){var ie=this.toRgb(),fe,le,ke,Ne,Ae,Le;return fe=ie.r/255,le=ie.g/255,ke=ie.b/255,fe<=.03928?Ne=fe/12.92:Ne=J.pow((fe+.055)/1.055,2.4),le<=.03928?Ae=le/12.92:Ae=J.pow((le+.055)/1.055,2.4),ke<=.03928?Le=ke/12.92:Le=J.pow((ke+.055)/1.055,2.4),.2126*Ne+.7152*Ae+.0722*Le},setAlpha:function(ie){return this._a=M(ie),this._roundA=U(100*this._a)/100,this},toHsv:function(){var ie=h(this._r,this._g,this._b);return{h:ie.h*360,s:ie.s,v:ie.v,a:this._a}},toHsvString:function(){var ie=h(this._r,this._g,this._b),fe=U(ie.h*360),le=U(ie.s*100),ke=U(ie.v*100);return this._a==1?"hsv("+fe+", "+le+"%, "+ke+"%)":"hsva("+fe+", "+le+"%, "+ke+"%, "+this._roundA+")"},toHsl:function(){var ie=p(this._r,this._g,this._b);return{h:ie.h*360,s:ie.s,l:ie.l,a:this._a}},toHslString:function(){var ie=p(this._r,this._g,this._b),fe=U(ie.h*360),le=U(ie.s*100),ke=U(ie.l*100);return this._a==1?"hsl("+fe+", "+le+"%, "+ke+"%)":"hsla("+fe+", "+le+"%, "+ke+"%, "+this._roundA+")"},toHex:function(ie){return o(this._r,this._g,this._b,ie)},toHexString:function(ie){return"#"+this.toHex(ie)},toHex8:function(ie){return l(this._r,this._g,this._b,this._a,ie)},toHex8String:function(ie){return"#"+this.toHex8(ie)},toRgb:function(){return{r:U(this._r),g:U(this._g),b:U(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+U(this._r)+", "+U(this._g)+", "+U(this._b)+")":"rgba("+U(this._r)+", "+U(this._g)+", "+U(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:U(I(this._r,255)*100)+"%",g:U(I(this._g,255)*100)+"%",b:U(I(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+U(I(this._r,255)*100)+"%, "+U(I(this._g,255)*100)+"%, "+U(I(this._b,255)*100)+"%)":"rgba("+U(I(this._r,255)*100)+"%, "+U(I(this._g,255)*100)+"%, "+U(I(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:F[o(this._r,this._g,this._b,!0)]||!1},toFilter:function(ie){var fe="#"+s(this._r,this._g,this._b,this._a),le=fe,ke=this._gradientType?"GradientType = 1, ":"";if(ie){var Ne=L(ie);le="#"+s(Ne._r,Ne._g,Ne._b,Ne._a)}return"progid:DXImageTransform.Microsoft.gradient("+ke+"startColorstr="+fe+",endColorstr="+le+")"},toString:function(ie){var fe=!!ie;ie=ie||this._format;var le=!1,ke=this._a<1&&this._a>=0,Ne=!fe&&ke&&(ie==="hex"||ie==="hex6"||ie==="hex3"||ie==="hex4"||ie==="hex8"||ie==="name");return Ne?ie==="name"&&this._a===0?this.toName():this.toRgbString():(ie==="rgb"&&(le=this.toRgbString()),ie==="prgb"&&(le=this.toPercentageRgbString()),(ie==="hex"||ie==="hex6")&&(le=this.toHexString()),ie==="hex3"&&(le=this.toHexString(!0)),ie==="hex4"&&(le=this.toHex8String(!0)),ie==="hex8"&&(le=this.toHex8String()),ie==="name"&&(le=this.toName()),ie==="hsl"&&(le=this.toHslString()),ie==="hsv"&&(le=this.toHsvString()),le||this.toHexString())},clone:function(){return L(this.toString())},_applyModification:function(ie,fe){var le=ie.apply(null,[this].concat([].slice.call(fe)));return this._r=le._r,this._g=le._g,this._b=le._b,this.setAlpha(le._a),this},lighten:function(){return this._applyModification(S,arguments)},brighten:function(){return this._applyModification(D,arguments)},darken:function(){return this._applyModification(A,arguments)},desaturate:function(){return this._applyModification(a,arguments)},saturate:function(){return this._applyModification(R,arguments)},greyscale:function(){return this._applyModification(E,arguments)},spin:function(){return this._applyModification(O,arguments)},_applyCombination:function(ie,fe){return ie.apply(null,[this].concat([].slice.call(fe)))},analogous:function(){return this._applyCombination(b,arguments)},complement:function(){return this._applyCombination(C,arguments)},monochromatic:function(){return this._applyCombination(y,arguments)},splitcomplement:function(){return this._applyCombination(w,arguments)},triad:function(){return this._applyCombination(x,arguments)},tetrad:function(){return this._applyCombination(f,arguments)}},L.fromRatio=function(ie,fe){if(typeof ie=="object"){var le={};for(var ke in ie)ie.hasOwnProperty(ke)&&(ke==="a"?le[ke]=ie[ke]:le[ke]=Oe(ie[ke]));ie=le}return L(ie,fe)};function v(ie){var fe={r:0,g:0,b:0},le=1,ke=null,Ne=null,Ae=null,Le=!1,Fe=!1;return typeof ie=="string"&&(ie=de(ie)),typeof ie=="object"&&(Ie(ie.r)&&Ie(ie.g)&&Ie(ie.b)?(fe=g(ie.r,ie.g,ie.b),Le=!0,Fe=String(ie.r).substr(-1)==="%"?"prgb":"rgb"):Ie(ie.h)&&Ie(ie.s)&&Ie(ie.v)?(ke=Oe(ie.s),Ne=Oe(ie.v),fe=c(ie.h,ke,Ne),Le=!0,Fe="hsv"):Ie(ie.h)&&Ie(ie.s)&&Ie(ie.l)&&(ke=Oe(ie.s),Ae=Oe(ie.l),fe=u(ie.h,ke,Ae),Le=!0,Fe="hsl"),ie.hasOwnProperty("a")&&(le=ie.a)),le=M(le),{ok:Le,format:ie.format||Fe,r:z(255,H(fe.r,0)),g:z(255,H(fe.g,0)),b:z(255,H(fe.b,0)),a:le}}function g(ie,fe,le){return{r:I(ie,255)*255,g:I(fe,255)*255,b:I(le,255)*255}}function p(ie,fe,le){ie=I(ie,255),fe=I(fe,255),le=I(le,255);var ke=H(ie,fe,le),Ne=z(ie,fe,le),Ae,Le,Fe=(ke+Ne)/2;if(ke==Ne)Ae=Le=0;else{var oe=ke-Ne;Le=Fe>.5?oe/(2-ke-Ne):oe/(ke+Ne);switch(ke){case ie:Ae=(fe-le)/oe+(fe<le?6:0);break;case fe:Ae=(le-ie)/oe+2;break;case le:Ae=(ie-fe)/oe+4;break}Ae/=6}return{h:Ae,s:Le,l:Fe}}function u(ie,fe,le){var ke,Ne,Ae;ie=I(ie,360),fe=I(fe,100),le=I(le,100);function Le(ge,we,De){return De<0&&(De+=1),De>1&&(De-=1),De<1/6?ge+(we-ge)*6*De:De<1/2?we:De<2/3?ge+(we-ge)*(2/3-De)*6:ge}if(fe===0)ke=Ne=Ae=le;else{var Fe=le<.5?le*(1+fe):le+fe-le*fe,oe=2*le-Fe;ke=Le(oe,Fe,ie+1/3),Ne=Le(oe,Fe,ie),Ae=Le(oe,Fe,ie-1/3)}return{r:ke*255,g:Ne*255,b:Ae*255}}function h(ie,fe,le){ie=I(ie,255),fe=I(fe,255),le=I(le,255);var ke=H(ie,fe,le),Ne=z(ie,fe,le),Ae,Le,Fe=ke,oe=ke-Ne;if(Le=ke===0?0:oe/ke,ke==Ne)Ae=0;else{switch(ke){case ie:Ae=(fe-le)/oe+(fe<le?6:0);break;case fe:Ae=(le-ie)/oe+2;break;case le:Ae=(ie-fe)/oe+4;break}Ae/=6}return{h:Ae,s:Le,v:Fe}}function c(ie,fe,le){ie=I(ie,360)*6,fe=I(fe,100),le=I(le,100);var ke=J.floor(ie),Ne=ie-ke,Ae=le*(1-fe),Le=le*(1-Ne*fe),Fe=le*(1-(1-Ne)*fe),oe=ke%6,ge=[le,Le,Ae,Ae,Fe,le][oe],we=[Fe,le,le,Le,Ae,Ae][oe],De=[Ae,Ae,Fe,le,le,Le][oe];return{r:ge*255,g:we*255,b:De*255}}function o(ie,fe,le,ke){var Ne=[ue(U(ie).toString(16)),ue(U(fe).toString(16)),ue(U(le).toString(16))];return ke&&Ne[0].charAt(0)==Ne[0].charAt(1)&&Ne[1].charAt(0)==Ne[1].charAt(1)&&Ne[2].charAt(0)==Ne[2].charAt(1)?Ne[0].charAt(0)+Ne[1].charAt(0)+Ne[2].charAt(0):Ne.join("")}function l(ie,fe,le,ke,Ne){var Ae=[ue(U(ie).toString(16)),ue(U(fe).toString(16)),ue(U(le).toString(16)),ue(ve(ke))];return Ne&&Ae[0].charAt(0)==Ae[0].charAt(1)&&Ae[1].charAt(0)==Ae[1].charAt(1)&&Ae[2].charAt(0)==Ae[2].charAt(1)&&Ae[3].charAt(0)==Ae[3].charAt(1)?Ae[0].charAt(0)+Ae[1].charAt(0)+Ae[2].charAt(0)+Ae[3].charAt(0):Ae.join("")}function s(ie,fe,le,ke){var Ne=[ue(ve(ke)),ue(U(ie).toString(16)),ue(U(fe).toString(16)),ue(U(le).toString(16))];return Ne.join("")}L.equals=function(ie,fe){return!ie||!fe?!1:L(ie).toRgbString()==L(fe).toRgbString()},L.random=function(){return L.fromRatio({r:r(),g:r(),b:r()})};function a(ie,fe){fe=fe===0?0:fe||10;var le=L(ie).toHsl();return le.s-=fe/100,le.s=m(le.s),L(le)}function R(ie,fe){fe=fe===0?0:fe||10;var le=L(ie).toHsl();return le.s+=fe/100,le.s=m(le.s),L(le)}function E(ie){return L(ie).desaturate(100)}function S(ie,fe){fe=fe===0?0:fe||10;var le=L(ie).toHsl();return le.l+=fe/100,le.l=m(le.l),L(le)}function D(ie,fe){fe=fe===0?0:fe||10;var le=L(ie).toRgb();return le.r=H(0,z(255,le.r-U(255*-(fe/100)))),le.g=H(0,z(255,le.g-U(255*-(fe/100)))),le.b=H(0,z(255,le.b-U(255*-(fe/100)))),L(le)}function A(ie,fe){fe=fe===0?0:fe||10;var le=L(ie).toHsl();return le.l-=fe/100,le.l=m(le.l),L(le)}function O(ie,fe){var le=L(ie).toHsl(),ke=(le.h+fe)%360;return le.h=ke<0?360+ke:ke,L(le)}function C(ie){var fe=L(ie).toHsl();return fe.h=(fe.h+180)%360,L(fe)}function x(ie){var fe=L(ie).toHsl(),le=fe.h;return[L(ie),L({h:(le+120)%360,s:fe.s,l:fe.l}),L({h:(le+240)%360,s:fe.s,l:fe.l})]}function f(ie){var fe=L(ie).toHsl(),le=fe.h;return[L(ie),L({h:(le+90)%360,s:fe.s,l:fe.l}),L({h:(le+180)%360,s:fe.s,l:fe.l}),L({h:(le+270)%360,s:fe.s,l:fe.l})]}function w(ie){var fe=L(ie).toHsl(),le=fe.h;return[L(ie),L({h:(le+72)%360,s:fe.s,l:fe.l}),L({h:(le+216)%360,s:fe.s,l:fe.l})]}function b(ie,fe,le){fe=fe||6,le=le||30;var ke=L(ie).toHsl(),Ne=360/le,Ae=[L(ie)];for(ke.h=(ke.h-(Ne*fe>>1)+720)%360;--fe;)ke.h=(ke.h+Ne)%360,Ae.push(L(ke));return Ae}function y(ie,fe){fe=fe||6;for(var le=L(ie).toHsv(),ke=le.h,Ne=le.s,Ae=le.v,Le=[],Fe=1/fe;fe--;)Le.push(L({h:ke,s:Ne,v:Ae})),Ae=(Ae+Fe)%1;return Le}L.mix=function(ie,fe,le){le=le===0?0:le||50;var ke=L(ie).toRgb(),Ne=L(fe).toRgb(),Ae=le/100,Le={r:(Ne.r-ke.r)*Ae+ke.r,g:(Ne.g-ke.g)*Ae+ke.g,b:(Ne.b-ke.b)*Ae+ke.b,a:(Ne.a-ke.a)*Ae+ke.a};return L(Le)},L.readability=function(ie,fe){var le=L(ie),ke=L(fe);return(J.max(le.getLuminance(),ke.getLuminance())+.05)/(J.min(le.getLuminance(),ke.getLuminance())+.05)},L.isReadable=function(ie,fe,le){var ke=L.readability(ie,fe),Ne,Ae;Ae=!1,Ne=ce(le);switch(Ne.level+Ne.size){case"AAsmall":case"AAAlarge":Ae=ke>=4.5;break;case"AAlarge":Ae=ke>=3;break;case"AAAsmall":Ae=ke>=7;break}return Ae},L.mostReadable=function(ie,fe,le){var ke=null,Ne=0,Ae,Le,Fe,oe;le=le||{},Le=le.includeFallbackColors,Fe=le.level,oe=le.size;for(var ge=0;ge<fe.length;ge++)Ae=L.readability(ie,fe[ge]),Ae>Ne&&(Ne=Ae,ke=L(fe[ge]));return L.isReadable(ie,ke,{level:Fe,size:oe})||!Le?ke:(le.includeFallbackColors=!1,L.mostReadable(ie,["#fff","#000"],le))};var B=L.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},F=L.hexNames=_(B);function _(ie){var fe={};for(var le in ie)ie.hasOwnProperty(le)&&(fe[ie[le]]=le);return fe}function M(ie){return ie=parseFloat(ie),(isNaN(ie)||ie<0||ie>1)&&(ie=1),ie}function I(ie,fe){$(ie)&&(ie="100%");var le=ae(ie);return ie=z(fe,H(0,parseFloat(ie))),le&&(ie=parseInt(ie*fe,10)/100),J.abs(ie-fe)<1e-6?1:ie%fe/parseFloat(fe)}function m(ie){return z(1,H(0,ie))}function W(ie){return parseInt(ie,16)}function $(ie){return typeof ie=="string"&&ie.indexOf(".")!=-1&&parseFloat(ie)===1}function ae(ie){return typeof ie=="string"&&ie.indexOf("%")!=-1}function ue(ie){return ie.length==1?"0"+ie:""+ie}function Oe(ie){return ie<=1&&(ie=ie*100+"%"),ie}function ve(ie){return J.round(parseFloat(ie)*255).toString(16)}function Ee(ie){return W(ie)/255}var xe=function(){var ie="[-\\+]?\\d+%?",fe="[-\\+]?\\d*\\.\\d+%?",le="(?:"+fe+")|(?:"+ie+")",ke="[\\s|\\(]+("+le+")[,|\\s]+("+le+")[,|\\s]+("+le+")\\s*\\)?",Ne="[\\s|\\(]+("+le+")[,|\\s]+("+le+")[,|\\s]+("+le+")[,|\\s]+("+le+")\\s*\\)?";return{CSS_UNIT:new RegExp(le),rgb:new RegExp("rgb"+ke),rgba:new RegExp("rgba"+Ne),hsl:new RegExp("hsl"+ke),hsla:new RegExp("hsla"+Ne),hsv:new RegExp("hsv"+ke),hsva:new RegExp("hsva"+Ne),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Ie(ie){return!!xe.CSS_UNIT.exec(ie)}function de(ie){ie=ie.replace(P,"").replace(Y,"").toLowerCase();var fe=!1;if(B[ie])ie=B[ie],fe=!0;else if(ie=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var le;return(le=xe.rgb.exec(ie))?{r:le[1],g:le[2],b:le[3]}:(le=xe.rgba.exec(ie))?{r:le[1],g:le[2],b:le[3],a:le[4]}:(le=xe.hsl.exec(ie))?{h:le[1],s:le[2],l:le[3]}:(le=xe.hsla.exec(ie))?{h:le[1],s:le[2],l:le[3],a:le[4]}:(le=xe.hsv.exec(ie))?{h:le[1],s:le[2],v:le[3]}:(le=xe.hsva.exec(ie))?{h:le[1],s:le[2],v:le[3],a:le[4]}:(le=xe.hex8.exec(ie))?{r:W(le[1]),g:W(le[2]),b:W(le[3]),a:Ee(le[4]),format:fe?"name":"hex8"}:(le=xe.hex6.exec(ie))?{r:W(le[1]),g:W(le[2]),b:W(le[3]),format:fe?"name":"hex"}:(le=xe.hex4.exec(ie))?{r:W(le[1]+""+le[1]),g:W(le[2]+""+le[2]),b:W(le[3]+""+le[3]),a:Ee(le[4]+""+le[4]),format:fe?"name":"hex8"}:(le=xe.hex3.exec(ie))?{r:W(le[1]+""+le[1]),g:W(le[2]+""+le[2]),b:W(le[3]+""+le[3]),format:fe?"name":"hex"}:!1}function ce(ie){var fe,le;return ie=ie||{level:"AA",size:"small"},fe=(ie.level||"AA").toUpperCase(),le=(ie.size||"small").toLowerCase(),fe!=="AA"&&fe!=="AAA"&&(fe="AA"),le!=="small"&&le!=="large"&&(le="small"),{level:fe,size:le}}nt.exports?nt.exports=L:!(ne=function(){return L}.call(ye,Q,ye,nt),ne!==void 0&&(nt.exports=ne))})(Math)},bT9E:function(nt,ye,Q){"use strict";Q.d(ye,"a",function(){return J});var ne=Q("VTBJ");function J(P,Y){var j=Object(ne.a)({},P);return Array.isArray(Y)&&Y.forEach(function(U){delete j[U]}),j}},c5Ni:function(nt,ye,Q){},dejd:function(nt,ye,Q){},dmUQ:function(nt,ye,Q){"use strict";var ne=Q("Ff2n"),J=Q("rePB"),P=Q("1OyB"),Y=Q("vuIU"),j=Q("Ji7U"),U=Q("md7G"),z=Q("foSv"),H=Q("q1tI"),r=Q.n(H),L=Q("TSYQ"),v=Q.n(L),g=Q("4IlW");function p(x,f){var w=Object.keys(x);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(x);f&&(b=b.filter(function(y){return Object.getOwnPropertyDescriptor(x,y).enumerable})),w.push.apply(w,b)}return w}function u(x){for(var f=1;f<arguments.length;f++){var w=arguments[f]!=null?arguments[f]:{};f%2?p(Object(w),!0).forEach(function(b){Object(J.a)(x,b,w[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(w)):p(Object(w)).forEach(function(b){Object.defineProperty(x,b,Object.getOwnPropertyDescriptor(w,b))})}return x}function h(x){var f=c();return function(){var b=Object(z.a)(x),y;if(f){var B=Object(z.a)(this).constructor;y=Reflect.construct(b,arguments,B)}else y=b.apply(this,arguments);return Object(U.a)(this,y)}}function c(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(x){return!1}}function o(){}function l(x){x.preventDefault()}var s=function(f){return f.replace(/[^\w.-]+/g,"")},a=200,R=600,E=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,S=function(f){return f!=null},D=function(f,w){return w===f||typeof w=="number"&&typeof f=="number"&&isNaN(w)&&isNaN(f)},A=function(x){Object(j.a)(w,x);var f=h(w);function w(b){var y;Object(P.a)(this,w),y=f.call(this,b),y.onKeyDown=function(_){var M=y.props,I=M.onKeyDown,m=M.onPressEnter;if(_.keyCode===g.a.UP){var W=y.getRatio(_);y.up(_,W,null),y.stop()}else if(_.keyCode===g.a.DOWN){var $=y.getRatio(_);y.down(_,$,null),y.stop()}else _.keyCode===g.a.ENTER&&m&&m(_);if(y.recordCursorPosition(),y.lastKeyCode=_.keyCode,I){for(var ae=arguments.length,ue=new Array(ae>1?ae-1:0),Oe=1;Oe<ae;Oe++)ue[Oe-1]=arguments[Oe];I.apply(void 0,[_].concat(ue))}},y.onKeyUp=function(_){var M=y.props.onKeyUp;if(y.stop(),y.recordCursorPosition(),M){for(var I=arguments.length,m=new Array(I>1?I-1:0),W=1;W<I;W++)m[W-1]=arguments[W];M.apply(void 0,[_].concat(m))}},y.onChange=function(_){var M=y.props.onChange;y.state.focused&&(y.inputting=!0),y.rawInput=y.props.parser(y.getValueFromEvent(_)),y.setState({inputValue:y.rawInput}),M(y.toNumber(y.rawInput))},y.onMouseUp=function(){var _=y.props.onMouseUp;y.recordCursorPosition(),_&&_.apply(void 0,arguments)},y.onFocus=function(){var _;y.setState({focused:!0}),(_=y.props).onFocus.apply(_,arguments)},y.onBlur=function(){var _=y.props.onBlur;y.inputting=!1,y.setState({focused:!1});var M=y.getCurrentValidValue(y.state.inputValue),I=y.setValue(M,o);if(_){var m=y.input.value,W=y.getInputDisplayValue({focus:!1,value:I});y.input.value=W&&Number(W),_.apply(void 0,arguments),y.input.value=m}},y.getRatio=function(_){var M=1;return _.metaKey||_.ctrlKey?M=.1:_.shiftKey&&(M=10),M},y.getFullNum=function(_){return isNaN(_)?_:/e/i.test(String(_))?Number(_).toFixed(18).replace(/\.?0+$/,""):_},y.getPrecision=function(_){if(S(y.props.precision))return y.props.precision;var M=String(_);if(M.indexOf("e-")>=0)return parseInt(M.slice(M.indexOf("e-")+2),10);var I=0;return M.indexOf(".")>=0&&(I=M.length-M.indexOf(".")-1),I},y.getInputDisplayValue=function(_){var M=_||y.state,I=M.focused,m=M.inputValue,W=M.value,$;I?$=m:$=y.toPrecisionAsStep(W),$==null&&($="");var ae=y.formatWrapper($);return S(y.props.decimalSeparator)&&(ae=ae.toString().replace(".",y.props.decimalSeparator)),ae},y.recordCursorPosition=function(){try{y.cursorStart=y.input.selectionStart,y.cursorEnd=y.input.selectionEnd,y.currentValue=y.input.value,y.cursorBefore=y.input.value.substring(0,y.cursorStart),y.cursorAfter=y.input.value.substring(y.cursorEnd)}catch(_){}},y.restoreByAfter=function(_){if(_===void 0)return!1;var M=y.input.value,I=M.lastIndexOf(_);if(I===-1)return!1;var m=y.cursorBefore.length;return y.lastKeyCode===g.a.DELETE&&y.cursorBefore.charAt(m-1)===_[0]?(y.fixCaret(m,m),!0):I+_.length===M.length?(y.fixCaret(I,I),!0):!1},y.partRestoreByAfter=function(_){return _===void 0?!1:Array.prototype.some.call(_,function(M,I){var m=_.substring(I);return y.restoreByAfter(m)})},y.isNotCompleteNumber=function(_){return isNaN(_)||_===""||_===null||_&&_.toString().indexOf(".")===_.toString().length-1},y.stop=function(){y.autoStepTimer&&clearTimeout(y.autoStepTimer)},y.down=function(_,M,I){y.pressingUpOrDown=!0,y.step("down",_,M,I)},y.up=function(_,M,I){y.pressingUpOrDown=!0,y.step("up",_,M,I)},y.saveInput=function(_){y.input=_};var B=b.value;B===void 0&&(B=b.defaultValue),y.state={focused:b.autoFocus};var F=y.getValidValue(y.toNumber(B));return y.state=u(u({},y.state),{},{inputValue:y.toPrecisionAsStep(F),value:F}),y}return Object(Y.a)(w,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(y){var B=this.props,F=B.value,_=B.onChange,M=B.max,I=B.min,m=this.state.focused;if(y){if(!D(y.value,F)||!D(y.max,M)||!D(y.min,I)){var W=m?F:this.getValidValue(F),$;this.pressingUpOrDown?$=W:this.inputting?$=this.rawInput:$=this.toPrecisionAsStep(W),this.setState({value:W,inputValue:$})}var ae="value"in this.props?F:this.state.value;"max"in this.props&&y.max!==M&&typeof ae=="number"&&ae>M&&_&&_(M),"min"in this.props&&y.min!==I&&typeof ae=="number"&&ae<I&&_&&_(I)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ue=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===g.a.BACKSPACE?ue=this.cursorStart-1:this.lastKeyCode===g.a.DELETE&&(ue=this.cursorStart):ue=this.input.value.length,this.fixCaret(ue,ue)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case g.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case g.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Oe){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(y){var B=y;return B===""?B="":this.isNotCompleteNumber(parseFloat(B))?B=this.state.value:B=this.getValidValue(B),this.toNumber(B)}},{key:"getValueFromEvent",value:function(y){var B=y.target.value.trim().replace(/。/g,".");return S(this.props.decimalSeparator)&&(B=B.replace(this.props.decimalSeparator,".")),B}},{key:"getValidValue",value:function(y){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,_=parseFloat(y);return isNaN(_)?y:(_<B&&(_=B),_>F&&(_=F),_)}},{key:"setValue",value:function(y,B){var F=this.props.precision,_=this.isNotCompleteNumber(parseFloat(y))?null:parseFloat(y),M=this.state.value,I=M===void 0?null:M,m=this.state.inputValue,W=m===void 0?null:m,$=typeof _=="number"?_.toFixed(F):"".concat(_),ae=_!==I||$!=="".concat(W);return"value"in this.props?(W=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:W},B)):this.setState({value:_,inputValue:this.toPrecisionAsStep(y)},B),ae&&this.props.onChange(_),_}},{key:"getMaxPrecision",value:function(y){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.props,_=F.precision,M=F.step;if(S(_))return _;var I=this.getPrecision(B),m=this.getPrecision(M),W=this.getPrecision(y);return y?Math.max(W,I+m):I+m}},{key:"getPrecisionFactor",value:function(y){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.getMaxPrecision(y,B);return Math.pow(10,F)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(y){return this.props.formatter?this.props.formatter(y):y}},{key:"toPrecisionAsStep",value:function(y){if(this.isNotCompleteNumber(y)||y==="")return y;var B=Math.abs(this.getMaxPrecision(y));return isNaN(B)?y.toString():Number(y).toFixed(B)}},{key:"toNumber",value:function(y){var B=this.props.precision,F=this.state.focused,_=y&&y.length>16&&F;return this.isNotCompleteNumber(y)||_?y:S(B)?Math.round(y*Math.pow(10,B))/Math.pow(10,B):Number(y)}},{key:"upStep",value:function(y,B){var F=this.props.step,_=this.getPrecisionFactor(y,B),M=Math.abs(this.getMaxPrecision(y,B)),I=((_*y+_*F*B)/_).toFixed(M);return this.toNumber(I)}},{key:"downStep",value:function(y,B){var F=this.props.step,_=this.getPrecisionFactor(y,B),M=Math.abs(this.getMaxPrecision(y,B)),I=((_*y-_*F*B)/_).toFixed(M);return this.toNumber(I)}},{key:"step",value:function(y,B){var F=this,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,M=arguments.length>3?arguments[3]:void 0;this.stop(),B&&(B.persist(),B.preventDefault());var I=this.props;if(I.disabled)return;var m=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(m))return;var W=this["".concat(y,"Step")](m,_),$=W>I.max||W<I.min;if(W>I.max?W=I.max:W<I.min&&(W=I.min),this.setValue(W,null),this.setState({focused:!0},function(){F.pressingUpOrDown=!1}),$)return;this.autoStepTimer=setTimeout(function(){F[y](B,_,!0)},M?a:R)}},{key:"fixCaret",value:function(y,B){if(y===void 0||B===void 0||!this.input||!this.input.value)return;try{var F=this.input.selectionStart,_=this.input.selectionEnd;(y!==F||B!==_)&&this.input.setSelectionRange(y,B)}catch(M){}}},{key:"render",value:function(){var y,B=this.props,F=B.prefixCls,_=B.disabled,M=B.readOnly,I=B.useTouch,m=B.autoComplete,W=B.upHandler,$=B.downHandler,ae=B.className,ue=B.max,Oe=B.min,ve=B.style,Ee=B.title,xe=B.onMouseEnter,Ie=B.onMouseLeave,de=B.onMouseOver,ce=B.onMouseOut,ie=B.required,fe=B.onClick,le=B.tabIndex,ke=B.type,Ne=B.placeholder,Ae=B.id,Le=B.inputMode,Fe=B.pattern,oe=B.step,ge=B.maxLength,we=B.autoFocus,De=B.name,je=B.onPaste,Ve=B.onInput,Je=Object(ne.a)(B,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),Xe=this.state,et=Xe.value,Ze=Xe.focused,rt=v()(F,(y={},Object(J.a)(y,ae,!!ae),Object(J.a)(y,"".concat(F,"-disabled"),_),Object(J.a)(y,"".concat(F,"-focused"),Ze),y)),Be={};Object.keys(Je).forEach(function(me){(me.substr(0,5)==="data-"||me.substr(0,5)==="aria-"||me==="role")&&(Be[me]=Je[me])});var ut=!M&&!_,it=this.getInputDisplayValue(null),He=(et||et===0)&&(isNaN(et)||Number(et)>=ue),We=(et||et===0)&&(isNaN(et)||Number(et)<=Oe),Re=He||_||M,be=We||_||M,Ce=v()("".concat(F,"-handler"),"".concat(F,"-handler-up"),Object(J.a)({},"".concat(F,"-handler-up-disabled"),Re)),re=v()("".concat(F,"-handler"),"".concat(F,"-handler-down"),Object(J.a)({},"".concat(F,"-handler-down-disabled"),be)),se=I?{onTouchStart:Re?o:this.up,onTouchEnd:this.stop}:{onMouseDown:Re?o:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},he=I?{onTouchStart:be?o:this.down,onTouchEnd:this.stop}:{onMouseDown:be?o:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return r.a.createElement("div",{className:rt,style:ve,title:Ee,onMouseEnter:xe,onMouseLeave:Ie,onMouseOver:de,onMouseOut:ce,onFocus:function(){return null},onBlur:function(){return null}},r.a.createElement("div",{className:"".concat(F,"-handler-wrap")},r.a.createElement("span",Object.assign({unselectable:"on"},se,{role:"button","aria-label":"Increase Value","aria-disabled":Re,className:Ce}),W||r.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-up-inner"),onClick:l})),r.a.createElement("span",Object.assign({unselectable:"on"},he,{role:"button","aria-label":"Decrease Value","aria-disabled":be,className:re}),$||r.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-down-inner"),onClick:l}))),r.a.createElement("div",{className:"".concat(F,"-input-wrap")},r.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Oe,"aria-valuemax":ue,"aria-valuenow":et,required:ie,type:ke,placeholder:Ne,onPaste:je,onClick:fe,onMouseUp:this.onMouseUp,className:"".concat(F,"-input"),tabIndex:le,autoComplete:m,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:ut?this.onKeyDown:o,onKeyUp:ut?this.onKeyUp:o,autoFocus:we,maxLength:ge,readOnly:M,disabled:_,max:ue,min:Oe,step:oe,name:De,title:Ee,id:Ae,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(it),pattern:Fe,inputMode:Le,onInput:Ve},Be))))}}]),w}(r.a.Component);A.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:E,min:-E,step:1,style:{},onChange:o,onKeyDown:o,onPressEnter:o,onFocus:o,onBlur:o,parser:s,required:!1,autoComplete:"off"};var O=A,C=ye.a=O},fjLI:function(nt,ye,Q){"use strict";Q.d(ye,"f",function(){return p}),Q.d(ye,"b",function(){return u}),Q.d(ye,"a",function(){return h}),Q.d(ye,"d",function(){return c}),Q.d(ye,"e",function(){return o}),Q.d(ye,"c",function(){return l});var ne=Q("8HAY"),J=Q("Vhoy"),P=Q("MI8n"),Y=Q("JYp7"),j=Q("pmY6"),U=Q("24hK"),z=Q("nnTU"),H=Q("T8No"),r=Q("Cg/j"),L=Q("t9D7"),v=function(s,a,R,E){var S=arguments.length,D=S<3?a:E===null?E=Object.getOwnPropertyDescriptor(a,R):E,A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(s,a,R,E);else for(var O=s.length-1;O>=0;O--)(A=s[O])&&(D=(S<3?A(D):S>3?A(a,R,D):A(a,R))||D);return S>3&&D&&Object.defineProperty(a,R,D),D},g=function(s,a){return function(R,E){a(R,E,s)}};function p(s){return s.command!==void 0}class u{constructor(s){this.id=u._idPool++,this._debugName=s}}u._idPool=0,u.CommandPalette=new u("CommandPalette"),u.EditorContext=new u("EditorContext"),u.SimpleEditorContext=new u("SimpleEditorContext"),u.EditorContextCopy=new u("EditorContextCopy"),u.EditorContextPeek=new u("EditorContextPeek"),u.MenubarEditMenu=new u("MenubarEditMenu"),u.MenubarCopy=new u("MenubarCopy"),u.MenubarGoMenu=new u("MenubarGoMenu"),u.MenubarSelectionMenu=new u("MenubarSelectionMenu"),u.InlineCompletionsActions=new u("InlineCompletionsActions");const h=Object(r.c)("menuService"),c=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new P.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:s=>s===u.CommandPalette}}addCommand(s){return this.addCommands(Y.a.single(s))}addCommands(s){for(const a of s)this._commands.set(a.id,a);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(j.i)(()=>{let a=!1;for(const R of s)a=this._commands.delete(R.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,R)=>s.set(R,a)),s}appendMenuItem(s,a){return this.appendMenuItems(Y.a.single({id:s,item:a}))}appendMenuItems(s){const a=new Set,R=new U.a;for(const{id:E,item:S}of s){let D=this._menuItems.get(E);D||(D=new U.a,this._menuItems.set(E,D)),R.push(D.push(S)),a.add(E)}return this._onDidChangeMenu.fire(a),Object(j.i)(()=>{if(R.size>0){for(let E of R)E();this._onDidChangeMenu.fire(a),R.clear()}})}getMenuItems(s){let a;return this._menuItems.has(s)?a=[...this._menuItems.get(s)]:a=[],s===u.CommandPalette&&this._appendImplicitItems(a),a}_appendImplicitItems(s){const a=new Set;for(const R of s)p(R)&&(a.add(R.command.id),R.alt&&a.add(R.alt.id));this._commands.forEach((R,E)=>{a.has(E)||s.push({command:R})})}};class o extends ne.e{constructor(s,a,R,E){super(`submenuitem.${s.submenu.id}`,typeof s.title=="string"?s.title:s.title.value,[],"submenu");this.item=s,this._menuService=a,this._contextKeyService=R,this._options=E}get actions(){const s=[],a=this._menuService.createMenu(this.item.submenu,this._contextKeyService),R=a.getActions(this._options);a.dispose();for(const[,E]of R)E.length>0&&(s.push(...E),s.push(new ne.d));return s.length&&s.pop(),s}}let l=class s{constructor(a,R,E,S,D){var A,O;if(this._commandService=D,this.id=a.id,this.label=(E==null?void 0:E.renderShortTitle)&&a.shortTitle?typeof a.shortTitle=="string"?a.shortTitle:a.shortTitle.value:typeof a.title=="string"?a.title:a.title.value,this.tooltip=(O=typeof a.tooltip=="string"?a.tooltip:(A=a.tooltip)===null||A===void 0?void 0:A.value)!==null&&O!==void 0?O:"",this.enabled=!a.precondition||S.contextMatchesRules(a.precondition),this.checked=void 0,a.toggled){const C=a.toggled.condition?a.toggled:{condition:a.toggled};this.checked=S.contextMatchesRules(C.condition),this.checked&&C.tooltip&&(this.tooltip=typeof C.tooltip=="string"?C.tooltip:C.tooltip.value),C.title&&(this.label=typeof C.title=="string"?C.title:C.title.value)}this.item=a,this.alt=R?new s(R,void 0,E,S,D):void 0,this._options=E,L.d.isThemeIcon(a.icon)&&(this.class=J.a.asClassName(a.icon))}dispose(){}run(...a){var R,E;let S=[];return((R=this._options)===null||R===void 0?void 0:R.arg)&&(S=[...S,this._options.arg]),((E=this._options)===null||E===void 0?void 0:E.shouldForwardArgs)&&(S=[...S,...a]),this._commandService.executeCommand(this.id,...S)}};l=v([g(3,H.b),g(4,z.b)],l)},gMzb:function(nt,ye,Q){"use strict";var ne=Q("k1fw"),J=Q("oBTY"),P=Q("9og8"),Y=Q("tJVT"),j=Q("sRBo"),U=Q("kaz8"),z=Q("WmNS"),H=Q.n(z),r=Q("q1tI"),L=Q.n(r),v=Q("9kvl"),g=Q("wlus"),p=Q("w5pM"),u=Q("ErOA"),h=Q("OaEy"),c=Q("2fM7"),o=Q("y8nQ"),l=Q("Vl3Y"),s=Q("Ty5D"),a=Q("yQHh"),R=Q.n(a),E=U.a.Group,S=function(f){var w,b,y,B,F,_,M,I,m=f.classroomList,W=f.loading,$=f.user,ae=f.exercise_id,ue=ae===void 0?null:ae,Oe=f.homework_common_id,ve=Oe===void 0?null:Oe,Ee=f.setitem,xe=f.item,Ie=f.type,de=f.rz,ce=f.dispatch,ie=Object(r.useState)([]),fe=Object(Y.a)(ie,2),le=fe[0],ke=fe[1],Ne=Object(r.useState)({zydatas:[],jbdatas:[],kcdatas:[],zsdatas:[],page:1,per_page:20}),Ae=Object(Y.a)(Ne,2),Le=Ae[0],Fe=Ae[1],oe=Object(s.i)(),ge=Object(r.useState)(!1),we=Object(Y.a)(ge,2),De=we[0],je=we[1],Ve=Object(r.useState)(!1),Je=Object(Y.a)(Ve,2),Xe=Je[0],et=Je[1],Ze=l.a.useForm(),rt=Object(Y.a)(Ze,1),Be=rt[0];Object(r.useEffect)(function(){de&&(Le.zydatas=de,Fe(Object(ne.a)({},Le)),xe!=null&&xe.ec_course_id&&ut())},[xe,de]);function ut(){return it.apply(this,arguments)}function it(){return it=Object(P.a)(H.a.mark(function re(){return H.a.wrap(function(he){for(;;)switch(he.prev=he.next){case 0:return console.log("----",xe),he.next=3,He(xe==null?void 0:xe.ec_major_school_id);case 3:return he.next=5,Re(xe==null?void 0:xe.ec_year_id);case 5:return he.next=7,Ce(xe==null?void 0:xe.ec_course_id);case 7:Be.setFieldsValue({ec_course_id:xe==null?void 0:xe.ec_course_id,ec_major_school_id:xe==null?void 0:xe.ec_major_school_id,ec_point_ids:xe==null?void 0:xe.ec_point_ids,ec_year_id:xe==null?void 0:xe.ec_year_id});case 8:case"end":return he.stop()}},re)})),it.apply(this,arguments)}function He(re){return We.apply(this,arguments)}function We(){return We=Object(P.a)(H.a.mark(function re(se){var he;return H.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.next=2,Object(u.a)("/api/ec_major_schools/".concat(se,"/ec_years/get_year_list.json"),{method:"get"});case 2:he=Se.sent,Le.jbdatas=he==null?void 0:he.data,Fe(Object(ne.a)({},Le)),Be.setFieldsValue({ec_year_id:"",ec_course_id:"",ec_point_ids:[]});case 6:case"end":return Se.stop()}},re)})),We.apply(this,arguments)}function Re(re){return be.apply(this,arguments)}function be(){return be=Object(P.a)(H.a.mark(function re(se){var he;return H.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.next=2,Object(u.a)("/api/ec_years/".concat(se,"/ec_courses/get_courses.json"),{method:"get"});case 2:he=Se.sent,Le.kcdatas=he==null?void 0:he.data,Fe(Object(ne.a)({},Le)),Be.setFieldsValue({ec_course_id:"",ec_point_ids:[]});case 6:case"end":return Se.stop()}},re)})),be.apply(this,arguments)}var Ce=function(){var re=Object(P.a)(H.a.mark(function se(he){var me;return H.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:return Ue.next=2,Object(u.a)("/api/ec_courses/".concat(he,"/ec_points.json"),{method:"get",params:{ec_course_id:he}});case 2:me=Ue.sent,Le.zsdatas=me==null?void 0:me.data,Fe(Object(ne.a)({},Le));case 5:case"end":return Ue.stop()}},se)}));return function(he){return re.apply(this,arguments)}}();return L.a.createElement("div",{className:R.a.from},L.a.createElement(l.a,{form:Be,layout:"inline",onValuesChange:function(se){console.log("----",se),se.ec_major_school_id&&(Le.jbdatas=[],Le.kcdatas=[],Le.zsdatas=[],Fe(Object(ne.a)({},Le)),He(se.ec_major_school_id)),se.ec_year_id&&(Le.kcdatas=[],Le.zsdatas=[],Fe(Object(ne.a)({},Le)),Re(se.ec_year_id)),se.ec_course_id&&(Le.zsdatas=[],Fe(Object(ne.a)({},Le)),Ce(se.ec_course_id))},onFinish:function(){var re=Object(P.a)(H.a.mark(function se(he){return H.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:Ee(he);case 1:case"end":return Se.stop()}},se)}));return function(se){return re.apply(this,arguments)}}()},L.a.createElement(l.a.Item,{label:"\u8BA4\u8BC1\u4E13\u4E1A",name:"ec_major_school_id"},L.a.createElement(c.a,{style:{width:150},disabled:((w=Le.zydatas)===null||w===void 0?void 0:w.length)<=0,placeholder:"\u8BF7\u9009\u62E9\u8BA4\u8BC1\u4E13\u4E1A"},Le==null||((b=Le.zydatas)===null||b===void 0)?void 0:b.map(function(re,se){return L.a.createElement(c.a.Option,{key:se,value:re==null?void 0:re.ec_major_school_id},re==null?void 0:re.name)}))),L.a.createElement(l.a.Item,{label:"\u8BA4\u8BC1\u5C4A\u522B",name:"ec_year_id"},L.a.createElement(c.a,{style:{width:150},disabled:((y=Le.jbdatas)===null||y===void 0?void 0:y.length)<=0,placeholder:"\u8BF7\u9009\u62E9\u8BA4\u8BC1\u5C4A\u522B"},Le==null||((B=Le.jbdatas)===null||B===void 0)?void 0:B.map(function(re,se){return L.a.createElement(c.a.Option,{key:se,value:re==null?void 0:re.ec_year_id},re==null?void 0:re.year)}))),L.a.createElement(l.a.Item,{label:"\u8BFE\u7A0B",name:"ec_course_id"},L.a.createElement(c.a,{style:{width:150},disabled:((F=Le.kcdatas)===null||F===void 0?void 0:F.length)<=0,placeholder:"\u8BF7\u9009\u62E9\u8BFE\u7A0B"},Le==null||((_=Le.kcdatas)===null||_===void 0)?void 0:_.map(function(re,se){return L.a.createElement(c.a.Option,{key:se,value:re==null?void 0:re.id},re==null?void 0:re.name)}))),L.a.createElement(l.a.Item,{label:"\u77E5\u8BC6\u70B9",name:"ec_point_ids"},L.a.createElement(c.a,{onChange:function(){Be.submit()},style:{width:150},mode:"multiple",disabled:((M=Le.zsdatas)===null||M===void 0?void 0:M.length)<=0,placeholder:"\u8BF7\u9009\u62E9\u77E5\u8BC6\u70B9"},Le==null||((I=Le.zsdatas)===null||I===void 0)?void 0:I.map(function(re,se){return L.a.createElement(c.a.Option,{key:se,value:re==null?void 0:re.id},re==null?void 0:re.name)})))))},D=Object(v.a)(function(x){var f=x.classroomList,w=x.loading,b=x.globalSetting,y=x.user;return{classroomList:f,globalSetting:b,loading:w.effects,user:y}})(S),A=U.a.Group,O=function(f){var w,b,y,B=f.classroomList,F=f.loading,_=f.user,M=f.exercise_id,I=M===void 0?null:M,m=f.homework_common_id,W=m===void 0?null:m,$=f.setitem,ae=f.type,ue=f.dispatch,Oe=Object(r.useState)([{}]),ve=Object(Y.a)(Oe,2),Ee=ve[0],xe=ve[1],Ie=Object(r.useState)([]),de=Object(Y.a)(Ie,2),ce=de[0],ie=de[1];function fe(){return le.apply(this,arguments)}function le(){return le=Object(P.a)(H.a.mark(function Ae(){var Le,Fe,oe,ge,we;return H.a.wrap(function(je){for(;;)switch(je.prev=je.next){case 0:return je.next=2,Object(u.a)("/api/ec_courses/".concat(0,"/ec_points/get_work_points.json"),{method:"get",params:{exercise_id:I,homework_common_id:W}});case 2:Fe=je.sent,(Fe==null||((Le=Fe.data)===null||Le===void 0)?void 0:Le.length)>0&&(we=[],Fe==null||((oe=Fe.data)===null||oe===void 0)||oe.map(function(Ve){var Je;Ve==null||((Je=Ve.ec_point_ids)===null||Je===void 0)||Je.map(function(Xe){we.push(Xe)})}),$(Object(ne.a)(Object(ne.a)({},Fe==null||((ge=Fe.data)===null||ge===void 0)?void 0:ge[0]),{},{ec_point_ids:we})),xe(Fe==null?void 0:Fe.data));case 4:case"end":return je.stop()}},Ae)})),le.apply(this,arguments)}Object(r.useEffect)(function(){var Ae,Le;_!=null&&(Ae=_.userInfo)!==null&&Ae!==void 0&&(Le=Ae.course)!==null&&Le!==void 0&&Le.course_school_id&&ke()},[_==null||((w=_.userInfo)===null||w===void 0||((b=w.course)===null||b===void 0))?void 0:b.course_school_id]);function ke(){return Ne.apply(this,arguments)}function Ne(){return Ne=Object(P.a)(H.a.mark(function Ae(){var Le,Fe,oe;return H.a.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:return we.next=2,Object(u.a)("/api/schools/".concat(_==null||((Le=_.userInfo)===null||Le===void 0||((Fe=Le.course)===null||Fe===void 0))?void 0:Fe.course_school_id,"/ec_majors/get_major_list.json"),{method:"get"});case 2:oe=we.sent,ie(oe==null?void 0:oe.data),(W||I)&&fe();case 5:case"end":return we.stop()}},Ae)})),Ne.apply(this,arguments)}return console.log(Ee),L.a.createElement("div",{style:{display:(y=_.userInfo.course)!==null&&y!==void 0&&y.is_openengineering?"":"none"}},L.a.createElement("p",{style:{fontSize:"16px",fontWeight:400}},"\u5DE5\u7A0B\u8BA4\u8BC1\u8003\u6838\u77E5\u8BC6\u70B9"),Ee==null?void 0:Ee.map(function(Ae,Le){return L.a.createElement("div",{style:{display:"flex",alignItems:"center",marginBottom:"10px"}},L.a.createElement(D,{rz:ce,item:Ae,type:Le,setitem:function(oe){Ee.splice(Le,1,oe),xe(Object(J.a)(Ee));var ge=[];Ee==null||Ee.map(function(we){var De;we==null||((De=we.ec_point_ids)===null||De===void 0)||De.map(function(je){ge.push(je)})}),$(Object(ne.a)(Object(ne.a)({},oe),{},{ec_point_ids:ge}))}}),Le!=0&&L.a.createElement(g.a,{onClick:function(){Ee.splice(Le,1),xe(Object(J.a)(Ee))},style:{marginLeft:10,fontSize:"20px"}}),L.a.createElement(p.a,{onClick:function(){Ee.push({}),xe(Object(J.a)(Ee))},style:{marginLeft:10,fontSize:"20px"}}))}))},C=ye.a=Object(v.a)(function(x){var f=x.classroomList,w=x.loading,b=x.globalSetting,y=x.user;return{classroomList:f,globalSetting:b,loading:w.effects,user:y}})(O)},h78n:function(nt,ye,Q){"use strict";Q.d(ye,"a",function(){return y});var ne=Q("q1tI"),J=Q.n(ne),P=Q("TSYQ"),Y=Q.n(P),j={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},U=function(_){var M=_.map(function(){return Object(ne.useRef)()}),I=Object(ne.useRef)();return Object(ne.useEffect)(function(){var m=Date.now(),W=!1;Object.keys(M).forEach(function($){var ae=M[$].current;if(!ae)return;W=!0;var ue=ae.style;ue.transitionDuration=".3s, .3s, .3s, .06s",I.current&&m-I.current<100&&(ue.transitionDuration="0s, 0s")}),W&&(I.current=Date.now())}),[M]};function z(){return z=Object.assign||function(F){for(var _=1;_<arguments.length;_++){var M=arguments[_];for(var I in M)Object.prototype.hasOwnProperty.call(M,I)&&(F[I]=M[I])}return F},z.apply(this,arguments)}function H(F,_){return p(F)||g(F,_)||L(F,_)||r()}function r(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L(F,_){if(!F)return;if(typeof F=="string")return v(F,_);var M=Object.prototype.toString.call(F).slice(8,-1);if(M==="Object"&&F.constructor&&(M=F.constructor.name),M==="Map"||M==="Set")return Array.from(F);if(M==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(M))return v(F,_)}function v(F,_){(_==null||_>F.length)&&(_=F.length);for(var M=0,I=new Array(_);M<_;M++)I[M]=F[M];return I}function g(F,_){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(F)))return;var M=[],I=!0,m=!1,W=void 0;try{for(var $=F[Symbol.iterator](),ae;!(I=(ae=$.next()).done)&&!(M.push(ae.value),_&&M.length===_);I=!0);}catch(ue){m=!0,W=ue}finally{try{!I&&$.return!=null&&$.return()}finally{if(m)throw W}}return M}function p(F){if(Array.isArray(F))return F}function u(F,_){if(F==null)return{};var M=h(F,_),I,m;if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(F);for(m=0;m<W.length;m++){if(I=W[m],_.indexOf(I)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(F,I))continue;M[I]=F[I]}}return M}function h(F,_){if(F==null)return{};var M={},I=Object.keys(F),m,W;for(W=0;W<I.length;W++){if(m=I[W],_.indexOf(m)>=0)continue;M[m]=F[m]}return M}var c=function(_){var M=_.className,I=_.percent,m=_.prefixCls,W=_.strokeColor,$=_.strokeLinecap,ae=_.strokeWidth,ue=_.style,Oe=_.trailColor,ve=_.trailWidth,Ee=_.transition,xe=u(_,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete xe.gapPosition;var Ie=Array.isArray(I)?I:[I],de=Array.isArray(W)?W:[W],ce=U(Ie),ie=H(ce,1),fe=ie[0],le=ae/2,ke=100-ae/2,Ne="M ".concat($==="round"?le:0,",").concat(le,`
|
|
L `).concat($==="round"?ke:100,",").concat(le),Ae="0 0 100 ".concat(ae),Le=0;return J.a.createElement("svg",z({className:Y()("".concat(m,"-line"),M),viewBox:Ae,preserveAspectRatio:"none",style:ue},xe),J.a.createElement("path",{className:"".concat(m,"-line-trail"),d:Ne,strokeLinecap:$,stroke:Oe,strokeWidth:ve||ae,fillOpacity:"0"}),Ie.map(function(Fe,oe){var ge={strokeDasharray:"".concat(Fe,"px, 100px"),strokeDashoffset:"-".concat(Le,"px"),transition:Ee||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},we=de[oe]||de[de.length-1];return Le+=Fe,J.a.createElement("path",{key:oe,className:"".concat(m,"-line-path"),d:Ne,strokeLinecap:$,stroke:we,strokeWidth:ae,fillOpacity:"0",ref:fe[oe],style:ge})}))};c.defaultProps=j;var o=c;function l(){return l=Object.assign||function(F){for(var _=1;_<arguments.length;_++){var M=arguments[_];for(var I in M)Object.prototype.hasOwnProperty.call(M,I)&&(F[I]=M[I])}return F},l.apply(this,arguments)}function s(F,_){return D(F)||S(F,_)||R(F,_)||a()}function a(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R(F,_){if(!F)return;if(typeof F=="string")return E(F,_);var M=Object.prototype.toString.call(F).slice(8,-1);if(M==="Object"&&F.constructor&&(M=F.constructor.name),M==="Map"||M==="Set")return Array.from(F);if(M==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(M))return E(F,_)}function E(F,_){(_==null||_>F.length)&&(_=F.length);for(var M=0,I=new Array(_);M<_;M++)I[M]=F[M];return I}function S(F,_){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(F)))return;var M=[],I=!0,m=!1,W=void 0;try{for(var $=F[Symbol.iterator](),ae;!(I=(ae=$.next()).done)&&!(M.push(ae.value),_&&M.length===_);I=!0);}catch(ue){m=!0,W=ue}finally{try{!I&&$.return!=null&&$.return()}finally{if(m)throw W}}return M}function D(F){if(Array.isArray(F))return F}function A(F,_){if(F==null)return{};var M=O(F,_),I,m;if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(F);for(m=0;m<W.length;m++){if(I=W[m],_.indexOf(I)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(F,I))continue;M[I]=F[I]}}return M}function O(F,_){if(F==null)return{};var M={},I=Object.keys(F),m,W;for(W=0;W<I.length;W++){if(m=I[W],_.indexOf(m)>=0)continue;M[m]=F[m]}return M}var C=0;function x(F){return+F.replace("%","")}function f(F){return Array.isArray(F)?F:[F]}function w(F,_,M,I){var m=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,W=arguments.length>5?arguments[5]:void 0,$=50-I/2,ae=0,ue=-$,Oe=0,ve=-2*$;switch(W){case"left":ae=-$,ue=0,Oe=2*$,ve=0;break;case"right":ae=$,ue=0,Oe=-2*$,ve=0;break;case"bottom":ue=$,ve=2*$;break;default:}var Ee="M 50,50 m ".concat(ae,",").concat(ue,`
|
|
a `).concat($,",").concat($," 0 1 1 ").concat(Oe,",").concat(-ve,`
|
|
a `).concat($,",").concat($," 0 1 1 ").concat(-Oe,",").concat(ve),xe=Math.PI*2*$,Ie={stroke:M,strokeDasharray:"".concat(_/100*(xe-m),"px ").concat(xe,"px"),strokeDashoffset:"-".concat(m/2+F/100*(xe-m),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Ee,pathStyle:Ie}}var b=function(_){var M=_.prefixCls,I=_.strokeWidth,m=_.trailWidth,W=_.gapDegree,$=_.gapPosition,ae=_.trailColor,ue=_.strokeLinecap,Oe=_.style,ve=_.className,Ee=_.strokeColor,xe=_.percent,Ie=A(_,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),de=Object(ne.useMemo)(function(){return C+=1,C},[]),ce=w(0,100,ae,I,W,$),ie=ce.pathString,fe=ce.pathStyle,le=f(xe),ke=f(Ee),Ne=ke.find(function(ge){return Object.prototype.toString.call(ge)==="[object Object]"}),Ae=U(le),Le=s(Ae,1),Fe=Le[0],oe=function(){var we=0;return le.map(function(De,je){var Ve=ke[je]||ke[ke.length-1],Je=Object.prototype.toString.call(Ve)==="[object Object]"?"url(#".concat(M,"-gradient-").concat(de,")"):"",Xe=w(we,De,Ve,I,W,$);return we+=De,J.a.createElement("path",{key:je,className:"".concat(M,"-circle-path"),d:Xe.pathString,stroke:Je,strokeLinecap:ue,strokeWidth:I,opacity:De===0?0:1,fillOpacity:"0",style:Xe.pathStyle,ref:Fe[je]})})};return J.a.createElement("svg",l({className:Y()("".concat(M,"-circle"),ve),viewBox:"0 0 100 100",style:Oe},Ie),Ne&&J.a.createElement("defs",null,J.a.createElement("linearGradient",{id:"".concat(M,"-gradient-").concat(de),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Ne).sort(function(ge,we){return x(ge)-x(we)}).map(function(ge,we){return J.a.createElement("stop",{key:we,offset:ge,stopColor:Ne[ge]})}))),J.a.createElement("path",{className:"".concat(M,"-circle-trail"),d:ie,stroke:ae,strokeLinecap:ue,strokeWidth:m||I,fillOpacity:"0",style:fe}),oe().reverse())};b.defaultProps=j;var y=b,B={Line:o,Circle:y}},ic2d:function(nt,ye,Q){"use strict";Q.d(ye,"a",function(){return Y});var ne=Q("FWmy"),J=Q("746U");class P{constructor(){this.data=new Map}add(j,U){ne.a(J.l(j)),ne.a(J.k(U)),ne.a(!this.data.has(j),"There is already an extension with this id"),this.data.set(j,U)}as(j){return this.data.get(j)||null}}const Y=new P},kSUc:function(nt,ye,Q){},lLeG:function(nt,ye,Q){nt.exports={bg:"bg___f0e4_",flexRow:"flexRow___1-S6r",flexJustifyCenter:"flexJustifyCenter___3KkrV",flexAlignEnd:"flexAlignEnd___146T7",flexAlignCenter:"flexAlignCenter___2UVve",flexColumn:"flexColumn___nj9sg",formWrap:"formWrap___2eqbH",titleWrap:"titleWrap___1gkN2",fieldWrap:"fieldWrap___2l5q8",mdWrap:"mdWrap___38Ffu",backgroundFa:"backgroundFa___2gBUv",button:"button___3jgMh"}},lZu9:function(nt,ye,Q){(function(ne){ne(Q("VrN/"),Q("1eCo"),Q("8EBN"))})(function(ne){"use strict";ne.defineMode("markdown",function(J,P){var Y=ne.getMode(J,"text/html"),j=Y.name=="null";function U(I){if(ne.findModeByName){var m=ne.findModeByName(I);m&&(I=m.mime||m.mimes[0])}var W=ne.getMode(J,I);return W.name=="null"?null:W}P.highlightFormatting===void 0&&(P.highlightFormatting=!1),P.maxBlockquoteDepth===void 0&&(P.maxBlockquoteDepth=0),P.taskLists===void 0&&(P.taskLists=!1),P.strikethrough===void 0&&(P.strikethrough=!1),P.emoji===void 0&&(P.emoji=!1),P.fencedCodeBlockHighlighting===void 0&&(P.fencedCodeBlockHighlighting=!0),P.fencedCodeBlockDefaultMode===void 0&&(P.fencedCodeBlockDefaultMode="text/plain"),P.xml===void 0&&(P.xml=!0),P.tokenTypeOverrides===void 0&&(P.tokenTypeOverrides={});var z={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 z)z.hasOwnProperty(H)&&P.tokenTypeOverrides[H]&&(z[H]=P.tokenTypeOverrides[H]);var r=/^([*\-_])(?:\s*\1){2,}\s*$/,L=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,v=/^\[(x| )\](?=\s)/i,g=P.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,p=/^ {0,3}(?:\={1,}|-{2,})\s*$/,u=/^[^#!\[\]*_\\<>` "'(~:]+/,h=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,c=/^\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]/,l=" ";function s(I,m,W){return m.f=m.inline=W,W(I,m)}function a(I,m,W){return m.f=m.block=W,W(I,m)}function R(I){return!I||!/\S/.test(I.string)}function E(I){if(I.linkTitle=!1,I.linkHref=!1,I.linkText=!1,I.em=!1,I.strong=!1,I.strikethrough=!1,I.quote=0,I.indentedCode=!1,I.f==D){var m=j;if(!m){var W=ne.innerMode(Y,I.htmlState);m=W.mode.name=="xml"&&W.state.tagStart===null&&!W.state.context&&W.state.tokenize.isInText}m&&(I.f=x,I.block=S,I.htmlState=null)}return I.trailingSpace=0,I.trailingSpaceNewLine=!1,I.prevLine=I.thisLine,I.thisLine={stream:null},null}function S(I,m){var W=I.column()===m.indentation,$=R(m.prevLine.stream),ae=m.indentedCode,ue=m.prevLine.hr,Oe=m.list!==!1,ve=(m.listStack[m.listStack.length-1]||0)+3;m.indentedCode=!1;var Ee=m.indentation;if(m.indentationDiff===null&&(m.indentationDiff=m.indentation,Oe)){for(m.list=null;Ee<m.listStack[m.listStack.length-1];)m.listStack.pop(),m.listStack.length?m.indentation=m.listStack[m.listStack.length-1]:m.list=!1;m.list!==!1&&(m.indentationDiff=Ee-m.listStack[m.listStack.length-1])}var xe=!$&&!ue&&!m.prevLine.header&&(!Oe||!ae)&&!m.prevLine.fencedCodeEnd,Ie=(m.list===!1||ue||$)&&m.indentation<=ve&&I.match(r),de=null;if(m.indentationDiff>=4&&(ae||m.prevLine.fencedCodeEnd||m.prevLine.header||$))return I.skipToEnd(),m.indentedCode=!0,z.code;if(I.eatSpace())return null;if(W&&m.indentation<=ve&&(de=I.match(g))&&de[1].length<=6)return m.quote=0,m.header=de[1].length,m.thisLine.header=!0,P.highlightFormatting&&(m.formatting="header"),m.f=m.inline,O(m);if(m.indentation<=ve&&I.eat(">"))return m.quote=W?1:m.quote+1,P.highlightFormatting&&(m.formatting="quote"),I.eatSpace(),O(m);if(!Ie&&!m.setext&&W&&m.indentation<=ve&&(de=I.match(L))){var ce=de[1]?"ol":"ul";return m.indentation=Ee+I.current().length,m.list=!0,m.quote=0,m.listStack.push(m.indentation),m.em=!1,m.strong=!1,m.code=!1,m.strikethrough=!1,P.taskLists&&I.match(v,!1)&&(m.taskList=!0),m.f=m.inline,P.highlightFormatting&&(m.formatting=["list","list-"+ce]),O(m)}else{if(W&&m.indentation<=ve&&(de=I.match(h,!0)))return m.quote=0,m.fencedEndRE=new RegExp(de[1]+"+ *$"),m.localMode=P.fencedCodeBlockHighlighting&&U(de[2]||P.fencedCodeBlockDefaultMode),m.localMode&&(m.localState=ne.startState(m.localMode)),m.f=m.block=A,P.highlightFormatting&&(m.formatting="code-block"),m.code=-1,O(m);if(m.setext||(!xe||!Oe)&&!m.quote&&m.list===!1&&!m.code&&!Ie&&!c.test(I.string)&&(de=I.lookAhead(1))&&(de=de.match(p)))return m.setext?(m.header=m.setext,m.setext=0,I.skipToEnd(),P.highlightFormatting&&(m.formatting="header")):(m.header=de[0].charAt(0)=="="?1:2,m.setext=m.header),m.thisLine.header=!0,m.f=m.inline,O(m);if(Ie)return I.skipToEnd(),m.hr=!0,m.thisLine.hr=!0,z.hr;if(I.peek()==="[")return s(I,m,B)}return s(I,m,m.inline)}function D(I,m){var W=Y.token(I,m.htmlState);if(!j){var $=ne.innerMode(Y,m.htmlState);($.mode.name=="xml"&&$.state.tagStart===null&&!$.state.context&&$.state.tokenize.isInText||m.md_inside&&I.current().indexOf(">")>-1)&&(m.f=x,m.block=S,m.htmlState=null)}return W}function A(I,m){var W=m.listStack[m.listStack.length-1]||0,$=m.indentation<W,ae=W+3;if(m.fencedEndRE&&m.indentation<=ae&&($||I.match(m.fencedEndRE))){P.highlightFormatting&&(m.formatting="code-block");var ue;return $||(ue=O(m)),m.localMode=m.localState=null,m.block=S,m.f=x,m.fencedEndRE=null,m.code=0,m.thisLine.fencedCodeEnd=!0,$?a(I,m,m.block):ue}else return m.localMode?m.localMode.token(I,m.localState):(I.skipToEnd(),z.code)}function O(I){var m=[];if(I.formatting){m.push(z.formatting),typeof I.formatting=="string"&&(I.formatting=[I.formatting]);for(var W=0;W<I.formatting.length;W++)m.push(z.formatting+"-"+I.formatting[W]),I.formatting[W]==="header"&&m.push(z.formatting+"-"+I.formatting[W]+"-"+I.header),I.formatting[W]==="quote"&&(!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=I.quote?m.push(z.formatting+"-"+I.formatting[W]+"-"+I.quote):m.push("error"))}if(I.taskOpen)return m.push("meta"),m.length?m.join(" "):null;if(I.taskClosed)return m.push("property"),m.length?m.join(" "):null;if(I.linkHref?m.push(z.linkHref,"url"):(I.strong&&m.push(z.strong),I.em&&m.push(z.em),I.strikethrough&&m.push(z.strikethrough),I.emoji&&m.push(z.emoji),I.linkText&&m.push(z.linkText),I.code&&m.push(z.code),I.image&&m.push(z.image),I.imageAltText&&m.push(z.imageAltText,"link"),I.imageMarker&&m.push(z.imageMarker)),I.header&&m.push(z.header,z.header+"-"+I.header),I.quote&&(m.push(z.quote),!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=I.quote?m.push(z.quote+"-"+I.quote):m.push(z.quote+"-"+P.maxBlockquoteDepth)),I.list!==!1){var $=(I.listStack.length-1)%3;$?$===1?m.push(z.list2):m.push(z.list3):m.push(z.list1)}return I.trailingSpaceNewLine?m.push("trailing-space-new-line"):I.trailingSpace&&m.push("trailing-space-"+(I.trailingSpace%2?"a":"b")),m.length?m.join(" "):null}function C(I,m){return I.match(u,!0)?O(m):void 0}function x(I,m){var W=m.text(I,m);if(typeof W!="undefined")return W;if(m.list)return m.list=null,O(m);if(m.taskList){var $=I.match(v,!0)[1]===" ";return $?m.taskOpen=!0:m.taskClosed=!0,P.highlightFormatting&&(m.formatting="task"),m.taskList=!1,O(m)}if(m.taskOpen=!1,m.taskClosed=!1,m.header&&I.match(/^#+$/,!0))return P.highlightFormatting&&(m.formatting="header"),O(m);var ae=I.next();if(m.linkTitle){m.linkTitle=!1;var ue=ae;ae==="("&&(ue=")"),ue=(ue+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Oe="^\\s*(?:[^"+ue+"\\\\]+|\\\\\\\\|\\\\.)"+ue;if(I.match(new RegExp(Oe),!0))return z.linkHref}if(ae==="`"){var ve=m.formatting;P.highlightFormatting&&(m.formatting="code"),I.eatWhile("`");var Ee=I.current().length;if(m.code==0&&(!m.quote||Ee==1))return m.code=Ee,O(m);if(Ee==m.code){var xe=O(m);return m.code=0,xe}else return m.formatting=ve,O(m)}else if(m.code)return O(m);if(ae==="\\"&&(I.next(),P.highlightFormatting)){var Ie=O(m),de=z.formatting+"-escape";return Ie?Ie+" "+de:de}if(ae==="!"&&I.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return m.imageMarker=!0,m.image=!0,P.highlightFormatting&&(m.formatting="image"),O(m);if(ae==="["&&m.imageMarker&&I.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return m.imageMarker=!1,m.imageAltText=!0,P.highlightFormatting&&(m.formatting="image"),O(m);if(ae==="]"&&m.imageAltText){P.highlightFormatting&&(m.formatting="image");var Ie=O(m);return m.imageAltText=!1,m.image=!1,m.inline=m.f=w,Ie}if(ae==="["&&!m.image)return m.linkText&&I.match(/^.*?\]/)||(m.linkText=!0,P.highlightFormatting&&(m.formatting="link")),O(m);if(ae==="]"&&m.linkText){P.highlightFormatting&&(m.formatting="link");var Ie=O(m);return m.linkText=!1,m.inline=m.f=I.match(/\(.*?\)| ?\[.*?\]/,!1)?w:x,Ie}if(ae==="<"&&I.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){m.f=m.inline=f,P.highlightFormatting&&(m.formatting="link");var Ie=O(m);return Ie?Ie+=" ":Ie="",Ie+z.linkInline}if(ae==="<"&&I.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){m.f=m.inline=f,P.highlightFormatting&&(m.formatting="link");var Ie=O(m);return Ie?Ie+=" ":Ie="",Ie+z.linkEmail}if(P.xml&&ae==="<"&&I.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ce=I.string.indexOf(">",I.pos);if(ce!=-1){var ie=I.string.substring(I.start,ce);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ie)&&(m.md_inside=!0)}return I.backUp(1),m.htmlState=ne.startState(Y),a(I,m,D)}if(P.xml&&ae==="<"&&I.match(/^\/\w*?>/))return m.md_inside=!1,"tag";if(ae==="*"||ae==="_"){for(var fe=1,le=I.pos==1?" ":I.string.charAt(I.pos-2);fe<3&&I.eat(ae);)fe++;var ke=I.peek()||" ",Ne=!/\s/.test(ke)&&(!o.test(ke)||/\s/.test(le)||o.test(le)),Ae=!/\s/.test(le)&&(!o.test(le)||/\s/.test(ke)||o.test(ke)),Le=null,Fe=null;if(fe%2&&(!m.em&&Ne&&(ae==="*"||!Ae||o.test(le))?Le=!0:m.em==ae&&Ae&&(ae==="*"||!Ne||o.test(ke))&&(Le=!1)),fe>1&&(!m.strong&&Ne&&(ae==="*"||!Ae||o.test(le))?Fe=!0:m.strong==ae&&Ae&&(ae==="*"||!Ne||o.test(ke))&&(Fe=!1)),Fe!=null||Le!=null){P.highlightFormatting&&(m.formatting=Le==null?"strong":Fe==null?"em":"strong em"),Le===!0&&(m.em=ae),Fe===!0&&(m.strong=ae);var xe=O(m);return Le===!1&&(m.em=!1),Fe===!1&&(m.strong=!1),xe}}else if(ae===" "&&(I.eat("*")||I.eat("_"))){if(I.peek()===" ")return O(m);I.backUp(1)}if(P.strikethrough){if(ae==="~"&&I.eatWhile(ae)){if(m.strikethrough){P.highlightFormatting&&(m.formatting="strikethrough");var xe=O(m);return m.strikethrough=!1,xe}else if(I.match(/^[^\s]/,!1))return m.strikethrough=!0,P.highlightFormatting&&(m.formatting="strikethrough"),O(m)}else if(ae===" "&&I.match(/^~~/,!0)){if(I.peek()===" ")return O(m);I.backUp(2)}}if(P.emoji&&ae===":"&&I.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){m.emoji=!0,P.highlightFormatting&&(m.formatting="emoji");var oe=O(m);return m.emoji=!1,oe}return ae===" "&&(I.match(/^ +$/,!1)?m.trailingSpace++:m.trailingSpace&&(m.trailingSpaceNewLine=!0)),O(m)}function f(I,m){var W=I.next();if(W===">"){m.f=m.inline=x,P.highlightFormatting&&(m.formatting="link");var $=O(m);return $?$+=" ":$="",$+z.linkInline}return I.match(/^[^>]+/,!0),z.linkInline}function w(I,m){if(I.eatSpace())return null;var W=I.next();return W==="("||W==="["?(m.f=m.inline=y(W==="("?")":"]"),P.highlightFormatting&&(m.formatting="link-string"),m.linkHref=!0,O(m)):"error"}var b={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function y(I){return function(m,W){var $=m.next();if($===I){W.f=W.inline=x,P.highlightFormatting&&(W.formatting="link-string");var ae=O(W);return W.linkHref=!1,ae}return m.match(b[I]),W.linkHref=!0,O(W)}}function B(I,m){return I.match(/^([^\]\\]|\\.)*\]:/,!1)?(m.f=F,I.next(),P.highlightFormatting&&(m.formatting="link"),m.linkText=!0,O(m)):s(I,m,x)}function F(I,m){if(I.match(/^\]:/,!0)){m.f=m.inline=_,P.highlightFormatting&&(m.formatting="link");var W=O(m);return m.linkText=!1,W}return I.match(/^([^\]\\]|\\.)+/,!0),z.linkText}function _(I,m){return I.eatSpace()?null:(I.match(/^[^\s]+/,!0),I.peek()===void 0?m.linkTitle=!0:I.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),m.f=m.inline=x,z.linkHref+" url")}var M={startState:function(){return{f:S,prevLine:{stream:null},thisLine:{stream:null},block:S,htmlState:null,indentation:0,inline:x,text:C,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(I){return{f:I.f,prevLine:I.prevLine,thisLine:I.thisLine,block:I.block,htmlState:I.htmlState&&ne.copyState(Y,I.htmlState),indentation:I.indentation,localMode:I.localMode,localState:I.localMode?ne.copyState(I.localMode,I.localState):null,inline:I.inline,text:I.text,formatting:!1,linkText:I.linkText,linkTitle:I.linkTitle,linkHref:I.linkHref,code:I.code,em:I.em,strong:I.strong,strikethrough:I.strikethrough,emoji:I.emoji,header:I.header,setext:I.setext,hr:I.hr,taskList:I.taskList,list:I.list,listStack:I.listStack.slice(0),quote:I.quote,indentedCode:I.indentedCode,trailingSpace:I.trailingSpace,trailingSpaceNewLine:I.trailingSpaceNewLine,md_inside:I.md_inside,fencedEndRE:I.fencedEndRE}},token:function(I,m){if(m.formatting=!1,I!=m.thisLine.stream){if(m.header=0,m.hr=!1,I.match(/^\s*$/,!0))return E(m),null;if(m.prevLine=m.thisLine,m.thisLine={stream:I},m.taskList=!1,m.trailingSpace=0,m.trailingSpaceNewLine=!1,!m.localState&&(m.f=m.block,m.f!=D)){var W=I.match(/^\s*/,!0)[0].replace(/\t/g,l).length;if(m.indentation=W,m.indentationDiff=null,W>0)return null}}return m.f(I,m)},innerMode:function(I){return I.block==D?{state:I.htmlState,mode:Y}:I.localState?{state:I.localState,mode:I.localMode}:{state:I,mode:M}},indent:function(I,m,W){return I.block==D&&Y.indent?Y.indent(I.htmlState,m,W):I.localState&&I.localMode.indent?I.localMode.indent(I.localState,m,W):ne.Pass},blankLine:E,getType:O,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return M},"xml"),ne.defineMIME("text/markdown","markdown"),ne.defineMIME("text/x-markdown","markdown")})},nEHx:function(nt,ye,Q){"use strict";Q.d(ye,"a",function(){return ne});var ne;(function(J){J.DARK="dark",J.LIGHT="light",J.HIGH_CONTRAST="hc"})(ne||(ne={}))},nnTU:function(nt,ye,Q){"use strict";Q.d(ye,"b",function(){return z}),Q.d(ye,"a",function(){return H});var ne=Q("MI8n"),J=Q("JYp7"),P=Q("pmY6"),Y=Q("24hK"),j=Q("746U"),U=Q("Cg/j");const z=Object(U.c)("commandService"),H=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ne.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(r,L){if(!r)throw new Error("invalid command");if(typeof r=="string"){if(!L)throw new Error("invalid command");return this.registerCommand({id:r,handler:L})}if(r.description){const h=[];for(let o of r.description.args)h.push(o.constraint);const c=r.handler;r.handler=function(o,...l){return Object(j.o)(l,h),c(o,...l)}}const{id:v}=r;let g=this._commands.get(v);g||(g=new Y.a,this._commands.set(v,g));let p=g.unshift(r),u=Object(P.i)(()=>{p();const h=this._commands.get(v);(h==null?void 0:h.isEmpty())&&this._commands.delete(v)});return this._onDidRegisterCommand.fire(v),u}registerCommandAlias(r,L){return H.registerCommand(r,(v,...g)=>v.get(z).executeCommand(L,...g))}getCommand(r){const L=this._commands.get(r);return!L||L.isEmpty()?void 0:J.a.first(L)}getCommands(){const r=new Map;for(const L of this._commands.keys()){const v=this.getCommand(L);v&&r.set(L,v)}return r}};H.registerCommand("noop",()=>{})},osHv:function(nt,ye,Q){(function(ne){ne(Q("VrN/"))})(function(ne){"use strict";var J=ne.Pos;function P(o,l){return o.line-l.line||o.ch-l.ch}var Y="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",j=Y+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",U=new RegExp("<(/?)(["+Y+"]["+j+"]*)","g");function z(o,l,s,a){this.line=l,this.ch=s,this.cm=o,this.text=o.getLine(l),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,l){var s=o.cm.getTokenTypeAt(J(o.line,l));return s&&/\btag\b/.test(s)}function r(o){return o.line>=o.max?void 0:(o.ch=0,o.text=o.cm.getLine(++o.line),!0)}function L(o){return o.line<=o.min?void 0:(o.text=o.cm.getLine(--o.line),o.ch=o.text.length,!0)}function v(o){for(;;){var l=o.text.indexOf(">",o.ch);if(l==-1){if(r(o))continue;return}if(!H(o,l+1)){o.ch=l+1;continue}var s=o.text.lastIndexOf("/",l),a=s>-1&&!/\S/.test(o.text.slice(s+1,l));return o.ch=l+1,a?"selfClose":"regular"}}function g(o){for(;;){var l=o.ch?o.text.lastIndexOf("<",o.ch-1):-1;if(l==-1){if(L(o))continue;return}if(!H(o,l+1)){o.ch=l;continue}U.lastIndex=l,o.ch=l;var s=U.exec(o.text);if(s&&s.index==l)return s}}function p(o){for(;;){U.lastIndex=o.ch;var l=U.exec(o.text);if(!l){if(r(o))continue;return}if(!H(o,l.index+1)){o.ch=l.index+1;continue}return o.ch=l.index+l[0].length,l}}function u(o){for(;;){var l=o.ch?o.text.lastIndexOf(">",o.ch-1):-1;if(l==-1){if(L(o))continue;return}if(!H(o,l+1)){o.ch=l;continue}var s=o.text.lastIndexOf("/",l),a=s>-1&&!/\S/.test(o.text.slice(s+1,l));return o.ch=l+1,a?"selfClose":"regular"}}function h(o,l){for(var s=[];;){var a=p(o),R,E=o.line,S=o.ch-(a?a[0].length:0);if(!a||!(R=v(o)))return;if(R=="selfClose")continue;if(a[1]){for(var D=s.length-1;D>=0;--D)if(s[D]==a[2]){s.length=D;break}if(D<0&&(!l||l==a[2]))return{tag:a[2],from:J(E,S),to:J(o.line,o.ch)}}else s.push(a[2])}}function c(o,l){for(var s=[];;){var a=u(o);if(!a)return;if(a=="selfClose"){g(o);continue}var R=o.line,E=o.ch,S=g(o);if(!S)return;if(S[1])s.push(S[2]);else{for(var D=s.length-1;D>=0;--D)if(s[D]==S[2]){s.length=D;break}if(D<0&&(!l||l==S[2]))return{tag:S[2],from:J(o.line,o.ch),to:J(R,E)}}}}ne.registerHelper("fold","xml",function(o,l){for(var s=new z(o,l.line,0);;){var a=p(s);if(!a||s.line!=l.line)return;var R=v(s);if(!R)return;if(!a[1]&&R!="selfClose"){var E=J(s.line,s.ch),S=h(s,a[2]);return S&&P(S.from,E)>0?{from:E,to:S.from}:null}}}),ne.findMatchingTag=function(o,l,s){var a=new z(o,l.line,l.ch,s);if(a.text.indexOf(">")==-1&&a.text.indexOf("<")==-1)return;var R=v(a),E=R&&J(a.line,a.ch),S=R&&g(a);if(!R||!S||P(a,l)>0)return;var D={from:J(a.line,a.ch),to:E,tag:S[2]};return R=="selfClose"?{open:D,close:null,at:"open"}:S[1]?{open:c(a,S[2]),close:D,at:"close"}:(a=new z(o,E.line,E.ch,s),{open:D,close:h(a,S[2]),at:"open"})},ne.findEnclosingTag=function(o,l,s,a){for(var R=new z(o,l.line,l.ch,s);;){var E=c(R,a);if(!E)break;var S=new z(o,l.line,l.ch,s),D=h(S,E.tag);if(D)return{open:E,close:D}}},ne.scanForClosingTag=function(o,l,s,a){var R=new z(o,l.line,l.ch,a?{from:0,to:a}:null);return h(R,s)}})},p5ED:function(nt,ye,Q){"use strict";var ne=Q("+L6B"),J=Q("2/Rp"),P=Q("5Dmo"),Y=Q("3S7+"),j=Q("k1fw"),U=Q("tJVT"),z=Q("q1tI"),H=Q.n(z),r=Q("vHTk"),L=Q.n(r),v=Q("yEEn"),g=Q("ZW9T"),p=Q("1vsH");ye.a=function(u){var h=u.name,c=u.data,o=u.theme,l=u.type,s=u.filename,a=u.monacoEditor,R=u.className,E=u.style,S=u.close,D=u.onClose,A=u.hasMask,O=Object(z.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),C=Object(U.a)(O,2),x=C[0],f=C[1],w=Object(z.useState)(""),b=Object(U.a)(w,2),y=b[0],B=b[1],F,_=1024*1024,M=10*_,I=Object(z.useRef)();l==="office"&&(F=Object(p.T)(c).filesize,F>M&&(l="other")),s&&(a.filename=s),Object(z.useEffect)(function(){var $,ae,ue=($=document.cookie)===null||$===void 0||((ae=$.replace(/\s/g,""))===null||ae===void 0)?void 0:ae.split(";");ue==null||ue.map(function(Oe){var ve=Oe.split("=");ve[0]==="_educoder_session"&&B(ve[1])})},[]);var m=function(){if(c.startsWith("http")||c.startsWith("/")){W();return}Object(p.z)(s||"educoder",c,s)},W=function(){Object(p.x)(s||h,c)};return console.log("data:",c,"fileanme:",s," name:",h),H.a.createElement("div",{style:Object(j.a)({},E||{}),className:"".concat(A&&L.a.bgBlack," ").concat(l?L.a.wrp:"hide")},S&&H.a.createElement("div",{className:L.a.close,ref:I},H.a.createElement(Y.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return I.current}},H.a.createElement("span",{onClick:W},H.a.createElement("i",{className:"icon-quxiaozhiding"}))),H.a.createElement(Y.a,{title:"\u5173\u95ED",getPopupContainer:function(){return I.current}},H.a.createElement("span",{className:"",onClick:D},H.a.createElement("i",{className:"icon-guanbi1"})))),H.a.createElement("div",{className:"".concat(L.a[R]," ").concat(R," ").concat(L.a.monaco," ").concat(l==="txt"?"show":"hide")},l==="txt"&&H.a.createElement(g.b,a)),l==="audio"&&H.a.createElement("audio",{src:"".concat(c!=null&&c.startsWith("/")||(c==null?void 0:c.indexOf("https://"))>-1?c:"data:audio/mp3;base64,").concat(c),autoPlay:!0}),l==="video"&&H.a.createElement(H.a.Fragment,null,c!=null&&c.startsWith("/")?H.a.createElement("video",{controls:!0,src:"".concat(c),autoPlay:!0}):H.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(c),autoPlay:!0})),l==="html"&&H.a.createElement("iframe",{src:c+"&disposition=inline"}),l==="pdf"&&H.a.createElement("embed",{className:L.a.embed,src:c}),l==="image"&&H.a.createElement(H.a.Fragment,null,H.a.createElement("img",{src:"".concat(c!=null&&c.startsWith("/")||(c==null?void 0:c.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(c)})),l==="other"&&H.a.createElement("div",null,H.a.createElement(J.a,{type:"primary",size:"large",onClick:m},H.a.createElement(v.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(l==="download"||l==="office")&&H.a.createElement(J.a,{type:"primary",size:"large",onClick:m},H.a.createElement(v.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(nt,ye,Q){},pmY6:function(nt,ye,Q){"use strict";Q.d(ye,"h",function(){return L}),Q.d(ye,"g",function(){return g}),Q.d(ye,"f",function(){return p}),Q.d(ye,"e",function(){return u}),Q.d(ye,"i",function(){return h}),Q.d(ye,"b",function(){return c}),Q.d(ye,"a",function(){return o}),Q.d(ye,"d",function(){return l}),Q.d(ye,"c",function(){return s});var ne=Q("C/vA"),J=Q("JYp7");const P=!1;let Y=null;function j(a){Y=a}if(P){const a="__is_disposable_tracked__";j(new class{trackDisposable(R){const E=new Error("Potentially leaked disposable").stack;setTimeout(()=>{R[a]||console.log(E)},3e3)}setParent(R,E){if(R&&R!==o.None)try{R[a]=!0}catch(S){}}markAsDisposed(R){if(R&&R!==o.None)try{R[a]=!0}catch(E){}}markAsSingleton(R){}})}function U(a){return Y==null||Y.trackDisposable(a),a}function z(a){Y==null||Y.markAsDisposed(a)}function H(a,R){Y==null||Y.setParent(a,R)}function r(a,R){if(!Y)return;for(const E of a)Y.setParent(E,R)}function L(a){return Y==null||Y.markAsSingleton(a),a}class v extends Error{constructor(a){super(`Encountered errors while disposing of store. Errors: [${a.join(", ")}]`);this.errors=a}}function g(a){return typeof a.dispose=="function"&&a.dispose.length===0}function p(a){if(J.a.is(a)){let R=[];for(const E of a)if(E)try{E.dispose()}catch(S){R.push(S)}if(R.length===1)throw R[0];if(R.length>1)throw new v(R);return Array.isArray(a)?[]:a}else if(a)return a.dispose(),a}function u(...a){const R=h(()=>p(a));return r(a,R),R}function h(a){const R=U({dispose:Object(ne.a)(()=>{z(R),a()})});return R}class c{constructor(){this._toDispose=new Set,this._isDisposed=!1,U(this)}dispose(){if(this._isDisposed)return;z(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?c.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}}c.DISABLE_DISPOSED_WARNING=!1;class o{constructor(){this._store=new c,U(this),H(this._store,this)}dispose(){z(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 l{constructor(){this._isDisposed=!1,U(this)}get value(){return this._isDisposed?void 0:this._value}set value(a){var R;if(this._isDisposed||a===this._value)return;(R=this._value)===null||R===void 0||R.dispose(),a&&H(a,this),this._value=a}clear(){this.value=void 0}dispose(){var a;this._isDisposed=!0,z(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(nt,ye,Q){var ne,J;(function(){var P;(function(){"use strict";var z=[,,function(v){function g(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=[]}g.prototype.clone_empty=function(){var h=new g(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},g.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},g.prototype.has_match=function(h){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(h))return!0;return!1},g.prototype.set_indent=function(h,c){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=c||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},g.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)},g.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},g.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},g.prototype.is_empty=function(){return this.__items.length===0},g.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},g.prototype.push=function(h){this.__items.push(h);var c=h.lastIndexOf(`
|
|
`);c!==-1?this.__character_count=h.length-c:this.__character_count+=h.length},g.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},g.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},g.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},g.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},g.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,c){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)),c=c||"",h.indent_level>0&&(c=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}p.prototype.get_indent_size=function(h,c){var o=this.__base_string_length;return c=c||0,h<0&&(o=0),o+=h*this.__indent_size,o+=c,o},p.prototype.get_indent_string=function(h,c){var o=this.__base_string;return c=c||0,h<0&&(h=0,o=""),c+=h*this.__indent_size,this.__ensure_cache(c),o+=this.__cache[c],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,c=0,o="";this.__indent_size&&h>=this.__indent_size&&(c=Math.floor(h/this.__indent_size),h-=c*this.__indent_size,o=new Array(c+1).join(this.__indent_string)),h&&(o+=new Array(h+1).join(" ")),this.__cache.push(o)};function u(h,c){this.__indent_cache=new p(h,c),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 g(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}u.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},u.prototype.get_line_number=function(){return this.__lines.length},u.prototype.get_indent_string=function(h,c){return this.__indent_cache.get_indent_string(h,c)},u.prototype.get_indent_size=function(h,c){return this.__indent_cache.get_indent_size(h,c)},u.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},u.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},u.prototype.get_code=function(h){this.trim(!0);var c=this.current_line.pop();c&&(c[c.length-1]===`
|
|
`&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
|
|
`);return h!==`
|
|
`&&(o=o.replace(/[\n]/g,h)),o},u.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},u.prototype.set_indent=function(h,c){return h=h||0,c=c||0,this.next_line.set_indent(h,c),this.__lines.length>1?(this.current_line.set_indent(h,c),!0):(this.current_line.set_indent(),!1)},u.prototype.add_raw_token=function(h){for(var c=0;c<h.newlines;c++)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},u.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()},u.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},u.prototype.remove_indent=function(h){for(var c=this.__lines.length;h<c;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},u.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},u.prototype.just_added_newline=function(){return this.current_line.is_empty()},u.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},u.prototype.ensure_empty_line_above=function(h,c){for(var o=this.__lines.length-2;o>=0;){var l=this.__lines[o];if(l.is_empty())break;if(l.item(0).indexOf(h)!==0&&l.item(-1)!==c){this.__lines.splice(o+1,0,new g(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},v.exports.Output=u},function(v){function g(p,u,h,c){this.type=p,this.text=u,this.comments_before=null,this.newlines=h||0,this.whitespace_before=c||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}v.exports.Token=g},,,function(v){function g(h,c){this.raw_options=p(h,c),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"])}g.prototype._get_array=function(h,c){var o=this.raw_options[h],l=c||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(l=o.concat()):typeof o=="string"&&(l=o.split(/[^a-zA-Z0-9_\/\-]+/)),l},g.prototype._get_boolean=function(h,c){var o=this.raw_options[h],l=o===void 0?!!c:!!o;return l},g.prototype._get_characters=function(h,c){var o=this.raw_options[h],l=c||"";return typeof o=="string"&&(l=o.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),l},g.prototype._get_number=function(h,c){var o=this.raw_options[h];c=parseInt(c,10),isNaN(c)&&(c=0);var l=parseInt(o,10);return isNaN(l)&&(l=c),l},g.prototype._get_selection=function(h,c,o){var l=this._get_selection_list(h,c,o);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[h]+"'");return l[0]},g.prototype._get_selection_list=function(h,c,o){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[c[0]],!this._is_valid_selection(o,c))throw new Error("Invalid Default Value!");var l=this._get_array(h,o);if(!this._is_valid_selection(l,c))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[h]+"'");return l},g.prototype._is_valid_selection=function(h,c){return h.length&&c.length&&!h.some(function(o){return c.indexOf(o)===-1})};function p(h,c){var o={};h=u(h);var l;for(l in h)l!==c&&(o[l]=h[l]);if(c&&h[c])for(l in h[c])o[l]=h[c][l];return o}function u(h){var c={},o;for(o in h){var l=o.replace(/-/g,"_");c[l]=h[o]}return c}v.exports.Options=g,v.exports.normalizeOpts=u,v.exports.mergeOpts=p},,function(v){var g=RegExp.prototype.hasOwnProperty("sticky");function p(u){this.__input=u||"",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 u=null;return this.hasNext()&&(u=this.__input.charAt(this.__position),this.__position+=1),u},p.prototype.peek=function(u){var h=null;return u=u||0,u+=this.__position,u>=0&&u<this.__input_length&&(h=this.__input.charAt(u)),h},p.prototype.__match=function(u,h){u.lastIndex=h;var c=u.exec(this.__input);return c&&!(g&&u.sticky)&&(c.index!==h&&(c=null)),c},p.prototype.test=function(u,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(u,h):!1},p.prototype.testChar=function(u,h){var c=this.peek(h);return u.lastIndex=0,c!==null&&u.test(c)},p.prototype.match=function(u){var h=this.__match(u,this.__position);return h?this.__position+=h[0].length:h=null,h},p.prototype.read=function(u,h,c){var o="",l;return u&&(l=this.match(u),l&&(o+=l[0])),h&&(l||!u)&&(o+=this.readUntil(h,c)),o},p.prototype.readUntil=function(u,h){var c="",o=this.__position;u.lastIndex=this.__position;var l=u.exec(this.__input);return l?(o=l.index,h&&(o+=l[0].length)):o=this.__input_length,c=this.__input.substring(this.__position,o),this.__position=o,c},p.prototype.readUntilAfter=function(u){return this.readUntil(u,!0)},p.prototype.get_regexp=function(u,h){var c=null,o="g";return h&&g&&(o="y"),typeof u=="string"&&u!==""?c=new RegExp(u,o):u&&(c=new RegExp(u.source,o)),c},p.prototype.get_literal_regexp=function(u){return RegExp(u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(u){var h=this.__position,c=this.readUntilAfter(u);return this.__position=h,c},p.prototype.lookBack=function(u){var h=this.__position-1;return h>=u.length&&this.__input.substring(h-u.length,h).toLowerCase()===u},v.exports.InputScanner=p},function(v,g,p){var u=p(8).InputScanner,h=p(3).Token,c=p(10).TokenStream,o=p(11).WhitespacePattern,l={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(a,R){this._input=new u(a),this._options=R||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new c,this._reset();for(var a,R=new h(l.START,""),E=null,S=[],D=new c;R.type!==l.EOF;){for(a=this._get_next_token(R,E);this._is_comment(a);)D.add(a),a=this._get_next_token(R,E);D.isEmpty()||(a.comments_before=D,D=new c),a.parent=E,this._is_opening(a)?(S.push(E),E=a):E&&this._is_closing(a,E)&&(a.opened=E,E.closed=a,E=S.pop(),a.parent=E),a.previous=R,R.next=a,this.__tokens.add(a),R=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,R){this._readWhitespace();var E=this._input.read(/.+/g);return E?this._create_token(l.RAW,E):this._create_token(l.EOF,"")},s.prototype._is_comment=function(a){return!1},s.prototype._is_opening=function(a){return!1},s.prototype._is_closing=function(a,R){return!1},s.prototype._create_token=function(a,R){var E=new h(a,R,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return E},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},v.exports.Tokenizer=s,v.exports.TOKEN=l},function(v){function g(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}g.prototype.restart=function(){this.__position=0},g.prototype.isEmpty=function(){return this.__tokens_length===0},g.prototype.hasNext=function(){return this.__position<this.__tokens_length},g.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__tokens[this.__position],this.__position+=1),p},g.prototype.peek=function(p){var u=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(u=this.__tokens[p]),u},g.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},v.exports.TokenStream=g},function(v,g,p){var u=p(12).Pattern;function h(c,o){u.call(this,c,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 u,h.prototype.__set_whitespace_patterns=function(c,o){c+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+c+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 c=this._input.read(this._match_pattern);if(c===" ")this.whitespace_before_token=" ";else if(c){var o=this.__split(this._newline_regexp,c);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return c},h.prototype.matching=function(c,o){var l=this._create();return l.__set_whitespace_patterns(c,o),l._update(),l},h.prototype._create=function(){return new h(this._input,this)},h.prototype.__split=function(c,o){c.lastIndex=0;for(var l=0,s=[],a=c.exec(o);a;)s.push(o.substring(l,a.index)),l=a.index+a[0].length,a=c.exec(o);return l<o.length?s.push(o.substring(l,o.length)):s.push(""),s},v.exports.WhitespacePattern=h},function(v){function g(p,u){this._input=p,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,u&&(this._starting_pattern=this._input.get_regexp(u._starting_pattern,!0),this._match_pattern=this._input.get_regexp(u._match_pattern,!0),this._until_pattern=this._input.get_regexp(u._until_pattern),this._until_after=u._until_after)}g.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},g.prototype.read_match=function(){return this._input.match(this._match_pattern)},g.prototype.until_after=function(p){var u=this._create();return u._until_after=!0,u._until_pattern=this._input.get_regexp(p),u._update(),u},g.prototype.until=function(p){var u=this._create();return u._until_after=!1,u._until_pattern=this._input.get_regexp(p),u._update(),u},g.prototype.starting_with=function(p){var u=this._create();return u._starting_pattern=this._input.get_regexp(p,!0),u._update(),u},g.prototype.matching=function(p){var u=this._create();return u._match_pattern=this._input.get_regexp(p,!0),u._update(),u},g.prototype._create=function(){return new g(this._input,this)},g.prototype._update=function(){},v.exports.Pattern=g},function(v){function g(p,u){p=typeof p=="string"?p:p.source,u=typeof u=="string"?u:u.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+u,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+u,"g")}g.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var u={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(p);h;)u[h[1]]=h[2],h=this.__directive_pattern.exec(p);return u},g.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},v.exports.Directives=g},function(v,g,p){var u=p(12).Pattern,h={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function c(o,l){u.call(this,o,l),this.__template_pattern=null,this._disabled=Object.assign({},h),this._excluded=Object.assign({},h),l&&(this.__template_pattern=this._input.get_regexp(l.__template_pattern),this._excluded=Object.assign(this._excluded,l._excluded),this._disabled=Object.assign(this._disabled,l._disabled));var s=new u(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}/)}}c.prototype=new u,c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){this.__set_templated_pattern()},c.prototype.disable=function(o){var l=this._create();return l._disabled[o]=!0,l._update(),l},c.prototype.read_options=function(o){var l=this._create();for(var s in h)l._disabled[s]=o.templating.indexOf(s)===-1;return l._update(),l},c.prototype.exclude=function(o){var l=this._create();return l._excluded[o]=!0,l._update(),l},c.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 l=this._read_template();l;)this._match_pattern?l+=this._input.read(this._match_pattern):l+=this._input.readUntil(this.__template_pattern),o+=l,l=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},c.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("|")+")")},c.prototype._read_template=function(){var o="",l=this._input.peek();if(l==="<"){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 l==="{"&&(!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=c},,,,function(v,g,p){var u=p(19).Beautifier,h=p(20).Options;function c(o,l,s,a){var R=new u(o,l,s,a);return R.beautify()}v.exports=c,v.exports.defaultOptions=function(){return new h}},function(v,g,p){var u=p(20).Options,h=p(2).Output,c=p(21).Tokenizer,o=p(21).TOKEN,l=/\r\n|[\r\n]/,s=/\r\n|[\r\n]/g,a=function(w,b){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=w.max_preserve_newlines,this.preserve_newlines=w.preserve_newlines,this._output=new h(w,b)};a.prototype.current_line_has_match=function(w){return this._output.current_line.has_match(w)},a.prototype.set_space_before_token=function(w,b){this._output.space_before_token=w,this._output.non_breaking_space=b},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(w){this._output.add_raw_token(w)},a.prototype.print_preserved_newlines=function(w){var b=0;w.type!==o.TEXT&&w.previous.type!==o.TEXT&&(b=w.newlines?1:0),this.preserve_newlines&&(b=w.newlines<this.max_preserve_newlines+1?w.newlines:this.max_preserve_newlines+1);for(var y=0;y<b;y++)this.print_newline(y>0);return b!==0},a.prototype.traverse_whitespace=function(w){return w.whitespace_before||w.newlines?(this.print_preserved_newlines(w)||(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(w){this._output.add_new_line(w)},a.prototype.print_token=function(w){w.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(w.text))},a.prototype.indent=function(){this.indent_level++},a.prototype.get_full_indent=function(w){return w=this.indent_level+(w||0),w<1?"":this._output.get_indent_string(w)};var R=function(w){for(var b=null,y=w.next;y.type!==o.EOF&&w.closed!==y;){if(y.type===o.ATTRIBUTE&&y.text==="type"){y.next&&y.next.type===o.EQUALS&&y.next.next&&y.next.next.type===o.VALUE&&(b=y.next.next.text);break}y=y.next}return b},E=function(w,b){var y=null,B=null;return b.closed?(w==="script"?y="text/javascript":w==="style"&&(y="text/css"),y=R(b)||y,y.search("text/css")>-1?B="css":y.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?B="javascript":y.search(/(text|application|dojo)\/(x-)?(html)/)>-1?B="html":y.search(/test\/null/)>-1&&(B="null"),B):null};function S(w,b){return b.indexOf(w)!==-1}function D(w,b,y){this.parent=w||null,this.tag=b?b.tag_name:"",this.indent_level=y||0,this.parser_token=b||null}function A(w){this._printer=w,this._current_frame=null}A.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},A.prototype.record_tag=function(w){var b=new D(this._current_frame,w,this._printer.indent_level);this._current_frame=b},A.prototype._try_pop_frame=function(w){var b=null;return w&&(b=w.parser_token,this._printer.indent_level=w.indent_level,this._current_frame=w.parent),b},A.prototype._get_frame=function(w,b){for(var y=this._current_frame;y&&!(w.indexOf(y.tag)!==-1);){if(b&&b.indexOf(y.tag)!==-1){y=null;break}y=y.parent}return y},A.prototype.try_pop=function(w,b){var y=this._get_frame([w],b);return this._try_pop_frame(y)},A.prototype.indent_to_tag=function(w){var b=this._get_frame(w);b&&(this._printer.indent_level=b.indent_level)};function O(w,b,y,B){this._source_text=w||"",b=b||{},this._js_beautify=y,this._css_beautify=B,this._tag_stack=null;var F=new u(b,"html");this._options=F,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}O.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var w=this._source_text,b=this._options.eol;this._options.eol==="auto"&&(b=`
|
|
`,w&&l.test(w)&&(b=w.match(l)[0])),w=w.replace(s,`
|
|
`);var y=w.match(/^[\t ]*/)[0],B={text:"",type:""},F=new C,_=new a(this._options,y),M=new c(w,this._options).tokenize();this._tag_stack=new A(_);for(var I=null,m=M.next();m.type!==o.EOF;)m.type===o.TAG_OPEN||m.type===o.COMMENT?(I=this._handle_tag_open(_,m,F,B),F=I):m.type===o.ATTRIBUTE||m.type===o.EQUALS||m.type===o.VALUE||m.type===o.TEXT&&!F.tag_complete?I=this._handle_inside_tag(_,m,F,M):m.type===o.TAG_CLOSE?I=this._handle_tag_close(_,m,F):m.type===o.TEXT?I=this._handle_text(_,m,F):_.add_raw_token(m),B=I,m=M.next();var W=_._output.get_code(b);return W},O.prototype._handle_tag_close=function(w,b,y){var B={text:b.text,type:b.type};return w.alignment_size=0,y.tag_complete=!0,w.set_space_before_token(b.newlines||b.whitespace_before!=="",!0),y.is_unformatted?w.add_raw_token(b):(y.tag_start_char==="<"&&(w.set_space_before_token(b.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&y.has_wrapped_attrs&&w.print_newline(!1)),w.print_token(b)),y.indent_content&&!(y.is_unformatted||y.is_content_unformatted)&&(w.indent(),y.indent_content=!1),!y.is_inline_element&&!(y.is_unformatted||y.is_content_unformatted)&&w.set_wrap_point(),B},O.prototype._handle_inside_tag=function(w,b,y,B){var F=y.has_wrapped_attrs,_={text:b.text,type:b.type};if(w.set_space_before_token(b.newlines||b.whitespace_before!=="",!0),y.is_unformatted)w.add_raw_token(b);else if(y.tag_start_char==="{"&&b.type===o.TEXT)w.print_preserved_newlines(b)?(b.newlines=0,w.add_raw_token(b)):w.print_token(b);else{if(b.type===o.ATTRIBUTE?(w.set_space_before_token(!0),y.attr_count+=1):(b.type===o.EQUALS||b.type===o.VALUE&&b.previous.type===o.EQUALS)&&w.set_space_before_token(!1),b.type===o.ATTRIBUTE&&y.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(w.traverse_whitespace(b),F=F||b.newlines!==0),this._is_wrap_attributes_force)){var M=y.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&y.attr_count===1){var I=!0,m=0,W;do{if(W=B.peek(m),W.type===o.ATTRIBUTE){I=!1;break}m+=1}while(m<4&&W.type!==o.EOF&&W.type!==o.TAG_CLOSE);M=!I}M&&(w.print_newline(!1),F=!0)}w.print_token(b),F=F||w.previous_token_wrapped(),y.has_wrapped_attrs=F}return _},O.prototype._handle_text=function(w,b,y){var B={text:b.text,type:"TK_CONTENT"};return y.custom_beautifier_name?this._print_custom_beatifier_text(w,b,y):y.is_unformatted||y.is_content_unformatted?w.add_raw_token(b):(w.traverse_whitespace(b),w.print_token(b)),B},O.prototype._print_custom_beatifier_text=function(w,b,y){var B=this;if(b.text!==""){var F=b.text,_,M=1,I="",m="";y.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?_=this._js_beautify:y.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?_=this._css_beautify:y.custom_beautifier_name==="html"&&(_=function(ve,Ee){var xe=new O(ve,Ee,B._js_beautify,B._css_beautify);return xe.beautify()}),this._options.indent_scripts==="keep"?M=0:this._options.indent_scripts==="separate"&&(M=-w.indent_level);var W=w.get_full_indent(M);if(F=F.replace(/\n[ \t]*$/,""),y.custom_beautifier_name!=="html"&&F[0]==="<"&&F.match(/^(<!--|<!\[CDATA\[)/)){var $=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(F);if(!$){w.add_raw_token(b);return}I=W+$[1]+`
|
|
`,F=$[4],$[5]&&(m=W+$[5]),F=F.replace(/\n[ \t]*$/,""),($[2]||$[3].indexOf(`
|
|
`)!==-1)&&($=$[3].match(/[ \t]+$/),$&&(b.whitespace_before=$[0]))}if(F)if(_){var ae=function(){this.eol=`
|
|
`};ae.prototype=this._options.raw_options;var ue=new ae;F=_(W+F,ue)}else{var Oe=b.whitespace_before;Oe&&(F=F.replace(new RegExp(`
|
|
(`+Oe+")?","g"),`
|
|
`)),F=W+F.replace(/\n/g,`
|
|
`+W)}I&&(F?F=I+F+`
|
|
`+m:F=I+m),w.print_newline(!1),F&&(b.text=F,b.whitespace_before="",b.newlines=0,w.add_raw_token(b),w.print_newline(!0))}},O.prototype._handle_tag_open=function(w,b,y,B){var F=this._get_tag_open_token(b);return(y.is_unformatted||y.is_content_unformatted)&&!y.is_empty_element&&b.type===o.TAG_OPEN&&b.text.indexOf("</")===0?(w.add_raw_token(b),F.start_tag_token=this._tag_stack.try_pop(F.tag_name)):(w.traverse_whitespace(b),this._set_tag_position(w,b,F,y,B),F.is_inline_element||w.set_wrap_point(),w.print_token(b)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(F.alignment_size=b.text.length+1),!F.tag_complete&&!F.is_unformatted&&(w.alignment_size=F.alignment_size),F};var C=function(w,b){if(this.parent=w||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!b)this.tag_complete=!0;else{var y;this.tag_start_char=b.text[0],this.text=b.text,this.tag_start_char==="<"?(y=b.text.match(/^<([^\s>]*)/),this.tag_check=y?y[1]:""):(y=b.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=y?y[1]:"",(b.text.startsWith("{{#>")||b.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&b.next!==null?this.tag_check=b.next.text.split(" ")[0]:this.tag_check=b.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),b.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||b.closed&&b.closed.text==="/>";var B=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(B=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(B)))}};O.prototype._get_tag_open_token=function(w){var b=new C(this._tag_stack.get_parser_token(),w);return b.alignment_size=this._options.wrap_attributes_indent_size,b.is_end_tag=b.is_end_tag||S(b.tag_check,this._options.void_elements),b.is_empty_element=b.tag_complete||b.is_start_tag&&b.is_end_tag,b.is_unformatted=!b.tag_complete&&S(b.tag_check,this._options.unformatted),b.is_content_unformatted=!b.is_empty_element&&S(b.tag_check,this._options.content_unformatted),b.is_inline_element=S(b.tag_name,this._options.inline)||b.tag_name.includes("-")||b.tag_start_char==="{",b},O.prototype._set_tag_position=function(w,b,y,B,F){if(y.is_empty_element||(y.is_end_tag?y.start_tag_token=this._tag_stack.try_pop(y.tag_name):(this._do_optional_end_element(y)&&(y.is_inline_element||w.print_newline(!1)),this._tag_stack.record_tag(y),(y.tag_name==="script"||y.tag_name==="style")&&!(y.is_unformatted||y.is_content_unformatted)&&(y.custom_beautifier_name=E(y.tag_check,b)))),S(y.tag_check,this._options.extra_liners)&&(w.print_newline(!1),w._output.just_added_blankline()||w.print_newline(!0)),y.is_empty_element){if(y.tag_start_char==="{"&&y.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),y.indent_content=!0;var _=w.current_line_has_match(/{{#if/);_||w.print_newline(!1)}y.tag_name==="!--"&&F.type===o.TAG_CLOSE&&B.is_end_tag&&y.text.indexOf(`
|
|
`)===-1||(y.is_inline_element||y.is_unformatted||w.print_newline(!1),this._calcluate_parent_multiline(w,y))}else if(y.is_end_tag){var M=!1;M=y.start_tag_token&&y.start_tag_token.multiline_content,M=M||!y.is_inline_element&&!(B.is_inline_element||B.is_unformatted)&&!(F.type===o.TAG_CLOSE&&y.start_tag_token===B)&&F.type!=="TK_CONTENT",(y.is_content_unformatted||y.is_unformatted)&&(M=!1),M&&w.print_newline(!1)}else y.indent_content=!y.custom_beautifier_name,y.tag_start_char==="<"&&(y.tag_name==="html"?y.indent_content=this._options.indent_inner_html:y.tag_name==="head"?y.indent_content=this._options.indent_head_inner_html:y.tag_name==="body"&&(y.indent_content=this._options.indent_body_inner_html)),!(y.is_inline_element||y.is_unformatted)&&(F.type!=="TK_CONTENT"||y.is_content_unformatted)&&w.print_newline(!1),this._calcluate_parent_multiline(w,y)},O.prototype._calcluate_parent_multiline=function(w,b){b.parent&&w._output.just_added_newline()&&!((b.is_inline_element||b.is_unformatted)&&b.parent.is_inline_element)&&(b.parent.multiline_content=!0)};var x=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],f=["a","audio","del","ins","map","noscript","video"];O.prototype._do_optional_end_element=function(w){var b=null;if(w.is_empty_element||!w.is_start_tag||!w.parent)return;if(w.tag_name==="body")b=b||this._tag_stack.try_pop("head");else if(w.tag_name==="li")b=b||this._tag_stack.try_pop("li",["ol","ul"]);else if(w.tag_name==="dd"||w.tag_name==="dt")b=b||this._tag_stack.try_pop("dt",["dl"]),b=b||this._tag_stack.try_pop("dd",["dl"]);else if(w.parent.tag_name==="p"&&x.indexOf(w.tag_name)!==-1){var y=w.parent.parent;(!y||f.indexOf(y.tag_name)===-1)&&(b=b||this._tag_stack.try_pop("p"))}else w.tag_name==="rp"||w.tag_name==="rt"?(b=b||this._tag_stack.try_pop("rt",["ruby","rtc"]),b=b||this._tag_stack.try_pop("rp",["ruby","rtc"])):w.tag_name==="optgroup"?b=b||this._tag_stack.try_pop("optgroup",["select"]):w.tag_name==="option"?b=b||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):w.tag_name==="colgroup"?b=b||this._tag_stack.try_pop("caption",["table"]):w.tag_name==="thead"?(b=b||this._tag_stack.try_pop("caption",["table"]),b=b||this._tag_stack.try_pop("colgroup",["table"])):w.tag_name==="tbody"||w.tag_name==="tfoot"?(b=b||this._tag_stack.try_pop("caption",["table"]),b=b||this._tag_stack.try_pop("colgroup",["table"]),b=b||this._tag_stack.try_pop("thead",["table"]),b=b||this._tag_stack.try_pop("tbody",["table"])):w.tag_name==="tr"?(b=b||this._tag_stack.try_pop("caption",["table"]),b=b||this._tag_stack.try_pop("colgroup",["table"]),b=b||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(w.tag_name==="th"||w.tag_name==="td")&&(b=b||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),b=b||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return w.parent=this._tag_stack.get_parser_token(),b},v.exports.Beautifier=O},function(v,g,p){var u=p(6).Options;function h(c){u.call(this,c,"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 u,v.exports.Options=h},function(v,g,p){var u=p(9).Tokenizer,h=p(9).TOKEN,c=p(13).Directives,o=p(14).TemplatablePattern,l=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 c(/<\!--/,/-->/),R=function(E,S){u.call(this,E,S),this._current_tag_name="";var D=new o(this._input).read_options(this._options),A=new l(this._input);if(this.__patterns={word:D.until(/[\n\r\t <]/),single_quote:D.until_after(/'/),double_quote:D.until_after(/"/),attribute:D.until(/[\n\r\t =>]|\/>/),element_name:D.until(/[\n\r\t >\/]/),handlebars_comment:A.starting_with(/{{!--/).until_after(/--}}/),handlebars:A.starting_with(/{{/).until_after(/}}/),handlebars_open:A.until(/[\n\r\t }]/),handlebars_raw_close:A.until(/}}/),comment:A.starting_with(/<!--/).until_after(/-->/),cdata:A.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:A.starting_with(/<!\[/).until_after(/]>/),processing:A.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 O=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=A.matching(O).until_after(O)}};R.prototype=new u,R.prototype._is_comment=function(E){return!1},R.prototype._is_opening=function(E){return E.type===s.TAG_OPEN},R.prototype._is_closing=function(E,S){return E.type===s.TAG_CLOSE&&S&&((E.text===">"||E.text==="/>")&&S.text[0]==="<"||E.text==="}}"&&S.text[0]==="{"&&S.text[1]==="{")},R.prototype._reset=function(){this._current_tag_name=""},R.prototype._get_next_token=function(E,S){var D=null;this._readWhitespace();var A=this._input.peek();return A===null?this._create_token(s.EOF,""):(D=D||this._read_open_handlebars(A,S),D=D||this._read_attribute(A,E,S),D=D||this._read_close(A,S),D=D||this._read_raw_content(A,E,S),D=D||this._read_content_word(A),D=D||this._read_comment_or_cdata(A),D=D||this._read_processing(A),D=D||this._read_open(A,S),D=D||this._create_token(s.UNKNOWN,this._input.next()),D)},R.prototype._read_comment_or_cdata=function(E){var S=null,D=null,A=null;if(E==="<"){var O=this._input.peek(1);O==="!"&&(D=this.__patterns.comment.read(),D?(A=a.get_directives(D),A&&A.ignore==="start"&&(D+=a.readIgnored(this._input))):D=this.__patterns.cdata.read()),D&&(S=this._create_token(s.COMMENT,D),S.directives=A)}return S},R.prototype._read_processing=function(E){var S=null,D=null,A=null;if(E==="<"){var O=this._input.peek(1);(O==="!"||O==="?")&&(D=this.__patterns.conditional_comment.read(),D=D||this.__patterns.processing.read()),D&&(S=this._create_token(s.COMMENT,D),S.directives=A)}return S},R.prototype._read_open=function(E,S){var D=null,A=null;return S||E==="<"&&(D=this._input.next(),this._input.peek()==="/"&&(D+=this._input.next()),D+=this.__patterns.element_name.read(),A=this._create_token(s.TAG_OPEN,D)),A},R.prototype._read_open_handlebars=function(E,S){var D=null,A=null;return S||this._options.indent_handlebars&&E==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(D=this.__patterns.handlebars_comment.read(),D=D||this.__patterns.handlebars.read(),A=this._create_token(s.COMMENT,D)):(D=this.__patterns.handlebars_open.read(),A=this._create_token(s.TAG_OPEN,D))),A},R.prototype._read_close=function(E,S){var D=null,A=null;return S&&(S.text[0]==="<"&&(E===">"||E==="/"&&this._input.peek(1)===">")?(D=this._input.next(),E==="/"&&(D+=this._input.next()),A=this._create_token(s.TAG_CLOSE,D)):S.text[0]==="{"&&E==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),A=this._create_token(s.TAG_CLOSE,"}}"))),A},R.prototype._read_attribute=function(E,S,D){var A=null,O="";if(D&&D.text[0]==="<")if(E==="=")A=this._create_token(s.EQUALS,this._input.next());else if(E==='"'||E==="'"){var C=this._input.next();E==='"'?C+=this.__patterns.double_quote.read():C+=this.__patterns.single_quote.read(),A=this._create_token(s.VALUE,C)}else O=this.__patterns.attribute.read(),O&&(S.type===s.EQUALS?A=this._create_token(s.VALUE,O):A=this._create_token(s.ATTRIBUTE,O));return A},R.prototype._is_content_unformatted=function(E){return this._options.void_elements.indexOf(E)===-1&&(this._options.content_unformatted.indexOf(E)!==-1||this._options.unformatted.indexOf(E)!==-1)},R.prototype._read_raw_content=function(E,S,D){var A="";if(D&&D.text[0]==="{")A=this.__patterns.handlebars_raw_close.read();else if(S.type===s.TAG_CLOSE&&S.opened.text[0]==="<"&&S.text[0]!=="/"){var O=S.opened.text.substr(1).toLowerCase();if(O==="script"||O==="style"){var C=this._read_comment_or_cdata(E);if(C)return C.type=s.TEXT,C;A=this._input.readUntil(new RegExp("</"+O+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(O)&&(A=this._input.readUntil(new RegExp("</"+O+"[\\n\\r\\t ]*?>","ig")))}return A?this._create_token(s.TEXT,A):null},R.prototype._read_content_word=function(E){var S="";if(this._options.unformatted_content_delimiter&&(E===this._options.unformatted_content_delimiter[0]&&(S=this.__patterns.unformatted_content_delimiter.read())),S||(S=this.__patterns.word.read()),S)return this._create_token(s.TEXT,S)},v.exports.Tokenizer=R,v.exports.TOKEN=s}],H={};function r(v){var g=H[v];if(g!==void 0)return g.exports;var p=H[v]={exports:{}};return z[v](p,p.exports,r),p.exports}var L=r(18);P=L})();var Y=P;if(!0)!(ne=[Q,Q("6UM0"),Q("TXwP")],J=function(z){var H=Q("6UM0"),r=Q("TXwP");return{html_beautify:function(L,v){return Y(L,v,H.js_beautify,r.css_beautify)}}}.apply(ye,ne),J!==void 0&&(nt.exports=J));else var j,U})()},"rAM+":function(nt,ye,Q){"use strict";Q.d(ye,"a",function(){return J});var ne=Q("Qw5x");function J(P,Y){var j;if(typeof Symbol=="undefined"||P[Symbol.iterator]==null){if(Array.isArray(P)||(j=Object(ne.a)(P))||Y&&P&&typeof P.length=="number"){j&&(P=j);var U=0,z=function(){};return{s:z,n:function(){return U>=P.length?{done:!0}:{done:!1,value:P[U++]}},e:function(g){throw g},f:z}}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,r=!1,L;return{s:function(){j=P[Symbol.iterator]()},n:function(){var g=j.next();return H=g.done,g},e:function(g){r=!0,L=g},f:function(){try{!H&&j.return!=null&&j.return()}finally{if(r)throw L}}}}},rUJ1:function(nt,ye){const Q=/[&<>"']/,ne=/[&<>"']/g,J=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,Y={"&":"&","<":"<",">":">",'"':""","'":"'"},j=A=>Y[A];function U(A,O){if(O){if(Q.test(A))return A.replace(ne,j)}else if(J.test(A))return A.replace(P,j);return A}const z=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function H(A){return A.replace(z,(O,C)=>(C=C.toLowerCase(),C==="colon"?":":C.charAt(0)==="#"?C.charAt(1)==="x"?String.fromCharCode(parseInt(C.substring(2),16)):String.fromCharCode(+C.substring(1)):""))}const r=/(^|[^\[])\^/g;function L(A,O){A=A.source||A,O=O||"";const C={replace:(x,f)=>(f=f.source||f,f=f.replace(r,"$1"),A=A.replace(x,f),C),getRegex:()=>new RegExp(A,O)};return C}const v=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(A,O,C){if(A){let x;try{x=decodeURIComponent(H(C)).replace(v,"").toLowerCase()}catch(f){return null}if(x.indexOf("javascript:")===0||x.indexOf("vbscript:")===0||x.indexOf("data:")===0)return null}O&&!g.test(C)&&(C=l(O,C));try{C=encodeURI(C).replace(/%25/g,"%")}catch(x){return null}return C}const u={},h=/^[^:]+:\/*[^/]*$/,c=/^([^:]+:)[\s\S]*$/,o=/^([^:]+:\/*[^/]*)[\s\S]*$/;function l(A,O){u[" "+A]||(h.test(A)?u[" "+A]=A+"/":u[" "+A]=E(A,"/",!0)),A=u[" "+A];const C=A.indexOf(":")===-1;return O.substring(0,2)==="//"?C?O:A.replace(c,"$1")+O:O.charAt(0)==="/"?C?O:A.replace(o,"$1")+O:A+O}const s={exec:function(){}};function a(A){let O=1,C,x;for(;O<arguments.length;O++){C=arguments[O];for(x in C)Object.prototype.hasOwnProperty.call(C,x)&&(A[x]=C[x])}return A}function R(A,O){const C=A.replace(/\|/g,(w,b,y)=>{let B=!1,F=b;for(;--F>=0&&y[F]==="\\";)B=!B;return B?"|":" |"}),x=C.split(/ \|/);let f=0;if(x.length>O)x.splice(O);else for(;x.length<O;)x.push("");for(;f<x.length;f++)x[f]=x[f].trim().replace(/\\\|/g,"|");return x}function E(A,O,C){const x=A.length;if(x===0)return"";let f=0;for(;f<x;){const w=A.charAt(x-f-1);if(w===O&&!C)f++;else if(w!==O&&C)f++;else break}return A.substr(0,x-f)}function S(A,O){if(A.indexOf(O[1])===-1)return-1;const C=A.length;let x=0,f=0;for(;f<C;f++)if(A[f]==="\\")f++;else if(A[f]===O[0])x++;else if(A[f]===O[1]&&(x--,x<0))return f;return-1}function D(A){A&&A.sanitize&&!A.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}nt.exports={escape:U,unescape:H,edit:L,cleanUrl:p,resolveUrl:l,noopTest:s,merge:a,splitCells:R,rtrim:E,findClosingBracket:S,checkSanitizeDeprecation:D}},t9D7:function(nt,ye,Q){"use strict";Q.d(ye,"b",function(){return z}),Q.d(ye,"g",function(){return r}),Q.d(ye,"d",function(){return L}),Q.d(ye,"e",function(){return v}),Q.d(ye,"a",function(){return g}),Q.d(ye,"f",function(){return h}),Q.d(ye,"c",function(){return c});var ne=Q("Vhoy"),J=Q("MI8n"),P=Q("pmY6"),Y=Q("Cg/j"),j=Q("ic2d"),U=Q("nEHx");const z=Object(Y.c)("themeService");var H;(function(o){function l(s){return s&&typeof s=="object"&&typeof s.id=="string"}o.isThemeColor=l})(H||(H={}));function r(o){return{id:o}}var L;(function(o){function l(D){return D&&typeof D=="object"&&typeof D.id=="string"&&(typeof D.color=="undefined"||H.isThemeColor(D.color))}o.isThemeIcon=l;const s=new RegExp(`^\\$\\((${ne.a.iconNameExpression}(?:${ne.a.iconModifierExpression})?)\\)$`);function a(D){const A=s.exec(D);if(!A)return;let[,O]=A;return{id:O}}o.fromString=a;function R(D,A){let O=D.id;const C=O.lastIndexOf("~");return C!==-1&&(O=O.substring(0,C)),A&&(O=`${O}~${A}`),{id:O}}o.modify=R;function E(D,A){var O,C;return D.id===A.id&&((O=D.color)===null||O===void 0?void 0:O.id)===((C=A.color)===null||C===void 0?void 0:C.id)}o.isEqual=E;function S(D,A){return{id:D.id,color:A?r(A):void 0}}o.asThemeIcon=S,o.asClassNameArray=ne.a.asClassNameArray,o.asClassName=ne.a.asClassName,o.asCSSSelector=ne.a.asCSSSelector})(L||(L={}));function v(o){switch(o){case U.a.DARK:return"vs-dark";case U.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const g={ThemingContribution:"base.contributions.theming"};class p{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new J.b}onColorThemeChange(o){return this.themingParticipants.push(o),this.onThemingParticipantAddedEmitter.fire(o),Object(P.i)(()=>{const l=this.themingParticipants.indexOf(o);this.themingParticipants.splice(l,1)})}getThemingParticipants(){return this.themingParticipants}}let u=new p;j.a.add(g.ThemingContribution,u);function h(o){return u.onColorThemeChange(o)}class c extends P.a{constructor(o){super();this.themeService=o,this.theme=o.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(l=>this.onThemeChange(l)))}onThemeChange(o){this.theme=o,this.updateStyles()}updateStyles(){}}},tt94:function(nt,ye,Q){"use strict";Q.r(ye);var ne=Q("+L6B"),J=Q("2/Rp"),P=Q("sRBo"),Y=Q("kaz8"),j=Q("14J3"),U=Q("BMrR"),z=Q("jCWc"),H=Q("kPKH"),r=Q("giR+"),L=Q("fyUT"),v=Q("5NDa"),g=Q("5rEg"),p=Q("sPJy"),u=Q("bE4q"),h=Q("k1fw"),c=Q("miYZ"),o=Q("tsqr"),l=Q("9og8"),s=Q("y8nQ"),a=Q("Vl3Y"),R=Q("tJVT"),E=Q("WmNS"),S=Q.n(E),D=Q("q1tI"),A=Q.n(D),O=Q("9kvl"),C=Q("55Ip"),x=Q("1vsH"),f=Q("Ot1p"),w=Q("XYT7"),b=Q("lLeG"),y=Q.n(b),B=Q("500L"),F=Q("gMzb"),_=Q("ErOA"),M=function(m){var W,$=m.shixunHomeworks,ae=m.newCourse,ue=m.globalSetting,Oe=m.loading,ve=m.dispatch,Ee=m.match,xe=a.a.useForm(),Ie=Object(R.a)(xe,1),de=Ie[0],ce=Object(D.useState)({}),ie=Object(R.a)(ce,2),fe=ie[0],le=ie[1],ke=Object(D.useRef)(),Ne=$.commonHomeWorkAddDefaultData,Ae=Object(D.useState)({}),Le=Object(R.a)(Ae,2),Fe=Le[0],oe=Le[1];Object(D.useEffect)(function(){setTimeout(function(){document.body.scrollIntoView()},300);var je=Ee.params,Ve=je.coursesId,Je=je.categoryId;ve({type:"shixunHomeworks/addCommonHomeWorkDefaultData",payload:{category:Je,coursesId:Ve,type:3}})},[]);var ge=function(){var je=Object(l.a)(S.a.mark(function Ve(Je){var Xe,et,Ze,rt,Be,ut,it;return S.a.wrap(function(We){for(;;)switch(We.prev=We.next){case 0:if(!(fe.min_num>fe.max_num)){We.next=3;break}return o.b.info("\u6700\u5927\u4EBA\u6570\u4E0D\u80FD\u5C0F\u4E8E\u6700\u5C0F\u4EBA\u6570"),We.abrupt("return");case 3:return Xe=Object(h.a)({},fe),Xe.attachment_ids&&(Xe.attachment_ids=Xe==null||((et=Xe.attachment_ids)===null||et===void 0)?void 0:et.map(function(Re){return Re.response.id})),Xe.reference_attachment_ids&&(Xe.reference_attachment_ids=Xe==null||((Ze=Xe.reference_attachment_ids)===null||Ze===void 0)?void 0:Ze.map(function(Re){return Re.response.id})),rt=Ee.params,Be=rt.coursesId,ut=rt.categoryId,We.next=9,Object(w.a)(Object(h.a)(Object(h.a)({coursesId:Be,category:ut},Xe),{},{type:3}));case 9:it=We.sent,it.status===0&&(we(it.homework_id),Object(x.cb)(["\u6559\u5B66\u8BFE\u5802","\u5206\u7EC4\u4F5C\u4E1A","\u65B0\u5EFA\u5206\u7EC4\u4F5C\u4E1A"]),O.d.push("/classrooms/".concat(Be,"/group_homework/").concat(it.homework_id,"/detail")));case 11:case"end":return We.stop()}},Ve)}));return function(Je){return je.apply(this,arguments)}}();function we(je){return De.apply(this,arguments)}function De(){return De=Object(l.a)(S.a.mark(function je(Ve){var Je;return S.a.wrap(function(et){for(;;)switch(et.prev=et.next){case 0:if(Fe!=null&&Fe.ec_point_ids){et.next=2;break}return et.abrupt("return");case 2:return et.next=4,Object(_.a)("/api/ec_courses/".concat(Fe==null?void 0:Fe.ec_course_id,"/ec_points/set_work_points.json"),{method:"post",body:Object(h.a)({homework_common_id:Ve},Fe)});case 4:Je=et.sent;case 5:case"end":return et.stop()}},je)})),De.apply(this,arguments)}return A.a.createElement("section",{className:y.a.bg},Ne.course_name&&A.a.createElement("section",{className:"animated fadeIn"},A.a.createElement("aside",{className:"mt10"},Ne.category&&A.a.createElement(u.a,{separator:">"},A.a.createElement(u.a.Item,null,A.a.createElement(C.a,{to:"/classrooms/".concat(Ne.course_id,"/group_homework")},Ne.course_name)),A.a.createElement(u.a.Item,null,A.a.createElement(C.a,{to:"/classrooms/".concat(Ne.course_id,"/group_homework")},Ne.category.category_name)),A.a.createElement(u.a.Item,null,"\u65B0\u5EFA\u8BE6\u60C5")))),A.a.createElement("aside",{className:"font24 bold mt20 mb20"},"\u65B0\u5EFA\u5206\u7EC4\u4F5C\u4E1A"),A.a.createElement(a.a,{form:de,className:y.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(){le(Object(h.a)({},de.getFieldsValue()))},initialValues:{base_on_project:!1},onFinish:ge},A.a.createElement("div",{className:y.a.fieldWrap},A.a.createElement(a.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u9898"}]},A.a.createElement(g.a,{maxLength:60,suffix:"".concat(((W=fe.name)===null||W===void 0?void 0:W.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),A.a.createElement("div",{className:y.a.mdWrap},A.a.createElement(a.a.Item,{name:"description",label:"\u5185\u5BB9:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:5e3,message:"\u4F5C\u4E1A\u7B80\u4ECB\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"}]},A.a.createElement(f.a,{watch:!0,defaultValue:fe.intro})),A.a.createElement("div",null,A.a.createElement(a.a.Item,{name:"attachment_ids"},A.a.createElement(B.b,null))),A.a.createElement(U.a,{gutter:[20,20]},A.a.createElement(H.a,{flex:"230px"},A.a.createElement(a.a.Item,{name:"min_num",label:"\u5206\u7EC4\u8BBE\u7F6E",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u6BCF\u7EC4\u6700\u5C0F\u4EBA\u6570"}]},A.a.createElement(L.a,{style:{width:200},min:1,placeholder:"\u8BF7\u586B\u5199\u6BCF\u7EC4\u6700\u5C0F\u4EBA\u6570"}))),A.a.createElement(H.a,{flex:"230px"},A.a.createElement(a.a.Item,{name:"max_num",label:A.a.createElement("div",null,"\xA0"),rules:[{required:!0,message:"\u8BF7\u586B\u5199\u6BCF\u7EC4\u6700\u5927\u4EBA\u6570"}]},A.a.createElement(L.a,{style:{width:200},max:100,placeholder:"\u8BF7\u586B\u5199\u6BCF\u7EC4\u6700\u5927\u4EBA\u6570"}))),A.a.createElement(H.a,null,A.a.createElement("div",{className:"mt30"},"\uFF08\u5B66\u751F\u63D0\u4EA4\u4F5C\u54C1\u65F6\u9700\u8981\u5173\u8054\u540C\u7EC4\u6210\u5458\uFF0C\u7EC4\u5185\u6210\u5458\u4F5C\u54C1\u5171\u4EAB\uFF09"))),A.a.createElement(U.a,null,A.a.createElement(H.a,null,A.a.createElement(a.a.Item,{name:"base_on_project",valuePropName:"checked"},A.a.createElement(Y.a,{value:!0},"\u57FA\u4E8E\u9879\u76EE\u5B9E\u65BD")),A.a.createElement("span",{className:"c-light-black"},"\uFF08\u9009\u4E2D\uFF0C\u5219\u5FC5\u987B\u5728\u672C\u5E73\u53F0\u521B\u5EFA\u9879\u76EE\uFF0C\u9879\u76EE\u7BA1\u7406\u5458\u53EF\u4EE5\u63D0\u4EA4\u4F5C\u54C1\uFF1B\u4E0D\u9009\u4E2D\uFF0C\u65E0\u9700\u5728\u5E73\u53F0\u521B\u5EFA\u9879\u76EE\uFF0C\u4EFB\u610F\u5C0F\u7EC4\u6210\u5458\u5747\u53EF\u4EE5\u63D0\u4EA4\u4F5C\u54C1\uFF09")))),A.a.createElement("div",{className:y.a.mdWrap},A.a.createElement(a.a.Item,{name:"reference_answer",label:"\u53C2\u8003\u7B54\u6848:"},A.a.createElement(f.a,{watch:!0,defaultValue:fe.notice})),A.a.createElement("div",null,A.a.createElement(a.a.Item,{name:"reference_attachment_ids"},A.a.createElement(B.b,null))))),A.a.createElement("div",{className:y.a.mdWrap},A.a.createElement(F.a,{setitem:function(Ve){return oe(Object(h.a)({},Ve))}})),A.a.createElement("div",{className:y.a.backgroundFa},A.a.createElement("div",{className:"pt40 mb30"},A.a.createElement(a.a.Item,null,A.a.createElement(J.a,{size:"large",type:"primary",onClick:function(){de.submit()},className:"".concat(y.a.button," mr20"),htmlType:"submit",loading:Oe["newCourse/editCourse"]||Oe["newCourse/submitCourse"]},"\u63D0\u4EA4"),A.a.createElement(J.a,{size:"large",type:"primary",ghost:!0,className:y.a.button,onClick:function(){return O.d.push("/classrooms/".concat(Ee.params.coursesId,"/group_homework"))}},"\u53D6\u6D88")))))};ye.default=Object(O.a)(function(I){var m=I.shixunHomeworks,W=I.newCourse,$=I.loading,ae=I.globalSetting;return{shixunHomeworks:m,newCourse:W,globalSetting:ae,loading:$.effects}})(M)},ulZh:function(nt,ye,Q){typeof window!="undefined"&&function(J,P){nt.exports=P()}(this,function(){return function(ne){var J={};function P(Y){if(J[Y])return J[Y].exports;var j=J[Y]={i:Y,l:!1,exports:{}};return ne[Y].call(j.exports,j,j.exports,P),j.l=!0,j.exports}return P.m=ne,P.c=J,P.d=function(Y,j,U){P.o(Y,j)||Object.defineProperty(Y,j,{enumerable:!0,get:U})},P.r=function(Y){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Y,"__esModule",{value:!0})},P.t=function(Y,j){if(j&1&&(Y=P(Y)),j&8)return Y;if(j&4&&typeof Y=="object"&&Y&&Y.__esModule)return Y;var U=Object.create(null);if(P.r(U),Object.defineProperty(U,"default",{enumerable:!0,value:Y}),j&2&&typeof Y!="string")for(var z in Y)P.d(U,z,function(H){return Y[H]}.bind(null,z));return U},P.n=function(Y){var j=Y&&Y.__esModule?function(){return Y.default}:function(){return Y};return P.d(j,"a",j),j},P.o=function(Y,j){return Object.prototype.hasOwnProperty.call(Y,j)},P.p="/dist/",P(P.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ne,J,P){"use strict";var Y=Object.prototype.hasOwnProperty,j="~";function U(){}Object.create&&(U.prototype=Object.create(null),new U().__proto__||(j=!1));function z(v,g,p){this.fn=v,this.context=g,this.once=p||!1}function H(v,g,p,u,h){if(typeof p!="function")throw new TypeError("The listener must be a function");var c=new z(p,u||v,h),o=j?j+g:g;return v._events[o]?v._events[o].fn?v._events[o]=[v._events[o],c]:v._events[o].push(c):(v._events[o]=c,v._eventsCount++),v}function r(v,g){--v._eventsCount===0?v._events=new U:delete v._events[g]}function L(){this._events=new U,this._eventsCount=0}L.prototype.eventNames=function(){var g=[],p,u;if(this._eventsCount===0)return g;for(u in p=this._events)Y.call(p,u)&&g.push(j?u.slice(1):u);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(p)):g},L.prototype.listeners=function(g){var p=j?j+g:g,u=this._events[p];if(!u)return[];if(u.fn)return[u.fn];for(var h=0,c=u.length,o=new Array(c);h<c;h++)o[h]=u[h].fn;return o},L.prototype.listenerCount=function(g){var p=j?j+g:g,u=this._events[p];return u?u.fn?1:u.length:0},L.prototype.emit=function(g,p,u,h,c,o){var l=j?j+g:g;if(!this._events[l])return!1;var s=this._events[l],a=arguments.length,R,E;if(s.fn){s.once&&this.removeListener(g,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,u),!0;case 4:return s.fn.call(s.context,p,u,h),!0;case 5:return s.fn.call(s.context,p,u,h,c),!0;case 6:return s.fn.call(s.context,p,u,h,c,o),!0}for(E=1,R=new Array(a-1);E<a;E++)R[E-1]=arguments[E];s.fn.apply(s.context,R)}else{var S=s.length,D;for(E=0;E<S;E++){s[E].once&&this.removeListener(g,s[E].fn,void 0,!0);switch(a){case 1:s[E].fn.call(s[E].context);break;case 2:s[E].fn.call(s[E].context,p);break;case 3:s[E].fn.call(s[E].context,p,u);break;case 4:s[E].fn.call(s[E].context,p,u,h);break;default:if(!R)for(D=1,R=new Array(a-1);D<a;D++)R[D-1]=arguments[D];s[E].fn.apply(s[E].context,R)}}}return!0},L.prototype.on=function(g,p,u){return H(this,g,p,u,!1)},L.prototype.once=function(g,p,u){return H(this,g,p,u,!0)},L.prototype.removeListener=function(g,p,u,h){var c=j?j+g:g;if(!this._events[c])return this;if(!p)return r(this,c),this;var o=this._events[c];if(o.fn)o.fn===p&&(!h||o.once)&&(!u||o.context===u)&&r(this,c);else{for(var l=0,s=[],a=o.length;l<a;l++)(o[l].fn!==p||h&&!o[l].once||u&&o[l].context!==u)&&s.push(o[l]);s.length?this._events[c]=s.length===1?s[0]:s:r(this,c)}return this},L.prototype.removeAllListeners=function(g){var p;return g?(p=j?j+g:g,this._events[p]&&r(this,p)):(this._events=new U,this._eventsCount=0),this},L.prototype.off=L.prototype.removeListener,L.prototype.addListener=L.prototype.on,L.prefixed=j,L.EventEmitter=L,ne.exports=L},"./node_modules/url-toolkit/src/url-toolkit.js":function(ne,J,P){(function(Y){var j=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,U=/^([^\/?#]*)([^]*)$/,z=/(?:\/|^)\.(?=\/)/g,H=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,r={buildAbsoluteURL:function(L,v,g){if(g=g||{},L=L.trim(),v=v.trim(),!v){if(!g.alwaysNormalize)return L;var p=r.parseURL(L);if(!p)throw new Error("Error trying to parse base URL.");return p.path=r.normalizePath(p.path),r.buildURLFromParts(p)}var u=r.parseURL(v);if(!u)throw new Error("Error trying to parse relative URL.");if(u.scheme)return g.alwaysNormalize?(u.path=r.normalizePath(u.path),r.buildURLFromParts(u)):v;var h=r.parseURL(L);if(!h)throw new Error("Error trying to parse base URL.");if(!h.netLoc&&h.path&&h.path[0]!=="/"){var c=U.exec(h.path);h.netLoc=c[1],h.path=c[2]}h.netLoc&&!h.path&&(h.path="/");var o={scheme:h.scheme,netLoc:u.netLoc,path:null,params:u.params,query:u.query,fragment:u.fragment};if(!u.netLoc&&(o.netLoc=h.netLoc,u.path[0]!=="/"))if(!u.path)o.path=h.path,u.params||(o.params=h.params,u.query||(o.query=h.query));else{var l=h.path,s=l.substring(0,l.lastIndexOf("/")+1)+u.path;o.path=r.normalizePath(s)}return o.path===null&&(o.path=g.alwaysNormalize?r.normalizePath(u.path):u.path),r.buildURLFromParts(o)},parseURL:function(L){var v=j.exec(L);return v?{scheme:v[1]||"",netLoc:v[2]||"",path:v[3]||"",params:v[4]||"",query:v[5]||"",fragment:v[6]||""}:null},normalizePath:function(L){for(L=L.split("").reverse().join("").replace(z,"");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}};ne.exports=r})(this)},"./node_modules/webworkify-webpack/index.js":function(ne,J,P){function Y(g){var p={};function u(c){if(p[c])return p[c].exports;var o=p[c]={i:c,l:!1,exports:{}};return g[c].call(o.exports,o,o.exports,u),o.l=!0,o.exports}u.m=g,u.c=p,u.i=function(c){return c},u.d=function(c,o,l){u.o(c,o)||Object.defineProperty(c,o,{configurable:!1,enumerable:!0,get:l})},u.r=function(c){Object.defineProperty(c,"__esModule",{value:!0})},u.n=function(c){var o=c&&c.__esModule?function(){return c.default}:function(){return c};return u.d(o,"a",o),o},u.o=function(c,o){return Object.prototype.hasOwnProperty.call(c,o)},u.p="/",u.oe=function(c){throw console.error(c),c};var h=u(u.s=ENTRY_MODULE);return h.default||h}var j="[\\.|\\-|\\+|\\w|/|@]+",U="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+j+").*?\\)";function z(g){return(g+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function H(g){return!isNaN(1*g)}function r(g,p,u){var h={};h[u]=[];var c=p.toString(),o=c.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!o)return h;for(var l=o[1],s=new RegExp("(\\\\n|\\W)"+z(l)+U,"g"),a;a=s.exec(c);){if(a[3]==="dll-reference")continue;h[u].push(a[3])}for(s=new RegExp("\\("+z(l)+'\\("(dll-reference\\s('+j+'))"\\)\\)'+U,"g");a=s.exec(c);)g[a[2]]||(h[u].push(a[1]),g[a[2]]=P(a[1]).m),h[a[2]]=h[a[2]]||[],h[a[2]].push(a[4]);for(var R=Object.keys(h),E=0;E<R.length;E++)for(var S=0;S<h[R[E]].length;S++)H(h[R[E]][S])&&(h[R[E]][S]=1*h[R[E]][S]);return h}function L(g){var p=Object.keys(g);return p.reduce(function(u,h){return u||g[h].length>0},!1)}function v(g,p){for(var u={main:[p]},h={main:[]},c={main:{}};L(u);)for(var o=Object.keys(u),l=0;l<o.length;l++){var s=o[l],a=u[s],R=a.pop();if(c[s]=c[s]||{},c[s][R]||!g[s][R])continue;c[s][R]=!0,h[s]=h[s]||[],h[s].push(R);for(var E=r(g,g[s][R],s),S=Object.keys(E),D=0;D<S.length;D++)u[S[D]]=u[S[D]]||[],u[S[D]]=u[S[D]].concat(E[S[D]])}return h}ne.exports=function(g,p){p=p||{};var u={main:P.m},h=p.all?{main:Object.keys(u.main)}:v(u,g),c="";Object.keys(h).filter(function(R){return R!=="main"}).forEach(function(R){for(var E=0;h[R][E];)E++;h[R].push(E),u[R][E]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",c=c+"var "+R+" = ("+Y.toString().replace("ENTRY_MODULE",JSON.stringify(E))+")({"+h[R].map(function(S){return""+JSON.stringify(S)+": "+u[R][S].toString()}).join(",")+`});
|
|
`}),c=c+"new (("+Y.toString().replace("ENTRY_MODULE",JSON.stringify(g))+")({"+h.main.map(function(R){return""+JSON.stringify(R)+": "+u.main[R].toString()}).join(",")+"}))(self);";var o=new window.Blob([c],{type:"text/javascript"});if(p.bare)return o;var l=window.URL||window.webkitURL||window.mozURL||window.msURL,s=l.createObjectURL(o),a=new window.Worker(s);return a.objectURL=s,a}},"./src/config.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"hlsDefaultConfig",function(){return D}),P.d(J,"mergeConfig",function(){return O}),P.d(J,"enableStreamingMode",function(){return C});var Y=P("./src/controller/abr-controller.ts"),j=P("./src/controller/audio-stream-controller.ts"),U=P("./src/controller/audio-track-controller.ts"),z=P("./src/controller/subtitle-stream-controller.ts"),H=P("./src/controller/subtitle-track-controller.ts"),r=P("./src/controller/buffer-controller.ts"),L=P("./src/controller/timeline-controller.ts"),v=P("./src/controller/cap-level-controller.ts"),g=P("./src/controller/fps-controller.ts"),p=P("./src/controller/eme-controller.ts"),u=P("./src/controller/cmcd-controller.ts"),h=P("./src/utils/xhr-loader.ts"),c=P("./src/utils/fetch-loader.ts"),o=P("./src/utils/cues.ts"),l=P("./src/utils/mediakeys-helper.ts"),s=P("./src/utils/logger.ts");function a(){return a=Object.assign||function(x){for(var f=1;f<arguments.length;f++){var w=arguments[f];for(var b in w)Object.prototype.hasOwnProperty.call(w,b)&&(x[b]=w[b])}return x},a.apply(this,arguments)}function R(x,f){var w=Object.keys(x);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(x);f&&(b=b.filter(function(y){return Object.getOwnPropertyDescriptor(x,y).enumerable})),w.push.apply(w,b)}return w}function E(x){for(var f=1;f<arguments.length;f++){var w=arguments[f]!=null?arguments[f]:{};f%2?R(Object(w),!0).forEach(function(b){S(x,b,w[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(w)):R(Object(w)).forEach(function(b){Object.defineProperty(x,b,Object.getOwnPropertyDescriptor(w,b))})}return x}function S(x,f,w){return f in x?Object.defineProperty(x,f,{value:w,enumerable:!0,configurable:!0,writable:!0}):x[f]=w,x}var D=E(E({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:Y.default,bufferController:r.default,capLevelController:v.default,fpsController:g.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:l.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},A()),{},{subtitleStreamController:z.SubtitleStreamController,subtitleTrackController:H.default,timelineController:L.TimelineController,audioStreamController:j.default,audioTrackController:U.default,emeController:p.default,cmcdController:u.default});function A(){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 O(x,f){if((f.liveSyncDurationCount||f.liveMaxLatencyDurationCount)&&(f.liveSyncDuration||f.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(f.liveMaxLatencyDurationCount!==void 0&&(f.liveSyncDurationCount===void 0||f.liveMaxLatencyDurationCount<=f.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(f.liveMaxLatencyDuration!==void 0&&(f.liveSyncDuration===void 0||f.liveMaxLatencyDuration<=f.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return a({},x,f)}function C(x){var f=x.loader;if(f!==c.default&&f!==h.default)s.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),x.progressive=!1;else{var w=Object(c.fetchSupported)();w&&(x.loader=c.default,x.progressive=!0,x.enableSoftwareAES=!0,s.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ne,J,P){"use strict";P.r(J);var Y=P("./src/polyfills/number.ts"),j=P("./src/utils/ewma-bandwidth-estimator.ts"),U=P("./src/events.ts"),z=P("./src/utils/buffer-helper.ts"),H=P("./src/errors.ts"),r=P("./src/types/loader.ts"),L=P("./src/utils/logger.ts");function v(u,h){for(var c=0;c<h.length;c++){var o=h[c];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(u,o.key,o)}}function g(u,h,c){return h&&v(u.prototype,h),c&&v(u,c),u}var p=function(){function u(c){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=c;var o=c.config;this.bwEstimator=new j.default(o.abrEwmaSlowVoD,o.abrEwmaFastVoD,o.abrEwmaDefaultEstimate),this.registerListeners()}var h=u.prototype;return h.registerListeners=function(){var o=this.hls;o.on(U.Events.FRAG_LOADING,this.onFragLoading,this),o.on(U.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(U.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.on(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.on(U.Events.ERROR,this.onError,this)},h.unregisterListeners=function(){var o=this.hls;o.off(U.Events.FRAG_LOADING,this.onFragLoading,this),o.off(U.Events.FRAG_LOADED,this.onFragLoaded,this),o.off(U.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.off(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.off(U.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,l){var s=l.frag;if(s.type===r.PlaylistLevelType.MAIN&&!this.timer){var a;this.fragCurrent=s,this.partCurrent=(a=l.part)!=null?a:null,this.timer=self.setInterval(this.onCheck,100)}},h.onLevelLoaded=function(o,l){var s=this.hls.config;l.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)},h._abandonRulesCheck=function(){var o=this.fragCurrent,l=this.partCurrent,s=this.hls,a=s.autoLevelEnabled,R=s.config,E=s.media;if(!o||!E)return;var S=l?l.stats:o.stats,D=l?l.duration:o.duration;if(S.aborted){L.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!a||E.paused||!E.playbackRate||!E.readyState)return;var A=performance.now()-S.loading.start,O=Math.abs(E.playbackRate);if(A<=500*D/O)return;var C=s.levels,x=s.minAutoLevel,f=C[o.level],w=S.total||Math.max(S.loaded,Math.round(D*f.maxBitrate/8)),b=Math.max(1,S.bwEstimate?S.bwEstimate/8:S.loaded*1e3/A),y=(w-S.loaded)/b,B=E.currentTime,F=(z.BufferHelper.bufferInfo(E,B,R.maxBufferHole).end-B)/O;if(F>=2*D/O||y<=F)return;var _=Number.POSITIVE_INFINITY,M;for(M=o.level-1;M>x;M--){var I=C[M].maxBitrate;if(_=D*I/(8*.8*b),_<F)break}if(_>=y)return;var m=this.bwEstimator.getEstimate();L.logger.warn("Fragment "+o.sn+(l?" part "+l.index:"")+" of level "+o.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+M+`
|
|
Current BW estimate: `+(Object(Y.isFiniteNumber)(m)?(m/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+y.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+_.toFixed(3)+` s
|
|
Time to underbuffer: `+F.toFixed(3)+" s"),s.nextLoadLevel=M,this.bwEstimator.sample(A,S.loaded),this.clearTimer(),o.loader&&(this.fragCurrent=this.partCurrent=null,o.loader.abort()),s.trigger(U.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:o,part:l,stats:S})},h.onFragLoaded=function(o,l){var s=l.frag,a=l.part;if(s.type===r.PlaylistLevelType.MAIN&&Object(Y.isFiniteNumber)(s.sn)){var R=a?a.stats:s.stats,E=a?a.duration:s.duration;if(this.clearTimer(),this.lastLoadedFragLevel=s.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var S=this.hls.levels[s.level],D=(S.loaded?S.loaded.bytes:0)+R.loaded,A=(S.loaded?S.loaded.duration:0)+E;S.loaded={bytes:D,duration:A},S.realBitrate=Math.round(8*D/A)}if(s.bitrateTest){var O={stats:R,frag:s,part:a,id:s.type};this.onFragBuffered(U.Events.FRAG_BUFFERED,O),s.bitrateTest=!1}}},h.onFragBuffered=function(o,l){var s=l.frag,a=l.part,R=a?a.stats:s.stats;if(R.aborted)return;if(s.type!==r.PlaylistLevelType.MAIN||s.sn==="initSegment")return;var E=R.parsing.end-R.loading.start;this.bwEstimator.sample(E,R.loaded),R.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=E/1e3:this.bitrateTestDelay=0},h.onError=function(o,l){switch(l.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,l=this.partCurrent,s=this.hls,a=s.maxAutoLevel,R=s.config,E=s.minAutoLevel,S=s.media,D=l?l.duration:o?o.duration:0,A=S?S.currentTime:0,O=S&&S.playbackRate!==0?Math.abs(S.playbackRate):1,C=this.bwEstimator?this.bwEstimator.getEstimate():R.abrEwmaDefaultEstimate,x=(z.BufferHelper.bufferInfo(S,A,R.maxBufferHole).end-A)/O,f=this.findBestLevel(C,E,a,x,R.abrBandWidthFactor,R.abrBandWidthUpFactor);if(f>=0)return f;L.logger.trace((x?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var w=D?Math.min(D,R.maxStarvationDelay):R.maxStarvationDelay,b=R.abrBandWidthFactor,y=R.abrBandWidthUpFactor;if(!x){var B=this.bitrateTestDelay;if(B){var F=D?Math.min(D,R.maxLoadingDelay):R.maxLoadingDelay;w=F-B,L.logger.trace("bitrate test took "+Math.round(1e3*B)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*w)+" ms"),b=y=1}}return f=this.findBestLevel(C,E,a,x+w,b,y),Math.max(f,0)},h.findBestLevel=function(o,l,s,a,R,E){for(var S,D=this.fragCurrent,A=this.partCurrent,O=this.lastLoadedFragLevel,C=this.hls.levels,x=C[O],f=!!(x!=null&&(S=x.details)!==null&&S!==void 0&&S.live),w=x==null?void 0:x.codecSet,b=A?A.duration:D?D.duration:0,y=s;y>=l;y--){var B=C[y];if(!B||w&&B.codecSet!==w)continue;var F=B.details,_=(A?F==null?void 0:F.partTarget:F==null?void 0:F.averagetargetduration)||b,M=void 0;y<=O?M=R*o:M=E*o;var I=C[y].maxBitrate,m=I*_/M;if(L.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+y+"/"+Math.round(M)+"/"+I+"/"+_+"/"+a+"/"+m),M>I&&(!m||f&&!this.bitrateTestDelay||m<a))return y}return-1},g(u,[{key:"nextAutoLevel",get:function(){var o=this._nextAutoLevel,l=this.bwEstimator;if(o!==-1&&(!l||!l.canEstimate()))return o;var s=this.getNextABRAutoLevel();return o!==-1&&(s=Math.min(o,s)),s},set:function(o){this._nextAutoLevel=o}}]),u}();J.default=p},"./src/controller/audio-stream-controller.ts":function(ne,J,P){"use strict";P.r(J);var Y=P("./src/polyfills/number.ts"),j=P("./src/controller/base-stream-controller.ts"),U=P("./src/events.ts"),z=P("./src/utils/buffer-helper.ts"),H=P("./src/controller/fragment-tracker.ts"),r=P("./src/types/level.ts"),L=P("./src/types/loader.ts"),v=P("./src/loader/fragment.ts"),g=P("./src/demux/chunk-cache.ts"),p=P("./src/demux/transmuxer-interface.ts"),u=P("./src/types/transmuxer.ts"),h=P("./src/controller/fragment-finders.ts"),c=P("./src/utils/discontinuities.ts"),o=P("./src/errors.ts"),l=P("./src/utils/logger.ts");function s(){return s=Object.assign||function(D){for(var A=1;A<arguments.length;A++){var O=arguments[A];for(var C in O)Object.prototype.hasOwnProperty.call(O,C)&&(D[C]=O[C])}return D},s.apply(this,arguments)}function a(D,A){D.prototype=Object.create(A.prototype),D.prototype.constructor=D,R(D,A)}function R(D,A){return R=Object.setPrototypeOf||function(C,x){return C.__proto__=x,C},R(D,A)}var E=100,S=function(D){a(A,D);function A(C,x){var f;return f=D.call(this,C,x,"[audio-stream-controller]")||this,f.videoBuffer=null,f.videoTrackCC=-1,f.waitingVideoCC=-1,f.audioSwitch=!1,f.trackId=-1,f.waitingData=null,f.mainDetails=null,f.bufferFlushed=!1,f._registerListeners(),f}var O=A.prototype;return O.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},O._registerListeners=function(){var x=this.hls;x.on(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.on(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.on(U.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),x.on(U.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.on(U.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),x.on(U.Events.ERROR,this.onError,this),x.on(U.Events.BUFFER_RESET,this.onBufferReset,this),x.on(U.Events.BUFFER_CREATED,this.onBufferCreated,this),x.on(U.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.on(U.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),x.on(U.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O._unregisterListeners=function(){var x=this.hls;x.off(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.off(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.off(U.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),x.off(U.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.off(U.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),x.off(U.Events.ERROR,this.onError,this),x.off(U.Events.BUFFER_RESET,this.onBufferReset,this),x.off(U.Events.BUFFER_CREATED,this.onBufferCreated,this),x.off(U.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.off(U.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),x.off(U.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O.onInitPtsFound=function(x,f){var w=f.frag,b=f.id,y=f.initPTS;if(b==="main"){var B=w.cc;this.initPTS[w.cc]=y,this.log("InitPTS for cc: "+B+" found from main: "+y),this.videoTrackCC=B,this.state===j.State.WAITING_INIT_PTS&&this.tick()}},O.startLoad=function(x){if(!this.levels){this.startPosition=x,this.state=j.State.STOPPED;return}var f=this.lastCurrentTime;this.stopLoad(),this.setInterval(E),this.fragLoadError=0,f>0&&x===-1?(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),this.state=j.State.IDLE):(this.loadedmetadata=!1,this.state=j.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=x,this.tick()},O.doTick=function(){switch(this.state){case j.State.IDLE:this.doTickIdle();break;case j.State.WAITING_TRACK:{var x,f=this.levels,w=this.trackId,b=f==null||((x=f[w])===null||x===void 0)?void 0:x.details;if(b){if(this.waitForCdnTuneIn(b))break;this.state=j.State.WAITING_INIT_PTS}break}case j.State.FRAG_LOADING_WAITING_RETRY:{var y,B=performance.now(),F=this.retryDate;(!F||B>=F||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=j.State.IDLE);break}case j.State.WAITING_INIT_PTS:{var _=this.waitingData;if(_){var M=_.frag,I=_.part,m=_.cache,W=_.complete;if(this.initPTS[M.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=j.State.FRAG_LOADING;var $=m.flush(),ae={frag:M,part:I,payload:$,networkDetails:null};this._handleFragmentLoadProgress(ae),W&&D.prototype._handleFragmentLoadComplete.call(this,ae)}else if(this.videoTrackCC!==this.waitingVideoCC)l.logger.log("Waiting fragment cc ("+M.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ue=this.getLoadPosition(),Oe=z.BufferHelper.bufferInfo(this.mediaBuffer,ue,this.config.maxBufferHole),ve=Object(h.fragmentWithinToleranceTest)(Oe.end,this.config.maxFragLookUpTolerance,M);ve<0&&(l.logger.log("Waiting fragment cc ("+M.cc+") @ "+M.start+" cancelled because another fragment at "+Oe.end+" is needed"),this.clearWaitingFragment())}}else this.state=j.State.IDLE}}this.onTickEnd()},O.clearWaitingFragment=function(){var x=this.waitingData;x&&(this.fragmentTracker.removeFragment(x.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=j.State.IDLE)},O.onTickEnd=function(){var x=this.media;if(!x||!x.readyState)return;var f=this.mediaBuffer?this.mediaBuffer:x,w=f.buffered;!this.loadedmetadata&&w.length&&(this.loadedmetadata=!0),this.lastCurrentTime=x.currentTime},O.doTickIdle=function(){var x,f,w=this.hls,b=this.levels,y=this.media,B=this.trackId,F=w.config;if(!b||!b[B])return;if(!y&&(this.startFragRequested||!F.startFragPrefetch))return;var _=b[B],M=_.details;if(!M||M.live&&this.levelLastLoaded!==B||this.waitForCdnTuneIn(M)){this.state=j.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,v.ElementaryStreamTypes.AUDIO,L.PlaylistLevelType.AUDIO));var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,L.PlaylistLevelType.AUDIO);if(I===null)return;var m=I.len,W=this.getMaxBufferLength(),$=this.audioSwitch;if(m>=W&&!$)return;if(!$&&this._streamEnded(I,M)){w.trigger(U.Events.BUFFER_EOS,{type:"audio"}),this.state=j.State.ENDED;return}var ae=M.fragments,ue=ae[0].start,Oe=I.end;if($){var ve=this.getLoadPosition();Oe=ve,M.PTSKnown&&ve<ue&&((I.end>ue||I.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),y.currentTime=ue+.05))}var Ee=this.getNextFragment(Oe,M);if(!Ee){this.bufferFlushed=!0;return}((x=Ee.decryptdata)===null||x===void 0?void 0:x.keyFormat)==="identity"&&!((f=Ee.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(Ee,M):this.loadFragment(Ee,M,Oe)},O.getMaxBufferLength=function(){var x=D.prototype.getMaxBufferLength.call(this),f=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,L.PlaylistLevelType.MAIN);return f===null?x:Math.max(x,f.len)},O.onMediaDetaching=function(){this.videoBuffer=null,D.prototype.onMediaDetaching.call(this)},O.onAudioTracksUpdated=function(x,f){var w=f.audioTracks;this.resetTransmuxer(),this.levels=w.map(function(b){return new r.Level(b)})},O.onAudioTrackSwitching=function(x,f){var w=!!f.url;this.trackId=f.id;var b=this.fragCurrent;b!=null&&b.loader&&b.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),w?this.setInterval(E):this.resetTransmuxer(),w?(this.audioSwitch=!0,this.state=j.State.IDLE):this.state=j.State.STOPPED,this.tick()},O.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},O.onLevelLoaded=function(x,f){this.mainDetails=f.details},O.onAudioTrackLoaded=function(x,f){var w,b=this.levels,y=f.details,B=f.id;if(!b){this.warn("Audio tracks were reset while loading level "+B);return}this.log("Track "+B+" loaded ["+y.startSN+","+y.endSN+"],duration:"+y.totalduration);var F=b[B],_=0;if(y.live||(w=F.details)!==null&&w!==void 0&&w.live){var M=this.mainDetails;if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed||!M)return;!F.details&&y.hasProgramDateTime&&M.hasProgramDateTime?(Object(c.alignMediaPlaylistByPDT)(y,M),_=y.fragments[0].start):_=this.alignPlaylists(y,F.details)}F.details=y,this.levelLastLoaded=B,!this.startFragRequested&&(this.mainDetails||!y.live)&&this.setStartPosition(F.details,_),this.state===j.State.WAITING_TRACK&&!this.waitForCdnTuneIn(y)&&(this.state=j.State.IDLE),this.tick()},O._handleFragmentLoadProgress=function(x){var f,w=x.frag,b=x.part,y=x.payload,B=this.config,F=this.trackId,_=this.levels;if(!_){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+w.sn+" of level "+w.level+" will not be buffered");return}var M=_[F];console.assert(M,"Audio track is defined on fragment load progress");var I=M.details;console.assert(I,"Audio track details are defined on fragment load progress");var m=B.defaultAudioCodec||M.audioCodec||"mp4a.40.2",W=this.transmuxer;W||(W=this.transmuxer=new p.default(this.hls,L.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var $=this.initPTS[w.cc],ae=(f=w.initSegment)===null||f===void 0?void 0:f.data;if($!==void 0){var ue=!1,Oe=b?b.index:-1,ve=Oe!==-1,Ee=new u.ChunkMetadata(w.level,w.sn,w.stats.chunkCount,y.byteLength,Oe,ve);W.push(y,ae,m,"",w,b,I.totalduration,ue,Ee,$)}else{l.logger.log("Unknown video PTS for cc "+w.cc+", waiting for video PTS before demuxing audio frag "+w.sn+" of ["+I.startSN+" ,"+I.endSN+"],track "+F);var xe=this.waitingData=this.waitingData||{frag:w,part:b,cache:new g.default,complete:!1},Ie=xe.cache;Ie.push(new Uint8Array(y)),this.waitingVideoCC=this.videoTrackCC,this.state=j.State.WAITING_INIT_PTS}},O._handleFragmentLoadComplete=function(x){if(this.waitingData){this.waitingData.complete=!0;return}D.prototype._handleFragmentLoadComplete.call(this,x)},O.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},O.onBufferCreated=function(x,f){var w=f.tracks.audio;w&&(this.mediaBuffer=w.buffer),f.tracks.video&&(this.videoBuffer=f.tracks.video.buffer)},O.onFragBuffered=function(x,f){var w=f.frag,b=f.part;if(w.type!==L.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(w)){this.warn("Fragment "+w.sn+(b?" p: "+b.index:"")+" of level "+w.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}w.sn!=="initSegment"&&(this.fragPrevious=w,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(U.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(w,b)},O.onError=function(x,f){switch(f.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,f);break;case o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==j.State.ERROR&&this.state!==j.State.STOPPED&&(this.state=f.fatal?j.State.ERROR:j.State.IDLE,this.warn(f.details+" while loading frag, switching to "+this.state+" state"));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="audio"&&(this.state===j.State.PARSING||this.state===j.State.PARSED)){var w=!0,b=this.getFwdBufferInfo(this.mediaBuffer,L.PlaylistLevelType.AUDIO);b&&b.len>.5&&(w=!this.reduceMaxBufferLength(b.len)),w&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},O.onBufferFlushed=function(x,f){var w=f.type;w===v.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},O._handleTransmuxComplete=function(x){var f,w="audio",b=this.hls,y=x.remuxResult,B=x.chunkMeta,F=this.getCurrentContext(B);if(!F){this.warn("The loading context changed while buffering fragment "+B.sn+" of level "+B.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(B.level);return}var _=F.frag,M=F.part,I=y.audio,m=y.text,W=y.id3,$=y.initSegment;if(this.fragContextChanged(_))return;if(this.state=j.State.PARSING,this.audioSwitch&&I&&this.completeAudioSwitch(),$!=null&&$.tracks&&(this._bufferInitSegment($.tracks,_,B),b.trigger(U.Events.FRAG_PARSING_INIT_SEGMENT,{frag:_,id:w,tracks:$.tracks})),I){var ae=I.startPTS,ue=I.endPTS,Oe=I.startDTS,ve=I.endDTS;M&&(M.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:ae,endPTS:ue,startDTS:Oe,endDTS:ve}),_.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,ae,ue,Oe,ve),this.bufferFragmentData(I,_,M,B)}if(W!=null&&(f=W.samples)!==null&&f!==void 0&&f.length){var Ee=s({frag:_,id:w},W);b.trigger(U.Events.FRAG_PARSING_METADATA,Ee)}if(m){var xe=s({frag:_,id:w},m);b.trigger(U.Events.FRAG_PARSING_USERDATA,xe)}},O._bufferInitSegment=function(x,f,w){if(this.state!==j.State.PARSING)return;x.video&&delete x.video;var b=x.audio;if(!b)return;b.levelCodec=b.codec,b.id="audio",this.log("Init audio buffer, container:"+b.container+", codecs[parsed]=["+b.codec+"]"),this.hls.trigger(U.Events.BUFFER_CODECS,x);var y=b.initSegment;if(y!=null&&y.byteLength){var B={type:"audio",frag:f,part:null,chunkMeta:w,parent:f.type,data:y};this.hls.trigger(U.Events.BUFFER_APPENDING,B)}this.tick()},O.loadFragment=function(x,f,w){var b=this.fragmentTracker.getState(x);this.fragCurrent=x,(this.audioSwitch||b===H.FragmentState.NOT_LOADED||b===H.FragmentState.PARTIAL)&&(x.sn==="initSegment"?this._loadInitSegment(x):f.live&&!Object(Y.isFiniteNumber)(this.initPTS[x.cc])?(this.log("Waiting for video PTS in continuity counter "+x.cc+" of live stream before loading audio fragment "+x.sn+" of level "+this.trackId),this.state=j.State.WAITING_INIT_PTS):(this.startFragRequested=!0,D.prototype.loadFragment.call(this,x,f,w)))},O.completeAudioSwitch=function(){var x=this.hls,f=this.media,w=this.trackId;f&&(this.log("Switching audio track : flushing all audio"),D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,x.trigger(U.Events.AUDIO_TRACK_SWITCHED,{id:w})},A}(j.default);J.default=S},"./src/controller/audio-track-controller.ts":function(ne,J,P){"use strict";P.r(J);var Y=P("./src/events.ts"),j=P("./src/errors.ts"),U=P("./src/controller/base-playlist-controller.ts"),z=P("./src/types/loader.ts");function H(p,u){for(var h=0;h<u.length;h++){var c=u[h];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(p,c.key,c)}}function r(p,u,h){return u&&H(p.prototype,u),h&&H(p,h),p}function L(p,u){p.prototype=Object.create(u.prototype),p.prototype.constructor=p,v(p,u)}function v(p,u){return v=Object.setPrototypeOf||function(c,o){return c.__proto__=o,c},v(p,u)}var g=function(p){L(u,p);function u(c){var o;return o=p.call(this,c,"[audio-track-controller]")||this,o.tracks=[],o.groupId=null,o.tracksInGroup=[],o.trackId=-1,o.trackName="",o.selectDefaultTrack=!0,o.registerListeners(),o}var h=u.prototype;return h.registerListeners=function(){var o=this.hls;o.on(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.on(Y.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.on(Y.Events.ERROR,this.onError,this)},h.unregisterListeners=function(){var o=this.hls;o.off(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.off(Y.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.off(Y.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,l){this.tracks=l.audioTracks||[]},h.onAudioTrackLoaded=function(o,l){var s=l.id,a=l.details,R=this.tracksInGroup[s];if(!R){this.warn("Invalid audio track id "+s);return}var E=R.details;R.details=l.details,this.log("audioTrack "+s+" loaded ["+a.startSN+"-"+a.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,l,E))},h.onLevelLoading=function(o,l){this.switchLevel(l.level)},h.onLevelSwitching=function(o,l){this.switchLevel(l.level)},h.switchLevel=function(o){var l=this.hls.levels[o];if(!(l!=null&&l.audioGroupIds))return;var s=l.audioGroupIds[l.urlId];if(this.groupId!==s){this.groupId=s;var a=this.tracks.filter(function(E){return!s||E.groupId===s});this.selectDefaultTrack&&!a.some(function(E){return E.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=a;var R={audioTracks:a};this.log("Updating audio tracks, "+a.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(Y.Events.AUDIO_TRACKS_UPDATED,R),this.selectInitialTrack()}},h.onError=function(o,l){if(p.prototype.onError.call(this,o,l),l.fatal||!l.context)return;l.context.type===z.PlaylistContextType.AUDIO_TRACK&&l.context.id===this.trackId&&l.context.groupId===this.groupId&&this.retryLoadingOrFail(l)},h.setAudioTrack=function(o){var l=this.tracksInGroup;if(o<0||o>=l.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var s=l[this.trackId];this.log("Now switching to audio-track index "+o);var a=l[o],R=a.id,E=a.groupId,S=E===void 0?"":E,D=a.name,A=a.type,O=a.url;if(this.trackId=o,this.trackName=D,this.selectDefaultTrack=!1,this.hls.trigger(Y.Events.AUDIO_TRACK_SWITCHING,{id:R,groupId:S,name:D,type:A,url:O}),a.details&&!a.details.live)return;var C=this.switchParams(a.url,s==null?void 0:s.details);this.loadPlaylist(C)},h.selectInitialTrack=function(){var o=this.tracksInGroup;console.assert(o.length,"Initial audio track should be selected when tracks are known");var l=this.trackName,s=this.findTrackId(l)||this.findTrackId();s!==-1?this.setAudioTrack(s):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},h.findTrackId=function(o){for(var l=this.tracksInGroup,s=0;s<l.length;s++){var a=l[s];if((!this.selectDefaultTrack||a.default)&&(!o||o===a.name))return a.id}return-1},h.loadPlaylist=function(o){var l=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(l)){var s=l.id,a=l.groupId,R=l.url;if(o)try{R=o.addDirectives(R)}catch(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}this.log("loading audio-track playlist for id: "+s),this.clearTimer(),this.hls.trigger(Y.Events.AUDIO_TRACK_LOADING,{url:R,id:s,groupId:a,deliveryDirectives:o||null})}},r(u,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(o){this.selectDefaultTrack=!1,this.setAudioTrack(o)}}]),u}(U.default);J.default=g},"./src/controller/base-playlist-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return r});var Y=P("./src/polyfills/number.ts"),j=P("./src/types/level.ts"),U=P("./src/controller/level-helper.ts"),z=P("./src/utils/logger.ts"),H=P("./src/errors.ts"),r=function(){function L(g,p){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=z.logger.log.bind(z.logger,p+":"),this.warn=z.logger.warn.bind(z.logger,p+":"),this.hls=g}var v=L.prototype;return v.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},v.onError=function(p,u){u.fatal&&u.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,u){var h=u==null?void 0:u.renditionReports;if(h)for(var c=0;c<h.length;c++){var o=h[c],l=""+o.URI;if(l===p.substr(-l.length)){var s=parseInt(o["LAST-MSN"]),a=parseInt(o["LAST-PART"]);if(u&&this.hls.config.lowLatencyMode){var R=Math.min(u.age-u.partTarget,u.targetduration);a!==void 0&&R>u.partTarget&&(a+=1)}if(Object(Y.isFiniteNumber)(s))return new j.HlsUrlParameters(s,Object(Y.isFiniteNumber)(a)?a:void 0,j.HlsSkip.No)}}},v.loadPlaylist=function(p){},v.shouldLoadTrack=function(p){return this.canLoad&&p&&!!p.url&&(!p.details||p.details.live)},v.playlistLoaded=function(p,u,h){var c=this,o=u.details,l=u.stats,s=l.loading.end?Math.max(0,self.performance.now()-l.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(U.mergeDetails)(h,o),!this.canLoad||!o.live)return;var a,R=void 0,E=void 0;if(o.canBlockReload&&o.endSN&&o.advanced){var S=this.hls.config.lowLatencyMode,D=o.lastPartSn,A=o.endSN,O=o.lastPartIndex,C=O!==-1,x=D===A,f=S?0:O;C?(R=x?A+1:D,E=x?f:O+1):R=A+1;var w=o.age,b=w+o.ageHeader,y=Math.min(b-o.partTarget,o.targetduration*1.5);if(y>0){if(h&&y>h.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+h.tuneInGoal+" to: "+y+" with playlist age: "+o.age),y=0;else{var B=Math.floor(y/o.targetduration);if(R+=B,E!==void 0){var F=Math.round(y%o.targetduration/o.partTarget);E+=F}this.log("CDN Tune-in age: "+o.ageHeader+"s last advanced "+w.toFixed(2)+"s goal: "+y+" skip sn "+B+" to part "+E)}o.tuneInGoal=y}if(a=this.getDeliveryDirectives(o,u.deliveryDirectives,R,E),S||!x){this.loadPlaylist(a);return}}else a=this.getDeliveryDirectives(o,u.deliveryDirectives,R,E);var _=Object(U.computeReloadInterval)(o,l);R!==void 0&&o.canBlockReload&&(_-=o.partTarget||1),this.log("reload live playlist "+p+" in "+Math.round(_)+" ms"),this.timer=self.setTimeout(function(){return c.loadPlaylist(a)},_)}else this.clearTimer()},v.getDeliveryDirectives=function(p,u,h,c){var o=Object(j.getSkipValue)(p,h);return u!=null&&u.skip&&p.deltaUpdateFailed&&(h=u.msn,c=u.part,o=j.HlsSkip.No),new j.HlsUrlParameters(h,c,o)},v.retryLoadingOrFail=function(p){var u=this,h=this.hls.config,c=this.retryCount<h.levelLoadingMaxRetry;if(c){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 l=Math.min(Math.pow(2,this.retryCount)*h.levelLoadingRetryDelay,h.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return u.loadPlaylist()},l),this.warn("retry playlist loading #"+this.retryCount+" in "+l+' ms after "'+p.details+'"')}}else this.warn('cannot recover from error "'+p.details+'"'),this.clearTimer(),p.fatal=!0;return c},L}()},"./src/controller/base-stream-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"State",function(){return A}),P.d(J,"default",function(){return O});var Y=P("./src/polyfills/number.ts"),j=P("./src/task-loop.ts"),U=P("./src/controller/fragment-tracker.ts"),z=P("./src/utils/buffer-helper.ts"),H=P("./src/utils/logger.ts"),r=P("./src/events.ts"),L=P("./src/errors.ts"),v=P("./src/types/transmuxer.ts"),g=P("./src/utils/mp4-tools.ts"),p=P("./src/utils/discontinuities.ts"),u=P("./src/controller/fragment-finders.ts"),h=P("./src/controller/level-helper.ts"),c=P("./src/loader/fragment-loader.ts"),o=P("./src/crypt/decrypter.ts"),l=P("./src/utils/time-ranges.ts"),s=P("./src/types/loader.ts");function a(C,x){for(var f=0;f<x.length;f++){var w=x[f];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(C,w.key,w)}}function R(C,x,f){return x&&a(C.prototype,x),f&&a(C,f),C}function E(C){if(C===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}function S(C,x){C.prototype=Object.create(x.prototype),C.prototype.constructor=C,D(C,x)}function D(C,x){return D=Object.setPrototypeOf||function(w,b){return w.__proto__=b,w},D(C,x)}var A={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"},O=function(C){S(x,C);function x(w,b,y){var B;return B=C.call(this)||this,B.hls=void 0,B.fragPrevious=null,B.fragCurrent=null,B.fragmentTracker=void 0,B.transmuxer=null,B._state=A.STOPPED,B.media=void 0,B.mediaBuffer=void 0,B.config=void 0,B.bitrateTest=!1,B.lastCurrentTime=0,B.nextLoadPosition=0,B.startPosition=0,B.loadedmetadata=!1,B.fragLoadError=0,B.retryDate=0,B.levels=null,B.fragmentLoader=void 0,B.levelLastLoaded=null,B.startFragRequested=!1,B.decrypter=void 0,B.initPTS=[],B.onvseeking=null,B.onvended=null,B.logPrefix="",B.log=void 0,B.warn=void 0,B.logPrefix=y,B.log=H.logger.log.bind(H.logger,y+":"),B.warn=H.logger.warn.bind(H.logger,y+":"),B.hls=w,B.fragmentLoader=new c.default(w.config),B.fragmentTracker=b,B.config=w.config,B.decrypter=new o.default(w,w.config),w.on(r.Events.KEY_LOADED,B.onKeyLoaded,E(B)),B}var f=x.prototype;return f.doTick=function(){this.onTickEnd()},f.onTickEnd=function(){},f.startLoad=function(b){},f.stopLoad=function(){this.fragmentLoader.abort();var b=this.fragCurrent;b&&this.fragmentTracker.removeFragment(b),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=A.STOPPED},f._streamEnded=function(b,y){var B=this.fragCurrent,F=this.fragmentTracker;if(!y.live&&B&&B.sn===y.endSN&&!b.nextStart){var _=F.getState(B);return _===U.FragmentState.PARTIAL||_===U.FragmentState.OK}return!1},f.onMediaAttached=function(b,y){var B=this.media=this.mediaBuffer=y.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),B.addEventListener("seeking",this.onvseeking),B.addEventListener("ended",this.onvended);var F=this.config;this.levels&&F.autoStartLoad&&this.state===A.STOPPED&&this.startLoad(F.startPosition)},f.onMediaDetaching=function(){var b=this.media;b!=null&&b.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),b&&(b.removeEventListener("seeking",this.onvseeking),b.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},f.onMediaSeeking=function(){var b=this.config,y=this.fragCurrent,B=this.media,F=this.mediaBuffer,_=this.state,M=B?B.currentTime:0,I=z.BufferHelper.bufferInfo(F||B,M,b.maxBufferHole);if(this.log("media seeking to "+(Object(Y.isFiniteNumber)(M)?M.toFixed(3):M)+", state: "+_),_===A.ENDED)this.resetLoadingState();else if(y&&!I.len){var m=b.maxFragLookUpTolerance,W=y.start-m,$=y.start+y.duration+m,ae=M>$;(M<W||ae)&&(ae&&y.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),y.loader.abort()),this.resetLoadingState())}B&&(this.lastCurrentTime=M),!this.loadedmetadata&&!I.len&&(this.nextLoadPosition=this.startPosition=M),this.tickImmediate()},f.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},f.onKeyLoaded=function(b,y){if(this.state!==A.KEY_LOADING||y.frag!==this.fragCurrent||!this.levels)return;this.state=A.IDLE;var B=this.levels[y.frag.level].details;B&&this.loadFragment(y.frag,B,y.frag.start)},f.onHandlerDestroying=function(){this.stopLoad(),C.prototype.onHandlerDestroying.call(this)},f.onHandlerDestroyed=function(){this.state=A.STOPPED,this.hls.off(r.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,C.prototype.onHandlerDestroyed.call(this)},f.loadKey=function(b,y){this.log("Loading key for "+b.sn+" of ["+y.startSN+"-"+y.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level),this.state=A.KEY_LOADING,this.fragCurrent=b,this.hls.trigger(r.Events.KEY_LOADING,{frag:b})},f.loadFragment=function(b,y,B){this._loadFragForPlayback(b,y,B)},f._loadFragForPlayback=function(b,y,B){var F=this,_=function(I){if(F.fragContextChanged(b)){F.warn("Fragment "+b.sn+(I.part?" p: "+I.part.index:"")+" of level "+b.level+" was dropped during download."),F.fragmentTracker.removeFragment(b);return}b.stats.chunkCount++,F._handleFragmentLoadProgress(I)};this._doFragLoad(b,y,B,_).then(function(M){if(!M)return;F.fragLoadError=0;var I=F.state;if(F.fragContextChanged(b)){(I===A.FRAG_LOADING||I===A.BACKTRACKING||!F.fragCurrent&&I===A.PARSING)&&(F.fragmentTracker.removeFragment(b),F.state=A.IDLE);return}if("payload"in M&&(F.log("Loaded fragment "+b.sn+" of level "+b.level),F.hls.trigger(r.Events.FRAG_LOADED,M),F.state===A.BACKTRACKING)){F.fragmentTracker.backtrack(b,M),F.resetFragmentLoading(b);return}F._handleFragmentLoadComplete(M)}).catch(function(M){F.warn(M),F.resetFragmentLoading(b)})},f.flushMainBuffer=function(b,y,B){if(B===void 0&&(B=null),!(b-y))return;var F={startOffset:b,endOffset:y,type:B};this.fragLoadError=0,this.hls.trigger(r.Events.BUFFER_FLUSHING,F)},f._loadInitSegment=function(b){var y=this;this._doFragLoad(b).then(function(B){if(!B||y.fragContextChanged(b)||!y.levels)throw new Error("init load aborted");return B}).then(function(B){var F=y.hls,_=B.payload,M=b.decryptdata;if(_&&_.byteLength>0&&M&&M.key&&M.iv&&M.method==="AES-128"){var I=self.performance.now();return y.decrypter.webCryptoDecrypt(new Uint8Array(_),M.key.buffer,M.iv.buffer).then(function(m){var W=self.performance.now();return F.trigger(r.Events.FRAG_DECRYPTED,{frag:b,payload:m,stats:{tstart:I,tdecrypt:W}}),B.payload=m,B})}return B}).then(function(B){var F=y.fragCurrent,_=y.hls,M=y.levels;if(!M)throw new Error("init load aborted, missing levels");var I=M[b.level].details;console.assert(I,"Level details are defined when init segment is loaded");var m=b.stats;y.state=A.IDLE,y.fragLoadError=0,b.data=new Uint8Array(B.payload),m.parsing.start=m.buffering.start=self.performance.now(),m.parsing.end=m.buffering.end=self.performance.now(),B.frag===F&&_.trigger(r.Events.FRAG_BUFFERED,{stats:m,frag:F,part:null,id:b.type}),y.tick()}).catch(function(B){y.warn(B),y.resetFragmentLoading(b)})},f.fragContextChanged=function(b){var y=this.fragCurrent;return!b||!y||b.level!==y.level||b.sn!==y.sn||b.urlId!==y.urlId},f.fragBufferedComplete=function(b,y){var B=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+b.type+" sn: "+b.sn+(y?" part: "+y.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level+" "+l.default.toString(z.BufferHelper.getBuffered(B))),this.state=A.IDLE,this.tick()},f._handleFragmentLoadComplete=function(b){var y=this.transmuxer;if(!y)return;var B=b.frag,F=b.part,_=b.partsLoaded,M=!_||_.length===0||_.some(function(m){return!m}),I=new v.ChunkMetadata(B.level,B.sn,B.stats.chunkCount+1,0,F?F.index:-1,!M);y.flush(I)},f._handleFragmentLoadProgress=function(b){},f._doFragLoad=function(b,y,B,F){var _=this;if(B===void 0&&(B=null),!this.levels)throw new Error("frag load aborted, missing levels");if(B=Math.max(b.start,B||0),this.config.lowLatencyMode&&y){var M=y.partList;if(M&&F){B>b.end&&y.fragmentHint&&(b=y.fragmentHint);var I=this.getNextPart(M,b,B);if(I>-1){var m=M[I];return this.log("Loading part sn: "+b.sn+" p: "+m.index+" cc: "+b.cc+" of playlist ["+y.startSN+"-"+y.endSN+"] parts [0-"+I+"-"+(M.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(B.toFixed(3))),this.nextLoadPosition=m.start+m.duration,this.state=A.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:b,part:M[I],targetBufferTime:B}),this.doFragPartsLoad(b,M,I,F).catch(function(W){return _.handleFragLoadError(W)})}else if(!b.url||this.loadedEndOfParts(M,B))return Promise.resolve(null)}}return this.log("Loading fragment "+b.sn+" cc: "+b.cc+" "+(y?"of ["+y.startSN+"-"+y.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(B.toFixed(3))),Object(Y.isFiniteNumber)(b.sn)&&!this.bitrateTest&&(this.nextLoadPosition=b.start+b.duration),this.state=A.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:b,targetBufferTime:B}),this.fragmentLoader.load(b,F).catch(function(W){return _.handleFragLoadError(W)})},f.doFragPartsLoad=function(b,y,B,F){var _=this;return new Promise(function(M,I){var m=[],W=function $(ae){var ue=y[ae];_.fragmentLoader.loadPart(b,ue,F).then(function(Oe){m[ue.index]=Oe;var ve=Oe.part;_.hls.trigger(r.Events.FRAG_LOADED,Oe);var Ee=y[ae+1];if(Ee&&Ee.fragment===b)$(ae+1);else return M({frag:b,part:ve,partsLoaded:m})}).catch(I)};W(B)})},f.handleFragLoadError=function(b){var y=b.data;return y&&y.details===L.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(y.frag,y.part):this.hls.trigger(r.Events.ERROR,y),null},f._handleTransmuxerFlush=function(b){var y=this.getCurrentContext(b);if(!y||this.state!==A.PARSING){this.fragCurrent||(this.state=A.IDLE);return}var B=y.frag,F=y.part,_=y.level,M=self.performance.now();B.stats.parsing.end=M,F&&(F.stats.parsing.end=M),this.updateLevelTiming(B,F,_,b.partial)},f.getCurrentContext=function(b){var y=this.levels,B=b.level,F=b.sn,_=b.part;if(!y||!y[B])return this.warn("Levels object was unset while buffering fragment "+F+" of level "+B+". The current chunk will not be buffered."),null;var M=y[B],I=_>-1?Object(h.getPartWith)(M,F,_):null,m=I?I.fragment:Object(h.getFragmentWithSN)(M,F,this.fragCurrent);return m?{frag:m,part:I,level:M}:null},f.bufferFragmentData=function(b,y,B,F){if(!b||this.state!==A.PARSING)return;var _=b.data1,M=b.data2,I=_;if(_&&M&&(I=Object(g.appendUint8Array)(_,M)),!I||!I.length)return;var m={type:b.type,frag:y,part:B,chunkMeta:F,parent:y.type,data:I};this.hls.trigger(r.Events.BUFFER_APPENDING,m),b.dropped&&b.independent&&!B&&this.flushBufferGap(y)},f.flushBufferGap=function(b){var y=this.media;if(!y)return;if(!z.BufferHelper.isBuffered(y,y.currentTime)){this.flushMainBuffer(0,b.start);return}var B=y.currentTime,F=z.BufferHelper.bufferInfo(y,B,0),_=b.duration,M=Math.min(this.config.maxFragLookUpTolerance*2,_*.25),I=Math.max(Math.min(b.start-M,F.end-M),B+M);b.start-I>M&&this.flushMainBuffer(I,b.start)},f.getFwdBufferInfo=function(b,y){var B=this.config,F=this.getLoadPosition();if(!Object(Y.isFiniteNumber)(F))return null;var _=z.BufferHelper.bufferInfo(b,F,B.maxBufferHole);if(_.len===0&&_.nextStart!==void 0){var M=this.fragmentTracker.getBufferedFrag(F,y);if(M&&_.nextStart<M.end)return z.BufferHelper.bufferInfo(b,F,Math.max(_.nextStart,B.maxBufferHole))}return _},f.getMaxBufferLength=function(b){var y=this.config,B;return b?B=Math.max(8*y.maxBufferSize/b,y.maxBufferLength):B=y.maxBufferLength,Math.min(B,y.maxMaxBufferLength)},f.reduceMaxBufferLength=function(b){var y=this.config,B=b||y.maxBufferLength;return y.maxMaxBufferLength>=B?(y.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+y.maxMaxBufferLength+"s"),!0):!1},f.getNextFragment=function(b,y){var B,F,_=y.fragments,M=_.length;if(!M)return null;var I=this.config,m=_[0].start,W;if(y.live){var $=I.initialLiveManifestSize;if(M<$)return this.warn("Not enough fragments to start playback (have: "+M+", need: "+$+")"),null;!y.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(W=this.getInitialLiveFragment(y,_),this.startPosition=W?this.hls.liveSyncPosition||W.start:b)}else b<=m&&(W=_[0]);if(!W){var ae=I.lowLatencyMode?y.partEnd:y.fragmentEnd;W=this.getFragmentAtPosition(b,ae,y)}return(B=W)!==null&&B!==void 0&&B.initSegment&&!((F=W)!==null&&F!==void 0&&F.initSegment.data)&&!this.bitrateTest&&(W=W.initSegment),W},f.getNextPart=function(b,y,B){for(var F=-1,_=!1,M=!0,I=0,m=b.length;I<m;I++){var W=b[I];if(M=M&&!W.independent,F>-1&&B<W.start)break;var $=W.loaded;!$&&(_||W.independent||M)&&W.fragment===y&&(F=I),_=$}return F},f.loadedEndOfParts=function(b,y){var B=b[b.length-1];return B&&y>B.start&&B.loaded},f.getInitialLiveFragment=function(b,y){var B=this.fragPrevious,F=null;if(B){if(b.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+B.programDateTime),F=Object(u.findFragmentByPDT)(y,B.endProgramDateTime,this.config.maxFragLookUpTolerance)),!F){var _=B.sn+1;if(_>=b.startSN&&_<=b.endSN){var M=y[_-b.startSN];B.cc===M.cc&&(F=M,this.log("Live playlist, switching playlist, load frag with next SN: "+F.sn))}F||(F=Object(u.findFragWithCC)(y,B.cc),F&&this.log("Live playlist, switching playlist, load frag with same CC: "+F.sn))}}else{var I=this.hls.liveSyncPosition;I!==null&&(F=this.getFragmentAtPosition(I,this.bitrateTest?b.fragmentEnd:b.edge,b))}return F},f.getFragmentAtPosition=function(b,y,B){var F=this.config,_=this.fragPrevious,M=B.fragments,I=B.endSN,m=B.fragmentHint,W=F.maxFragLookUpTolerance,$=!!(F.lowLatencyMode&&B.partList&&m);$&&m&&!this.bitrateTest&&(M=M.concat(m),I=m.sn);var ae;if(b<y){var ue=b>y-W?0:W;ae=Object(u.findFragmentByPTS)(_,M,b,ue)}else ae=M[M.length-1];if(ae){var Oe=ae.sn-B.startSN,ve=_&&ae.level===_.level,Ee=M[Oe+1],xe=this.fragmentTracker.getState(ae);if(xe===U.FragmentState.BACKTRACKED){ae=null;for(var Ie=Oe;M[Ie]&&this.fragmentTracker.getState(M[Ie])===U.FragmentState.BACKTRACKED;)_?ae=M[Ie--]:ae=M[--Ie];ae||(ae=Ee)}else _&&ae.sn===_.sn&&!$&&(ve&&(ae.sn<I&&this.fragmentTracker.getState(Ee)!==U.FragmentState.OK?(this.log("SN "+ae.sn+" just loaded, load next one: "+Ee.sn),ae=Ee):ae=null))}return ae},f.synchronizeToLiveEdge=function(b){var y=this.config,B=this.media;if(!B)return;var F=this.hls.liveSyncPosition,_=B.currentTime,M=b.fragments[0].start,I=b.edge,m=_>=M-y.maxFragLookUpTolerance&&_<=I;if(F!==null&&B.duration>F&&(_<F||!m)){var W=y.liveMaxLatencyDuration!==void 0?y.liveMaxLatencyDuration:y.liveMaxLatencyDurationCount*b.targetduration;(!m&&B.readyState<4||_<I-W)&&(this.loadedmetadata||(this.nextLoadPosition=F),B.readyState&&(this.warn("Playback: "+_.toFixed(3)+" is located too far from the end of live sliding playlist: "+I+", reset currentTime to : "+F.toFixed(3)),B.currentTime=F))}},f.alignPlaylists=function(b,y){var B=this.levels,F=this.levelLastLoaded,_=this.fragPrevious,M=F!==null?B[F]:null,I=b.fragments.length;if(!I)return this.warn("No fragments in live playlist"),0;var m=b.fragments[0].start,W=!y,$=b.alignedSliding&&Object(Y.isFiniteNumber)(m);if(W||!$&&!m){Object(p.alignStream)(_,M,b);var ae=b.fragments[0].start;return this.log("Live playlist sliding: "+ae.toFixed(2)+" start-sn: "+(y?y.startSN:"na")+"->"+b.startSN+" prev-sn: "+(_?_.sn:"na")+" fragments: "+I),ae}return m},f.waitForCdnTuneIn=function(b){var y=3;return b.live&&b.canBlockReload&&b.tuneInGoal>Math.max(b.partHoldBack,b.partTarget*y)},f.setStartPosition=function(b,y){var B=this.startPosition;if(B<y&&(B=-1),B===-1||this.lastCurrentTime===-1){var F=b.startTimeOffset;Object(Y.isFiniteNumber)(F)?(B=y+F,F<0&&(B+=b.totalduration),B=Math.min(Math.max(y,B),y+b.totalduration),this.log("Start time offset "+F+" found in playlist, adjust startPosition to "+B),this.startPosition=B):b.live?B=this.hls.liveSyncPosition||y:this.startPosition=B=0,this.lastCurrentTime=B}this.nextLoadPosition=B},f.getLoadPosition=function(){var b=this.media,y=0;return this.loadedmetadata&&b?y=b.currentTime:this.nextLoadPosition&&(y=this.nextLoadPosition),y},f.handleFragLoadAborted=function(b,y){this.transmuxer&&b.sn!=="initSegment"&&b.stats.aborted&&(this.warn("Fragment "+b.sn+(y?" part"+y.index:"")+" of level "+b.level+" was aborted"),this.resetFragmentLoading(b))},f.resetFragmentLoading=function(b){(!this.fragCurrent||!this.fragContextChanged(b))&&(this.state=A.IDLE)},f.onFragmentOrKeyLoadError=function(b,y){if(y.fatal)return;var B=y.frag;if(!B||B.type!==b)return;var F=this.fragCurrent;console.assert(F&&B.sn===F.sn&&B.level===F.level&&B.urlId===F.urlId,"Frag load error must match current frag to retry");var _=this.config;if(this.fragLoadError+1<=_.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(B.level))return;var M=Math.min(Math.pow(2,this.fragLoadError)*_.fragLoadingRetryDelay,_.fragLoadingMaxRetryTimeout);this.warn("Fragment "+B.sn+" of "+b+" "+B.level+" failed to load, retrying in "+M+"ms"),this.retryDate=self.performance.now()+M,this.fragLoadError++,this.state=A.FRAG_LOADING_WAITING_RETRY}else y.levelRetry?(b===s.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=A.IDLE):(H.logger.error(y.details+" reaches max retry, redispatch as fatal ..."),y.fatal=!0,this.hls.stopLoad(),this.state=A.ERROR)},f.afterBufferFlushed=function(b,y,B){if(!b)return;var F=z.BufferHelper.getBuffered(b);this.fragmentTracker.detectEvictedFragments(y,F,B),this.state===A.ENDED&&this.resetLoadingState()},f.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=A.IDLE},f.resetLiveStartWhenNotLoaded=function(b){if(!this.loadedmetadata){this.startFragRequested=!1;var y=this.levels?this.levels[b].details:null;if(y!=null&&y.live)return this.startPosition=-1,this.setStartPosition(y,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},f.updateLevelTiming=function(b,y,B,F){var _=this,M=B.details;console.assert(!!M,"level.details must be defined");var I=Object.keys(b.elementaryStreams).reduce(function(m,W){var $=b.elementaryStreams[W];if($){var ae=$.endPTS-$.startPTS;if(ae<=0)return _.warn("Could not parse fragment "+b.sn+" "+W+" duration reliably ("+ae+") resetting transmuxer to fallback to playlist timing"),_.resetTransmuxer(),m||!1;var ue=F?0:Object(h.updateFragPTSDTS)(M,b,$.startPTS,$.endPTS,$.startDTS,$.endDTS);return _.hls.trigger(r.Events.LEVEL_PTS_UPDATED,{details:M,level:B,drift:ue,type:W,frag:b,start:$.startPTS,end:$.endPTS}),!0}return m},!1);I?(this.state=A.PARSED,this.hls.trigger(r.Events.FRAG_PARSED,{frag:b,part:y})):this.resetLoadingState()},f.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},R(x,[{key:"state",get:function(){return this._state},set:function(b){var y=this._state;y!==b&&(this._state=b,this.log(y+"->"+b))}}]),x}(j.default)},"./src/controller/buffer-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return u});var Y=P("./src/polyfills/number.ts"),j=P("./src/events.ts"),U=P("./src/utils/logger.ts"),z=P("./src/errors.ts"),H=P("./src/utils/buffer-helper.ts"),r=P("./src/utils/mediasource-helper.ts"),L=P("./src/loader/fragment.ts"),v=P("./src/controller/buffer-operation-queue.ts"),g=Object(r.getMediaSource)(),p=/([ha]vc.)(?:\.[^.,]+)+/,u=function(){function h(o){var l=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=l.hls,a=l.media,R=l.mediaSource;U.logger.log("[buffer-controller]: Media source opened"),a&&(l.updateMediaElementDuration(),s.trigger(j.Events.MEDIA_ATTACHED,{media:a})),R&&R.removeEventListener("sourceopen",l._onMediaSourceOpen),l.checkPendingTracks()},this._onMediaSourceClose=function(){U.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){U.logger.log("[buffer-controller]: Media source ended")},this.hls=o,this._initSourceBuffer(),this.registerListeners()}var c=h.prototype;return c.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},c.destroy=function(){this.unregisterListeners(),this.details=null},c.registerListeners=function(){var l=this.hls;l.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(j.Events.BUFFER_RESET,this.onBufferReset,this),l.on(j.Events.BUFFER_APPENDING,this.onBufferAppending,this),l.on(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),l.on(j.Events.BUFFER_EOS,this.onBufferEos,this),l.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),l.on(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),l.on(j.Events.FRAG_PARSED,this.onFragParsed,this),l.on(j.Events.FRAG_CHANGED,this.onFragChanged,this)},c.unregisterListeners=function(){var l=this.hls;l.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(j.Events.BUFFER_RESET,this.onBufferReset,this),l.off(j.Events.BUFFER_APPENDING,this.onBufferAppending,this),l.off(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),l.off(j.Events.BUFFER_EOS,this.onBufferEos,this),l.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),l.off(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),l.off(j.Events.FRAG_PARSED,this.onFragParsed,this),l.off(j.Events.FRAG_CHANGED,this.onFragChanged,this)},c._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new v.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},c.onManifestParsed=function(l,s){var a=2;(s.audio&&!s.video||!s.altAudio)&&(a=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=a,this.details=null,U.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},c.onMediaAttaching=function(l,s){var a=this.media=s.media;if(a&&g){var R=this.mediaSource=new g;R.addEventListener("sourceopen",this._onMediaSourceOpen),R.addEventListener("sourceended",this._onMediaSourceEnded),R.addEventListener("sourceclose",this._onMediaSourceClose),a.src=self.URL.createObjectURL(R),this._objectUrl=a.src}},c.onMediaDetaching=function(){var l=this.media,s=this.mediaSource,a=this._objectUrl;if(s){if(U.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(R){U.logger.warn("[buffer-controller]: onMediaDetaching: "+R.message+" while calling endOfStream")}this.onBufferReset(),s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),l&&(a&&self.URL.revokeObjectURL(a),l.src===a?(l.removeAttribute("src"),l.load()):U.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(j.Events.MEDIA_DETACHED,void 0)},c.onBufferReset=function(){var l=this;this.getSourceBufferTypes().forEach(function(s){var a=l.sourceBuffer[s];try{a&&(l.removeBufferListeners(s),l.mediaSource&&l.mediaSource.removeSourceBuffer(a),l.sourceBuffer[s]=void 0)}catch(R){U.logger.warn("[buffer-controller]: Failed to reset the "+s+" buffer",R)}}),this._initSourceBuffer()},c.onBufferCodecs=function(l,s){var a=this,R=this.getSourceBufferTypes().length;if(Object.keys(s).forEach(function(E){if(R){var S=a.tracks[E];if(S&&typeof S.buffer.changeType=="function"){var D=s[E],A=D.codec,O=D.levelCodec,C=D.container,x=(S.levelCodec||S.codec).replace(p,"$1"),f=(O||A).replace(p,"$1");if(x!==f){var w=C+";codecs="+(O||A);a.appendChangeType(E,w)}}}else a.pendingTracks[E]=s[E]}),R)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},c.appendChangeType=function(l,s){var a=this,R=this.operationQueue,E={execute:function(){var D=a.sourceBuffer[l];D&&(U.logger.log("[buffer-controller]: changing "+l+" sourceBuffer type to "+s),D.changeType(s)),R.shiftAndExecuteNext(l)},onStart:function(){},onComplete:function(){},onError:function(D){U.logger.warn("[buffer-controller]: Failed to change "+l+" SourceBuffer type",D)}};R.append(E,l)},c.onBufferAppending=function(l,s){var a=this,R=this.hls,E=this.operationQueue,S=this.tracks,D=s.data,A=s.type,O=s.frag,C=s.part,x=s.chunkMeta,f=x.buffering[A],w=self.performance.now();f.start=w;var b=O.stats.buffering,y=C?C.stats.buffering:null;b.start===0&&(b.start=w),y&&y.start===0&&(y.start=w);var B=S.audio,F=A==="audio"&&x.id===1&&(B==null?void 0:B.container)==="audio/mpeg",_={execute:function(){if(f.executeStart=self.performance.now(),F){var I=a.sourceBuffer[A];if(I){var m=O.start-I.timestampOffset;Math.abs(m)>=.1&&(U.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+O.start+" (delta: "+m+") sn: "+O.sn+")"),I.timestampOffset=O.start)}}a.appendExecutor(D,A)},onStart:function(){},onComplete:function(){var I=self.performance.now();f.executeEnd=f.end=I,b.first===0&&(b.first=I),y&&y.first===0&&(y.first=I);var m=a.sourceBuffer,W={};for(var $ in m)W[$]=H.BufferHelper.getBuffered(m[$]);a.appendError=0,a.hls.trigger(j.Events.BUFFER_APPENDED,{type:A,frag:O,part:C,chunkMeta:x,parent:O.type,timeRanges:W})},onError:function(I){U.logger.error("[buffer-controller]: Error encountered while trying to append to the "+A+" SourceBuffer",I);var m={type:z.ErrorTypes.MEDIA_ERROR,parent:O.type,details:z.ErrorDetails.BUFFER_APPEND_ERROR,err:I,fatal:!1};I.code===DOMException.QUOTA_EXCEEDED_ERR?m.details=z.ErrorDetails.BUFFER_FULL_ERROR:(a.appendError++,m.details=z.ErrorDetails.BUFFER_APPEND_ERROR,a.appendError>R.config.appendErrorMaxRetry&&(U.logger.error("[buffer-controller]: Failed "+R.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),m.fatal=!0)),R.trigger(j.Events.ERROR,m)}};E.append(_,A)},c.onBufferFlushing=function(l,s){var a=this,R=this.operationQueue,E=function(D){return{execute:a.removeExecutor.bind(a,D,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){a.hls.trigger(j.Events.BUFFER_FLUSHED,{type:D})},onError:function(O){U.logger.warn("[buffer-controller]: Failed to remove from "+D+" SourceBuffer",O)}}};s.type?R.append(E(s.type),s.type):this.getSourceBufferTypes().forEach(function(S){R.append(E(S),S)})},c.onFragParsed=function(l,s){var a=this,R=s.frag,E=s.part,S=[],D=E?E.elementaryStreams:R.elementaryStreams;D[L.ElementaryStreamTypes.AUDIOVIDEO]?S.push("audiovideo"):(D[L.ElementaryStreamTypes.AUDIO]&&S.push("audio"),D[L.ElementaryStreamTypes.VIDEO]&&S.push("video"));var A=function(){var C=self.performance.now();R.stats.buffering.end=C,E&&(E.stats.buffering.end=C);var x=E?E.stats:R.stats;a.hls.trigger(j.Events.FRAG_BUFFERED,{frag:R,part:E,stats:x,id:R.type})};S.length===0&&U.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+R.type+" level: "+R.level+" sn: "+R.sn),this.blockBuffers(A,S)},c.onFragChanged=function(l,s){this.flushBackBuffer()},c.onBufferEos=function(l,s){var a=this,R=this.getSourceBufferTypes().reduce(function(E,S){var D=a.sourceBuffer[S];return(!s.type||s.type===S)&&(D&&!D.ended&&(D.ended=!0,U.logger.log("[buffer-controller]: "+S+" sourceBuffer now EOS"))),E&&!!(!D||D.ended)},!0);R&&this.blockBuffers(function(){var E=a.mediaSource;if(!E||E.readyState!=="open")return;E.endOfStream()})},c.onLevelUpdated=function(l,s){var a=s.details;if(!a.fragments.length)return;this.details=a,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},c.flushBackBuffer=function(){var l=this.hls,s=this.details,a=this.media,R=this.sourceBuffer;if(!a||s===null)return;var E=this.getSourceBufferTypes();if(!E.length)return;var S=s.live&&l.config.liveBackBufferLength!==null?l.config.liveBackBufferLength:l.config.backBufferLength;if(!Object(Y.isFiniteNumber)(S)||S<0)return;var D=a.currentTime,A=s.levelTargetDuration,O=Math.max(S,A),C=Math.floor(D/A)*A-O;E.forEach(function(x){var f=R[x];if(f){var w=H.BufferHelper.getBuffered(f);w.length>0&&C>w.start(0)&&(l.trigger(j.Events.BACK_BUFFER_REACHED,{bufferEnd:C}),s.live&&l.trigger(j.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:C}),l.trigger(j.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:C,type:x}))}})},c.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var l=this.details,s=this.hls,a=this.media,R=this.mediaSource,E=l.fragments[0].start+l.totalduration,S=a.duration,D=Object(Y.isFiniteNumber)(R.duration)?R.duration:0;l.live&&s.config.liveDurationInfinity?(U.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),R.duration=Infinity,this.updateSeekableRange(l)):(E>D&&E>S||!Object(Y.isFiniteNumber)(S))&&(U.logger.log("[buffer-controller]: Updating Media Source duration to "+E.toFixed(3)),R.duration=E)},c.updateSeekableRange=function(l){var s=this.mediaSource,a=l.fragments,R=a.length;if(R&&l.live&&s!==null&&s!==void 0&&s.setLiveSeekableRange){var E=Math.max(0,a[0].start),S=Math.max(E,E+l.totalduration);s.setLiveSeekableRange(E,S)}},c.checkPendingTracks=function(){var l=this.bufferCodecEventsExpected,s=this.operationQueue,a=this.pendingTracks,R=Object.keys(a).length;if(R&&!l||R===2){this.createSourceBuffers(a),this.pendingTracks={};var E=this.getSourceBufferTypes();if(E.length===0){this.hls.trigger(j.Events.ERROR,{type:z.ErrorTypes.MEDIA_ERROR,details:z.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}E.forEach(function(S){s.executeNext(S)})}},c.createSourceBuffers=function(l){var s=this.sourceBuffer,a=this.mediaSource;if(!a)throw Error("createSourceBuffers called when mediaSource was null");var R=0;for(var E in l)if(!s[E]){var S=l[E];if(!S)throw Error("source buffer exists for track "+E+", however track does not");var D=S.levelCodec||S.codec,A=S.container+";codecs="+D;U.logger.log("[buffer-controller]: creating sourceBuffer("+A+")");try{var O=s[E]=a.addSourceBuffer(A),C=E;this.addBufferListener(C,"updatestart",this._onSBUpdateStart),this.addBufferListener(C,"updateend",this._onSBUpdateEnd),this.addBufferListener(C,"error",this._onSBUpdateError),this.tracks[E]={buffer:O,codec:D,container:S.container,levelCodec:S.levelCodec,id:S.id},R++}catch(x){U.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+x.message),this.hls.trigger(j.Events.ERROR,{type:z.ErrorTypes.MEDIA_ERROR,details:z.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:x,mimeType:A})}}R&&this.hls.trigger(j.Events.BUFFER_CREATED,{tracks:this.tracks})},c._onSBUpdateStart=function(l){var s=this.operationQueue,a=s.current(l);a.onStart()},c._onSBUpdateEnd=function(l){var s=this.operationQueue,a=s.current(l);a.onComplete(),s.shiftAndExecuteNext(l)},c._onSBUpdateError=function(l,s){U.logger.error("[buffer-controller]: "+l+" SourceBuffer error",s),this.hls.trigger(j.Events.ERROR,{type:z.ErrorTypes.MEDIA_ERROR,details:z.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var a=this.operationQueue.current(l);a&&a.onError(s)},c.removeExecutor=function(l,s,a){var R=this.media,E=this.mediaSource,S=this.operationQueue,D=this.sourceBuffer,A=D[l];if(!R||!E||!A){U.logger.warn("[buffer-controller]: Attempting to remove from the "+l+" SourceBuffer, but it does not exist"),S.shiftAndExecuteNext(l);return}var O=Object(Y.isFiniteNumber)(R.duration)?R.duration:Infinity,C=Object(Y.isFiniteNumber)(E.duration)?E.duration:Infinity,x=Math.max(0,s),f=Math.min(a,O,C);f>x?(U.logger.log("[buffer-controller]: Removing ["+x+","+f+"] from the "+l+" SourceBuffer"),console.assert(!A.updating,l+" sourceBuffer must not be updating"),A.remove(x,f)):S.shiftAndExecuteNext(l)},c.appendExecutor=function(l,s){var a=this.operationQueue,R=this.sourceBuffer,E=R[s];if(!E){U.logger.warn("[buffer-controller]: Attempting to append to the "+s+" SourceBuffer, but it does not exist"),a.shiftAndExecuteNext(s);return}E.ended=!1,console.assert(!E.updating,s+" sourceBuffer must not be updating"),E.appendBuffer(l)},c.blockBuffers=function(l,s){var a=this;if(s===void 0&&(s=this.getSourceBufferTypes()),!s.length){U.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(l);return}var R=this.operationQueue,E=s.map(function(S){return R.appendBlocker(S)});Promise.all(E).then(function(){l(),s.forEach(function(S){var D=a.sourceBuffer[S];(!D||!D.updating)&&R.shiftAndExecuteNext(S)})})},c.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},c.addBufferListener=function(l,s,a){var R=this.sourceBuffer[l];if(!R)return;var E=a.bind(this,l);this.listeners[l].push({event:s,listener:E}),R.addEventListener(s,E)},c.removeBufferListeners=function(l){var s=this.sourceBuffer[l];if(!s)return;this.listeners[l].forEach(function(a){s.removeEventListener(a.event,a.listener)})},h}()},"./src/controller/buffer-operation-queue.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return j});var Y=P("./src/utils/logger.ts"),j=function(){function U(H){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=H}var z=U.prototype;return z.append=function(r,L){var v=this.queues[L];v.push(r),v.length===1&&this.buffers[L]&&this.executeNext(L)},z.insertAbort=function(r,L){var v=this.queues[L];v.unshift(r),this.executeNext(L)},z.appendBlocker=function(r){var L,v=new Promise(function(p){L=p}),g={execute:L,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(g,r),v},z.executeNext=function(r){var L=this.buffers,v=this.queues,g=L[r],p=v[r];if(p.length){var u=p[0];try{u.execute()}catch(h){Y.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),u.onError(h),(!g||!g.updating)&&(p.shift(),this.executeNext(r))}}},z.shiftAndExecuteNext=function(r){this.queues[r].shift(),this.executeNext(r)},z.current=function(r){return this.queues[r][0]},U}()},"./src/controller/cap-level-controller.ts":function(ne,J,P){"use strict";P.r(J);var Y=P("./src/events.ts");function j(H,r){for(var L=0;L<r.length;L++){var v=r[L];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(H,v.key,v)}}function U(H,r,L){return r&&j(H.prototype,r),L&&j(H,L),H}var z=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 r=H.prototype;return r.setStreamController=function(v){this.streamController=v},r.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},r.registerListeners=function(){var v=this.hls;v.on(Y.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.on(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.on(Y.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.unregisterListener=function(){var v=this.hls;v.off(Y.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.off(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.off(Y.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.onFpsDropLevelCapping=function(v,g){H.isLevelAllowed(g.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(g.droppedLevel)},r.onMediaAttaching=function(v,g){this.media=g.media instanceof HTMLVideoElement?g.media:null},r.onManifestParsed=function(v,g){var p=this.hls;this.restrictedLevels=[],this.firstLevel=g.firstLevel,p.config.capLevelToPlayerSize&&g.video&&this.startCapping()},r.onBufferCodecs=function(v,g){var p=this.hls;p.config.capLevelToPlayerSize&&g.video&&this.startCapping()},r.onMediaDetaching=function(){this.stopCapping()},r.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var v=this.hls.levels;if(v.length){var g=this.hls;g.autoLevelCapping=this.getMaxLevel(v.length-1),g.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=g.autoLevelCapping}}},r.getMaxLevel=function(v){var g=this,p=this.hls.levels;if(!p.length)return-1;var u=p.filter(function(h,c){return H.isLevelAllowed(c,g.restrictedLevels)&&c<=v});return this.clientRect=null,H.getMaxLevelByMediaSize(u,this.mediaWidth,this.mediaHeight)},r.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},r.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},r.getDimensions=function(){if(this.clientRect)return this.clientRect;var v=this.media,g={width:0,height:0};if(v){var p=v.getBoundingClientRect();g.width=p.width,g.height=p.height,!g.width&&!g.height&&(g.width=p.right-p.left||v.width||0,g.height=p.bottom-p.top||v.height||0)}return this.clientRect=g,g},H.isLevelAllowed=function(v,g){return g===void 0&&(g=[]),g.indexOf(v)===-1},H.getMaxLevelByMediaSize=function(v,g,p){if(!v||!v.length)return-1;for(var u=function(s,a){return a?s.width!==a.width||s.height!==a.height:!0},h=v.length-1,c=0;c<v.length;c+=1){var o=v[c];if((o.width>=g||o.height>=p)&&u(o,v[c+1])){h=c;break}}return h},U(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(g){}return v}}]),H}();J.default=z},"./src/controller/cmcd-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return u});var Y=P("./src/events.ts"),j=P("./src/types/cmcd.ts"),U=P("./src/utils/buffer-helper.ts"),z=P("./src/utils/logger.ts");function H(h,c){for(var o=0;o<c.length;o++){var l=c[o];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function r(h,c,o){return c&&H(h.prototype,c),o&&H(h,o),h}function L(h,c){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))||c&&h&&typeof h.length=="number"){o&&(h=o);var l=0;return function(){return l>=h.length?{done:!0}:{done:!1,value:h[l++]}}}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,c){if(!h)return;if(typeof h=="string")return g(h,c);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 g(h,c)}function g(h,c){(c==null||c>h.length)&&(c=h.length);for(var o=0,l=new Array(c);o<c;o++)l[o]=h[o];return l}function p(){return p=Object.assign||function(h){for(var c=1;c<arguments.length;c++){var o=arguments[c];for(var l in o)Object.prototype.hasOwnProperty.call(o,l)&&(h[l]=o[l])}return h},p.apply(this,arguments)}var u=function(){function h(o){var l=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(){l.initialized&&(l.starved=!0),l.buffering=!0},this.onPlaying=function(){l.initialized||(l.initialized=!0),l.buffering=!1},this.applyPlaylistData=function(R){try{l.apply(R,{ot:j.CMCDObjectType.MANIFEST,su:!l.initialized})}catch(E){z.logger.warn("Could not generate manifest CMCD data.",E)}},this.applyFragmentData=function(R){try{var E=R.frag,S=l.hls.levels[E.level],D=l.getObjectType(E),A={d:E.duration*1e3,ot:D};(D===j.CMCDObjectType.VIDEO||D===j.CMCDObjectType.AUDIO||D==j.CMCDObjectType.MUXED)&&(A.br=S.bitrate/1e3,A.tb=l.getTopBandwidth(D),A.bl=l.getBufferLength(D)),l.apply(R,A)}catch(O){z.logger.warn("Could not generate segment CMCD data.",O)}},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 c=h.prototype;return c.registerListeners=function(){var l=this.hls;l.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),l.on(Y.Events.BUFFER_CREATED,this.onBufferCreated,this)},c.unregisterListeners=function(){var l=this.hls;l.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),l.off(Y.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},c.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},c.onMediaAttached=function(l,s){this.media=s.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},c.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},c.onBufferCreated=function(l,s){var a,R;this.audioBuffer=(a=s.tracks.audio)===null||a===void 0?void 0:a.buffer,this.videoBuffer=(R=s.tracks.video)===null||R===void 0?void 0:R.buffer},c.createData=function(){var l;return{v:j.CMCDVersion,sf:j.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(l=this.media)===null||l===void 0?void 0:l.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},c.apply=function(l,s){s===void 0&&(s={}),p(s,this.createData());var a=s.ot===j.CMCDObjectType.INIT||s.ot===j.CMCDObjectType.VIDEO||s.ot===j.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 R=h.toHeaders(s);if(!Object.keys(R).length)return;l.headers||(l.headers={}),p(l.headers,R)}else{var E=h.toQuery(s);if(!E)return;l.url=h.appendQueryToUri(l.url,E)}},c.getObjectType=function(l){var s=l.type;return s==="subtitle"?j.CMCDObjectType.TIMED_TEXT:l.sn==="initSegment"?j.CMCDObjectType.INIT:s==="audio"?j.CMCDObjectType.AUDIO:s==="main"?this.hls.audioTracks.length?j.CMCDObjectType.VIDEO:j.CMCDObjectType.MUXED:void 0},c.getTopBandwidth=function(l){for(var s=0,a=l===j.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,R=L(a),E;!(E=R()).done;){var S=E.value;S.bitrate>s&&(s=S.bitrate)}return s>0?s:NaN},c.getBufferLength=function(l){var s=this.hls.media,a=l===j.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!a||!s)return NaN;var R=U.BufferHelper.bufferInfo(a,s.currentTime,this.config.maxBufferHole);return R.len*1e3},c.createPlaylistLoader=function(){var l=this.config.pLoader,s=this.applyPlaylistData,a=l||this.config.loader;return function(){function R(S){this.loader=void 0,this.loader=new a(S)}var E=R.prototype;return E.destroy=function(){this.loader.destroy()},E.abort=function(){this.loader.abort()},E.load=function(D,A,O){s(D),this.loader.load(D,A,O)},r(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},c.createFragmentLoader=function(){var l=this.config.fLoader,s=this.applyFragmentData,a=l||this.config.loader;return function(){function R(S){this.loader=void 0,this.loader=new a(S)}var E=R.prototype;return E.destroy=function(){this.loader.destroy()},E.abort=function(){this.loader.abort()},E.load=function(D,A,O){s(D),this.loader.load(D,A,O)},r(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},h.uuid=function(){var l=URL.createObjectURL(new Blob),s=l.toString();return URL.revokeObjectURL(l),s.substr(s.lastIndexOf("/")+1)},h.serialize=function(l){for(var s=[],a=function(F){return!Number.isNaN(F)&&F!=null&&F!==""&&F!==!1},R=function(F){return Math.round(F)},E=function(F){return R(F/100)*100},S=function(F){return encodeURIComponent(F)},D={br:R,d:R,bl:E,dl:E,mtp:E,nor:S,rtp:E,tb:R},A=Object.keys(l||{}).sort(),O=L(A),C;!(C=O()).done;){var x=C.value,f=l[x];if(!a(f))continue;if(x==="v"&&f===1)continue;if(x=="pr"&&f===1)continue;var w=D[x];w&&(f=w(f));var b=typeof f,y=void 0;x==="ot"||x==="sf"||x==="st"?y=x+"="+f:b==="boolean"?y=x:b==="number"?y=x+"="+f:y=x+"="+JSON.stringify(f),s.push(y)}return s.join(",")},h.toHeaders=function(l){for(var s=Object.keys(l),a={},R=["Object","Request","Session","Status"],E=[{},{},{},{}],S={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},D=0,A=s;D<A.length;D++){var O=A[D],C=S[O]!=null?S[O]:1;E[C][O]=l[O]}for(var x=0;x<E.length;x++){var f=h.serialize(E[x]);f&&(a["CMCD-"+R[x]]=f)}return a},h.toQuery=function(l){return"CMCD="+encodeURIComponent(h.serialize(l))},h.appendQueryToUri=function(l,s){if(!s)return l;var a=l.includes("?")?"&":"?";return""+l+a+s},h}()},"./src/controller/eme-controller.ts":function(ne,J,P){"use strict";P.r(J);var Y=P("./src/events.ts"),j=P("./src/errors.ts"),U=P("./src/utils/logger.ts"),z=P("./src/utils/mediakeys-helper.ts");function H(u,h){for(var c=0;c<h.length;c++){var o=h[c];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(u,o.key,o)}}function r(u,h,c){return h&&H(u.prototype,h),c&&H(u,c),u}var L=3,v=function(h,c,o){var l={audioCapabilities:[],videoCapabilities:[]};return h.forEach(function(s){l.audioCapabilities.push({contentType:'audio/mp4; codecs="'+s+'"',robustness:o.audioRobustness||""})}),c.forEach(function(s){l.videoCapabilities.push({contentType:'video/mp4; codecs="'+s+'"',robustness:o.videoRobustness||""})}),[l]},g=function(h,c,o,l){switch(h){case z.KeySystems.WIDEVINE:return v(c,o,l);default:throw new Error("Unknown key-system: "+h)}},p=function(){function u(c){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=c,this._config=c.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=u.prototype;return h.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},h._registerListeners=function(){this.hls.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this)},h._unregisterListeners=function(){this.hls.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this)},h.getLicenseServerUrl=function(o){switch(o){case z.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,l,s){var a=this,R=g(o,l,s,this._drmSystemOptions);U.logger.log("Requesting encrypted media key-system access");var E=this.requestMediaKeySystemAccess(o,R);this.mediaKeysPromise=E.then(function(S){return a._onMediaKeySystemAccessObtained(o,S)}),E.catch(function(S){U.logger.error('Failed to obtain key-system "'+o+'" access:',S)})},h._onMediaKeySystemAccessObtained=function(o,l){var s=this;U.logger.log('Access for key-system "'+o+'" obtained');var a={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:l,mediaKeySystemDomain:o};this._mediaKeysList.push(a);var R=Promise.resolve().then(function(){return l.createMediaKeys()}).then(function(E){return a.mediaKeys=E,U.logger.log('Media-keys created for key-system "'+o+'"'),s._onMediaKeysCreated(),E});return R.catch(function(E){U.logger.error("Failed to create media-keys:",E)}),R},h._onMediaKeysCreated=function(){var o=this;this._mediaKeysList.forEach(function(l){l.mediaKeysSession||(l.mediaKeysSession=l.mediaKeys.createSession(),o._onNewMediaKeySession(l.mediaKeysSession))})},h._onNewMediaKeySession=function(o){var l=this;U.logger.log("New key-system session "+o.sessionId),o.addEventListener("message",function(s){l._onKeySessionMessage(o,s.message)},!1)},h._onKeySessionMessage=function(o,l){U.logger.log("Got EME message event, creating license request"),this._requestLicense(l,function(s){U.logger.log("Received license data (length: "+(s&&s.byteLength)+"), updating key-session"),o.update(s)})},h.onMediaEncrypted=function(o){var l=this;if(U.logger.log('Media is encrypted using "'+o.initDataType+'" init data type'),!this.mediaKeysPromise){U.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var s=function(R){if(!l._media)return;l._attemptSetMediaKeys(R),l._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 l=this._mediaKeysList[0];if(!l||!l.mediaKeys){U.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}U.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(l.mediaKeys),this._hasSetMediaKeys=!0}},h._generateRequestWithPreferredKeySession=function(o,l){var s=this,a=this._mediaKeysList[0];if(!a){U.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(a.mediaKeysSessionInitialized){U.logger.warn("Key-Session already initialized but requested again");return}var R=a.mediaKeysSession;if(!R){U.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!l){U.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}U.logger.log('Generating key-session request for "'+o+'" init data type'),a.mediaKeysSessionInitialized=!0,R.generateRequest(o,l).then(function(){U.logger.debug("Key-session generation succeeded")}).catch(function(E){U.logger.error("Error generating key-session request:",E),s.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},h._createLicenseXhr=function(o,l,s){var a=new XMLHttpRequest;a.responseType="arraybuffer",a.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,a,o,l,s);var R=this._licenseXhrSetup;if(R)try{R.call(this.hls,a,o),R=void 0}catch(E){U.logger.error(E)}try{a.readyState||a.open("POST",o,!0),R&&R.call(this.hls,a,o)}catch(E){throw new Error("issue setting up KeySystem license XHR "+E)}return a},h._onLicenseRequestReadyStageChange=function(o,l,s,a){switch(o.readyState){case 4:if(o.status===200){this._requestLicenseFailureCount=0,U.logger.log("License request succeeded");var R=o.response,E=this._licenseResponseCallback;if(E)try{R=E.call(this.hls,o,l)}catch(D){U.logger.error(D)}a(R)}else{if(U.logger.error("License Request XHR failed ("+l+"). Status: "+o.status+" ("+o.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>L){this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var S=L-this._requestLicenseFailureCount+1;U.logger.warn("Retrying license request, "+S+" attempts left"),this._requestLicense(s,a)}break}},h._generateLicenseRequestChallenge=function(o,l){switch(o.mediaKeySystemDomain){case z.KeySystems.WIDEVINE:return l}throw new Error("unsupported key-system: "+o.mediaKeySystemDomain)},h._requestLicense=function(o,l){U.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){U.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var a=this.getLicenseServerUrl(s.mediaKeySystemDomain),R=this._createLicenseXhr(a,o,l);U.logger.log("Sending license request to URL: "+a);var E=this._generateLicenseRequestChallenge(s,o);R.send(E)}catch(S){U.logger.error("Failure requesting DRM license: "+S),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},h.onMediaAttached=function(o,l){if(!this._emeEnabled)return;var s=l.media;this._media=s,s.addEventListener("encrypted",this._onMediaEncrypted)},h.onMediaDetached=function(){var o=this._media,l=this._mediaKeysList;if(!o)return;o.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(l.map(function(s){if(s.mediaKeysSession)return s.mediaKeysSession.close().catch(function(){})})).then(function(){return o.setMediaKeys(null)}).catch(function(){})},h.onManifestParsed=function(o,l){if(!this._emeEnabled)return;var s=l.levels.map(function(R){return R.audioCodec}).filter(function(R){return!!R}),a=l.levels.map(function(R){return R.videoCodec}).filter(function(R){return!!R});this._attemptKeySystemAccess(z.KeySystems.WIDEVINE,s,a)},r(u,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),u}();J.default=p},"./src/controller/fps-controller.ts":function(ne,J,P){"use strict";P.r(J);var Y=P("./src/events.ts"),j=P("./src/utils/logger.ts"),U=function(){function z(r){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=r,this.registerListeners()}var H=z.prototype;return H.setStreamController=function(L){this.streamController=L},H.registerListeners=function(){this.hls.on(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},H.unregisterListeners=function(){this.hls.off(Y.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 g=this.hls.config;if(g.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),g.fpsDroppedMonitoringPeriod)}},H.checkFPS=function(L,v,g){var p=performance.now();if(v){if(this.lastTime){var u=p-this.lastTime,h=g-this.lastDroppedFrames,c=v-this.lastDecodedFrames,o=1e3*h/u,l=this.hls;if(l.trigger(Y.Events.FPS_DROP,{currentDropped:h,currentDecoded:c,totalDroppedFrames:g}),o>0&&h>l.config.fpsDroppedMonitoringThreshold*c){var s=l.currentLevel;j.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(l.autoLevelCapping===-1||l.autoLevelCapping>=s)&&(s=s-1,l.trigger(Y.Events.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:l.currentLevel}),l.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=p,this.lastDroppedFrames=g,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)},z}();J.default=U},"./src/controller/fragment-finders.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"findFragmentByPDT",function(){return U}),P.d(J,"findFragmentByPTS",function(){return z}),P.d(J,"fragmentWithinToleranceTest",function(){return H}),P.d(J,"pdtWithinToleranceTest",function(){return r}),P.d(J,"findFragWithCC",function(){return L});var Y=P("./src/polyfills/number.ts"),j=P("./src/utils/binary-search.ts");function U(v,g,p){if(g===null||!Array.isArray(v)||!v.length||!Object(Y.isFiniteNumber)(g))return null;var u=v[0].programDateTime;if(g<(u||0))return null;var h=v[v.length-1].endProgramDateTime;if(g>=(h||0))return null;p=p||0;for(var c=0;c<v.length;++c){var o=v[c];if(r(g,p,o))return o}return null}function z(v,g,p,u){p===void 0&&(p=0),u===void 0&&(u=0);var h=null;if(v?h=g[v.sn-g[0].sn+1]||null:p===0&&g[0].start===0&&(h=g[0]),h&&H(p,u,h)===0)return h;var c=j.default.search(g,H.bind(null,p,u));return c||h}function H(v,g,p){v===void 0&&(v=0),g===void 0&&(g=0);var u=Math.min(g,p.duration+(p.deltaPTS?p.deltaPTS:0));return p.start+p.duration-u<=v?1:p.start-u>v&&p.start?-1:0}function r(v,g,p){var u=Math.min(g,p.duration+(p.deltaPTS?p.deltaPTS:0))*1e3,h=p.endProgramDateTime||0;return h-u>v}function L(v,g){return j.default.search(v,function(p){return p.cc<g?1:p.cc>g?-1:0})}},"./src/controller/fragment-tracker.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"FragmentState",function(){return U}),P.d(J,"FragmentTracker",function(){return z});var Y=P("./src/events.ts"),j=P("./src/types/loader.ts"),U;(function(L){L.NOT_LOADED="NOT_LOADED",L.BACKTRACKED="BACKTRACKED",L.APPENDING="APPENDING",L.PARTIAL="PARTIAL",L.OK="OK"})(U||(U={}));var z=function(){function L(g){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=g,this._registerListeners()}var v=L.prototype;return v._registerListeners=function(){var p=this.hls;p.on(Y.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.on(Y.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.on(Y.Events.FRAG_LOADED,this.onFragLoaded,this)},v._unregisterListeners=function(){var p=this.hls;p.off(Y.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.off(Y.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.off(Y.Events.FRAG_LOADED,this.onFragLoaded,this)},v.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},v.getAppendedFrag=function(p,u){if(u===j.PlaylistLevelType.MAIN){var h=this.activeFragment,c=this.activeParts;if(!h)return null;if(c)for(var o=c.length;o--;){var l=c[o],s=l?l.end:h.appendedPTS;if(l.start<=p&&s!==void 0&&p<=s)return o>9&&(this.activeParts=c.slice(o-9)),l}else if(h.start<=p&&h.appendedPTS!==void 0&&p<=h.appendedPTS)return h}return this.getBufferedFrag(p,u)},v.getBufferedFrag=function(p,u){for(var h=this.fragments,c=Object.keys(h),o=c.length;o--;){var l=h[c[o]];if((l==null?void 0:l.body.type)===u&&l.buffered){var s=l.body;if(s.start<=p&&p<=s.end)return s}}return null},v.detectEvictedFragments=function(p,u,h){var c=this;Object.keys(this.fragments).forEach(function(o){var l=c.fragments[o];if(!l)return;if(!l.buffered){l.body.type===h&&c.removeFragment(l.body);return}var s=l.range[p];if(!s)return;s.time.some(function(a){var R=!c.isTimeBuffered(a.startPTS,a.endPTS,u);return R&&c.removeFragment(l.body),R})})},v.detectPartialFragments=function(p){var u=this,h=this.timeRanges,c=p.frag,o=p.part;if(!h||c.sn==="initSegment")return;var l=r(c),s=this.fragments[l];if(!s)return;Object.keys(h).forEach(function(a){var R=c.elementaryStreams[a];if(!R)return;var E=h[a],S=o!==null||R.partial===!0;s.range[a]=u.getBufferedTimes(c,o,S,E)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},v.fragBuffered=function(p){var u=r(p),h=this.fragments[u];h&&(h.backtrack=h.loaded=null,h.buffered=!0)},v.getBufferedTimes=function(p,u,h,c){for(var o={time:[],partial:h},l=u?u.start:p.start,s=u?u.end:p.end,a=p.minEndPTS||s,R=p.maxStartPTS||l,E=0;E<c.length;E++){var S=c.start(E)-this.bufferPadding,D=c.end(E)+this.bufferPadding;if(R>=S&&a<=D){o.time.push({startPTS:Math.max(l,c.start(E)),endPTS:Math.min(s,c.end(E))});break}else if(l<D&&s>S)o.partial=!0,o.time.push({startPTS:Math.max(l,c.start(E)),endPTS:Math.min(s,c.end(E))});else if(s<=S)break}return o},v.getPartialFragment=function(p){var u=null,h,c,o,l=0,s=this.bufferPadding,a=this.fragments;return Object.keys(a).forEach(function(R){var E=a[R];if(!E)return;H(E)&&(c=E.body.start-s,o=E.body.end+s,p>=c&&p<=o&&(h=Math.min(p-c,o-p),l<=h&&(u=E.body,l=h)))}),u},v.getState=function(p){var u=r(p),h=this.fragments[u];return h?h.buffered?H(h)?U.PARTIAL:U.OK:h.backtrack?U.BACKTRACKED:U.APPENDING:U.NOT_LOADED},v.backtrack=function(p,u){var h=r(p),c=this.fragments[h];if(!c||c.backtrack)return null;var o=c.backtrack=u||c.loaded;return c.loaded=null,o},v.getBacktrackData=function(p){var u=r(p),h=this.fragments[u];if(h){var c,o=h.backtrack;if(o!=null&&(c=o.payload)!==null&&c!==void 0&&c.byteLength)return o;this.removeFragment(p)}return null},v.isTimeBuffered=function(p,u,h){for(var c,o,l=0;l<h.length;l++){if(c=h.start(l)-this.bufferPadding,o=h.end(l)+this.bufferPadding,p>=c&&u<=o)return!0;if(u<=c)return!1}return!1},v.onFragLoaded=function(p,u){var h=u.frag,c=u.part;if(h.sn==="initSegment"||h.bitrateTest||c)return;var o=r(h);this.fragments[o]={body:h,loaded:u,backtrack:null,buffered:!1,range:Object.create(null)}},v.onBufferAppended=function(p,u){var h=this,c=u.frag,o=u.part,l=u.timeRanges;if(c.type===j.PlaylistLevelType.MAIN)if(this.activeFragment=c,o){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(o)}else this.activeParts=null;this.timeRanges=l,Object.keys(l).forEach(function(a){var R=l[a];if(h.detectEvictedFragments(a,R),!o)for(var E=0;E<R.length;E++)c.appendedPTS=Math.max(R.end(E),c.appendedPTS||0)})},v.onFragBuffered=function(p,u){this.detectPartialFragments(u)},v.hasFragment=function(p){var u=r(p);return!!this.fragments[u]},v.removeFragmentsInRange=function(p,u,h){var c=this;Object.keys(this.fragments).forEach(function(o){var l=c.fragments[o];if(!l)return;if(l.buffered){var s=l.body;s.type===h&&s.start<u&&s.end>p&&c.removeFragment(s)}})},v.removeFragment=function(p){var u=r(p);p.stats.loaded=0,p.clearElementaryStreamInfo(),delete this.fragments[u]},v.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},L}();function H(L){var v,g;return L.buffered&&(((v=L.range.video)===null||v===void 0?void 0:v.partial)||((g=L.range.audio)===null||g===void 0?void 0:g.partial))}function r(L){return L.type+"_"+L.level+"_"+L.urlId+"_"+L.sn}},"./src/controller/gap-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"STALL_MINIMUM_DURATION_MS",function(){return H}),P.d(J,"MAX_START_GAP_JUMP",function(){return r}),P.d(J,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return L}),P.d(J,"SKIP_BUFFER_RANGE_START",function(){return v}),P.d(J,"default",function(){return g});var Y=P("./src/utils/buffer-helper.ts"),j=P("./src/errors.ts"),U=P("./src/events.ts"),z=P("./src/utils/logger.ts"),H=250,r=2,L=.1,v=.05,g=function(){function p(h,c,o,l){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=c,this.fragmentTracker=o,this.hls=l}var u=p.prototype;return u.destroy=function(){this.hls=this.fragmentTracker=this.media=null},u.poll=function(c){var o=this.config,l=this.media,s=this.stalled,a=l.currentTime,R=l.seeking,E=this.seeking&&!R,S=!this.seeking&&R;if(this.seeking=R,a!==c){if(this.moved=!0,s!==null){if(this.stallReported){var D=self.performance.now()-s;z.logger.warn("playback not stuck anymore @"+a+", after "+Math.round(D)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((S||E)&&(this.stalled=null),l.paused||l.ended||l.playbackRate===0||!Y.BufferHelper.getBuffered(l).length)return;var A=Y.BufferHelper.bufferInfo(l,a,0),O=A.len>0,C=A.nextStart||0;if(!O&&!C)return;if(R){var x=A.len>r,f=!C||C-a>r&&!this.fragmentTracker.getPartialFragment(a);if(x||f)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var w,b=Math.max(C,A.start||0)-a,y=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,B=y==null||((w=y.details)===null||w===void 0)?void 0:w.live,F=B?y.details.targetduration*2:r;if(b>0&&b<=F){this._trySkipBufferHole(null);return}}var _=self.performance.now();if(s===null){this.stalled=_;return}var M=_-s;!R&&M>=H&&this._reportStall(A.len);var I=Y.BufferHelper.bufferInfo(l,a,o.maxBufferHole);this._tryFixBufferStall(I,M)},u._tryFixBufferStall=function(c,o){var l=this.config,s=this.fragmentTracker,a=this.media,R=a.currentTime,E=s.getPartialFragment(R);if(E){var S=this._trySkipBufferHole(E);if(S)return}c.len>l.maxBufferHole&&o>l.highBufferWatchdogPeriod*1e3&&(z.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},u._reportStall=function(c){var o=this.hls,l=this.media,s=this.stallReported;s||(this.stallReported=!0,z.logger.warn("Playback stalling at @"+l.currentTime+" due to low buffer (buffer="+c+")"),o.trigger(U.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:c}))},u._trySkipBufferHole=function(c){for(var o=this.config,l=this.hls,s=this.media,a=s.currentTime,R=0,E=Y.BufferHelper.getBuffered(s),S=0;S<E.length;S++){var D=E.start(S);if(a+o.maxBufferHole>=R&&a<D){var A=Math.max(D+v,s.currentTime+L);return z.logger.warn("skipping hole, adjusting currentTime from "+a+" to "+A),this.moved=!0,this.stalled=null,s.currentTime=A,c&&l.trigger(U.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+a+" to "+A,frag:c}),A}R=E.end(S)}return 0},u._tryNudgeBuffer=function(){var c=this.config,o=this.hls,l=this.media,s=l.currentTime,a=(this.nudgeRetry||0)+1;if(this.nudgeRetry=a,a<c.nudgeMaxRetry){var R=s+a*c.nudgeOffset;z.logger.warn("Nudging 'currentTime' from "+s+" to "+R),l.currentTime=R,o.trigger(U.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else z.logger.error("Playhead still not moving while enough data buffered @"+s+" after "+c.nudgeMaxRetry+" nudges"),o.trigger(U.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},p}()},"./src/controller/id3-track-controller.ts":function(ne,J,P){"use strict";P.r(J);var Y=P("./src/events.ts"),j=P("./src/utils/texttrack-utils.ts"),U=P("./src/demux/id3.ts"),z=.25,H=function(){function r(v){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=v,this._registerListeners()}var L=r.prototype;return L.destroy=function(){this._unregisterListeners()},L._registerListeners=function(){var g=this.hls;g.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.on(Y.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.on(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},L._unregisterListeners=function(){var g=this.hls;g.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(Y.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.off(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},L.onMediaAttached=function(g,p){this.media=p.media},L.onMediaDetaching=function(){if(!this.id3Track)return;Object(j.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},L.getID3Track=function(g){if(!this.media)return;for(var p=0;p<g.length;p++){var u=g[p];if(u.kind==="metadata"&&u.label==="id3")return Object(j.sendAddTrackEvent)(u,this.media),u}return this.media.addTextTrack("metadata","id3")},L.onFragParsingMetadata=function(g,p){if(!this.media)return;var u=p.frag,h=p.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var c=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,o=0;o<h.length;o++){var l=U.getID3Frames(h[o].data);if(l){var s=h[o].pts,a=o<h.length-1?h[o+1].pts:u.end,R=a-s;R<=0&&(a=s+z);for(var E=0;E<l.length;E++){var S=l[E];if(!U.isTimeStampFrame(S)){var D=new c(s,a,"");D.value=S,this.id3Track.addCue(D)}}}}},L.onBufferFlushing=function(g,p){var u=p.startOffset,h=p.endOffset,c=p.type;if(!c||c==="audio"){var o=this.id3Track;o&&Object(j.removeCuesInRange)(o,u,h)}},r}();J.default=H},"./src/controller/latency-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return r});var Y=P("./src/errors.ts"),j=P("./src/events.ts"),U=P("./src/utils/logger.ts");function z(L,v){for(var g=0;g<v.length;g++){var p=v[g];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(L,p.key,p)}}function H(L,v,g){return v&&z(L.prototype,v),g&&z(L,g),L}var r=function(){function L(g){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=g,this.config=g.config,this.registerListeners()}var v=L.prototype;return v.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},v.registerListeners=function(){this.hls.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(j.Events.ERROR,this.onError,this)},v.unregisterListeners=function(){this.hls.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(j.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(j.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(j.Events.ERROR,this.onError)},v.onMediaAttached=function(p,u){this.media=u.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,u){var h=u.details;this.levelDetails=h,h.advanced&&this.timeupdate(),!h.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},v.onError=function(p,u){if(u.details!==Y.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,U.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},v.timeupdate=function(){var p=this.media,u=this.levelDetails;if(!p||!u)return;this.currentTime=p.currentTime;var h=this.computeLatency();if(h===null)return;this._latency=h;var c=this.config,o=c.lowLatencyMode,l=c.maxLiveSyncPlaybackRate;if(!o||l===1)return;var s=this.targetLatency;if(s===null)return;var a=h-s,R=Math.min(this.maxLatency,s+u.targetduration),E=a<R;if(u.live&&E&&a>.05&&this.forwardBufferLength>1){var S=Math.min(2,Math.max(1,l)),D=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;p.playbackRate=Math.min(S,Math.max(1,D))}else p.playbackRate!==1&&p.playbackRate!==0&&(p.playbackRate=1)},v.estimateLiveEdge=function(){var p=this.levelDetails;return p===null?null:p.edge+p.age},v.computeLatency=function(){var p=this.estimateLiveEdge();return p===null?null:p-this.currentTime},H(L,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var p=this.config,u=this.levelDetails;return p.liveMaxLatencyDuration!==void 0?p.liveMaxLatencyDuration:u?p.liveMaxLatencyDurationCount*u.targetduration:0}},{key:"targetLatency",get:function(){var p=this.levelDetails;if(p===null)return null;var u=p.holdBack,h=p.partHoldBack,c=p.targetduration,o=this.config,l=o.liveSyncDuration,s=o.liveSyncDurationCount,a=o.lowLatencyMode,R=this.hls.userConfig,E=a&&h||u;(R.liveSyncDuration||R.liveSyncDurationCount||E===0)&&(E=l!==void 0?l:s*c);var S=c,D=1;return E+Math.min(this.stallCount*D,S)}},{key:"liveSyncPosition",get:function(){var p=this.estimateLiveEdge(),u=this.targetLatency,h=this.levelDetails;if(p===null||u===null||h===null)return null;var c=h.edge,o=p-u-this.edgeStalled,l=c-h.totalduration,s=c-(this.config.lowLatencyMode&&h.partTarget||h.targetduration);return Math.min(Math.max(l,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 u=(this.config.lowLatencyMode&&p.partTarget||p.targetduration)*3;return Math.max(p.age-u,0)}},{key:"forwardBufferLength",get:function(){var p=this.media,u=this.levelDetails;if(!p||!u)return 0;var h=p.buffered.length;return h?p.buffered.end(h-1):u.edge-this.currentTime}}]),L}()},"./src/controller/level-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return o});var Y=P("./src/types/level.ts"),j=P("./src/events.ts"),U=P("./src/errors.ts"),z=P("./src/utils/codecs.ts"),H=P("./src/controller/level-helper.ts"),r=P("./src/controller/base-playlist-controller.ts"),L=P("./src/types/loader.ts");function v(){return v=Object.assign||function(l){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var R in a)Object.prototype.hasOwnProperty.call(a,R)&&(l[R]=a[R])}return l},v.apply(this,arguments)}function g(l,s){for(var a=0;a<s.length;a++){var R=s[a];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(l,R.key,R)}}function p(l,s,a){return s&&g(l.prototype,s),a&&g(l,a),l}function u(l,s){l.prototype=Object.create(s.prototype),l.prototype.constructor=l,h(l,s)}function h(l,s){return h=Object.setPrototypeOf||function(R,E){return R.__proto__=E,R},h(l,s)}var c=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),o=function(l){u(s,l);function s(R){var E;return E=l.call(this,R,"[level-controller]")||this,E._levels=[],E._firstLevel=-1,E._startLevel=void 0,E.currentLevelIndex=-1,E.manualLevelIndex=-1,E.onParsedComplete=void 0,E._registerListeners(),E}var a=s.prototype;return a._registerListeners=function(){var E=this.hls;E.on(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),E.on(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.on(j.Events.FRAG_LOADED,this.onFragLoaded,this),E.on(j.Events.ERROR,this.onError,this)},a._unregisterListeners=function(){var E=this.hls;E.off(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),E.off(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.off(j.Events.FRAG_LOADED,this.onFragLoaded,this),E.off(j.Events.ERROR,this.onError,this)},a.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,l.prototype.destroy.call(this)},a.startLoad=function(){var E=this._levels;E.forEach(function(S){S.loadError=0}),l.prototype.startLoad.call(this)},a.onManifestLoaded=function(E,S){var D=[],A=[],O=[],C,x={},f,w=!1,b=!1,y=!1;if(S.levels.forEach(function(M){var I=M.attrs;w=w||!!(M.width&&M.height),b=b||!!M.videoCodec,y=y||!!M.audioCodec,c&&M.audioCodec&&M.audioCodec.indexOf("mp4a.40.34")!==-1&&(M.audioCodec=void 0);var m=M.bitrate+"-"+M.attrs.RESOLUTION+"-"+M.attrs.CODECS;f=x[m],f?f.url.push(M.url):(f=new Y.Level(M),x[m]=f,D.push(f)),I&&(I.AUDIO&&Object(H.addGroupId)(f,"audio",I.AUDIO),I.SUBTITLES&&Object(H.addGroupId)(f,"text",I.SUBTITLES))}),(w||b)&&y&&(D=D.filter(function(M){var I=M.videoCodec,m=M.width,W=M.height;return!!I||!!(m&&W)})),D=D.filter(function(M){var I=M.audioCodec,m=M.videoCodec;return(!I||Object(z.isCodecSupportedInMp4)(I,"audio"))&&(!m||Object(z.isCodecSupportedInMp4)(m,"video"))}),S.audioTracks&&(A=S.audioTracks.filter(function(M){return!M.audioCodec||Object(z.isCodecSupportedInMp4)(M.audioCodec,"audio")}),Object(H.assignTrackIdsByGroup)(A)),S.subtitles&&(O=S.subtitles,Object(H.assignTrackIdsByGroup)(O)),D.length>0){C=D[0].bitrate,D.sort(function(M,I){return M.bitrate-I.bitrate}),this._levels=D;for(var B=0;B<D.length;B++)if(D[B].bitrate===C){this._firstLevel=B,this.log("manifest loaded, "+D.length+" level(s) found, first bitrate: "+C);break}var F=y&&!b,_={levels:D,audioTracks:A,subtitleTracks:O,firstLevel:this._firstLevel,stats:S.stats,audio:y,video:b,altAudio:!F&&A.some(function(M){return!!M.url})};this.hls.trigger(j.Events.MANIFEST_PARSED,_),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(j.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:S.url,reason:"no level with compatible codecs found in manifest"})},a.onError=function(E,S){if(l.prototype.onError.call(this,E,S),S.fatal)return;var D=S.context,A=this._levels[this.currentLevelIndex];if(D&&(D.type===L.PlaylistContextType.AUDIO_TRACK&&A.audioGroupIds&&D.groupId===A.audioGroupIds[A.urlId]||D.type===L.PlaylistContextType.SUBTITLE_TRACK&&A.textGroupIds&&D.groupId===A.textGroupIds[A.urlId])){this.redundantFailover(this.currentLevelIndex);return}var O=!1,C=!0,x;switch(S.details){case U.ErrorDetails.FRAG_LOAD_ERROR:case U.ErrorDetails.FRAG_LOAD_TIMEOUT:case U.ErrorDetails.KEY_LOAD_ERROR:case U.ErrorDetails.KEY_LOAD_TIMEOUT:if(S.frag){var f=this._levels[S.frag.level];f?(f.fragmentError++,f.fragmentError>this.hls.config.fragLoadingMaxRetry&&(x=S.frag.level)):x=S.frag.level}break;case U.ErrorDetails.LEVEL_LOAD_ERROR:case U.ErrorDetails.LEVEL_LOAD_TIMEOUT:D&&(D.deliveryDirectives&&(C=!1),x=D.level),O=!0;break;case U.ErrorDetails.REMUX_ALLOC_ERROR:x=S.level,O=!0;break}x!==void 0&&this.recoverLevel(S,x,O,C)},a.recoverLevel=function(E,S,D,A){var O=E.details,C=this._levels[S];if(C.loadError++,D){var x=this.retryLoadingOrFail(E);if(x)E.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(A){var f=C.url.length;if(f>1&&C.loadError<f)E.levelRetry=!0,this.redundantFailover(S);else if(this.manualLevelIndex===-1){var w=S===0?this._levels.length-1:S-1;this.currentLevelIndex!==w&&this._levels[w].loadError===0&&(this.warn(O+": switch to "+w),E.levelRetry=!0,this.hls.nextAutoLevel=w)}}},a.redundantFailover=function(E){var S=this._levels[E],D=S.url.length;if(D>1){var A=(S.urlId+1)%D;this.warn("Switching to redundant URL-id "+A),this._levels.forEach(function(O){O.urlId=A}),this.level=E}},a.onFragLoaded=function(E,S){var D=S.frag;if(D!==void 0&&D.type===L.PlaylistLevelType.MAIN){var A=this._levels[D.level];A!==void 0&&(A.fragmentError=0,A.loadError=0)}},a.onLevelLoaded=function(E,S){var D,A=S.level,O=S.details,C=this._levels[A];if(!C){var x;this.warn("Invalid level index "+A),(x=S.deliveryDirectives)!==null&&x!==void 0&&x.skip&&(O.deltaUpdateFailed=!0);return}A===this.currentLevelIndex?(C.fragmentError===0&&(C.loadError=0,this.retryCount=0),this.playlistLoaded(A,S,C.details)):(D=S.deliveryDirectives)!==null&&D!==void 0&&D.skip&&(O.deltaUpdateFailed=!0)},a.onAudioTrackSwitched=function(E,S){var D=this.hls.levels[this.currentLevelIndex];if(!D)return;if(D.audioGroupIds){for(var A=-1,O=this.hls.audioTracks[S.id].groupId,C=0;C<D.audioGroupIds.length;C++)if(D.audioGroupIds[C]===O){A=C;break}A!==D.urlId&&(D.urlId=A,this.startLoad())}},a.loadPlaylist=function(E){var S=this.currentLevelIndex,D=this._levels[S];if(this.canLoad&&D&&D.url.length>0){var A=D.urlId,O=D.url[A];if(E)try{O=E.addDirectives(O)}catch(C){this.warn("Could not construct new URL with HLS Delivery Directives: "+C)}this.log("Attempt loading level index "+S+(E?" at sn "+E.msn+" part "+E.part:"")+" with URL-id "+A+" "+O),this.clearTimer(),this.hls.trigger(j.Events.LEVEL_LOADING,{url:O,level:S,id:A,deliveryDirectives:E||null})}},a.removeLevel=function(E,S){var D=function(C,x){return x!==S},A=this._levels.filter(function(O,C){return C!==E?!0:O.url.length>1&&S!==void 0?(O.url=O.url.filter(D),O.audioGroupIds&&(O.audioGroupIds=O.audioGroupIds.filter(D)),O.textGroupIds&&(O.textGroupIds=O.textGroupIds.filter(D)),O.urlId=0,!0):!1}).map(function(O,C){var x=O.details;return x!=null&&x.fragments&&x.fragments.forEach(function(f){f.level=C}),O});this._levels=A,this.hls.trigger(j.Events.LEVELS_UPDATED,{levels:A})},p(s,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(E){var S,D=this._levels;if(D.length===0)return;if(this.currentLevelIndex===E&&(S=D[E])!==null&&S!==void 0&&S.details)return;if(E<0||E>=D.length){var A=E<0;if(this.hls.trigger(j.Events.ERROR,{type:U.ErrorTypes.OTHER_ERROR,details:U.ErrorDetails.LEVEL_SWITCH_ERROR,level:E,fatal:A,reason:"invalid level idx"}),A)return;E=Math.min(E,D.length-1)}this.clearTimer();var O=this.currentLevelIndex,C=D[O],x=D[E];this.log("switching to level "+E+" from "+O),this.currentLevelIndex=E;var f=v({},x,{level:E,maxBitrate:x.maxBitrate,uri:x.uri,urlId:x.urlId});delete f._urlId,this.hls.trigger(j.Events.LEVEL_SWITCHING,f);var w=x.details;if(!w||w.live){var b=this.switchParams(x.uri,C==null?void 0:C.details);this.loadPlaylist(b)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(E){this.manualLevelIndex=E,this._startLevel===void 0&&(this._startLevel=E),E!==-1&&(this.level=E)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(E){this._firstLevel=E}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var E=this.hls.config.startLevel;return E!==void 0?E:this._firstLevel}else return this._startLevel},set:function(E){this._startLevel=E}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(E){this.level=E,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=E)}}]),s}(r.default)},"./src/controller/level-helper.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"addGroupId",function(){return U}),P.d(J,"assignTrackIdsByGroup",function(){return z}),P.d(J,"updatePTS",function(){return H}),P.d(J,"updateFragPTSDTS",function(){return L}),P.d(J,"mergeDetails",function(){return v}),P.d(J,"mapPartIntersection",function(){return g}),P.d(J,"mapFragmentIntersection",function(){return p}),P.d(J,"adjustSliding",function(){return u}),P.d(J,"addSliding",function(){return h}),P.d(J,"computeReloadInterval",function(){return c}),P.d(J,"getFragmentWithSN",function(){return o}),P.d(J,"getPartWith",function(){return l});var Y=P("./src/polyfills/number.ts"),j=P("./src/utils/logger.ts");function U(s,a,R){switch(a){case"audio":s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds.push(R);break;case"text":s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds.push(R);break}}function z(s){var a={};s.forEach(function(R){var E=R.groupId||"";R.id=a[E]=a[E]||0,a[E]++})}function H(s,a,R){var E=s[a],S=s[R];r(E,S)}function r(s,a){var R=a.startPTS;if(Object(Y.isFiniteNumber)(R)){var E=0,S;a.sn>s.sn?(E=R-s.start,S=s):(E=s.start-R,S=a),S.duration!==E&&(S.duration=E)}else if(a.sn>s.sn){var D=s.cc===a.cc;D&&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,R,E,S,D){var A=E-R;A<=0&&(j.logger.warn("Fragment should have a positive duration",a),E=R+a.duration,D=S+a.duration);var O=R,C=E,x=a.startPTS,f=a.endPTS;if(Object(Y.isFiniteNumber)(x)){var w=Math.abs(x-R);Object(Y.isFiniteNumber)(a.deltaPTS)?a.deltaPTS=Math.max(w,a.deltaPTS):a.deltaPTS=w,O=Math.max(R,x),R=Math.min(R,x),S=Math.min(S,a.startDTS),C=Math.min(E,f),E=Math.max(E,f),D=Math.max(D,a.endDTS)}a.duration=E-R;var b=R-a.start;a.appendedPTS=E,a.start=a.startPTS=R,a.maxStartPTS=O,a.startDTS=S,a.endPTS=E,a.minEndPTS=C,a.endDTS=D;var y=a.sn;if(!s||y<s.startSN||y>s.endSN)return 0;var B,F=y-s.startSN,_=s.fragments;for(_[F]=a,B=F;B>0;B--)r(_[B],_[B-1]);for(B=F;B<_.length-1;B++)r(_[B],_[B+1]);return s.fragmentHint&&r(_[_.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,b}function v(s,a){for(var R=null,E=s.fragments,S=E.length-1;S>=0;S--){var D=E[S].initSegment;if(D){R=D;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var A=0,O;if(p(s,a,function(B,F){B.relurl&&(A=B.cc-F.cc),Object(Y.isFiniteNumber)(B.startPTS)&&Object(Y.isFiniteNumber)(B.endPTS)&&(F.start=F.startPTS=B.startPTS,F.startDTS=B.startDTS,F.appendedPTS=B.appendedPTS,F.maxStartPTS=B.maxStartPTS,F.endPTS=B.endPTS,F.endDTS=B.endDTS,F.minEndPTS=B.minEndPTS,F.duration=B.endPTS-B.startPTS,F.duration&&(O=F),a.PTSKnown=a.alignedSliding=!0),F.elementaryStreams=B.elementaryStreams,F.loader=B.loader,F.stats=B.stats,F.urlId=B.urlId,B.initSegment&&(F.initSegment=B.initSegment,R=B.initSegment)}),R){var C=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;C.forEach(function(B){var F;(!B.initSegment||B.initSegment.relurl===((F=R)===null||F===void 0?void 0:F.relurl))&&(B.initSegment=R)})}if(a.skippedSegments&&(a.deltaUpdateFailed=a.fragments.some(function(B){return!B}),a.deltaUpdateFailed)){j.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var x=a.skippedSegments;x--;)a.fragments.shift();a.startSN=a.fragments[0].sn,a.startCC=a.fragments[0].cc}var f=a.fragments;if(A){j.logger.warn("discontinuity sliding from playlist, take drift into account");for(var w=0;w<f.length;w++)f[w].cc+=A}a.skippedSegments&&(a.startCC=a.fragments[0].cc),g(s.partList,a.partList,function(B,F){F.elementaryStreams=B.elementaryStreams,F.stats=B.stats}),O?L(a,O,O.startPTS,O.endPTS,O.startDTS,O.endDTS):u(s,a),f.length&&(a.totalduration=a.edge-f[0].start),a.driftStartTime=s.driftStartTime,a.driftStart=s.driftStart;var b=a.advancedDateTime;if(a.advanced&&b){var y=a.edge;a.driftStart||(a.driftStartTime=b,a.driftStart=y),a.driftEndTime=b,a.driftEnd=y}else a.driftEndTime=s.driftEndTime,a.driftEnd=s.driftEnd,a.advancedDateTime=s.advancedDateTime}function g(s,a,R){if(s&&a)for(var E=0,S=0,D=s.length;S<=D;S++){var A=s[S],O=a[S+E];A&&O&&A.index===O.index&&A.fragment.sn===O.fragment.sn?R(A,O):E--}}function p(s,a,R){for(var E=a.skippedSegments,S=Math.max(s.startSN,a.startSN)-a.startSN,D=(s.fragmentHint?1:0)+(E?a.endSN:Math.min(s.endSN,a.endSN))-a.startSN,A=a.startSN-s.startSN,O=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments,C=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,x=S;x<=D;x++){var f=C[A+x],w=O[x];E&&!w&&x<E&&(w=a.fragments[x]=f),f&&w&&R(f,w)}}function u(s,a){var R=a.startSN+a.skippedSegments-s.startSN,E=s.fragments;if(R<0||R>=E.length)return;h(a,E[R].start)}function h(s,a){if(a){for(var R=s.fragments,E=s.skippedSegments;E<R.length;E++)R[E].start+=a;s.fragmentHint&&(s.fragmentHint.start+=a)}}function c(s,a){var R=1e3*s.levelTargetDuration,E=R/2,S=s.age,D=S>0&&S<R*3,A=a.loading.end-a.loading.start,O,C=s.availabilityDelay;if(s.updated===!1)if(D){var x=333*s.misses;O=Math.max(Math.min(E,A*2),x),s.availabilityDelay=(s.availabilityDelay||0)+O}else O=E;else D?(C=Math.min(C||R/2,S),s.availabilityDelay=C,O=C+R-S):O=R-A;return Math.round(O)}function o(s,a,R){if(!s||!s.details)return null;var E=s.details,S=E.fragments[a-E.startSN];return S||(S=E.fragmentHint,S&&S.sn===a?S:a<E.startSN&&R&&R.sn===a?R:null)}function l(s,a,R){if(!s||!s.details)return null;var E=s.details.partList;if(E)for(var S=E.length;S--;){var D=E[S];if(D.index===R&&D.fragment.sn===a)return D}return null}},"./src/controller/stream-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return E});var Y=P("./src/polyfills/number.ts"),j=P("./src/controller/base-stream-controller.ts"),U=P("./src/is-supported.ts"),z=P("./src/events.ts"),H=P("./src/utils/buffer-helper.ts"),r=P("./src/controller/fragment-tracker.ts"),L=P("./src/types/loader.ts"),v=P("./src/loader/fragment.ts"),g=P("./src/demux/transmuxer-interface.ts"),p=P("./src/types/transmuxer.ts"),u=P("./src/controller/gap-controller.ts"),h=P("./src/errors.ts"),c=P("./src/utils/logger.ts");function o(S,D){for(var A=0;A<D.length;A++){var O=D[A];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(S,O.key,O)}}function l(S,D,A){return D&&o(S.prototype,D),A&&o(S,A),S}function s(S,D){S.prototype=Object.create(D.prototype),S.prototype.constructor=S,a(S,D)}function a(S,D){return a=Object.setPrototypeOf||function(O,C){return O.__proto__=C,O},a(S,D)}var R=100,E=function(S){s(D,S);function D(O,C){var x;return x=S.call(this,O,C,"[stream-controller]")||this,x.audioCodecSwap=!1,x.gapController=null,x.level=-1,x._forceStartLoad=!1,x.altAudio=!1,x.audioOnly=!1,x.fragPlaying=null,x.onvplaying=null,x.onvseeked=null,x.fragLastKbps=0,x.stalled=!1,x.couldBacktrack=!1,x.audioCodecSwitch=!1,x.videoBuffer=null,x._registerListeners(),x}var A=D.prototype;return A._registerListeners=function(){var C=this.hls;C.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),C.on(z.Events.LEVEL_LOADING,this.onLevelLoading,this),C.on(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.on(z.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),C.on(z.Events.ERROR,this.onError,this),C.on(z.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),C.on(z.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.on(z.Events.BUFFER_CREATED,this.onBufferCreated,this),C.on(z.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),C.on(z.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),C.on(z.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A._unregisterListeners=function(){var C=this.hls;C.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),C.off(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.off(z.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),C.off(z.Events.ERROR,this.onError,this),C.off(z.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),C.off(z.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.off(z.Events.BUFFER_CREATED,this.onBufferCreated,this),C.off(z.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),C.off(z.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),C.off(z.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},A.startLoad=function(C){if(this.levels){var x=this.lastCurrentTime,f=this.hls;if(this.stopLoad(),this.setInterval(R),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var w=f.startLevel;w===-1&&(f.config.testBandwidth?(w=0,this.bitrateTest=!0):w=f.nextAutoLevel),this.level=f.nextLoadLevel=w,this.loadedmetadata=!1}x>0&&C===-1&&(this.log("Override startPosition with lastCurrentTime @"+x.toFixed(3)),C=x),this.state=j.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=C,this.tick()}else this._forceStartLoad=!0,this.state=j.State.STOPPED},A.stopLoad=function(){this._forceStartLoad=!1,S.prototype.stopLoad.call(this)},A.doTick=function(){switch(this.state){case j.State.IDLE:this.doTickIdle();break;case j.State.WAITING_LEVEL:{var C,x=this.levels,f=this.level,w=x==null||((C=x[f])===null||C===void 0)?void 0:C.details;if(w&&(!w.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(w))break;this.state=j.State.IDLE;break}break}case j.State.FRAG_LOADING_WAITING_RETRY:{var b,y=self.performance.now(),B=this.retryDate;(!B||y>=B||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=j.State.IDLE)}break;default:break}this.onTickEnd()},A.onTickEnd=function(){S.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},A.doTickIdle=function(){var C,x,f=this.hls,w=this.levelLastLoaded,b=this.levels,y=this.media,B=f.config,F=f.nextLoadLevel;if(w===null||!y&&(this.startFragRequested||!B.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!b||!b[F])return;var _=b[F];this.level=f.nextLoadLevel=F;var M=_.details;if(!M||this.state===j.State.WAITING_LEVEL||M.live&&this.levelLastLoaded!==F){this.state=j.State.WAITING_LEVEL;return}var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:y,L.PlaylistLevelType.MAIN);if(I===null)return;var m=I.len,W=this.getMaxBufferLength(_.maxBitrate);if(m>=W)return;if(this._streamEnded(I,M)){var $={};this.altAudio&&($.type="video"),this.hls.trigger(z.Events.BUFFER_EOS,$),this.state=j.State.ENDED;return}var ae=I.end,ue=this.getNextFragment(ae,M);if(this.couldBacktrack&&!this.fragPrevious&&ue&&ue.sn!=="initSegment"){var Oe=ue.sn-M.startSN;Oe>1&&(ue=M.fragments[Oe-1],this.fragmentTracker.removeFragment(ue))}if(ue&&this.fragmentTracker.getState(ue)===r.FragmentState.OK&&this.nextLoadPosition>ae){var ve=this.audioOnly&&!this.altAudio?v.ElementaryStreamTypes.AUDIO:v.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(y,ve,L.PlaylistLevelType.MAIN),ue=this.getNextFragment(this.nextLoadPosition,M)}if(!ue)return;ue.initSegment&&!ue.initSegment.data&&!this.bitrateTest&&(ue=ue.initSegment),((C=ue.decryptdata)===null||C===void 0?void 0:C.keyFormat)==="identity"&&!((x=ue.decryptdata)!==null&&x!==void 0&&x.key)?this.loadKey(ue,M):this.loadFragment(ue,M,ae)},A.loadFragment=function(C,x,f){var w,b=this.fragmentTracker.getState(C);if(this.fragCurrent=C,b===r.FragmentState.BACKTRACKED){var y=this.fragmentTracker.getBacktrackData(C);if(y){this._handleFragmentLoadProgress(y),this._handleFragmentLoadComplete(y);return}else b=r.FragmentState.NOT_LOADED}b===r.FragmentState.NOT_LOADED||b===r.FragmentState.PARTIAL?C.sn==="initSegment"?this._loadInitSegment(C):this.bitrateTest?(C.bitrateTest=!0,this.log("Fragment "+C.sn+" of level "+C.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(C)):(this.startFragRequested=!0,S.prototype.loadFragment.call(this,C,x,f)):b===r.FragmentState.APPENDING?this.reduceMaxBufferLength(C.duration)&&this.fragmentTracker.removeFragment(C):((w=this.media)===null||w===void 0?void 0:w.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},A.getAppendedFrag=function(C){var x=this.fragmentTracker.getAppendedFrag(C,L.PlaylistLevelType.MAIN);return x&&"fragment"in x?x.fragment:x},A.getBufferedFrag=function(C){return this.fragmentTracker.getBufferedFrag(C,L.PlaylistLevelType.MAIN)},A.followingBufferedFrag=function(C){return C?this.getBufferedFrag(C.end+.5):null},A.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},A.nextLevelSwitch=function(){var C=this.levels,x=this.media;if(x!=null&&x.readyState){var f,w=this.getAppendedFrag(x.currentTime);if(w&&w.start>1&&this.flushMainBuffer(0,w.start-1),!x.paused&&C){var b=this.hls.nextLoadLevel,y=C[b],B=this.fragLastKbps;B&&this.fragCurrent?f=this.fragCurrent.duration*y.maxBitrate/(1e3*B)+1:f=0}else f=0;var F=this.getBufferedFrag(x.currentTime+f);if(F){var _=this.followingBufferedFrag(F);if(_){this.abortCurrentFrag();var M=_.maxStartPTS?_.maxStartPTS:_.start,I=_.duration,m=Math.max(F.end,M+Math.min(Math.max(I-this.config.maxFragLookUpTolerance,I*.5),I*.75));this.flushMainBuffer(m,Number.POSITIVE_INFINITY)}}}},A.abortCurrentFrag=function(){var C=this.fragCurrent;this.fragCurrent=null,C!=null&&C.loader&&C.loader.abort(),this.state===j.State.KEY_LOADING&&(this.state=j.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},A.flushMainBuffer=function(C,x){S.prototype.flushMainBuffer.call(this,C,x,this.altAudio?"video":null)},A.onMediaAttached=function(C,x){S.prototype.onMediaAttached.call(this,C,x);var f=x.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),f.addEventListener("playing",this.onvplaying),f.addEventListener("seeked",this.onvseeked),this.gapController=new u.default(this.config,f,this.fragmentTracker,this.hls)},A.onMediaDetaching=function(){var C=this.media;C&&(C.removeEventListener("playing",this.onvplaying),C.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),S.prototype.onMediaDetaching.call(this)},A.onMediaPlaying=function(){this.tick()},A.onMediaSeeked=function(){var C=this.media,x=C?C.currentTime:null;Object(Y.isFiniteNumber)(x)&&this.log("Media seeked to "+x.toFixed(3)),this.tick()},A.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(z.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},A.onManifestParsed=function(C,x){var f=!1,w=!1,b;x.levels.forEach(function(y){b=y.audioCodec,b&&(b.indexOf("mp4a.40.2")!==-1&&(f=!0),b.indexOf("mp4a.40.5")!==-1&&(w=!0))}),this.audioCodecSwitch=f&&w&&!Object(U.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=x.levels,this.startFragRequested=!1},A.onLevelLoading=function(C,x){var f=this.levels;if(!f||this.state!==j.State.IDLE)return;var w=f[x.level];(!w.details||w.details.live&&this.levelLastLoaded!==x.level||this.waitForCdnTuneIn(w.details))&&(this.state=j.State.WAITING_LEVEL)},A.onLevelLoaded=function(C,x){var f,w=this.levels,b=x.level,y=x.details,B=y.totalduration;if(!w){this.warn("Levels were reset while loading level "+b);return}this.log("Level "+b+" loaded ["+y.startSN+","+y.endSN+"], cc ["+y.startCC+", "+y.endCC+"] duration:"+B);var F=this.fragCurrent;F&&(this.state===j.State.FRAG_LOADING||this.state===j.State.FRAG_LOADING_WAITING_RETRY)&&(F.level!==x.level&&F.loader&&(this.state=j.State.IDLE,F.loader.abort()));var _=w[b],M=0;if(y.live||(f=_.details)!==null&&f!==void 0&&f.live){if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed)return;M=this.alignPlaylists(y,_.details)}if(_.details=y,this.levelLastLoaded=b,this.hls.trigger(z.Events.LEVEL_UPDATED,{details:y,level:b}),this.state===j.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(y))return;this.state=j.State.IDLE}this.startFragRequested?y.live&&this.synchronizeToLiveEdge(y):this.setStartPosition(y,M),this.tick()},A._handleFragmentLoadProgress=function(C){var x,f=C.frag,w=C.part,b=C.payload,y=this.levels;if(!y){this.warn("Levels were reset while fragment load was in progress. Fragment "+f.sn+" of level "+f.level+" will not be buffered");return}var B=y[f.level],F=B.details;if(!F){this.warn("Dropping fragment "+f.sn+" of level "+f.level+" after level details were reset");return}var _=B.videoCodec,M=F.PTSKnown||!F.live,I=(x=f.initSegment)===null||x===void 0?void 0:x.data,m=this._getAudioCodec(B),W=this.transmuxer=this.transmuxer||new g.default(this.hls,L.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),$=w?w.index:-1,ae=$!==-1,ue=new p.ChunkMetadata(f.level,f.sn,f.stats.chunkCount,b.byteLength,$,ae),Oe=this.initPTS[f.cc];W.push(b,I,m,_,f,w,F.totalduration,M,ue,Oe)},A.onAudioTrackSwitching=function(C,x){var f=this.altAudio,w=!!x.url,b=x.id;if(!w){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var y=this.fragCurrent;y!=null&&y.loader&&(this.log("Switching to main audio track, cancel main fragment load"),y.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var B=this.hls;f&&B.trigger(z.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),B.trigger(z.Events.AUDIO_TRACK_SWITCHED,{id:b})}},A.onAudioTrackSwitched=function(C,x){var f=x.id,w=!!this.hls.audioTracks[f].url;if(w){var b=this.videoBuffer;b&&this.mediaBuffer!==b&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=b)}this.altAudio=w,this.tick()},A.onBufferCreated=function(C,x){var f=x.tracks,w,b,y=!1;for(var B in f){var F=f[B];if(F.id==="main"){if(b=B,w=F,B==="video"){var _=f[B];_&&(this.videoBuffer=_.buffer)}}else y=!0}y&&w?(this.log("Alternate track found, use "+b+".buffered to schedule main fragment loading"),this.mediaBuffer=w.buffer):this.mediaBuffer=this.media},A.onFragBuffered=function(C,x){var f=x.frag,w=x.part;if(f&&f.type!==L.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(f)){this.warn("Fragment "+f.sn+(w?" p: "+w.index:"")+" of level "+f.level+" finished buffering, but was aborted. state: "+this.state),this.state===j.State.PARSED&&(this.state=j.State.IDLE);return}var b=w?w.stats:f.stats;this.fragLastKbps=Math.round(8*b.total/(b.buffering.end-b.loading.first)),f.sn!=="initSegment"&&(this.fragPrevious=f),this.fragBufferedComplete(f,w)},A.onError=function(C,x){switch(x.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,x);break;case h.ErrorDetails.LEVEL_LOAD_ERROR:case h.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==j.State.ERROR&&(x.fatal?(this.warn(""+x.details),this.state=j.State.ERROR):!x.levelRetry&&this.state===j.State.WAITING_LEVEL&&(this.state=j.State.IDLE));break;case h.ErrorDetails.BUFFER_FULL_ERROR:if(x.parent==="main"&&(this.state===j.State.PARSING||this.state===j.State.PARSED)){var f=!0,w=this.getFwdBufferInfo(this.media,L.PlaylistLevelType.MAIN);w&&w.len>.5&&(f=!this.reduceMaxBufferLength(w.len)),f&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},A.checkBuffer=function(){var C=this.media,x=this.gapController;if(!C||!x||!C.readyState)return;var f=H.BufferHelper.getBuffered(C);!this.loadedmetadata&&f.length?(this.loadedmetadata=!0,this.seekToStartPos()):x.poll(this.lastCurrentTime),this.lastCurrentTime=C.currentTime},A.onFragLoadEmergencyAborted=function(){this.state=j.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},A.onBufferFlushed=function(C,x){var f=x.type;if(f!==v.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var w=(f===v.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(w,f,L.PlaylistLevelType.MAIN)}},A.onLevelsUpdated=function(C,x){this.levels=x.levels},A.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},A.seekToStartPos=function(){var C=this.media,x=C.currentTime,f=this.startPosition;if(f>=0&&x<f){if(C.seeking){c.logger.log("could not seek to "+f+", already seeking at "+x);return}var w=H.BufferHelper.getBuffered(C),b=w.length?w.start(0):0,y=b-f;y>0&&(y<this.config.maxBufferHole||y<this.config.maxFragLookUpTolerance)&&(c.logger.log("adjusting start position by "+y+" to match buffer start"),f+=y,this.startPosition=f),this.log("seek to target start position "+f+" from current time "+x),C.currentTime=f}},A._getAudioCodec=function(C){var x=this.config.defaultAudioCodec||C.audioCodec;return this.audioCodecSwap&&x&&(this.log("Swapping audio codec"),x.indexOf("mp4a.40.5")!==-1?x="mp4a.40.2":x="mp4a.40.5"),x},A._loadBitrateTestFrag=function(C){var x=this;this._doFragLoad(C).then(function(f){var w=x.hls;if(!f||w.nextLoadLevel||x.fragContextChanged(C))return;x.fragLoadError=0,x.state=j.State.IDLE,x.startFragRequested=!1,x.bitrateTest=!1;var b=C.stats;b.parsing.start=b.parsing.end=b.buffering.start=b.buffering.end=self.performance.now(),w.trigger(z.Events.FRAG_LOADED,f)})},A._handleTransmuxComplete=function(C){var x,f="main",w=this.hls,b=C.remuxResult,y=C.chunkMeta,B=this.getCurrentContext(y);if(!B){this.warn("The loading context changed while buffering fragment "+y.sn+" of level "+y.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(y.level);return}var F=B.frag,_=B.part,M=B.level,I=b.video,m=b.text,W=b.id3,$=b.initSegment,ae=this.altAudio?void 0:b.audio;if(this.fragContextChanged(F))return;if(this.state=j.State.PARSING,$){$.tracks&&(this._bufferInitSegment(M,$.tracks,F,y),w.trigger(z.Events.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:f,tracks:$.tracks}));var ue=$.initPTS,Oe=$.timescale;Object(Y.isFiniteNumber)(ue)&&(this.initPTS[F.cc]=ue,w.trigger(z.Events.INIT_PTS_FOUND,{frag:F,id:f,initPTS:ue,timescale:Oe}))}if(I&&b.independent!==!1){if(M.details){var ve=I.startPTS,Ee=I.endPTS,xe=I.startDTS,Ie=I.endDTS;if(_)_.elementaryStreams[I.type]={startPTS:ve,endPTS:Ee,startDTS:xe,endDTS:Ie};else if(I.firstKeyFrame&&I.independent&&(this.couldBacktrack=!0),I.dropped&&I.independent){var de=this.getLoadPosition()+this.config.maxBufferHole;if(de<ve){this.backtrack(F);return}F.setElementaryStreamInfo(I.type,F.start,Ee,F.start,Ie,!0)}F.setElementaryStreamInfo(I.type,ve,Ee,xe,Ie),this.bufferFragmentData(I,F,_,y)}}else if(b.independent===!1){this.backtrack(F);return}if(ae){var ce=ae.startPTS,ie=ae.endPTS,fe=ae.startDTS,le=ae.endDTS;_&&(_.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:ce,endPTS:ie,startDTS:fe,endDTS:le}),F.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,ce,ie,fe,le),this.bufferFragmentData(ae,F,_,y)}if(W!=null&&(x=W.samples)!==null&&x!==void 0&&x.length){var ke={frag:F,id:f,samples:W.samples};w.trigger(z.Events.FRAG_PARSING_METADATA,ke)}if(m){var Ne={frag:F,id:f,samples:m.samples};w.trigger(z.Events.FRAG_PARSING_USERDATA,Ne)}},A._bufferInitSegment=function(C,x,f,w){var b=this;if(this.state!==j.State.PARSING)return;this.audioOnly=!!x.audio&&!x.video,this.altAudio&&!this.audioOnly&&delete x.audio;var y=x.audio,B=x.video,F=x.audiovideo;if(y){var _=C.audioCodec,M=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(_&&(_.indexOf("mp4a.40.5")!==-1?_="mp4a.40.2":_="mp4a.40.5"),y.metadata.channelCount!==1&&M.indexOf("firefox")===-1&&(_="mp4a.40.5")),M.indexOf("android")!==-1&&y.container!=="audio/mpeg"&&(_="mp4a.40.2",this.log("Android: force audio codec to "+_)),C.audioCodec&&C.audioCodec!==_&&this.log('Swapping manifest audio codec "'+C.audioCodec+'" for "'+_+'"'),y.levelCodec=_,y.id="main",this.log("Init audio buffer, container:"+y.container+", codecs[selected/level/parsed]=["+(_||"")+"/"+(C.audioCodec||"")+"/"+y.codec+"]")}B&&(B.levelCodec=C.videoCodec,B.id="main",this.log("Init video buffer, container:"+B.container+", codecs[level/parsed]=["+(C.videoCodec||"")+"/"+B.codec+"]")),F&&this.log("Init audiovideo buffer, container:"+F.container+", codecs[level/parsed]=["+(C.attrs.CODECS||"")+"/"+F.codec+"]"),this.hls.trigger(z.Events.BUFFER_CODECS,x),Object.keys(x).forEach(function(I){var m=x[I],W=m.initSegment;W!=null&&W.byteLength&&b.hls.trigger(z.Events.BUFFER_APPENDING,{type:I,data:W,frag:f,part:null,chunkMeta:w,parent:f.type})}),this.tick()},A.backtrack=function(C){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(C);var x=this.fragmentTracker.backtrack(C);this.fragPrevious=null,this.nextLoadPosition=C.start,x?this.resetFragmentLoading(C):this.state=j.State.BACKTRACKING},A.checkFragmentChanged=function(){var C=this.media,x=null;if(C&&C.readyState>1&&C.seeking===!1){var f=C.currentTime;if(H.BufferHelper.isBuffered(C,f)?x=this.getAppendedFrag(f):H.BufferHelper.isBuffered(C,f+.1)&&(x=this.getAppendedFrag(f+.1)),x){var w=this.fragPlaying,b=x.level;(!w||x.sn!==w.sn||w.level!==b||x.urlId!==w.urlId)&&(this.hls.trigger(z.Events.FRAG_CHANGED,{frag:x}),(!w||w.level!==b)&&this.hls.trigger(z.Events.LEVEL_SWITCHED,{level:b}),this.fragPlaying=x)}}},l(D,[{key:"nextLevel",get:function(){var C=this.nextBufferedFrag;return C?C.level:-1}},{key:"currentLevel",get:function(){var C=this.media;if(C){var x=this.getAppendedFrag(C.currentTime);if(x)return x.level}return-1}},{key:"nextBufferedFrag",get:function(){var C=this.media;if(C){var x=this.getAppendedFrag(C.currentTime);return this.followingBufferedFrag(x)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),D}(j.default)},"./src/controller/subtitle-stream-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"SubtitleStreamController",function(){return s});var Y=P("./src/events.ts"),j=P("./src/utils/logger.ts"),U=P("./src/utils/buffer-helper.ts"),z=P("./src/controller/fragment-finders.ts"),H=P("./src/utils/discontinuities.ts"),r=P("./src/controller/level-helper.ts"),L=P("./src/controller/fragment-tracker.ts"),v=P("./src/controller/base-stream-controller.ts"),g=P("./src/types/loader.ts"),p=P("./src/types/level.ts");function u(a,R){for(var E=0;E<R.length;E++){var S=R[E];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(a,S.key,S)}}function h(a,R,E){return R&&u(a.prototype,R),E&&u(a,E),a}function c(a,R){a.prototype=Object.create(R.prototype),a.prototype.constructor=a,o(a,R)}function o(a,R){return o=Object.setPrototypeOf||function(S,D){return S.__proto__=D,S},o(a,R)}var l=500,s=function(a){c(R,a);function R(S,D){var A;return A=a.call(this,S,D,"[subtitle-stream-controller]")||this,A.levels=[],A.currentTrackId=-1,A.tracksBuffered=[],A.mainDetails=null,A._registerListeners(),A}var E=R.prototype;return E.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},E._registerListeners=function(){var D=this.hls;D.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.on(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.on(Y.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.on(Y.Events.ERROR,this.onError,this),D.on(Y.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.on(Y.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.on(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.on(Y.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.on(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},E._unregisterListeners=function(){var D=this.hls;D.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.off(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.off(Y.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.off(Y.Events.ERROR,this.onError,this),D.off(Y.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.off(Y.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.off(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.off(Y.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.off(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},E.startLoad=function(){this.stopLoad(),this.state=v.State.IDLE,this.setInterval(l),this.tick()},E.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},E.onLevelLoaded=function(D,A){this.mainDetails=A.details},E.onSubtitleFragProcessed=function(D,A){var O=A.frag,C=A.success;if(this.fragPrevious=O,this.state=v.State.IDLE,!C)return;var x=this.tracksBuffered[this.currentTrackId];if(!x)return;for(var f,w=O.start,b=0;b<x.length;b++)if(w>=x[b].start&&w<=x[b].end){f=x[b];break}var y=O.start+O.duration;f?f.end=y:(f={start:w,end:y},x.push(f)),this.fragmentTracker.fragBuffered(O)},E.onBufferFlushing=function(D,A){var O=A.startOffset,C=A.endOffset;if(O===0&&C!==Number.POSITIVE_INFINITY){var x=this.currentTrackId,f=this.levels;if(!f.length||!f[x]||!f[x].details)return;var w=f[x].details,b=w.targetduration,y=C-b;if(y<=0)return;A.endOffsetSubtitles=Math.max(0,y),this.tracksBuffered.forEach(function(B){for(var F=0;F<B.length;){if(B[F].end<=y){B.shift();continue}else if(B[F].start<y)B[F].start=y;else break;F++}}),this.fragmentTracker.removeFragmentsInRange(O,y,g.PlaylistLevelType.SUBTITLE)}},E.onError=function(D,A){var O,C=A.frag;if(!C||C.type!==g.PlaylistLevelType.SUBTITLE)return;(O=this.fragCurrent)!==null&&O!==void 0&&O.loader&&this.fragCurrent.loader.abort(),this.state=v.State.IDLE},E.onSubtitleTracksUpdated=function(D,A){var O=this,C=A.subtitleTracks;this.tracksBuffered=[],this.levels=C.map(function(x){return new p.Level(x)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(x){O.tracksBuffered[x.id]=[]}),this.mediaBuffer=null},E.onSubtitleTrackSwitch=function(D,A){if(this.currentTrackId=A.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var O=this.levels[this.currentTrackId];O!=null&&O.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,O&&this.setInterval(l)},E.onSubtitleTrackLoaded=function(D,A){var O,C=A.details,x=A.id,f=this.currentTrackId,w=this.levels;if(!w.length)return;var b=w[f];if(x>=w.length||x!==f||!b)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,C.live||(O=b.details)!==null&&O!==void 0&&O.live){var y=this.mainDetails;if(C.deltaUpdateFailed||!y)return;var B=y.fragments[0];if(!b.details)C.hasProgramDateTime&&y.hasProgramDateTime?Object(H.alignMediaPlaylistByPDT)(C,y):B&&Object(r.addSliding)(C,B.start);else{var F=this.alignPlaylists(C,b.details);F===0&&B&&Object(r.addSliding)(C,B.start)}}if(b.details=C,this.levelLastLoaded=x,this.tick(),C.live&&!this.fragCurrent&&this.media&&this.state===v.State.IDLE){var _=Object(z.findFragmentByPTS)(null,C.fragments,this.media.currentTime,0);_||(this.warn("Subtitle playlist not aligned with playback"),b.details=void 0)}},E._handleFragmentLoadComplete=function(D){var A=D.frag,O=D.payload,C=A.decryptdata,x=this.hls;if(this.fragContextChanged(A))return;if(O&&O.byteLength>0&&C&&C.key&&C.iv&&C.method==="AES-128"){var f=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(O),C.key.buffer,C.iv.buffer).then(function(w){var b=performance.now();x.trigger(Y.Events.FRAG_DECRYPTED,{frag:A,payload:w,stats:{tstart:f,tdecrypt:b}})})}},E.doTick=function(){if(!this.media){this.state=v.State.IDLE;return}if(this.state===v.State.IDLE){var D,A=this.currentTrackId,O=this.levels;if(!O.length||!O[A]||!O[A].details)return;var C=O[A].details,x=C.targetduration,f=this.config,w=this.media,b=U.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,w.currentTime-x,f.maxBufferHole),y=b.end,B=b.len,F=this.getMaxBufferLength()+x;if(B>F)return;console.assert(C,"Subtitle track details are defined on idle subtitle stream controller tick");var _=C.fragments,M=_.length,I=C.edge,m,W=this.fragPrevious;if(y<I){var $=f.maxFragLookUpTolerance;W&&C.hasProgramDateTime&&(m=Object(z.findFragmentByPDT)(_,W.endProgramDateTime,$)),m||(m=Object(z.findFragmentByPTS)(W,_,y,$),!m&&W&&W.start<_[0].start&&(m=_[0]))}else m=_[M-1];(D=m)!==null&&D!==void 0&&D.encrypted?(j.logger.log("Loading key for "+m.sn),this.state=v.State.KEY_LOADING,this.hls.trigger(Y.Events.KEY_LOADING,{frag:m})):m&&this.fragmentTracker.getState(m)===L.FragmentState.NOT_LOADED&&this.loadFragment(m,C,y)}},E.loadFragment=function(D,A,O){this.fragCurrent=D,a.prototype.loadFragment.call(this,D,A,O)},h(R,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),R}(v.default)},"./src/controller/subtitle-track-controller.ts":function(ne,J,P){"use strict";P.r(J);var Y=P("./src/events.ts"),j=P("./src/utils/texttrack-utils.ts"),U=P("./src/controller/base-playlist-controller.ts"),z=P("./src/types/loader.ts");function H(u,h){for(var c=0;c<h.length;c++){var o=h[c];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(u,o.key,o)}}function r(u,h,c){return h&&H(u.prototype,h),c&&H(u,c),u}function L(u,h){u.prototype=Object.create(h.prototype),u.prototype.constructor=u,v(u,h)}function v(u,h){return v=Object.setPrototypeOf||function(o,l){return o.__proto__=l,o},v(u,h)}var g=function(u){L(h,u);function h(o){var l;return l=u.call(this,o,"[subtitle-track-controller]")||this,l.media=null,l.tracks=[],l.groupId=null,l.tracksInGroup=[],l.trackId=-1,l.selectDefaultTrack=!0,l.queuedDefaultTrack=-1,l.trackChangeListener=function(){return l.onTextTracksChanged()},l.asyncPollTrackChange=function(){return l.pollTrackChange(0)},l.useTextTrackPolling=!1,l.subtitlePollingInterval=-1,l.subtitleDisplay=!0,l.registerListeners(),l}var c=h.prototype;return c.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,u.prototype.destroy.call(this)},c.registerListeners=function(){var l=this.hls;l.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.on(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),l.on(Y.Events.ERROR,this.onError,this)},c.unregisterListeners=function(){var l=this.hls;l.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.off(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),l.off(Y.Events.ERROR,this.onError,this)},c.onMediaAttached=function(l,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)},c.pollTrackChange=function(l){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,l)},c.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 l=p(this.media.textTracks);l.forEach(function(s){Object(j.clearCurrentCues)(s)}),this.subtitleTrack=-1,this.media=null},c.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},c.onManifestParsed=function(l,s){this.tracks=s.subtitleTracks},c.onSubtitleTrackLoaded=function(l,s){var a=s.id,R=s.details,E=this.trackId,S=this.tracksInGroup[E];if(!S){this.warn("Invalid subtitle track id "+a);return}var D=S.details;S.details=s.details,this.log("subtitle track "+a+" loaded ["+R.startSN+"-"+R.endSN+"]"),a===this.trackId&&(this.retryCount=0,this.playlistLoaded(a,s,D))},c.onLevelLoading=function(l,s){this.switchLevel(s.level)},c.onLevelSwitching=function(l,s){this.switchLevel(s.level)},c.switchLevel=function(l){var s=this.hls.levels[l];if(!(s!=null&&s.textGroupIds))return;var a=s.textGroupIds[s.urlId];if(this.groupId!==a){var R=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,E=this.tracks.filter(function(A){return!a||A.groupId===a});this.tracksInGroup=E;var S=this.findTrackId(R==null?void 0:R.name)||this.findTrackId();this.groupId=a;var D={subtitleTracks:E};this.log("Updating subtitle tracks, "+E.length+' track(s) found in "'+a+'" group-id'),this.hls.trigger(Y.Events.SUBTITLE_TRACKS_UPDATED,D),S!==-1&&this.setSubtitleTrack(S,R)}},c.findTrackId=function(l){for(var s=this.tracksInGroup,a=0;a<s.length;a++){var R=s[a];if((!this.selectDefaultTrack||R.default)&&(!l||l===R.name))return R.id}return-1},c.onError=function(l,s){if(u.prototype.onError.call(this,l,s),s.fatal||!s.context)return;s.context.type===z.PlaylistContextType.SUBTITLE_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},c.loadPlaylist=function(l){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var a=s.id,R=s.groupId,E=s.url;if(l)try{E=l.addDirectives(E)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("Loading subtitle playlist for id "+a),this.hls.trigger(Y.Events.SUBTITLE_TRACK_LOADING,{url:E,id:a,groupId:R,deliveryDirectives:l||null})}},c.toggleTrackModes=function(l){var s=this,a=this.media,R=this.subtitleDisplay,E=this.trackId;if(!a)return;var S=p(a.textTracks),D=S.filter(function(C){return C.groupId===s.groupId});if(l===-1)[].slice.call(S).forEach(function(C){C.mode="disabled"});else{var A=D[E];A&&(A.mode="disabled")}var O=D[l];O&&(O.mode=R?"showing":"hidden")},c.setSubtitleTrack=function(l,s){var a,R=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=l;return}if(this.trackId!==l&&this.toggleTrackModes(l),this.trackId===l&&(l===-1||(a=R[l])!==null&&a!==void 0&&a.details)||l<-1||l>=R.length)return;this.clearTimer();var E=R[l];if(this.log("Switching to subtitle track "+l),this.trackId=l,E){var S=E.id,D=E.groupId,A=D===void 0?"":D,O=E.name,C=E.type,x=E.url;this.hls.trigger(Y.Events.SUBTITLE_TRACK_SWITCH,{id:S,groupId:A,name:O,type:C,url:x});var f=this.switchParams(E.url,s==null?void 0:s.details);this.loadPlaylist(f)}else this.hls.trigger(Y.Events.SUBTITLE_TRACK_SWITCH,{id:l})},c.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var l=-1,s=p(this.media.textTracks),a=0;a<s.length;a++)if(s[a].mode==="hidden")l=a;else if(s[a].mode==="showing"){l=a;break}this.subtitleTrack!==l&&(this.subtitleTrack=l)},r(h,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(l){this.selectDefaultTrack=!1;var s=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(l,s)}}]),h}(U.default);function p(u){for(var h=[],c=0;c<u.length;c++){var o=u[c];o.kind==="subtitles"&&o.label&&h.push(u[c])}return h}J.default=g},"./src/controller/timeline-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"TimelineController",function(){return p});var Y=P("./src/polyfills/number.ts"),j=P("./src/events.ts"),U=P("./src/utils/cea-608-parser.ts"),z=P("./src/utils/output-filter.ts"),H=P("./src/utils/webvtt-parser.ts"),r=P("./src/utils/texttrack-utils.ts"),L=P("./src/utils/imsc1-ttml-parser.ts"),v=P("./src/types/loader.ts"),g=P("./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=c(),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 z.default(this,"textTrack1"),R=new z.default(this,"textTrack2"),E=new z.default(this,"textTrack3"),S=new z.default(this,"textTrack4");this.cea608Parser1=new U.default(1,a,R),this.cea608Parser2=new U.default(3,E,S)}s.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.on(j.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.on(j.Events.FRAG_LOADING,this.onFragLoading,this),s.on(j.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(j.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.on(j.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.on(j.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(j.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var l=o.prototype;return l.destroy=function(){var a=this.hls;a.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),a.off(j.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),a.off(j.Events.FRAG_LOADING,this.onFragLoading,this),a.off(j.Events.FRAG_LOADED,this.onFragLoaded,this),a.off(j.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),a.off(j.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),a.off(j.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.off(j.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),a.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},l.addCues=function(a,R,E,S,D){for(var A=!1,O=D.length;O--;){var C=D[O],x=h(C[0],C[1],R,E);if(x>=0&&(C[0]=Math.min(C[0],R),C[1]=Math.max(C[1],E),A=!0,x/(E-R)>.5))return}if(A||D.push([R,E]),this.config.renderTextTracksNatively){var f=this.captionsTracks[a];this.Cues.newCue(f,R,E,S)}else{var w=this.Cues.newCue(null,R,E,S);this.hls.trigger(j.Events.CUES_PARSED,{type:"captions",cues:w,track:a})}},l.onInitPtsFound=function(a,R){var E=this,S=R.frag,D=R.id,A=R.initPTS,O=R.timescale,C=this.unparsedVttFrags;D==="main"&&(this.initPTS[S.cc]=A,this.timescale[S.cc]=O),C.length&&(this.unparsedVttFrags=[],C.forEach(function(x){E.onFragLoaded(j.Events.FRAG_LOADED,x)}))},l.getExistingTrack=function(a){var R=this.media;if(R)for(var E=0;E<R.textTracks.length;E++){var S=R.textTracks[E];if(S[a])return S}return null},l.createCaptionsTrack=function(a){this.config.renderTextTracksNatively?this.createNativeTrack(a):this.createNonNativeTrack(a)},l.createNativeTrack=function(a){if(this.captionsTracks[a])return;var R=this.captionsProperties,E=this.captionsTracks,S=this.media,D=R[a],A=D.label,O=D.languageCode,C=this.getExistingTrack(a);if(C)E[a]=C,Object(r.clearCurrentCues)(E[a]),Object(r.sendAddTrackEvent)(E[a],S);else{var x=this.createTextTrack("captions",A,O);x&&(x[a]=!0,E[a]=x)}},l.createNonNativeTrack=function(a){if(this.nonNativeCaptionsTracks[a])return;var R=this.captionsProperties[a];if(!R)return;var E=R.label,S={_id:a,label:E,kind:"captions",default:R.media?!!R.media.default:!1,closedCaptions:R.media};this.nonNativeCaptionsTracks[a]=S,this.hls.trigger(j.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[S]})},l.createTextTrack=function(a,R,E){var S=this.media;return S?S.addTextTrack(a,R,E):void 0},l.onMediaAttaching=function(a,R){this.media=R.media,this._cleanTracks()},l.onMediaDetaching=function(){var a=this.captionsTracks;Object.keys(a).forEach(function(R){Object(r.clearCurrentCues)(a[R]),delete a[R]}),this.nonNativeCaptionsTracks={}},l.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=c(),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())},l._cleanTracks=function(){var a=this.media;if(!a)return;var R=a.textTracks;if(R)for(var E=0;E<R.length;E++)Object(r.clearCurrentCues)(R[E])},l.onSubtitleTracksUpdated=function(a,R){var E=this;this.textTracks=[];var S=R.subtitleTracks||[],D=S.some(function(x){return x.textCodec===L.IMSC1_CODEC});if(this.config.enableWebVTT||D&&this.config.enableIMSC1){var A=this.tracks&&S&&this.tracks.length===S.length;if(this.tracks=S||[],this.config.renderTextTracksNatively){var O=this.media?this.media.textTracks:[];this.tracks.forEach(function(x,f){var w;if(f<O.length){for(var b=null,y=0;y<O.length;y++)if(u(O[y],x)){b=O[y];break}b&&(w=b)}w?Object(r.clearCurrentCues)(w):(w=E.createTextTrack("subtitles",x.name,x.lang),w&&(w.mode="disabled")),w&&(w.groupId=x.groupId,E.textTracks.push(w))})}else if(!A&&this.tracks&&this.tracks.length){var C=this.tracks.map(function(x){return{label:x.name,kind:x.type.toLowerCase(),default:x.default,subtitleTrack:x}});this.hls.trigger(j.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:C})}}},l.onManifestLoaded=function(a,R){var E=this;this.config.enableCEA708Captions&&R.captions&&R.captions.forEach(function(S){var D=/(?:CC|SERVICE)([1-4])/.exec(S.instreamId);if(!D)return;var A="textTrack"+D[1],O=E.captionsProperties[A];if(!O)return;O.label=S.name,S.lang&&(O.languageCode=S.lang),O.media=S})},l.onFragLoading=function(a,R){var E=this.cea608Parser1,S=this.cea608Parser2,D=this.lastSn,A=this.lastPartIndex;if(!this.enabled||!(E&&S))return;if(R.frag.type===v.PlaylistLevelType.MAIN){var O,C,x=R.frag.sn,f=(O=R==null||((C=R.part)===null||C===void 0)?void 0:C.index)!=null?O:-1;x===D+1||x===D&&f===A+1||(E.reset(),S.reset()),this.lastSn=x,this.lastPartIndex=f}},l.onFragLoaded=function(a,R){var E=R.frag,S=R.payload,D=this.initPTS,A=this.unparsedVttFrags;if(E.type===v.PlaylistLevelType.SUBTITLE)if(S.byteLength){if(!Object(Y.isFiniteNumber)(D[E.cc])){A.push(R),D.length&&this.hls.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:E,error:new Error("Missing initial subtitle PTS")});return}var O=E.decryptdata;if(O==null||O.key==null||O.method!=="AES-128"){var C=this.tracks[E.level],x=this.vttCCs;x[E.cc]||(x[E.cc]={start:E.start,prevCC:this.prevCC,new:!0},this.prevCC=E.cc),C&&C.textCodec===L.IMSC1_CODEC?this._parseIMSC1(E,S):this._parseVTTs(E,S,x)}}else this.hls.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:E,error:new Error("Empty subtitle payload")})},l._parseIMSC1=function(a,R){var E=this,S=this.hls;Object(L.parseIMSC1)(R,this.initPTS[a.cc],this.timescale[a.cc],function(D){E._appendCues(D,a.level),S.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:a})},function(D){g.logger.log("Failed to parse IMSC1: "+D),S.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:D})})},l._parseVTTs=function(a,R,E){var S=this,D=this.hls;Object(H.parseWebVTT)(R,this.initPTS[a.cc],this.timescale[a.cc],E,a.cc,a.start,function(A){S._appendCues(A,a.level),D.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:a})},function(A){S._fallbackToIMSC1(a,R),g.logger.log("Failed to parse VTT cue: "+A),D.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:A})})},l._fallbackToIMSC1=function(a,R){var E=this,S=this.tracks[a.level];S.textCodec||Object(L.parseIMSC1)(R,this.initPTS[a.cc],this.timescale[a.cc],function(){S.textCodec=L.IMSC1_CODEC,E._parseIMSC1(a,R)},function(){S.textCodec="wvtt"})},l._appendCues=function(a,R){var E=this.hls;if(this.config.renderTextTracksNatively){var S=this.textTracks[R];if(S.mode==="disabled")return;a.forEach(function(O){return Object(r.addCueToTrack)(S,O)})}else{var D=this.tracks[R],A=D.default?"default":"subtitles"+R;E.trigger(j.Events.CUES_PARSED,{type:"subtitles",cues:a,track:A})}},l.onFragDecrypted=function(a,R){var E=R.frag;if(E.type===v.PlaylistLevelType.SUBTITLE){if(!Object(Y.isFiniteNumber)(this.initPTS[E.cc])){this.unparsedVttFrags.push(R);return}this.onFragLoaded(j.Events.FRAG_LOADED,R)}},l.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},l.onFragParsingUserdata=function(a,R){var E=this.cea608Parser1,S=this.cea608Parser2;if(!this.enabled||!(E&&S))return;for(var D=0;D<R.samples.length;D++){var A=R.samples[D].bytes;if(A){var O=this.extractCea608Data(A);E.addData(R.samples[D].pts,O[0]),S.addData(R.samples[D].pts,O[1])}}},l.onBufferFlushing=function(a,R){var E=R.startOffset,S=R.endOffset,D=R.endOffsetSubtitles,A=R.type,O=this.media;if(!O||O.currentTime<S)return;if(!A||A==="video"){var C=this.captionsTracks;Object.keys(C).forEach(function(f){return Object(r.removeCuesInRange)(C[f],E,S)})}if(this.config.renderTextTracksNatively&&(E===0&&D!==void 0)){var x=this.textTracks;Object.keys(x).forEach(function(f){return Object(r.removeCuesInRange)(x[f],E,D)})}},l.extractCea608Data=function(a){for(var R=a[0]&31,E=2,S=[[],[]],D=0;D<R;D++){var A=a[E++],O=127&a[E++],C=127&a[E++],x=(4&A)!==0,f=3&A;if(O===0&&C===0)continue;x&&((f===0||f===1)&&(S[f].push(O),S[f].push(C)))}return S},o}();function u(o,l){return o&&o.label===l.name&&!(o.textTrack1||o.textTrack2)}function h(o,l,s,a){return Math.min(l,a)-Math.max(o,s)}function c(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return Y});var Y=function(){function j(z,H){this.subtle=void 0,this.aesIV=void 0,this.subtle=z,this.aesIV=H}var U=j.prototype;return U.decrypt=function(H,r){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},r,H)},j}()},"./src/crypt/aes-decryptor.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"removePadding",function(){return j}),P.d(J,"default",function(){return U});var Y=P("./src/utils/typed-array.ts");function j(z){var H=z.byteLength,r=H&&new DataView(z.buffer).getUint8(H-1);return r?Object(Y.sliceUint8)(z,0,H-r):z}var U=function(){function z(){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=z.prototype;return H.uint8ArrayToUint32Array_=function(L){for(var v=new DataView(L),g=new Uint32Array(4),p=0;p<4;p++)g[p]=v.getUint32(p*4);return g},H.initTable=function(){var L=this.sBox,v=this.invSBox,g=this.subMix,p=g[0],u=g[1],h=g[2],c=g[3],o=this.invSubMix,l=o[0],s=o[1],a=o[2],R=o[3],E=new Uint32Array(256),S=0,D=0,A=0;for(A=0;A<256;A++)A<128?E[A]=A<<1:E[A]=A<<1^283;for(A=0;A<256;A++){var O=D^D<<1^D<<2^D<<3^D<<4;O=O>>>8^O&255^99,L[S]=O,v[O]=S;var C=E[S],x=E[C],f=E[x],w=E[O]*257^O*16843008;p[S]=w<<24|w>>>8,u[S]=w<<16|w>>>16,h[S]=w<<8|w>>>24,c[S]=w,w=f*16843009^x*65537^C*257^S*16843008,l[O]=w<<24|w>>>8,s[O]=w<<16|w>>>16,a[O]=w<<8|w>>>24,R[O]=w,S?(S=C^E[E[E[f^C]]],D^=E[E[D]]):S=D=1}},H.expandKey=function(L){for(var v=this.uint8ArrayToUint32Array_(L),g=!0,p=0;p<v.length&&g;)g=v[p]===this.key[p],p++;if(g)return;this.key=v;var u=this.keySize=v.length;if(u!==4&&u!==6&&u!==8)throw new Error("Invalid aes key size="+u);var h=this.ksRows=(u+6+1)*4,c,o,l=this.keySchedule=new Uint32Array(h),s=this.invKeySchedule=new Uint32Array(h),a=this.sBox,R=this.rcon,E=this.invSubMix,S=E[0],D=E[1],A=E[2],O=E[3],C,x;for(c=0;c<h;c++){if(c<u){C=l[c]=v[c];continue}x=C,c%u===0?(x=x<<8|x>>>24,x=a[x>>>24]<<24|a[x>>>16&255]<<16|a[x>>>8&255]<<8|a[x&255],x^=R[c/u|0]<<24):u>6&&c%u===4&&(x=a[x>>>24]<<24|a[x>>>16&255]<<16|a[x>>>8&255]<<8|a[x&255]),l[c]=C=(l[c-u]^x)>>>0}for(o=0;o<h;o++)c=h-o,o&3?x=l[c]:x=l[c-4],o<4||c<=4?s[o]=x:s[o]=S[a[x>>>24]]^D[a[x>>>16&255]]^A[a[x>>>8&255]]^O[a[x&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,g){for(var p=this.keySize+6,u=this.invKeySchedule,h=this.invSBox,c=this.invSubMix,o=c[0],l=c[1],s=c[2],a=c[3],R=this.uint8ArrayToUint32Array_(g),E=R[0],S=R[1],D=R[2],A=R[3],O=new Int32Array(L),C=new Int32Array(O.length),x,f,w,b,y,B,F,_,M,I,m,W,$,ae,ue=this.networkToHostOrderSwap;v<O.length;){for(M=ue(O[v]),I=ue(O[v+1]),m=ue(O[v+2]),W=ue(O[v+3]),y=M^u[0],B=W^u[1],F=m^u[2],_=I^u[3],$=4,ae=1;ae<p;ae++)x=o[y>>>24]^l[B>>16&255]^s[F>>8&255]^a[_&255]^u[$],f=o[B>>>24]^l[F>>16&255]^s[_>>8&255]^a[y&255]^u[$+1],w=o[F>>>24]^l[_>>16&255]^s[y>>8&255]^a[B&255]^u[$+2],b=o[_>>>24]^l[y>>16&255]^s[B>>8&255]^a[F&255]^u[$+3],y=x,B=f,F=w,_=b,$=$+4;x=h[y>>>24]<<24^h[B>>16&255]<<16^h[F>>8&255]<<8^h[_&255]^u[$],f=h[B>>>24]<<24^h[F>>16&255]<<16^h[_>>8&255]<<8^h[y&255]^u[$+1],w=h[F>>>24]<<24^h[_>>16&255]<<16^h[y>>8&255]<<8^h[B&255]^u[$+2],b=h[_>>>24]<<24^h[y>>16&255]<<16^h[B>>8&255]<<8^h[F&255]^u[$+3],C[v]=ue(x^E),C[v+1]=ue(b^S),C[v+2]=ue(w^D),C[v+3]=ue(f^A),E=M,S=I,D=m,A=W,v=v+4}return C.buffer},z}()},"./src/crypt/decrypter.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return v});var Y=P("./src/crypt/aes-crypto.ts"),j=P("./src/crypt/fast-aes-key.ts"),U=P("./src/crypt/aes-decryptor.ts"),z=P("./src/utils/logger.ts"),H=P("./src/utils/mp4-tools.ts"),r=P("./src/utils/typed-array.ts"),L=16,v=function(){function g(u,h,c){var o=c===void 0?{}:c,l=o.removePKCS7Padding,s=l===void 0?!0:l;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=u,this.config=h,this.removePKCS7Padding=s,s)try{var a=self.crypto;a&&(this.subtle=a.subtle||a.webkitSubtle)}catch(R){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var p=g.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 c=new Uint8Array(h);return this.reset(),this.removePKCS7Padding?Object(U.removePadding)(c):c},p.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},p.decrypt=function(h,c,o,l){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(h),c,o);var s=this.flush();s&&l(s.buffer)}else this.webCryptoDecrypt(new Uint8Array(h),c,o).then(l)},p.softwareDecrypt=function(h,c,o){var l=this.currentIV,s=this.currentResult,a=this.remainderData;this.logOnce("JS AES decrypt"),a&&(h=Object(H.appendUint8Array)(a,h),this.remainderData=null);var R=this.getValidChunk(h);if(!R.length)return null;l&&(o=l);var E=this.softwareDecrypter;E||(E=this.softwareDecrypter=new U.default),E.expandKey(c);var S=s;return this.currentResult=E.decrypt(R.buffer,0,o),this.currentIV=Object(r.sliceUint8)(R,-16).buffer,S||null},p.webCryptoDecrypt=function(h,c,o){var l=this,s=this.subtle;return(this.key!==c||!this.fastAesKey)&&(this.key=c,this.fastAesKey=new j.default(s,c)),this.fastAesKey.expandKey().then(function(a){if(!s)return Promise.reject(new Error("web crypto not initialized"));var R=new Y.default(s,o);return R.decrypt(h.buffer,a)}).catch(function(a){return l.onWebCryptoError(a,h,c,o)})},p.onWebCryptoError=function(h,c,o,l){return z.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",h),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(c,o,l)},p.getValidChunk=function(h){var c=h,o=h.length-h.length%L;return o!==h.length&&(c=Object(r.sliceUint8)(h,0,o),this.remainderData=Object(r.sliceUint8)(h,o)),c},p.logOnce=function(h){if(!this.logEnabled)return;z.logger.log("[decrypter.ts]: "+h),this.logEnabled=!1},g}()},"./src/crypt/fast-aes-key.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return Y});var Y=function(){function j(z,H){this.subtle=void 0,this.key=void 0,this.subtle=z,this.key=H}var U=j.prototype;return U.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},j}()},"./src/demux/aacdemuxer.ts":function(ne,J,P){"use strict";P.r(J);var Y=P("./src/demux/base-audio-demuxer.ts"),j=P("./src/demux/adts.ts"),U=P("./src/utils/logger.ts"),z=P("./src/demux/id3.ts");function H(v,g){v.prototype=Object.create(g.prototype),v.prototype.constructor=v,r(v,g)}function r(v,g){return r=Object.setPrototypeOf||function(u,h){return u.__proto__=h,u},r(v,g)}var L=function(v){H(g,v);function g(u,h){var c;return c=v.call(this)||this,c.observer=void 0,c.config=void 0,c.observer=u,c.config=h,c}var p=g.prototype;return p.resetInitSegment=function(h,c,o){v.prototype.resetInitSegment.call(this,h,c,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}},g.probe=function(h){if(!h)return!1;for(var c=z.getID3Data(h,0)||[],o=c.length,l=h.length;o<l;o++)if(j.probe(h,o))return U.logger.log("ADTS sync word found !"),!0;return!1},p.canParse=function(h,c){return j.canParse(h,c)},p.appendFrame=function(h,c,o){j.initTrackConfig(h,this.observer,c,o,h.manifestCodec);var l=j.appendFrame(h,c,o,this.initPTS,this.frameIndex);if(l&&l.missing===0)return l},g}(Y.default);L.minProbeByteLength=9,J.default=L},"./src/demux/adts.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"getAudioConfig",function(){return z}),P.d(J,"isHeaderPattern",function(){return H}),P.d(J,"getHeaderLength",function(){return r}),P.d(J,"getFullFrameLength",function(){return L}),P.d(J,"canGetFrameLength",function(){return v}),P.d(J,"isHeader",function(){return g}),P.d(J,"canParse",function(){return p}),P.d(J,"probe",function(){return u}),P.d(J,"initTrackConfig",function(){return h}),P.d(J,"getFrameDuration",function(){return c}),P.d(J,"parseFrameHeader",function(){return o}),P.d(J,"appendFrame",function(){return l});var Y=P("./src/utils/logger.ts"),j=P("./src/errors.ts"),U=P("./src/events.ts");function z(s,a,R,E){var S,D,A,O,C=navigator.userAgent.toLowerCase(),x=E,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];S=((a[R+2]&192)>>>6)+1;var w=(a[R+2]&60)>>>2;if(w>f.length-1){s.trigger(U.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+w});return}return A=(a[R+2]&1)<<2,A|=(a[R+3]&192)>>>6,Y.logger.log("manifest codec:"+E+", ADTS type:"+S+", samplingIndex:"+w),/firefox/i.test(C)?w>=6?(S=5,O=new Array(4),D=w-3):(S=2,O=new Array(2),D=w):C.indexOf("android")!==-1?(S=2,O=new Array(2),D=w):(S=5,O=new Array(4),E&&(E.indexOf("mp4a.40.29")!==-1||E.indexOf("mp4a.40.5")!==-1)||!E&&w>=6?D=w-3:((E&&E.indexOf("mp4a.40.2")!==-1&&(w>=6&&A===1||/vivaldi/i.test(C))||!E&&A===1)&&(S=2,O=new Array(2)),D=w)),O[0]=S<<3,O[0]|=(w&14)>>1,O[1]|=(w&1)<<7,O[1]|=A<<3,S===5&&(O[1]|=(D&14)>>1,O[2]=(D&1)<<7,O[2]|=2<<2,O[3]=0),{config:O,samplerate:f[w],channelCount:A,codec:"mp4a.40."+S,manifestCodec:x}}function H(s,a){return s[a]===255&&(s[a+1]&246)===240}function r(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 g(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 u(s,a){if(g(s,a)){var R=r(s,a);if(a+R>=s.length)return!1;var E=L(s,a);if(E<=R)return!1;var S=a+E;return S===s.length||g(s,S)}return!1}function h(s,a,R,E,S){if(!s.samplerate){var D=z(a,R,E,S);if(!D)return;s.config=D.config,s.samplerate=D.samplerate,s.channelCount=D.channelCount,s.codec=D.codec,s.manifestCodec=D.manifestCodec,Y.logger.log("parsed codec:"+s.codec+", rate:"+D.samplerate+", channels:"+D.channelCount)}}function c(s){return 1024*9e4/s}function o(s,a,R,E,S){var D=r(s,a),A=L(s,a);if(A-=D,A>0){var O=R+E*S;return{headerLength:D,frameLength:A,stamp:O}}}function l(s,a,R,E,S){var D=c(s.samplerate),A=o(a,R,E,S,D);if(A){var O=A.frameLength,C=A.headerLength,x=A.stamp,f=C+O,w=Math.max(0,R+f-a.length),b;w?(b=new Uint8Array(f-C),b.set(a.subarray(R+C,a.length),0)):b=a.subarray(R+C,R+f);var y={unit:b,pts:x};return w||s.samples.push(y),{sample:y,length:f,missing:w}}}},"./src/demux/base-audio-demuxer.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"initPTSFn",function(){return L});var Y=P("./src/polyfills/number.ts"),j=P("./src/demux/id3.ts"),U=P("./src/demux/dummy-demuxed-track.ts"),z=P("./src/utils/mp4-tools.ts"),H=P("./src/utils/typed-array.ts"),r=function(){function v(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var g=v.prototype;return g.resetInitSegment=function(u,h,c){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},g.resetTimeStamp=function(){},g.resetContiguity=function(){},g.canParse=function(u,h){return!1},g.appendFrame=function(u,h,c){},g.demux=function(u,h){this.cachedData&&(u=Object(z.appendUint8Array)(this.cachedData,u),this.cachedData=null);var c=j.getID3Data(u,0),o=c?c.length:0,l,s,a=this._audioTrack,R=this._id3Track,E=c?j.getTimeStamp(c):void 0,S=u.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=L(E,h)),c&&c.length>0&&R.samples.push({pts:this.initPTS,dts:this.initPTS,data:c}),s=this.initPTS;o<S;){if(this.canParse(u,o)){var D=this.appendFrame(a,u,o);D?(this.frameIndex++,s=D.sample.pts,o+=D.length,l=o):o=S}else j.canParse(u,o)?(c=j.getID3Data(u,o),R.samples.push({pts:s,dts:s,data:c}),o+=c.length,l=o):o++;if(o===S&&l!==S){var A=Object(H.sliceUint8)(u,l);this.cachedData?this.cachedData=Object(z.appendUint8Array)(this.cachedData,A):this.cachedData=A}}return{audioTrack:a,avcTrack:Object(U.dummyTrack)(),id3Track:R,textTrack:Object(U.dummyTrack)()}},g.demuxSampleAes=function(u,h,c){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},g.flush=function(u){var h=this.cachedData;return h&&(this.cachedData=null,this.demux(h,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(U.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(U.dummyTrack)()}},g.destroy=function(){},v}(),L=function(g,p){return Object(Y.isFiniteNumber)(g)?g*90:p*9e4};J.default=r},"./src/demux/chunk-cache.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return Y});var Y=function(){function U(){this.chunks=[],this.dataLength=0}var z=U.prototype;return z.push=function(r){this.chunks.push(r),this.dataLength+=r.length},z.flush=function(){var r=this.chunks,L=this.dataLength,v;if(r.length)r.length===1?v=r[0]:v=j(r,L);else return new Uint8Array(0);return this.reset(),v},z.reset=function(){this.chunks.length=0,this.dataLength=0},U}();function j(U,z){for(var H=new Uint8Array(z),r=0,L=0;L<U.length;L++){var v=U[L];H.set(v,r),r+=v.length}return H}},"./src/demux/dummy-demuxed-track.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"dummyTrack",function(){return Y});function Y(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ne,J,P){"use strict";P.r(J);var Y=P("./src/utils/logger.ts"),j=function(){function U(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 z=U.prototype;return z.loadWord=function(){var r=this.data,L=this.bytesAvailable,v=r.byteLength-L,g=new Uint8Array(4),p=Math.min(4,L);if(p===0)throw new Error("no bytes available");g.set(r.subarray(v,v+p)),this.word=new DataView(g.buffer).getUint32(0),this.bitsAvailable=p*8,this.bytesAvailable-=p},z.skipBits=function(r){var L;this.bitsAvailable>r?(this.word<<=r,this.bitsAvailable-=r):(r-=this.bitsAvailable,L=r>>3,r-=L>>3,this.bytesAvailable-=L,this.loadWord(),this.word<<=r,this.bitsAvailable-=r)},z.readBits=function(r){var L=Math.min(this.bitsAvailable,r),v=this.word>>>32-L;return r>32&&Y.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=L,this.bitsAvailable>0?this.word<<=L:this.bytesAvailable>0&&this.loadWord(),L=r-L,L>0&&this.bitsAvailable?v<<L|this.readBits(L):v},z.skipLZ=function(){var r;for(r=0;r<this.bitsAvailable;++r)if((this.word&2147483648>>>r)!==0)return this.word<<=r,this.bitsAvailable-=r,r;return this.loadWord(),r+this.skipLZ()},z.skipUEG=function(){this.skipBits(1+this.skipLZ())},z.skipEG=function(){this.skipBits(1+this.skipLZ())},z.readUEG=function(){var r=this.skipLZ();return this.readBits(r+1)-1},z.readEG=function(){var r=this.readUEG();return 1&r?1+r>>>1:-1*(r>>>1)},z.readBoolean=function(){return this.readBits(1)===1},z.readUByte=function(){return this.readBits(8)},z.readUShort=function(){return this.readBits(16)},z.readUInt=function(){return this.readBits(32)},z.skipScalingList=function(r){for(var L=8,v=8,g,p=0;p<r;p++)v!==0&&(g=this.readEG(),v=(L+g+256)%256),L=v===0?L:v},z.readSPS=function(){var r=0,L=0,v=0,g=0,p,u,h,c=this.readUByte.bind(this),o=this.readBits.bind(this),l=this.readUEG.bind(this),s=this.readBoolean.bind(this),a=this.skipBits.bind(this),R=this.skipEG.bind(this),E=this.skipUEG.bind(this),S=this.skipScalingList.bind(this);c();var D=c();if(o(5),a(3),c(),E(),D===100||D===110||D===122||D===244||D===44||D===83||D===86||D===118||D===128){var A=l();if(A===3&&a(1),E(),E(),a(1),s())for(u=A!==3?8:12,h=0;h<u;h++)s()&&(h<6?S(16):S(64))}E();var O=l();if(O===0)l();else if(O===1)for(a(1),R(),R(),p=l(),h=0;h<p;h++)R();E(),a(1);var C=l(),x=l(),f=o(1);f===0&&a(1),a(1),s()&&(r=l(),L=l(),v=l(),g=l());var w=[1,1];if(s()&&s()){var b=c();switch(b){case 1:w=[1,1];break;case 2:w=[12,11];break;case 3:w=[10,11];break;case 4:w=[16,11];break;case 5:w=[40,33];break;case 6:w=[24,11];break;case 7:w=[20,11];break;case 8:w=[32,11];break;case 9:w=[80,33];break;case 10:w=[18,11];break;case 11:w=[15,11];break;case 12:w=[64,33];break;case 13:w=[160,99];break;case 14:w=[4,3];break;case 15:w=[3,2];break;case 16:w=[2,1];break;case 255:{w=[c()<<8|c(),c()<<8|c()];break}}}return{width:Math.ceil((C+1)*16-r*2-L*2),height:(2-f)*(x+1)*16-(f?2:4)*(v+g),pixelRatio:w}},z.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},U}();J.default=j},"./src/demux/id3.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"isHeader",function(){return Y}),P.d(J,"isFooter",function(){return j}),P.d(J,"getID3Data",function(){return U}),P.d(J,"canParse",function(){return H}),P.d(J,"getTimeStamp",function(){return r}),P.d(J,"isTimeStampFrame",function(){return L}),P.d(J,"getID3Frames",function(){return g}),P.d(J,"decodeFrame",function(){return p}),P.d(J,"utf8ArrayToStr",function(){return l}),P.d(J,"testables",function(){return s});var Y=function(S,D){return D+10<=S.length&&(S[D]===73&&S[D+1]===68&&S[D+2]===51&&(S[D+3]<255&&S[D+4]<255&&(S[D+6]<128&&S[D+7]<128&&S[D+8]<128&&S[D+9]<128)))},j=function(S,D){return D+10<=S.length&&(S[D]===51&&S[D+1]===68&&S[D+2]===73&&(S[D+3]<255&&S[D+4]<255&&(S[D+6]<128&&S[D+7]<128&&S[D+8]<128&&S[D+9]<128)))},U=function(S,D){for(var A=D,O=0;Y(S,D);){O+=10;var C=z(S,D+6);O+=C,j(S,D+10)&&(O+=10),D+=O}return O>0?S.subarray(A,A+O):void 0},z=function(S,D){var A=0;return A=(S[D]&127)<<21,A|=(S[D+1]&127)<<14,A|=(S[D+2]&127)<<7,A|=S[D+3]&127,A},H=function(S,D){return Y(S,D)&&z(S,D+6)+10<=S.length-D},r=function(S){for(var D=g(S),A=0;A<D.length;A++){var O=D[A];if(L(O))return o(O)}return},L=function(S){return S&&S.key==="PRIV"&&S.info==="com.apple.streaming.transportStreamTimestamp"},v=function(S){var D=String.fromCharCode(S[0],S[1],S[2],S[3]),A=z(S,4),O=10;return{type:D,size:A,data:S.subarray(O,O+A)}},g=function(S){for(var D=0,A=[];Y(S,D);){var O=z(S,D+6);D+=10;for(var C=D+O;D+8<C;){var x=v(S.subarray(D)),f=p(x);f&&A.push(f),D+=x.size+10}j(S,D)&&(D+=10)}return A},p=function(S){return S.type==="PRIV"?u(S):S.type[0]==="W"?c(S):h(S)},u=function(S){if(S.size<2)return;var D=l(S.data,!0),A=new Uint8Array(S.data.subarray(D.length+1));return{key:S.type,info:D,data:A.buffer}},h=function(S){if(S.size<2)return;if(S.type==="TXXX"){var D=1,A=l(S.data.subarray(D),!0);D+=A.length+1;var O=l(S.data.subarray(D));return{key:S.type,info:A,data:O}}var C=l(S.data.subarray(1));return{key:S.type,data:C}},c=function(S){if(S.type==="WXXX"){if(S.size<2)return;var D=1,A=l(S.data.subarray(D),!0);D+=A.length+1;var O=l(S.data.subarray(D));return{key:S.type,info:A,data:O}}var C=l(S.data);return{key:S.type,data:C}},o=function(S){if(S.data.byteLength===8){var D=new Uint8Array(S.data),A=D[3]&1,O=(D[4]<<23)+(D[5]<<15)+(D[6]<<7)+D[7];return O/=45,A&&(O+=4772185884e-2),Math.round(O)}return},l=function(S,D){D===void 0&&(D=!1);var A=R();if(A){var O=A.decode(S);if(D){var C=O.indexOf("\0");return C!==-1?O.substring(0,C):O}return O.replace(/\0/g,"")}for(var x=S.length,f,w,b,y="",B=0;B<x;){if(f=S[B++],f===0&&D)return y;if(f===0||f===3)continue;switch(f>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:y+=String.fromCharCode(f);break;case 12:case 13:w=S[B++],y+=String.fromCharCode((f&31)<<6|w&63);break;case 14:w=S[B++],b=S[B++],y+=String.fromCharCode((f&15)<<12|(w&63)<<6|(b&63)<<0);break;default:}}return y},s={decodeTextFrame:h},a;function R(){return!a&&typeof self.TextDecoder!="undefined"&&(a=new self.TextDecoder("utf-8")),a}},"./src/demux/mp3demuxer.ts":function(ne,J,P){"use strict";P.r(J);var Y=P("./src/demux/base-audio-demuxer.ts"),j=P("./src/demux/id3.ts"),U=P("./src/utils/logger.ts"),z=P("./src/demux/mpegaudio.ts");function H(v,g){v.prototype=Object.create(g.prototype),v.prototype.constructor=v,r(v,g)}function r(v,g){return r=Object.setPrototypeOf||function(u,h){return u.__proto__=h,u},r(v,g)}var L=function(v){H(g,v);function g(){return v.apply(this,arguments)||this}var p=g.prototype;return p.resetInitSegment=function(h,c,o){v.prototype.resetInitSegment.call(this,h,c,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}},g.probe=function(h){if(!h)return!1;for(var c=j.getID3Data(h,0)||[],o=c.length,l=h.length;o<l;o++)if(z.probe(h,o))return U.logger.log("MPEG Audio sync word found !"),!0;return!1},p.canParse=function(h,c){return z.canParse(h,c)},p.appendFrame=function(h,c,o){return this.initPTS===null?void 0:z.appendFrame(h,c,o,this.initPTS,this.frameIndex)},g}(Y.default);L.minProbeByteLength=4,J.default=L},"./src/demux/mp4demuxer.ts":function(ne,J,P){"use strict";P.r(J);var Y=P("./src/utils/mp4-tools.ts"),j=P("./src/demux/dummy-demuxed-track.ts"),U=function(){function z(r,L){this.remainderData=null,this.config=void 0,this.config=L}var H=z.prototype;return H.resetTimeStamp=function(){},H.resetInitSegment=function(){},H.resetContiguity=function(){},z.probe=function(L){return Object(Y.findBox)({data:L,start:0,end:Math.min(L.length,16384)},["moof"]).length>0},H.demux=function(L){var v=L,g=Object(j.dummyTrack)();if(this.config.progressive){this.remainderData&&(v=Object(Y.appendUint8Array)(this.remainderData,L));var p=Object(Y.segmentValidRange)(v);this.remainderData=p.remainder,g.samples=p.valid||new Uint8Array}else g.samples=v;return{audioTrack:Object(j.dummyTrack)(),avcTrack:g,id3Track:Object(j.dummyTrack)(),textTrack:Object(j.dummyTrack)()}},H.flush=function(){var L=Object(j.dummyTrack)();return L.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(j.dummyTrack)(),avcTrack:L,id3Track:Object(j.dummyTrack)(),textTrack:Object(j.dummyTrack)()}},H.demuxSampleAes=function(L,v,g){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},H.destroy=function(){},z}();U.minProbeByteLength=1024,J.default=U},"./src/demux/mpegaudio.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"appendFrame",function(){return r}),P.d(J,"parseHeader",function(){return L}),P.d(J,"isHeaderPattern",function(){return v}),P.d(J,"isHeader",function(){return g}),P.d(J,"canParse",function(){return p}),P.d(J,"probe",function(){return u});var Y=null,j=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],U=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],z=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],H=[0,1,1,4];function r(h,c,o,l,s){if(o+24>c.length)return;var a=L(c,o);if(a&&o+a.frameLength<=c.length){var R=a.samplesPerFrame*9e4/a.sampleRate,E=l+s*R,S={unit:c.subarray(o,o+a.frameLength),pts:E,dts:E};return h.config=[],h.channelCount=a.channelCount,h.samplerate=a.sampleRate,h.samples.push(S),{sample:S,length:a.frameLength,missing:0}}}function L(h,c){var o=h[c+1]>>3&3,l=h[c+1]>>1&3,s=h[c+2]>>4&15,a=h[c+2]>>2&3;if(o!==1&&s!==0&&s!==15&&a!==3){var R=h[c+2]>>1&1,E=h[c+3]>>6,S=o===3?3-l:l===3?3:4,D=j[S*14+s-1]*1e3,A=o===3?0:o===2?1:2,O=U[A*3+a],C=E===3?1:2,x=z[o][l],f=H[l],w=x*8*f,b=Math.floor(x*D/O+R)*f;if(Y===null){var y=navigator.userAgent||"",B=y.match(/Chrome\/(\d+)/i);Y=B?parseInt(B[1]):0}var F=!!Y&&Y<=87;return F&&l===2&&D>=224e3&&E===0&&(h[c+3]=h[c+3]|128),{sampleRate:O,channelCount:C,frameLength:b,samplesPerFrame:w}}}function v(h,c){return h[c]===255&&(h[c+1]&224)===224&&(h[c+1]&6)!==0}function g(h,c){return c+1<h.length&&v(h,c)}function p(h,c){var o=4;return v(h,c)&&o<=h.length-c}function u(h,c){if(c+1<h.length&&v(h,c)){var o=4,l=L(h,c),s=o;l!=null&&l.frameLength&&(s=l.frameLength);var a=c+s;return a===h.length||g(h,a)}return!1}},"./src/demux/sample-aes.ts":function(ne,J,P){"use strict";P.r(J);var Y=P("./src/crypt/decrypter.ts"),j=P("./src/demux/tsdemuxer.ts"),U=function(){function z(r,L,v){this.keyData=void 0,this.decrypter=void 0,this.keyData=v,this.decrypter=new Y.default(r,L,{removePKCS7Padding:!1})}var H=z.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,g,p){var u=L[v].unit,h=u.subarray(16,u.length-u.length%16),c=h.buffer.slice(h.byteOffset,h.byteOffset+h.length),o=this;this.decryptBuffer(c,function(l){var s=new Uint8Array(l);u.set(s,16),p||o.decryptAacSamples(L,v+1,g)})},H.decryptAacSamples=function(L,v,g){for(;;v++){if(v>=L.length){g();return}if(L[v].unit.length<32)continue;var p=this.decrypter.isSync();if(this.decryptAacSample(L,v,g,p),!p)return}},H.getAvcEncryptedData=function(L){for(var v=Math.floor((L.length-48)/160)*16+16,g=new Int8Array(v),p=0,u=32;u<=L.length-16;u+=160,p+=16)g.set(L.subarray(u,u+16),p);return g},H.getAvcDecryptedUnit=function(L,v){for(var g=new Uint8Array(v),p=0,u=32;u<=L.length-16;u+=160,p+=16)L.set(g.subarray(p,p+16),u);return L},H.decryptAvcSample=function(L,v,g,p,u,h){var c=Object(j.discardEPB)(u.data),o=this.getAvcEncryptedData(c),l=this;this.decryptBuffer(o.buffer,function(s){u.data=l.getAvcDecryptedUnit(c,s),h||l.decryptAvcSamples(L,v,g+1,p)})},H.decryptAvcSamples=function(L,v,g,p){if(L instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;v++,g=0){if(v>=L.length){p();return}for(var u=L[v].units;!(g>=u.length);g++){var h=u[g];if(h.data.length<=48||h.type!==1&&h.type!==5)continue;var c=this.decrypter.isSync();if(this.decryptAvcSample(L,v,g,p,h,c),!c)return}}},z}();J.default=U},"./src/demux/transmuxer-interface.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return u});var Y=P("./node_modules/webworkify-webpack/index.js"),j=P.n(Y),U=P("./src/events.ts"),z=P("./src/demux/transmuxer.ts"),H=P("./src/utils/logger.ts"),r=P("./src/errors.ts"),L=P("./src/utils/mediasource-helper.ts"),v=P("./node_modules/eventemitter3/index.js"),g=P.n(v),p=Object(L.getMediaSource)()||{isTypeSupported:function(){return!1}},u=function(){function h(o,l,s,a){var R=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=o,this.id=l,this.onTransmuxComplete=s,this.onFlush=a;var E=o.config,S=function(x,f){f=f||{},f.frag=R.frag,f.id=R.id,o.trigger(x,f)};this.observer=new v.EventEmitter,this.observer.on(U.Events.FRAG_DECRYPTED,S),this.observer.on(U.Events.ERROR,S);var D={mp4:p.isTypeSupported("video/mp4"),mpeg:p.isTypeSupported("audio/mpeg"),mp3:p.isTypeSupported('audio/mp4; codecs="mp3"')},A=navigator.vendor;if(E.enableWorker&&typeof Worker!="undefined"){H.logger.log("demuxing in webworker");var O;try{O=this.worker=Y("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),O.addEventListener("message",this.onwmsg),O.onerror=function(C){o.trigger(U.Events.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(C.message+" ("+C.filename+":"+C.lineno+")")})},O.postMessage({cmd:"init",typeSupported:D,vendor:A,id:l,config:JSON.stringify(E)})}catch(C){H.logger.warn("Error in worker:",C),H.logger.error("Error while initializing DemuxerWorker, fallback to inline"),O&&self.URL.revokeObjectURL(O.objectURL),this.transmuxer=new z.default(this.observer,D,E,A,l),this.worker=null}}else this.transmuxer=new z.default(this.observer,D,E,A,l)}var c=h.prototype;return c.destroy=function(){var l=this.worker;if(l)l.removeEventListener("message",this.onwmsg),l.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},c.push=function(l,s,a,R,E,S,D,A,O,C){var x=this;O.transmuxing.start=self.performance.now();var f=this.transmuxer,w=this.worker,b=S?S.start:E.start,y=E.decryptdata,B=this.frag,F=!(B&&E.cc===B.cc),_=!(B&&O.level===B.level),M=B?O.sn-B.sn:-1,I=this.part?O.part-this.part.index:1,m=!_&&(M===1||M===0&&I===1),W=self.performance.now();(_||M||E.stats.parsing.start===0)&&(E.stats.parsing.start=W),S&&(I||!m)&&(S.stats.parsing.start=W);var $=new z.TransmuxState(F,m,A,_,b);if(!m||F){H.logger.log("[transmuxer-interface, "+E.type+"]: Starting new transmux session for sn: "+O.sn+" p: "+O.part+" level: "+O.level+" id: "+O.id+`
|
|
discontinuity: `+F+`
|
|
trackSwitch: `+_+`
|
|
contiguous: `+m+`
|
|
accurateTimeOffset: `+A+`
|
|
timeOffset: `+b);var ae=new z.TransmuxConfig(a,R,s,D,C);this.configureTransmuxer(ae)}if(this.frag=E,this.part=S,w)w.postMessage({cmd:"demux",data:l,decryptdata:y,chunkMeta:O,state:$},l instanceof ArrayBuffer?[l]:[]);else if(f){var ue=f.push(l,y,O,$);Object(z.isPromise)(ue)?ue.then(function(Oe){x.handleTransmuxComplete(Oe)}):this.handleTransmuxComplete(ue)}},c.flush=function(l){var s=this;l.transmuxing.start=self.performance.now();var a=this.transmuxer,R=this.worker;if(R)R.postMessage({cmd:"flush",chunkMeta:l});else if(a){var E=a.flush(l);Object(z.isPromise)(E)?E.then(function(S){s.handleFlushResult(S,l)}):this.handleFlushResult(E,l)}},c.handleFlushResult=function(l,s){var a=this;l.forEach(function(R){a.handleTransmuxComplete(R)}),this.onFlush(s)},c.onWorkerMessage=function(l){var s=l.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}}},c.configureTransmuxer=function(l){var s=this.worker,a=this.transmuxer;s?s.postMessage({cmd:"configure",config:l}):a&&a.configure(l)},c.handleTransmuxComplete=function(l){l.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(l)},h}()},"./src/demux/transmuxer-worker.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return r});var Y=P("./src/demux/transmuxer.ts"),j=P("./src/events.ts"),U=P("./src/utils/logger.ts"),z=P("./node_modules/eventemitter3/index.js"),H=P.n(z);function r(u){var h=new z.EventEmitter,c=function(l,s){u.postMessage({event:l,data:s})};h.on(j.Events.FRAG_DECRYPTED,c),h.on(j.Events.ERROR,c),u.addEventListener("message",function(o){var l=o.data;switch(l.cmd){case"init":{var s=JSON.parse(l.config);u.transmuxer=new Y.default(h,l.typeSupported,s,l.vendor,l.id),Object(U.enableLogs)(s.debug),c("init",null);break}case"configure":{u.transmuxer.configure(l.config);break}case"demux":{var a=u.transmuxer.push(l.data,l.decryptdata,l.chunkMeta,l.state);Object(Y.isPromise)(a)?a.then(function(S){L(u,S)}):L(u,a);break}case"flush":{var R=l.chunkMeta,E=u.transmuxer.flush(R);Object(Y.isPromise)(E)?E.then(function(S){g(u,S,R)}):g(u,E,R);break}default:break}})}function L(u,h){if(p(h.remuxResult))return;var c=[],o=h.remuxResult,l=o.audio,s=o.video;l&&v(c,l),s&&v(c,s),u.postMessage({event:"transmuxComplete",data:h},c)}function v(u,h){h.data1&&u.push(h.data1.buffer),h.data2&&u.push(h.data2.buffer)}function g(u,h,c){h.forEach(function(o){L(u,o)}),u.postMessage({event:"flush",data:c})}function p(u){return!u.audio&&!u.video&&!u.text&&!u.id3&&!u.initSegment}},"./src/demux/transmuxer.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return s}),P.d(J,"isPromise",function(){return E}),P.d(J,"TransmuxConfig",function(){return S}),P.d(J,"TransmuxState",function(){return D});var Y=P("./src/events.ts"),j=P("./src/errors.ts"),U=P("./src/crypt/decrypter.ts"),z=P("./src/demux/aacdemuxer.ts"),H=P("./src/demux/mp4demuxer.ts"),r=P("./src/demux/tsdemuxer.ts"),L=P("./src/demux/mp3demuxer.ts"),v=P("./src/remux/mp4-remuxer.ts"),g=P("./src/remux/passthrough-remuxer.ts"),p=P("./src/demux/chunk-cache.ts"),u=P("./src/utils/mp4-tools.ts"),h=P("./src/utils/logger.ts"),c;try{c=self.performance.now.bind(self.performance)}catch(A){h.logger.debug("Unable to use Performance API on this environment"),c=self.Date.now}var o=[{demux:r.default,remux:v.default},{demux:H.default,remux:g.default},{demux:z.default,remux:v.default},{demux:L.default,remux:v.default}],l=1024;o.forEach(function(A){var O=A.demux;l=Math.max(l,O.minProbeByteLength)});var s=function(){function A(C,x,f,w,b){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=C,this.typeSupported=x,this.config=f,this.vendor=w,this.id=b}var O=A.prototype;return O.configure=function(x){this.transmuxConfig=x,this.decrypter&&this.decrypter.reset()},O.push=function(x,f,w,b){var y=this,B=w.transmuxing;B.executeStart=c();var F=new Uint8Array(x),_=this.cache,M=this.config,I=this.currentTransmuxState,m=this.transmuxConfig;b&&(this.currentTransmuxState=b);var W=a(F,f);if(W&&W.method==="AES-128"){var $=this.getDecrypter();if(M.enableSoftwareAES){var ae=$.softwareDecrypt(F,W.key.buffer,W.iv.buffer);if(!ae)return B.executeEnd=c(),R(w);F=new Uint8Array(ae)}else return this.decryptionPromise=$.webCryptoDecrypt(F,W.key.buffer,W.iv.buffer).then(function(Le){var Fe=y.push(Le,null,w);return y.decryptionPromise=null,Fe}),this.decryptionPromise}var ue=b||I,Oe=ue.contiguous,ve=ue.discontinuity,Ee=ue.trackSwitch,xe=ue.accurateTimeOffset,Ie=ue.timeOffset,de=m.audioCodec,ce=m.videoCodec,ie=m.defaultInitPts,fe=m.duration,le=m.initSegmentData;if((ve||Ee)&&this.resetInitSegment(le,de,ce,fe),ve&&this.resetInitialTimestamp(ie),Oe||this.resetContiguity(),this.needsProbing(F,ve,Ee)){if(_.dataLength){var ke=_.flush();F=Object(u.appendUint8Array)(ke,F)}this.configureTransmuxer(F,m)}var Ne=this.transmux(F,W,Ie,xe,w),Ae=this.currentTransmuxState;return Ae.contiguous=!0,Ae.discontinuity=!1,Ae.trackSwitch=!1,B.executeEnd=c(),Ne},O.flush=function(x){var f=this,w=x.transmuxing;w.executeStart=c();var b=this.decrypter,y=this.cache,B=this.currentTransmuxState,F=this.decryptionPromise;if(F)return F.then(function(){return f.flush(x)});var _=[],M=B.timeOffset;if(b){var I=b.flush();I&&_.push(this.push(I,null,x))}var m=y.dataLength;y.reset();var W=this.demuxer,$=this.remuxer;if(!W||!$)return m>=l&&this.observer.emit(Y.Events.ERROR,Y.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),w.executeEnd=c(),[R(x)];var ae=W.flush(M);return E(ae)?ae.then(function(ue){return f.flushRemux(_,ue,x),_}):(this.flushRemux(_,ae,x),_)},O.flushRemux=function(x,f,w){var b=f.audioTrack,y=f.avcTrack,B=f.id3Track,F=f.textTrack,_=this.currentTransmuxState,M=_.accurateTimeOffset,I=_.timeOffset;h.logger.log("[transmuxer.ts]: Flushed fragment "+w.sn+(w.part>-1?" p: "+w.part:"")+" of level "+w.level);var m=this.remuxer.remux(b,y,B,F,I,M,!0,this.id);x.push({remuxResult:m,chunkMeta:w}),w.transmuxing.executeEnd=c()},O.resetInitialTimestamp=function(x){var f=this.demuxer,w=this.remuxer;if(!f||!w)return;f.resetTimeStamp(x),w.resetTimeStamp(x)},O.resetContiguity=function(){var x=this.demuxer,f=this.remuxer;if(!x||!f)return;x.resetContiguity(),f.resetNextTimestamp()},O.resetInitSegment=function(x,f,w,b){var y=this.demuxer,B=this.remuxer;if(!y||!B)return;y.resetInitSegment(f,w,b),B.resetInitSegment(x,f,w)},O.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},O.transmux=function(x,f,w,b,y){var B;return f&&f.method==="SAMPLE-AES"?B=this.transmuxSampleAes(x,f,w,b,y):B=this.transmuxUnencrypted(x,w,b,y),B},O.transmuxUnencrypted=function(x,f,w,b){var y=this.demuxer.demux(x,f,!1,!this.config.progressive),B=y.audioTrack,F=y.avcTrack,_=y.id3Track,M=y.textTrack,I=this.remuxer.remux(B,F,_,M,f,w,!1,this.id);return{remuxResult:I,chunkMeta:b}},O.transmuxSampleAes=function(x,f,w,b,y){var B=this;return this.demuxer.demuxSampleAes(x,f,w).then(function(F){var _=B.remuxer.remux(F.audioTrack,F.avcTrack,F.id3Track,F.textTrack,w,b,!1,B.id);return{remuxResult:_,chunkMeta:y}})},O.configureTransmuxer=function(x,f){for(var w=this.config,b=this.observer,y=this.typeSupported,B=this.vendor,F=f.audioCodec,_=f.defaultInitPts,M=f.duration,I=f.initSegmentData,m=f.videoCodec,W,$=0,ae=o.length;$<ae;$++)if(o[$].demux.probe(x)){W=o[$];break}W||(h.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),W={demux:H.default,remux:g.default});var ue=this.demuxer,Oe=this.remuxer,ve=W.remux,Ee=W.demux;(!Oe||!(Oe instanceof ve))&&(this.remuxer=new ve(b,w,y,B)),(!ue||!(ue instanceof Ee))&&(this.demuxer=new Ee(b,w,y),this.probe=Ee.probe),this.resetInitSegment(I,F,m,M),this.resetInitialTimestamp(_)},O.needsProbing=function(x,f,w){return!this.demuxer||!this.remuxer||f||w},O.getDecrypter=function(){var x=this.decrypter;return x||(x=this.decrypter=new U.default(this.observer,this.config)),x},A}();function a(A,O){var C=null;return A.byteLength>0&&O!=null&&O.key!=null&&O.iv!==null&&O.method!=null&&(C=O),C}var R=function(O){return{remuxResult:{},chunkMeta:O}};function E(A){return"then"in A&&A.then instanceof Function}var S=function(O,C,x,f,w){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=O,this.videoCodec=C,this.initSegmentData=x,this.duration=f,this.defaultInitPts=w},D=function(O,C,x,f,w){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=O,this.contiguous=C,this.accurateTimeOffset=x,this.trackSwitch=f,this.timeOffset=w}},"./src/demux/tsdemuxer.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"discardEPB",function(){return R});var Y=P("./src/demux/adts.ts"),j=P("./src/demux/mpegaudio.ts"),U=P("./src/demux/exp-golomb.ts"),z=P("./src/demux/id3.ts"),H=P("./src/demux/sample-aes.ts"),r=P("./src/events.ts"),L=P("./src/utils/mp4-tools.ts"),v=P("./src/utils/logger.ts"),g=P("./src/errors.ts"),p={video:1,audio:2,id3:3,text:4},u=function(){function E(D,A,O){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=D,this.config=A,this.typeSupported=O}E.probe=function(A){var O=E.syncOffset(A);return O<0?!1:(O&&v.logger.warn("MPEG2-TS detected but first sync word found @ offset "+O+", junk ahead ?"),!0)},E.syncOffset=function(A){for(var O=Math.min(1e3,A.length-3*188),C=0;C<O;){if(A[C]===71&&A[C+188]===71&&A[C+2*188]===71)return C;C++}return-1},E.createTrack=function(A,O){return{container:A==="video"||A==="audio"?"video/mp2t":void 0,type:A,id:p[A],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:A==="audio"?O:void 0}};var S=E.prototype;return S.resetInitSegment=function(A,O,C){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=E.createTrack("video",C),this._audioTrack=E.createTrack("audio",C),this._id3Track=E.createTrack("id3",C),this._txtTrack=E.createTrack("text",C),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=A,this.videoCodec=O,this._duration=C},S.resetTimeStamp=function(){},S.resetContiguity=function(){var A=this._audioTrack,O=this._avcTrack,C=this._id3Track;A&&(A.pesData=null),O&&(O.pesData=null),C&&(C.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},S.demux=function(A,O,C,x){C===void 0&&(C=!1),x===void 0&&(x=!1),C||(this.sampleAes=null);var f,w=this._avcTrack,b=this._audioTrack,y=this._id3Track,B=w.pid,F=w.pesData,_=b.pid,M=y.pid,I=b.pesData,m=y.pesData,W=!1,$=this.pmtParsed,ae=this._pmtId,ue=A.length;if(this.remainderData&&(A=Object(L.appendUint8Array)(this.remainderData,A),ue=A.length,this.remainderData=null),ue<188&&!x)return this.remainderData=A,{audioTrack:b,avcTrack:w,id3Track:y,textTrack:this._txtTrack};var Oe=Math.max(0,E.syncOffset(A));ue-=(ue+Oe)%188,ue<A.byteLength&&!x&&(this.remainderData=new Uint8Array(A.buffer,ue,A.buffer.byteLength-ue));for(var ve=Oe;ve<ue;ve+=188)if(A[ve]===71){var Ee=!!(A[ve+1]&64),xe=((A[ve+1]&31)<<8)+A[ve+2],Ie=(A[ve+3]&48)>>4,de=void 0;if(Ie>1){if(de=ve+5+A[ve+4],de===ve+188)continue}else de=ve+4;switch(xe){case B:Ee&&(F&&(f=l(F))&&this.parseAVCPES(f,!1),F={data:[],size:0}),F&&(F.data.push(A.subarray(de,ve+188)),F.size+=ve+188-de);break;case _:Ee&&(I&&(f=l(I))&&(b.isAAC?this.parseAACPES(f):this.parseMPEGPES(f)),I={data:[],size:0}),I&&(I.data.push(A.subarray(de,ve+188)),I.size+=ve+188-de);break;case M:Ee&&(m&&(f=l(m))&&this.parseID3PES(f),m={data:[],size:0}),m&&(m.data.push(A.subarray(de,ve+188)),m.size+=ve+188-de);break;case 0:Ee&&(de+=A[de]+1),ae=this._pmtId=c(A,de);break;case ae:{Ee&&(de+=A[de]+1);var ce=o(A,de,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,C);B=ce.avc,B>0&&(w.pid=B),_=ce.audio,_>0&&(b.pid=_,b.isAAC=ce.isAAC),M=ce.id3,M>0&&(y.pid=M),W&&!$&&(v.logger.log("reparse from beginning"),W=!1,ve=Oe-188),$=this.pmtParsed=!0;break}case 17:case 8191:break;default:W=!0;break}}else this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});w.pesData=F,b.pesData=I,y.pesData=m;var ie={audioTrack:b,avcTrack:w,id3Track:y,textTrack:this._txtTrack};return x&&this.extractRemainingSamples(ie),ie},S.flush=function(){var A=this.remainderData;this.remainderData=null;var O;return A?O=this.demux(A,-1,!1,!0):O={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(O),this.sampleAes?this.decrypt(O,this.sampleAes):O},S.extractRemainingSamples=function(A){var O=A.audioTrack,C=A.avcTrack,x=A.id3Track,f=C.pesData,w=O.pesData,b=x.pesData,y;f&&(y=l(f))?(this.parseAVCPES(y,!0),C.pesData=null):C.pesData=f,w&&(y=l(w))?(O.isAAC?this.parseAACPES(y):this.parseMPEGPES(y),O.pesData=null):(w!=null&&w.size&&v.logger.log("last AAC PES packet truncated,might overlap between fragments"),O.pesData=w),b&&(y=l(b))?(this.parseID3PES(y),x.pesData=null):x.pesData=b},S.demuxSampleAes=function(A,O,C){var x=this.demux(A,C,!0,!this.config.progressive),f=this.sampleAes=new H.default(this.observer,this.config,O);return this.decrypt(x,f)},S.decrypt=function(A,O){return new Promise(function(C){var x=A.audioTrack,f=A.avcTrack;x.samples&&x.isAAC?O.decryptAacSamples(x.samples,0,function(){f.samples?O.decryptAvcSamples(f.samples,0,0,function(){C(A)}):C(A)}):f.samples&&O.decryptAvcSamples(f.samples,0,0,function(){C(A)})})},S.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},S.parseAVCPES=function(A,O){var C=this,x=this._avcTrack,f=this.parseAVCNALu(A.data),w=!1,b=this.avcSample,y,B=!1;A.data=null,b&&f.length&&!x.audFound&&(s(b,x),b=this.avcSample=h(!1,A.pts,A.dts,"")),f.forEach(function(F){switch(F.type){case 1:{y=!0,b||(b=C.avcSample=h(!0,A.pts,A.dts,"")),w&&(b.debug+="NDR "),b.frame=!0;var _=F.data;if(B&&_.length>4){var M=new U.default(_).readSliceType();(M===2||M===4||M===7||M===9)&&(b.key=!0)}break}case 5:y=!0,b||(b=C.avcSample=h(!0,A.pts,A.dts,"")),w&&(b.debug+="IDR "),b.key=!0,b.frame=!0;break;case 6:{y=!0,w&&b&&(b.debug+="SEI ");var I=new U.default(R(F.data));I.readUByte();for(var m=0,W=0,$=!1,ae=0;!$&&I.bytesAvailable>1;){m=0;do ae=I.readUByte(),m+=ae;while(ae===255);W=0;do ae=I.readUByte(),W+=ae;while(ae===255);if(m===4&&I.bytesAvailable!==0){$=!0;var ue=I.readUByte();if(ue===181){var Oe=I.readUShort();if(Oe===49){var ve=I.readUInt();if(ve===1195456820){var Ee=I.readUByte();if(Ee===3){for(var xe=I.readUByte(),Ie=I.readUByte(),de=31&xe,ce=[xe,Ie],ie=0;ie<de;ie++)ce.push(I.readUByte()),ce.push(I.readUByte()),ce.push(I.readUByte());a(C._txtTrack.samples,{type:3,pts:A.pts,bytes:ce})}}}}}else if(m===5&&I.bytesAvailable!==0){if($=!0,W>16){for(var fe=[],le=0;le<16;le++)fe.push(I.readUByte().toString(16)),(le===3||le===5||le===7||le===9)&&fe.push("-");for(var ke=W-16,Ne=new Uint8Array(ke),Ae=0;Ae<ke;Ae++)Ne[Ae]=I.readUByte();a(C._txtTrack.samples,{pts:A.pts,payloadType:m,uuid:fe.join(""),userData:Object(z.utf8ArrayToStr)(Ne),userDataBytes:Ne})}}else if(W<I.bytesAvailable)for(var Le=0;Le<W;Le++)I.readUByte()}break}case 7:if(y=!0,B=!0,w&&b&&(b.debug+="SPS "),!x.sps){var Fe=new U.default(F.data),oe=Fe.readSPS();x.width=oe.width,x.height=oe.height,x.pixelRatio=oe.pixelRatio,x.sps=[F.data],x.duration=C._duration;for(var ge=F.data.subarray(1,4),we="avc1.",De=0;De<3;De++){var je=ge[De].toString(16);je.length<2&&(je="0"+je),we+=je}x.codec=we}break;case 8:y=!0,w&&b&&(b.debug+="PPS "),x.pps||(x.pps=[F.data]);break;case 9:y=!1,x.audFound=!0,b&&s(b,x),b=C.avcSample=h(!1,A.pts,A.dts,w?"AUD ":"");break;case 12:y=!1;break;default:y=!1,b&&(b.debug+="unknown NAL "+F.type+" ");break}if(b&&y){var Ve=b.units;Ve.push(F)}}),O&&b&&(s(b,x),this.avcSample=null)},S.getLastNalUnit=function(){var A,O=this.avcSample,C;if(!O||O.units.length===0){var x=this._avcTrack.samples;O=x[x.length-1]}if((A=O)!==null&&A!==void 0&&A.units){var f=O.units;C=f[f.length-1]}return C},S.parseAVCNALu=function(A){var O=A.byteLength,C=this._avcTrack,x=C.naluState||0,f=x,w=[],b=0,y,B,F,_=-1,M=0;for(x===-1&&(_=0,M=A[0]&31,x=0,b=1);b<O;){if(y=A[b++],!x){x=y?0:1;continue}if(x===1){x=y?0:2;continue}if(!y)x=3;else if(y===1){if(_>=0){var I={data:A.subarray(_,b-x-1),type:M};w.push(I)}else{var m=this.getLastNalUnit();if(m&&(f&&b<=4-f&&(m.state&&(m.data=m.data.subarray(0,m.data.byteLength-f))),B=b-x-1,B>0)){var W=new Uint8Array(m.data.byteLength+B);W.set(m.data,0),W.set(A.subarray(0,B),m.data.byteLength),m.data=W,m.state=0}}b<O?(F=A[b]&31,_=b,M=F,x=0):x=-1}else x=0}if(_>=0&&x>=0){var $={data:A.subarray(_,O),type:M,state:x};w.push($)}if(w.length===0){var ae=this.getLastNalUnit();if(ae){var ue=new Uint8Array(ae.data.byteLength+A.byteLength);ue.set(ae.data,0),ue.set(A,ae.data.byteLength),ae.data=ue}}return C.naluState=x,w},S.parseAACPES=function(A){var O=0,C=this._audioTrack,x=this.aacOverFlow,f=A.data;if(x){this.aacOverFlow=null;var w=x.sample.unit.byteLength,b=Math.min(x.missing,w),y=w-b;x.sample.unit.set(f.subarray(0,b),y),C.samples.push(x.sample),O=x.missing}var B,F;for(B=O,F=f.length;B<F-1&&!Y.isHeader(f,B);B++);if(B!==O){var _,M;if(B<F-1?(_="AAC PES did not start with ADTS header,offset:"+B,M=!1):(_="no ADTS header found in AAC PES",M=!0),v.logger.warn("parsing error:"+_),this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:M,reason:_}),M)return}Y.initTrackConfig(C,this.observer,f,B,this.audioCodec);var I;if(A.pts!==void 0)I=A.pts;else if(x){var m=Y.getFrameDuration(C.samplerate);I=x.sample.pts+m}else{v.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var W=0;B<F;)if(Y.isHeader(f,B)){if(B+5<F){var $=Y.appendFrame(C,f,B,I,W);if($)if($.missing)this.aacOverFlow=$;else{B+=$.length,W++;continue}}break}else B++},S.parseMPEGPES=function(A){var O=A.data,C=O.length,x=0,f=0,w=A.pts;if(w===void 0){v.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;f<C;)if(j.isHeader(O,f)){var b=j.appendFrame(this._audioTrack,O,f,w,x);if(b)f+=b.length,x++;else break}else f++},S.parseID3PES=function(A){if(A.pts===void 0){v.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(A)},E}();u.minProbeByteLength=188;function h(E,S,D,A){return{key:E,frame:!1,pts:S,dts:D,units:[],debug:A,length:0}}function c(E,S){return(E[S+10]&31)<<8|E[S+11]}function o(E,S,D,A){var O={audio:-1,avc:-1,id3:-1,isAAC:!0},C=(E[S+1]&15)<<8|E[S+2],x=S+3+C-4,f=(E[S+10]&15)<<8|E[S+11];for(S+=12+f;S<x;){var w=(E[S+1]&31)<<8|E[S+2];switch(E[S]){case 207:if(!A){v.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:O.audio===-1&&(O.audio=w);break;case 21:O.id3===-1&&(O.id3=w);break;case 219:if(!A){v.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:O.avc===-1&&(O.avc=w);break;case 3:case 4:D?O.audio===-1&&(O.audio=w,O.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}S+=((E[S+3]&15)<<8|E[S+4])+5}return O}function l(E){var S=0,D,A,O,C,x,f=E.data;if(!E||E.size===0)return null;for(;f[0].length<19&&f.length>1;){var w=new Uint8Array(f[0].length+f[1].length);w.set(f[0]),w.set(f[1],f[0].length),f[0]=w,f.splice(1,1)}D=f[0];var b=(D[0]<<16)+(D[1]<<8)+D[2];if(b===1){if(A=(D[4]<<8)+D[5],A&&A>E.size-6)return null;var y=D[7];y&192&&(C=(D[9]&14)*536870912+(D[10]&255)*4194304+(D[11]&254)*16384+(D[12]&255)*128+(D[13]&254)/2,y&64?(x=(D[14]&14)*536870912+(D[15]&255)*4194304+(D[16]&254)*16384+(D[17]&255)*128+(D[18]&254)/2,C-x>60*9e4&&(v.logger.warn(Math.round((C-x)/9e4)+"s delta between PTS and DTS, align them"),C=x)):x=C),O=D[8];var B=O+9;if(E.size<=B)return null;E.size-=B;for(var F=new Uint8Array(E.size),_=0,M=f.length;_<M;_++){D=f[_];var I=D.byteLength;if(B)if(B>I){B-=I;continue}else D=D.subarray(B),I-=B,B=0;F.set(D,S),S+=I}return A&&(A-=O+3),{data:F,pts:C,dts:x,len:A}}return null}function s(E,S){if(E.units.length&&E.frame){if(E.pts===void 0){var D=S.samples,A=D.length;if(A){var O=D[A-1];E.pts=O.pts,E.dts=O.dts}else{S.dropped++;return}}S.samples.push(E)}E.debug.length&&v.logger.log(E.pts+"/"+E.dts+":"+E.debug)}function a(E,S){var D=E.length;if(D>0){if(S.pts>=E[D-1].pts)E.push(S);else for(var A=D-1;A>=0;A--)if(S.pts<E[A].pts){E.splice(A,0,S);break}}else E.push(S)}function R(E){for(var S=E.byteLength,D=[],A=1;A<S-2;)E[A]===0&&E[A+1]===0&&E[A+2]===3?(D.push(A+2),A+=2):A++;if(D.length===0)return E;var O=S-D.length,C=new Uint8Array(O),x=0;for(A=0;A<O;x++,A++)x===D[0]&&(x++,D.shift()),C[A]=E[x];return C}J.default=u},"./src/errors.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"ErrorTypes",function(){return Y}),P.d(J,"ErrorDetails",function(){return j});var Y;(function(U){U.NETWORK_ERROR="networkError",U.MEDIA_ERROR="mediaError",U.KEY_SYSTEM_ERROR="keySystemError",U.MUX_ERROR="muxError",U.OTHER_ERROR="otherError"})(Y||(Y={}));var j;(function(U){U.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",U.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",U.KEY_SYSTEM_NO_SESSION="keySystemNoSession",U.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",U.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",U.MANIFEST_LOAD_ERROR="manifestLoadError",U.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",U.MANIFEST_PARSING_ERROR="manifestParsingError",U.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",U.LEVEL_EMPTY_ERROR="levelEmptyError",U.LEVEL_LOAD_ERROR="levelLoadError",U.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",U.LEVEL_SWITCH_ERROR="levelSwitchError",U.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",U.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",U.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",U.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",U.FRAG_LOAD_ERROR="fragLoadError",U.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",U.FRAG_DECRYPT_ERROR="fragDecryptError",U.FRAG_PARSING_ERROR="fragParsingError",U.REMUX_ALLOC_ERROR="remuxAllocError",U.KEY_LOAD_ERROR="keyLoadError",U.KEY_LOAD_TIMEOUT="keyLoadTimeOut",U.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",U.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",U.BUFFER_APPEND_ERROR="bufferAppendError",U.BUFFER_APPENDING_ERROR="bufferAppendingError",U.BUFFER_STALLED_ERROR="bufferStalledError",U.BUFFER_FULL_ERROR="bufferFullError",U.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",U.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",U.INTERNAL_EXCEPTION="internalException",U.INTERNAL_ABORTED="aborted",U.UNKNOWN="unknown"})(j||(j={}))},"./src/events.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"Events",function(){return Y});var Y;(function(j){j.MEDIA_ATTACHING="hlsMediaAttaching",j.MEDIA_ATTACHED="hlsMediaAttached",j.MEDIA_DETACHING="hlsMediaDetaching",j.MEDIA_DETACHED="hlsMediaDetached",j.BUFFER_RESET="hlsBufferReset",j.BUFFER_CODECS="hlsBufferCodecs",j.BUFFER_CREATED="hlsBufferCreated",j.BUFFER_APPENDING="hlsBufferAppending",j.BUFFER_APPENDED="hlsBufferAppended",j.BUFFER_EOS="hlsBufferEos",j.BUFFER_FLUSHING="hlsBufferFlushing",j.BUFFER_FLUSHED="hlsBufferFlushed",j.MANIFEST_LOADING="hlsManifestLoading",j.MANIFEST_LOADED="hlsManifestLoaded",j.MANIFEST_PARSED="hlsManifestParsed",j.LEVEL_SWITCHING="hlsLevelSwitching",j.LEVEL_SWITCHED="hlsLevelSwitched",j.LEVEL_LOADING="hlsLevelLoading",j.LEVEL_LOADED="hlsLevelLoaded",j.LEVEL_UPDATED="hlsLevelUpdated",j.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",j.LEVELS_UPDATED="hlsLevelsUpdated",j.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",j.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",j.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",j.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",j.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",j.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",j.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",j.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",j.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",j.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",j.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",j.CUES_PARSED="hlsCuesParsed",j.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",j.INIT_PTS_FOUND="hlsInitPtsFound",j.FRAG_LOADING="hlsFragLoading",j.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",j.FRAG_LOADED="hlsFragLoaded",j.FRAG_DECRYPTED="hlsFragDecrypted",j.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",j.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",j.FRAG_PARSING_METADATA="hlsFragParsingMetadata",j.FRAG_PARSED="hlsFragParsed",j.FRAG_BUFFERED="hlsFragBuffered",j.FRAG_CHANGED="hlsFragChanged",j.FPS_DROP="hlsFpsDrop",j.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",j.ERROR="hlsError",j.DESTROYING="hlsDestroying",j.KEY_LOADING="hlsKeyLoading",j.KEY_LOADED="hlsKeyLoaded",j.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",j.BACK_BUFFER_REACHED="hlsBackBufferReached"})(Y||(Y={}))},"./src/hls.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return E});var Y=P("./node_modules/url-toolkit/src/url-toolkit.js"),j=P.n(Y),U=P("./src/loader/playlist-loader.ts"),z=P("./src/loader/key-loader.ts"),H=P("./src/controller/id3-track-controller.ts"),r=P("./src/controller/latency-controller.ts"),L=P("./src/controller/level-controller.ts"),v=P("./src/controller/fragment-tracker.ts"),g=P("./src/controller/stream-controller.ts"),p=P("./src/is-supported.ts"),u=P("./src/utils/logger.ts"),h=P("./src/config.ts"),c=P("./node_modules/eventemitter3/index.js"),o=P.n(c),l=P("./src/events.ts"),s=P("./src/errors.ts");function a(S,D){for(var A=0;A<D.length;A++){var O=D[A];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(S,O.key,O)}}function R(S,D,A){return D&&a(S.prototype,D),A&&a(S,A),S}var E=function(){S.isSupported=function(){return Object(p.isSupported)()};function S(A){A===void 0&&(A={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new c.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 O=this.config=Object(h.mergeConfig)(S.DefaultConfig,A);this.userConfig=A,Object(u.enableLogs)(O.debug),this._autoLevelCapping=-1,O.progressive&&Object(h.enableStreamingMode)(O);var C=O.abrController,x=O.bufferController,f=O.capLevelController,w=O.fpsController,b=this.abrController=new C(this),y=this.bufferController=new x(this),B=this.capLevelController=new f(this),F=new w(this),_=new U.default(this),M=new z.default(this),I=new H.default(this),m=this.levelController=new L.default(this),W=new v.FragmentTracker(this),$=this.streamController=new g.default(this,W);B.setStreamController($),F.setStreamController($);var ae=[m,$];this.networkControllers=ae;var ue=[_,M,b,y,B,F,I,W];this.audioTrackController=this.createController(O.audioTrackController,null,ae),this.createController(O.audioStreamController,W,ae),this.subtitleTrackController=this.createController(O.subtitleTrackController,null,ae),this.createController(O.subtitleStreamController,W,ae),this.createController(O.timelineController,null,ue),this.emeController=this.createController(O.emeController,null,ue),this.cmcdController=this.createController(O.cmcdController,null,ue),this.latencyController=this.createController(r.default,null,ue),this.coreComponents=ue}var D=S.prototype;return D.createController=function(O,C,x){if(O){var f=C?new O(this,C):new O(this);return x&&x.push(f),f}return null},D.on=function(O,C,x){x===void 0&&(x=this),this._emitter.on(O,C,x)},D.once=function(O,C,x){x===void 0&&(x=this),this._emitter.once(O,C,x)},D.removeAllListeners=function(O){this._emitter.removeAllListeners(O)},D.off=function(O,C,x,f){x===void 0&&(x=this),this._emitter.off(O,C,x,f)},D.listeners=function(O){return this._emitter.listeners(O)},D.emit=function(O,C,x){return this._emitter.emit(O,C,x)},D.trigger=function(O,C){if(this.config.debug)return this.emit(O,O,C);try{return this.emit(O,O,C)}catch(x){u.logger.error("An internal error happened while handling event "+O+'. Error message: "'+x.message+'". Here is a stacktrace:',x),this.trigger(l.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:O,error:x})}return!1},D.listenerCount=function(O){return this._emitter.listenerCount(O)},D.destroy=function(){u.logger.log("destroy"),this.trigger(l.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(O){return O.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(O){return O.destroy()}),this.coreComponents.length=0},D.attachMedia=function(O){u.logger.log("attachMedia"),this._media=O,this.trigger(l.Events.MEDIA_ATTACHING,{media:O})},D.detachMedia=function(){u.logger.log("detachMedia"),this.trigger(l.Events.MEDIA_DETACHING,void 0),this._media=null},D.loadSource=function(O){this.stopLoad();var C=this.media,x=this.url,f=this.url=Y.buildAbsoluteURL(self.location.href,O,{alwaysNormalize:!0});u.logger.log("loadSource:"+f),C&&x&&x!==f&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(C)),this.trigger(l.Events.MANIFEST_LOADING,{url:O})},D.startLoad=function(O){O===void 0&&(O=-1),u.logger.log("startLoad("+O+")"),this.networkControllers.forEach(function(C){C.startLoad(O)})},D.stopLoad=function(){u.logger.log("stopLoad"),this.networkControllers.forEach(function(O){O.stopLoad()})},D.swapAudioCodec=function(){u.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},D.recoverMediaError=function(){u.logger.log("recoverMediaError");var O=this._media;this.detachMedia(),O&&this.attachMedia(O)},D.removeLevel=function(O,C){C===void 0&&(C=0),this.levelController.removeLevel(O,C)},R(S,[{key:"levels",get:function(){var O=this.levelController.levels;return O||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(O){u.logger.log("set currentLevel:"+O),this.loadLevel=O,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(O){u.logger.log("set nextLevel:"+O),this.levelController.manualLevel=O,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(O){u.logger.log("set loadLevel:"+O),this.levelController.manualLevel=O}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(O){this.levelController.nextLoadLevel=O}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(O){u.logger.log("set firstLevel:"+O),this.levelController.firstLevel=O}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(O){u.logger.log("set startLevel:"+O),O!==-1&&(O=Math.max(O,this.minAutoLevel)),this.levelController.startLevel=O}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(O){var C=!!O;C!==this.config.capLevelToPlayerSize&&(C?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=C)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(O){this._autoLevelCapping!==O&&(u.logger.log("set autoLevelCapping:"+O),this._autoLevelCapping=O)}},{key:"bandwidthEstimate",get:function(){var O=this.abrController.bwEstimator;return O?O.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var O=this.levels,C=this.config.minAutoBitrate;if(!O)return 0;for(var x=O.length,f=0;f<x;f++)if(O[f].maxBitrate>C)return f;return 0}},{key:"maxAutoLevel",get:function(){var O=this.levels,C=this.autoLevelCapping,x;return C===-1&&O&&O.length?x=O.length-1:x=C,x}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(O){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,O)}},{key:"audioTracks",get:function(){var O=this.audioTrackController;return O?O.audioTracks:[]}},{key:"audioTrack",get:function(){var O=this.audioTrackController;return O?O.audioTrack:-1},set:function(O){var C=this.audioTrackController;C&&(C.audioTrack=O)}},{key:"subtitleTracks",get:function(){var O=this.subtitleTrackController;return O?O.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var O=this.subtitleTrackController;return O?O.subtitleTrack:-1},set:function(O){var C=this.subtitleTrackController;C&&(C.subtitleTrack=O)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var O=this.subtitleTrackController;return O?O.subtitleDisplay:!1},set:function(O){var C=this.subtitleTrackController;C&&(C.subtitleDisplay=O)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(O){this.config.lowLatencyMode=O}},{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 l.Events}},{key:"ErrorTypes",get:function(){return s.ErrorTypes}},{key:"ErrorDetails",get:function(){return s.ErrorDetails}},{key:"DefaultConfig",get:function(){return S.defaultConfig?S.defaultConfig:h.hlsDefaultConfig},set:function(O){S.defaultConfig=O}}]),S}();E.defaultConfig=void 0},"./src/is-supported.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"isSupported",function(){return U}),P.d(J,"changeTypeSupported",function(){return z});var Y=P("./src/utils/mediasource-helper.ts");function j(){return self.SourceBuffer||self.WebKitSourceBuffer}function U(){var H=Object(Y.getMediaSource)();if(!H)return!1;var r=j(),L=H&&typeof H.isTypeSupported=="function"&&H.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),v=!r||r.prototype&&typeof r.prototype.appendBuffer=="function"&&typeof r.prototype.remove=="function";return!!L&&!!v}function z(){var H,r=j();return typeof(r==null||((H=r.prototype)===null||H===void 0)?void 0:H.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return u}),P.d(J,"LoadError",function(){return c});var Y=P("./src/polyfills/number.ts"),j=P("./src/errors.ts");function U(o,l){o.prototype=Object.create(l.prototype),o.prototype.constructor=o,v(o,l)}function z(o){var l=typeof Map=="function"?new Map:void 0;return z=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 l!="undefined"){if(l.has(a))return l.get(a);l.set(a,R)}function R(){return H(a,arguments,g(this).constructor)}return R.prototype=Object.create(a.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),v(R,a)},z(o)}function H(o,l,s){return r()?H=Reflect.construct:H=function(R,E,S){var D=[null];D.push.apply(D,E);var A=Function.bind.apply(R,D),O=new A;return S&&v(O,S.prototype),O},H.apply(null,arguments)}function r(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(o){return!1}}function L(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function v(o,l){return v=Object.setPrototypeOf||function(a,R){return a.__proto__=R,a},v(o,l)}function g(o){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},g(o)}var p=Math.pow(2,17),u=function(){function o(s){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=s}var l=o.prototype;return l.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},l.abort=function(){this.loader&&this.loader.abort()},l.load=function(a,R){var E=this,S=a.url;if(!S)return Promise.reject(new c({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,networkDetails:null},"Fragment does not have a "+(S?"part list":"url")));this.abort();var D=this.config,A=D.fLoader,O=D.loader;return new Promise(function(C,x){E.loader&&E.loader.destroy();var f=E.loader=a.loader=A?new A(D):new O(D),w=h(a),b={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:p};a.stats=f.stats,f.load(w,b,{onSuccess:function(B,F,_,M){E.resetLoader(a,f),C({frag:a,part:null,payload:B.data,networkDetails:M})},onError:function(B,F,_){E.resetLoader(a,f),x(new c({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,response:B,networkDetails:_}))},onAbort:function(B,F,_){E.resetLoader(a,f),x(new c({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,networkDetails:_}))},onTimeout:function(B,F,_){E.resetLoader(a,f),x(new c({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,networkDetails:_}))},onProgress:function(B,F,_,M){R&&R({frag:a,part:null,payload:_,networkDetails:M})}})})},l.loadPart=function(a,R,E){var S=this;this.abort();var D=this.config,A=D.fLoader,O=D.loader;return new Promise(function(C,x){S.loader&&S.loader.destroy();var f=S.loader=a.loader=A?new A(D):new O(D),w=h(a,R),b={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:p};R.stats=f.stats,f.load(w,b,{onSuccess:function(B,F,_,M){S.resetLoader(a,f),S.updateStatsFromPart(a,R);var I={frag:a,part:R,payload:B.data,networkDetails:M};E(I),C(I)},onError:function(B,F,_){S.resetLoader(a,f),x(new c({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,part:R,response:B,networkDetails:_}))},onAbort:function(B,F,_){a.stats.aborted=R.stats.aborted,S.resetLoader(a,f),x(new c({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,part:R,networkDetails:_}))},onTimeout:function(B,F,_){S.resetLoader(a,f),x(new c({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,part:R,networkDetails:_}))}})})},l.updateStatsFromPart=function(a,R){var E=a.stats,S=R.stats,D=S.total;if(E.loaded+=S.loaded,D){var A=Math.round(a.duration/R.duration),O=Math.min(Math.round(E.loaded/D),A),C=A-O,x=C*Math.round(E.loaded/O);E.total=E.loaded+x}else E.total=Math.max(E.loaded,E.total);var f=E.loading,w=S.loading;f.start?f.first+=w.first-w.start:(f.start=w.start,f.first=w.first),f.end=w.end},l.resetLoader=function(a,R){a.loader=null,this.loader===R&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),R.destroy()},o}();function h(o,l){l===void 0&&(l=null);var s=l||o,a={frag:o,part:l,responseType:"arraybuffer",url:s.url,headers:{},rangeStart:0,rangeEnd:0},R=s.byteRangeStartOffset,E=s.byteRangeEndOffset;return Object(Y.isFiniteNumber)(R)&&Object(Y.isFiniteNumber)(E)&&(a.rangeStart=R,a.rangeEnd=E),a}var c=function(o){U(l,o);function l(s){for(var a,R=arguments.length,E=new Array(R>1?R-1:0),S=1;S<R;S++)E[S-1]=arguments[S];return a=o.call.apply(o,[this].concat(E))||this,a.data=void 0,a.data=s,a}return l}(z(Error))},"./src/loader/fragment.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"ElementaryStreamTypes",function(){return u}),P.d(J,"BaseSegment",function(){return h}),P.d(J,"Fragment",function(){return c}),P.d(J,"Part",function(){return o});var Y=P("./src/polyfills/number.ts"),j=P("./node_modules/url-toolkit/src/url-toolkit.js"),U=P.n(j),z=P("./src/utils/logger.ts"),H=P("./src/loader/level-key.ts"),r=P("./src/loader/load-stats.ts");function L(l,s){l.prototype=Object.create(s.prototype),l.prototype.constructor=l,v(l,s)}function v(l,s){return v=Object.setPrototypeOf||function(R,E){return R.__proto__=E,R},v(l,s)}function g(l,s){for(var a=0;a<s.length;a++){var R=s[a];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(l,R.key,R)}}function p(l,s,a){return s&&g(l.prototype,s),a&&g(l,a),l}var u;(function(l){l.AUDIO="audio",l.VIDEO="video",l.AUDIOVIDEO="audiovideo"})(u||(u={}));var h=function(){function l(a){var R;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(R={},R[u.AUDIO]=null,R[u.VIDEO]=null,R[u.AUDIOVIDEO]=null,R),this.baseurl=a}var s=l.prototype;return s.setByteRange=function(R,E){var S=R.split("@",2),D=[];S.length===1?D[0]=E?E.byteRangeEndOffset:0:D[0]=parseInt(S[1]),D[1]=parseInt(S[0])+D[0],this._byteRange=D},p(l,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(j.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(R){this._url=R}}]),l}(),c=function(l){L(s,l);function s(R,E){var S;return S=l.call(this,E)||this,S._decryptdata=null,S.rawProgramDateTime=null,S.programDateTime=null,S.tagList=[],S.duration=0,S.sn=0,S.levelkey=void 0,S.type=void 0,S.loader=null,S.level=-1,S.cc=0,S.startPTS=void 0,S.endPTS=void 0,S.appendedPTS=void 0,S.startDTS=void 0,S.endDTS=void 0,S.start=0,S.deltaPTS=void 0,S.maxStartPTS=void 0,S.minEndPTS=void 0,S.stats=new r.LoadStats,S.urlId=0,S.data=void 0,S.bitrateTest=!1,S.title=null,S.initSegment=null,S.type=R,S}var a=s.prototype;return a.createInitializationVector=function(E){for(var S=new Uint8Array(16),D=12;D<16;D++)S[D]=E>>8*(15-D)&255;return S},a.setDecryptDataFromLevelKey=function(E,S){var D=E;return(E==null?void 0:E.method)==="AES-128"&&E.uri&&!E.iv&&(D=H.LevelKey.fromURI(E.uri),D.method=E.method,D.iv=this.createInitializationVector(S),D.keyFormat="identity"),D},a.setElementaryStreamInfo=function(E,S,D,A,O,C){C===void 0&&(C=!1);var x=this.elementaryStreams,f=x[E];if(!f){x[E]={startPTS:S,endPTS:D,startDTS:A,endDTS:O,partial:C};return}f.startPTS=Math.min(f.startPTS,S),f.endPTS=Math.max(f.endPTS,D),f.startDTS=Math.min(f.startDTS,A),f.endDTS=Math.max(f.endDTS,O)},a.clearElementaryStreamInfo=function(){var E=this.elementaryStreams;E[u.AUDIO]=null,E[u.VIDEO]=null,E[u.AUDIOVIDEO]=null},p(s,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var E=this.sn;typeof E!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&z.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),E=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,E)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(Y.isFiniteNumber)(this.programDateTime))return null;var E=Object(Y.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+E*1e3}},{key:"encrypted",get:function(){var E;return!!((E=this.decryptdata)!==null&&E!==void 0&&E.keyFormat&&this.decryptdata.uri)}}]),s}(h),o=function(l){L(s,l);function s(a,R,E,S,D){var A;A=l.call(this,E)||this,A.fragOffset=0,A.duration=0,A.gap=!1,A.independent=!1,A.relurl=void 0,A.fragment=void 0,A.index=void 0,A.stats=new r.LoadStats,A.duration=a.decimalFloatingPoint("DURATION"),A.gap=a.bool("GAP"),A.independent=a.bool("INDEPENDENT"),A.relurl=a.enumeratedString("URI"),A.fragment=R,A.index=S;var O=a.enumeratedString("BYTERANGE");return O&&A.setByteRange(O,D),D&&(A.fragOffset=D.fragOffset+D.duration),A}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 R=this.elementaryStreams;return!!(R.audio||R.video||R.audiovideo)}}]),s}(h)},"./src/loader/key-loader.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return z});var Y=P("./src/events.ts"),j=P("./src/errors.ts"),U=P("./src/utils/logger.ts"),z=function(){function H(L){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=L,this._registerListeners()}var r=H.prototype;return r._registerListeners=function(){this.hls.on(Y.Events.KEY_LOADING,this.onKeyLoading,this)},r._unregisterListeners=function(){this.hls.off(Y.Events.KEY_LOADING,this.onKeyLoading)},r.destroy=function(){this._unregisterListeners();for(var v in this.loaders){var g=this.loaders[v];g&&g.destroy()}this.loaders={}},r.onKeyLoading=function(v,g){var p=g.frag,u=p.type,h=this.loaders[u];if(!p.decryptdata){U.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var c=p.decryptdata.uri;if(c!==this.decrypturl||this.decryptkey===null){var o=this.hls.config;if(h&&(U.logger.warn("abort previous key loader for type:"+u),h.abort()),!c){U.logger.warn("key uri is falsy");return}var l=o.loader,s=p.loader=this.loaders[u]=new l(o);this.decrypturl=c,this.decryptkey=null;var a={url:c,frag:p,responseType:"arraybuffer"},R={timeout:o.fragLoadingTimeOut,maxRetry:0,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout,highWaterMark:0},E={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};s.load(a,R,E)}else this.decryptkey&&(p.decryptdata.key=this.decryptkey,this.hls.trigger(Y.Events.KEY_LOADED,{frag:p}))},r.loadsuccess=function(v,g,p){var u=p.frag;if(!u.decryptdata){U.logger.error("after key load, decryptdata unset");return}this.decryptkey=u.decryptdata.key=new Uint8Array(v.data),u.loader=null,delete this.loaders[u.type],this.hls.trigger(Y.Events.KEY_LOADED,{frag:u})},r.loaderror=function(v,g){var p=g.frag,u=p.loader;u&&u.abort(),delete this.loaders[p.type],this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:p,response:v})},r.loadtimeout=function(v,g){var p=g.frag,u=p.loader;u&&u.abort(),delete this.loaders[p.type],this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:p})},H}()},"./src/loader/level-details.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"LevelDetails",function(){return H});var Y=P("./src/polyfills/number.ts");function j(r,L){for(var v=0;v<L.length;v++){var g=L[v];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(r,g.key,g)}}function U(r,L,v){return L&&j(r.prototype,L),v&&j(r,v),r}var z=10,H=function(){function r(v){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=v}var L=r.prototype;return L.reloaded=function(g){if(!g){this.advanced=!0,this.updated=!0;return}var p=this.lastPartSn-g.lastPartSn,u=this.lastPartIndex-g.lastPartIndex;this.updated=this.endSN!==g.endSN||!!u||!!p,this.advanced=this.endSN>g.endSN||p>0||p===0&&u>0,this.updated||this.advanced?this.misses=Math.floor(g.misses*.6):this.misses=g.misses+1,this.availabilityDelay=g.availabilityDelay},U(r,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(Y.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||z}},{key:"drift",get:function(){var g=this.driftEndTime-this.driftStartTime;if(g>0){var p=this.driftEnd-this.driftStart;return p*1e3/g}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var g;return(g=this.fragments)!==null&&g!==void 0&&g.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 g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),r}()},"./src/loader/level-key.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"LevelKey",function(){return H});var Y=P("./node_modules/url-toolkit/src/url-toolkit.js"),j=P.n(Y);function U(r,L){for(var v=0;v<L.length;v++){var g=L[v];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(r,g.key,g)}}function z(r,L,v){return L&&U(r.prototype,L),v&&U(r,v),r}var H=function(){r.fromURL=function(v,g){return new r(v,g)},r.fromURI=function(v){return new r(v)};function r(L,v){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,v?this._uri=Object(Y.buildAbsoluteURL)(L,v,{alwaysNormalize:!0}):this._uri=L}return z(r,[{key:"uri",get:function(){return this._uri}}]),r}()},"./src/loader/load-stats.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"LoadStats",function(){return Y});var Y=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return s});var Y=P("./src/polyfills/number.ts"),j=P("./node_modules/url-toolkit/src/url-toolkit.js"),U=P.n(j),z=P("./src/loader/fragment.ts"),H=P("./src/loader/level-details.ts"),r=P("./src/loader/level-key.ts"),L=P("./src/utils/attr-list.ts"),v=P("./src/utils/logger.ts"),g=P("./src/utils/codecs.ts"),p=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,u=/#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"),c=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 l(D){var A,O;return o.test((A=(O=j.parseURL(D))===null||O===void 0?void 0:O.path)!=null?A:"")}var s=function(){function D(){}return D.findGroup=function(O,C){for(var x=0;x<O.length;x++){var f=O[x];if(f.id===C)return f}},D.convertAVC1ToAVCOTI=function(O){var C=O.split(".");if(C.length>2){var x=C.shift()+".";return x+=parseInt(C.shift()).toString(16),x+=("000"+parseInt(C.shift()).toString(16)).substr(-4),x}return O},D.resolve=function(O,C){return j.buildAbsoluteURL(C,O,{alwaysNormalize:!0})},D.parseMasterPlaylist=function(O,C){var x=[],f={},w=!1;p.lastIndex=0;for(var b;(b=p.exec(O))!=null;)if(b[1]){var y=new L.AttrList(b[1]),B={attrs:y,bitrate:y.decimalInteger("AVERAGE-BANDWIDTH")||y.decimalInteger("BANDWIDTH"),name:y.NAME,url:D.resolve(b[2],C)},F=y.decimalResolution("RESOLUTION");F&&(B.width=F.width,B.height=F.height),a((y.CODECS||"").split(/[ ,]+/).filter(function(M){return M}),B),B.videoCodec&&B.videoCodec.indexOf("avc1")!==-1&&(B.videoCodec=D.convertAVC1ToAVCOTI(B.videoCodec)),x.push(B)}else if(b[3]){var _=new L.AttrList(b[3]);_["DATA-ID"]&&(w=!0,f[_["DATA-ID"]]=_)}return{levels:x,sessionData:w?f:null}},D.parseMasterPlaylistMedia=function(O,C,x,f){f===void 0&&(f=[]);var w,b=[],y=0;for(u.lastIndex=0;(w=u.exec(O))!==null;){var B=new L.AttrList(w[1]);if(B.TYPE===x){var F={attrs:B,bitrate:0,id:y++,groupId:B["GROUP-ID"],instreamId:B["INSTREAM-ID"],name:B.NAME||B.LANGUAGE||"",type:x,default:B.bool("DEFAULT"),autoselect:B.bool("AUTOSELECT"),forced:B.bool("FORCED"),lang:B.LANGUAGE,url:B.URI?D.resolve(B.URI,C):""};if(f.length){var _=D.findGroup(f,F.groupId)||f[0];R(F,_,"audioCodec"),R(F,_,"textCodec")}b.push(F)}}return b},D.parseLevelPlaylist=function(O,C,x,f,w){var b=new H.LevelDetails(C),y=b.fragments,B=null,F=0,_=0,M=0,I=0,m=null,W=new z.Fragment(f,C),$,ae,ue,Oe=-1,ve=!1;for(h.lastIndex=0,b.m3u8=O;($=h.exec(O))!==null;){ve&&(ve=!1,W=new z.Fragment(f,C),W.start=M,W.sn=F,W.cc=I,W.level=x,B&&(W.initSegment=B,W.rawProgramDateTime=B.rawProgramDateTime));var Ee=$[1];if(Ee){W.duration=parseFloat(Ee);var xe=(" "+$[2]).slice(1);W.title=xe||null,W.tagList.push(xe?["INF",Ee,xe]:["INF",Ee])}else if($[3])Object(Y.isFiniteNumber)(W.duration)&&(W.start=M,ue&&(W.levelkey=ue),W.sn=F,W.level=x,W.cc=I,W.urlId=w,y.push(W),W.relurl=(" "+$[3]).slice(1),S(W,m),m=W,M+=W.duration,F++,_=0,ve=!0);else if($[4]){var Ie=(" "+$[4]).slice(1);m?W.setByteRange(Ie,m):W.setByteRange(Ie)}else if($[5])W.rawProgramDateTime=(" "+$[5]).slice(1),W.tagList.push(["PROGRAM-DATE-TIME",W.rawProgramDateTime]),Oe===-1&&(Oe=y.length);else{if($=$[0].match(c),!$){v.logger.warn("No matches on slow regex match for level playlist!");continue}for(ae=1;ae<$.length&&!(typeof $[ae]!="undefined");ae++);var de=(" "+$[ae]).slice(1),ce=(" "+$[ae+1]).slice(1),ie=$[ae+2]?(" "+$[ae+2]).slice(1):"";switch(de){case"PLAYLIST-TYPE":b.type=ce.toUpperCase();break;case"MEDIA-SEQUENCE":F=b.startSN=parseInt(ce);break;case"SKIP":{var fe=new L.AttrList(ce),le=fe.decimalInteger("SKIPPED-SEGMENTS");if(Object(Y.isFiniteNumber)(le)){b.skippedSegments=le;for(var ke=le;ke--;)y.unshift(null);F+=le}var Ne=fe.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ne&&(b.recentlyRemovedDateranges=Ne.split(" "));break}case"TARGETDURATION":b.targetduration=parseFloat(ce);break;case"VERSION":b.version=parseInt(ce);break;case"EXTM3U":break;case"ENDLIST":b.live=!1;break;case"#":(ce||ie)&&W.tagList.push(ie?[ce,ie]:[ce]);break;case"DIS":I++;case"GAP":W.tagList.push([de]);break;case"BITRATE":W.tagList.push([de,ce]);break;case"DISCONTINUITY-SEQ":I=parseInt(ce);break;case"KEY":{var Ae,Le=new L.AttrList(ce),Fe=Le.enumeratedString("METHOD"),oe=Le.URI,ge=Le.hexadecimalInteger("IV"),we=Le.enumeratedString("KEYFORMATVERSIONS"),De=Le.enumeratedString("KEYID"),je=(Ae=Le.enumeratedString("KEYFORMAT"))!=null?Ae:"identity",Ve=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Ve.indexOf(je)>-1){v.logger.warn("Keyformat "+je+" is not supported from the manifest");continue}else if(je!=="identity")continue;Fe&&(ue=r.LevelKey.fromURL(C,oe),oe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Fe)>=0&&(ue.method=Fe,ue.keyFormat=je,De&&(ue.keyID=De),we&&(ue.keyFormatVersions=we),ue.iv=ge));break}case"START":{var Je=new L.AttrList(ce),Xe=Je.decimalFloatingPoint("TIME-OFFSET");Object(Y.isFiniteNumber)(Xe)&&(b.startTimeOffset=Xe);break}case"MAP":{var et=new L.AttrList(ce);W.relurl=et.URI,et.BYTERANGE&&W.setByteRange(et.BYTERANGE),W.level=x,W.sn="initSegment",ue&&(W.levelkey=ue),W.initSegment=null,B=W,ve=!0;break}case"SERVER-CONTROL":{var Ze=new L.AttrList(ce);b.canBlockReload=Ze.bool("CAN-BLOCK-RELOAD"),b.canSkipUntil=Ze.optionalFloat("CAN-SKIP-UNTIL",0),b.canSkipDateRanges=b.canSkipUntil>0&&Ze.bool("CAN-SKIP-DATERANGES"),b.partHoldBack=Ze.optionalFloat("PART-HOLD-BACK",0),b.holdBack=Ze.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var rt=new L.AttrList(ce);b.partTarget=rt.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Be=b.partList;Be||(Be=b.partList=[]);var ut=_>0?Be[Be.length-1]:void 0,it=_++,He=new z.Part(new L.AttrList(ce),W,C,it,ut);Be.push(He),W.duration+=He.duration;break}case"PRELOAD-HINT":{var We=new L.AttrList(ce);b.preloadHint=We;break}case"RENDITION-REPORT":{var Re=new L.AttrList(ce);b.renditionReports=b.renditionReports||[],b.renditionReports.push(Re);break}default:v.logger.warn("line parsed but not handled: "+$);break}}}m&&!m.relurl?(y.pop(),M-=m.duration,b.partList&&(b.fragmentHint=m)):b.partList&&(S(W,m),W.cc=I,b.fragmentHint=W);var be=y.length,Ce=y[0],re=y[be-1];if(M+=b.skippedSegments*b.targetduration,M>0&&be&&re){b.averagetargetduration=M/be;var se=re.sn;b.endSN=se!=="initSegment"?se:0,Ce&&(b.startCC=Ce.cc,Ce.initSegment||b.fragments.every(function(he){return he.relurl&&l(he.relurl)})&&(v.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),W=new z.Fragment(f,C),W.relurl=re.relurl,W.level=x,W.sn="initSegment",Ce.initSegment=W,b.needSidxRanges=!0))}else b.endSN=0,b.startCC=0;return b.fragmentHint&&(M+=b.fragmentHint.duration),b.totalduration=M,b.endCC=I,Oe>0&&E(y,Oe),b},D}();function a(D,A){["video","audio","text"].forEach(function(O){var C=D.filter(function(f){return Object(g.isCodecType)(f,O)});if(C.length){var x=C.filter(function(f){return f.lastIndexOf("avc1",0)===0||f.lastIndexOf("mp4a",0)===0});A[O+"Codec"]=x.length>0?x[0]:C[0],D=D.filter(function(f){return C.indexOf(f)===-1})}}),A.unknownCodecs=D}function R(D,A,O){var C=A[O];C&&(D[O]=C)}function E(D,A){for(var O=D[A],C=A;C--;){var x=D[C];if(!x)return;x.programDateTime=O.programDateTime-x.duration*1e3,O=x}}function S(D,A){D.rawProgramDateTime?D.programDateTime=Date.parse(D.rawProgramDateTime):A!=null&&A.programDateTime&&(D.programDateTime=A.endProgramDateTime),Object(Y.isFiniteNumber)(D.programDateTime)||(D.programDateTime=null,D.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ne,J,P){"use strict";P.r(J);var Y=P("./src/polyfills/number.ts"),j=P("./src/events.ts"),U=P("./src/errors.ts"),z=P("./src/utils/logger.ts"),H=P("./src/utils/mp4-tools.ts"),r=P("./src/loader/m3u8-parser.ts"),L=P("./src/types/loader.ts"),v=P("./src/utils/attr-list.ts");function g(h){var c=h.type;switch(c){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,c){var o=h.url;return(o===void 0||o.indexOf("data:")===0)&&(o=c.url),o}var u=function(){function h(o){this.hls=void 0,this.loaders=Object.create(null),this.hls=o,this.registerListeners()}var c=h.prototype;return c.registerListeners=function(){var l=this.hls;l.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(j.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),l.on(j.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},c.unregisterListeners=function(){var l=this.hls;l.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(j.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(j.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),l.off(j.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},c.createInternalLoader=function(l){var s=this.hls.config,a=s.pLoader,R=s.loader,E=a||R,S=new E(s);return l.loader=S,this.loaders[l.type]=S,S},c.getInternalLoader=function(l){return this.loaders[l.type]},c.resetInternalLoader=function(l){this.loaders[l]&&delete this.loaders[l]},c.destroyInternalLoaders=function(){for(var l in this.loaders){var s=this.loaders[l];s&&s.destroy(),this.resetInternalLoader(l)}},c.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},c.onManifestLoading=function(l,s){var a=s.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:L.PlaylistContextType.MANIFEST,url:a,deliveryDirectives:null})},c.onLevelLoading=function(l,s){var a=s.id,R=s.level,E=s.url,S=s.deliveryDirectives;this.load({id:a,groupId:null,level:R,responseType:"text",type:L.PlaylistContextType.LEVEL,url:E,deliveryDirectives:S})},c.onAudioTrackLoading=function(l,s){var a=s.id,R=s.groupId,E=s.url,S=s.deliveryDirectives;this.load({id:a,groupId:R,level:null,responseType:"text",type:L.PlaylistContextType.AUDIO_TRACK,url:E,deliveryDirectives:S})},c.onSubtitleTrackLoading=function(l,s){var a=s.id,R=s.groupId,E=s.url,S=s.deliveryDirectives;this.load({id:a,groupId:R,level:null,responseType:"text",type:L.PlaylistContextType.SUBTITLE_TRACK,url:E,deliveryDirectives:S})},c.load=function(l){var s,a=this.hls.config,R=this.getInternalLoader(l);if(R){var E=R.context;if(E&&E.url===l.url){z.logger.trace("[playlist-loader]: playlist request ongoing");return}z.logger.log("[playlist-loader]: aborting previous loader for type: "+l.type),R.abort()}var S,D,A,O;switch(l.type){case L.PlaylistContextType.MANIFEST:S=a.manifestLoadingMaxRetry,D=a.manifestLoadingTimeOut,A=a.manifestLoadingRetryDelay,O=a.manifestLoadingMaxRetryTimeout;break;case L.PlaylistContextType.LEVEL:case L.PlaylistContextType.AUDIO_TRACK:case L.PlaylistContextType.SUBTITLE_TRACK:S=0,D=a.levelLoadingTimeOut;break;default:S=a.levelLoadingMaxRetry,D=a.levelLoadingTimeOut,A=a.levelLoadingRetryDelay,O=a.levelLoadingMaxRetryTimeout;break}if(R=this.createInternalLoader(l),(s=l.deliveryDirectives)!==null&&s!==void 0&&s.part){var C;if(l.type===L.PlaylistContextType.LEVEL&&l.level!==null?C=this.hls.levels[l.level].details:l.type===L.PlaylistContextType.AUDIO_TRACK&&l.id!==null?C=this.hls.audioTracks[l.id].details:l.type===L.PlaylistContextType.SUBTITLE_TRACK&&l.id!==null&&(C=this.hls.subtitleTracks[l.id].details),C){var x=C.partTarget,f=C.targetduration;x&&f&&(D=Math.min(Math.max(x*3,f*.8)*1e3,D))}}var w={timeout:D,maxRetry:S,retryDelay:A,maxRetryDelay:O,highWaterMark:0},b={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};R.load(l,w,b)},c.loadsuccess=function(l,s,a,R){if(R===void 0&&(R=null),a.isSidxRequest){this.handleSidxRequest(l,a),this.handlePlaylistLoaded(l,s,a,R);return}this.resetInternalLoader(a.type);var E=l.data;if(E.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(l,a,"no EXTM3U delimiter",R);return}s.parsing.start=performance.now(),E.indexOf("#EXTINF:")>0||E.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(l,s,a,R):this.handleMasterPlaylist(l,s,a,R)},c.loaderror=function(l,s,a){a===void 0&&(a=null),this.handleNetworkError(s,a,!1,l)},c.loadtimeout=function(l,s,a){a===void 0&&(a=null),this.handleNetworkError(s,a,!0)},c.handleMasterPlaylist=function(l,s,a,R){var E=this.hls,S=l.data,D=p(l,a),A=r.default.parseMasterPlaylist(S,D),O=A.levels,C=A.sessionData;if(!O.length){this.handleManifestParsingError(l,a,"no level found in manifest",R);return}var x=O.map(function(F){return{id:F.attrs.AUDIO,audioCodec:F.audioCodec}}),f=O.map(function(F){return{id:F.attrs.SUBTITLES,textCodec:F.textCodec}}),w=r.default.parseMasterPlaylistMedia(S,D,"AUDIO",x),b=r.default.parseMasterPlaylistMedia(S,D,"SUBTITLES",f),y=r.default.parseMasterPlaylistMedia(S,D,"CLOSED-CAPTIONS");if(w.length){var B=w.some(function(F){return!F.url});!B&&O[0].audioCodec&&!O[0].attrs.AUDIO&&(z.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),w.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new v.AttrList({}),bitrate:0,url:""}))}E.trigger(j.Events.MANIFEST_LOADED,{levels:O,audioTracks:w,subtitles:b,captions:y,url:D,stats:s,networkDetails:R,sessionData:C})},c.handleTrackOrLevelPlaylist=function(l,s,a,R){var E=this.hls,S=a.id,D=a.level,A=a.type,O=p(l,a),C=Object(Y.isFiniteNumber)(S)?S:0,x=Object(Y.isFiniteNumber)(D)?D:C,f=g(a),w=r.default.parseLevelPlaylist(l.data,O,x,f,C);if(!w.fragments.length){E.trigger(j.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:O,reason:"no fragments found in level",level:typeof a.level=="number"?a.level:void 0});return}if(A===L.PlaylistContextType.MANIFEST){var b={attrs:new v.AttrList({}),bitrate:0,details:w,name:"",url:O};E.trigger(j.Events.MANIFEST_LOADED,{levels:[b],audioTracks:[],url:O,stats:s,networkDetails:R,sessionData:null})}if(s.parsing.end=performance.now(),w.needSidxRanges){var y,B=(y=w.fragments[0].initSegment)===null||y===void 0?void 0:y.url;this.load({url:B,isSidxRequest:!0,type:A,level:D,levelDetails:w,id:S,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}a.levelDetails=w,this.handlePlaylistLoaded(l,s,a,R)},c.handleSidxRequest=function(l,s){var a=Object(H.parseSegmentIndex)(new Uint8Array(l.data));if(!a)return;var R=a.references,E=s.levelDetails;R.forEach(function(S,D){var A=S.info,O=E.fragments[D];O.byteRange.length===0&&O.setByteRange(String(1+A.end-A.start)+"@"+String(A.start)),O.initSegment&&O.initSegment.setByteRange(String(a.moovEndOffset)+"@0")})},c.handleManifestParsingError=function(l,s,a,R){this.hls.trigger(j.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:s.type===L.PlaylistContextType.MANIFEST,url:l.url,reason:a,response:l,context:s,networkDetails:R})},c.handleNetworkError=function(l,s,a,R){a===void 0&&(a=!1),z.logger.warn("[playlist-loader]: A network "+(a?"timeout":"error")+" occurred while loading "+l.type+" level: "+l.level+" id: "+l.id+' group-id: "'+l.groupId+'"');var E=U.ErrorDetails.UNKNOWN,S=!1,D=this.getInternalLoader(l);switch(l.type){case L.PlaylistContextType.MANIFEST:E=a?U.ErrorDetails.MANIFEST_LOAD_TIMEOUT:U.ErrorDetails.MANIFEST_LOAD_ERROR,S=!0;break;case L.PlaylistContextType.LEVEL:E=a?U.ErrorDetails.LEVEL_LOAD_TIMEOUT:U.ErrorDetails.LEVEL_LOAD_ERROR,S=!1;break;case L.PlaylistContextType.AUDIO_TRACK:E=a?U.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:U.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,S=!1;break;case L.PlaylistContextType.SUBTITLE_TRACK:E=a?U.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:U.ErrorDetails.SUBTITLE_LOAD_ERROR,S=!1;break}D&&this.resetInternalLoader(l.type);var A={type:U.ErrorTypes.NETWORK_ERROR,details:E,fatal:S,url:l.url,loader:D,context:l,networkDetails:s};R&&(A.response=R),this.hls.trigger(j.Events.ERROR,A)},c.handlePlaylistLoaded=function(l,s,a,R){var E=a.type,S=a.level,D=a.id,A=a.groupId,O=a.loader,C=a.levelDetails,x=a.deliveryDirectives;if(!(C!=null&&C.targetduration)){this.handleManifestParsingError(l,a,"invalid target duration",R);return}if(!O)return;C.live&&(O.getCacheAge&&(C.ageHeader=O.getCacheAge()||0),(!O.getCacheAge||isNaN(C.ageHeader))&&(C.ageHeader=0));switch(E){case L.PlaylistContextType.MANIFEST:case L.PlaylistContextType.LEVEL:this.hls.trigger(j.Events.LEVEL_LOADED,{details:C,level:S||0,id:D||0,stats:s,networkDetails:R,deliveryDirectives:x});break;case L.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(j.Events.AUDIO_TRACK_LOADED,{details:C,id:D||0,groupId:A||"",stats:s,networkDetails:R,deliveryDirectives:x});break;case L.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(j.Events.SUBTITLE_TRACK_LOADED,{details:C,id:D||0,groupId:A||"",stats:s,networkDetails:R,deliveryDirectives:x});break}},h}();J.default=u},"./src/polyfills/number.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"isFiniteNumber",function(){return Y}),P.d(J,"MAX_SAFE_INTEGER",function(){return j});var Y=Number.isFinite||function(U){return typeof U=="number"&&isFinite(U)},j=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ne,J,P){"use strict";P.r(J);var Y=function(){function j(){}return j.getSilentFrame=function(z,H){switch(z){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},j}();J.default=Y},"./src/remux/mp4-generator.ts":function(ne,J,P){"use strict";P.r(J);var Y=Math.pow(2,32)-1,j=function(){function U(){}return U.init=function(){U.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var H;for(H in U.types)U.types.hasOwnProperty(H)&&(U.types[H]=[H.charCodeAt(0),H.charCodeAt(1),H.charCodeAt(2),H.charCodeAt(3)]);var r=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),L=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);U.HDLR_TYPES={video:r,audio:L};var v=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),g=new Uint8Array([0,0,0,0,0,0,0,0]);U.STTS=U.STSC=U.STCO=g,U.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),U.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),U.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),U.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var p=new Uint8Array([105,115,111,109]),u=new Uint8Array([97,118,99,49]),h=new Uint8Array([0,0,0,1]);U.FTYP=U.box(U.types.ftyp,p,h,p,u),U.DINF=U.box(U.types.dinf,U.box(U.types.dref,v))},U.box=function(H){for(var r=8,L=arguments.length,v=new Array(L>1?L-1:0),g=1;g<L;g++)v[g-1]=arguments[g];for(var p=v.length,u=p;p--;)r+=v[p].byteLength;var h=new Uint8Array(r);for(h[0]=r>>24&255,h[1]=r>>16&255,h[2]=r>>8&255,h[3]=r&255,h.set(H,4),p=0,r=8;p<u;p++)h.set(v[p],r),r+=v[p].byteLength;return h},U.hdlr=function(H){return U.box(U.types.hdlr,U.HDLR_TYPES[H])},U.mdat=function(H){return U.box(U.types.mdat,H)},U.mdhd=function(H,r){r*=H;var L=Math.floor(r/(Y+1)),v=Math.floor(r%(Y+1));return U.box(U.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,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]))},U.mdia=function(H){return U.box(U.types.mdia,U.mdhd(H.timescale,H.duration),U.hdlr(H.type),U.minf(H))},U.mfhd=function(H){return U.box(U.types.mfhd,new Uint8Array([0,0,0,0,H>>24,H>>16&255,H>>8&255,H&255]))},U.minf=function(H){return H.type==="audio"?U.box(U.types.minf,U.box(U.types.smhd,U.SMHD),U.DINF,U.stbl(H)):U.box(U.types.minf,U.box(U.types.vmhd,U.VMHD),U.DINF,U.stbl(H))},U.moof=function(H,r,L){return U.box(U.types.moof,U.mfhd(H),U.traf(L,r))},U.moov=function(H){for(var r=H.length,L=[];r--;)L[r]=U.trak(H[r]);return U.box.apply(null,[U.types.moov,U.mvhd(H[0].timescale,H[0].duration)].concat(L).concat(U.mvex(H)))},U.mvex=function(H){for(var r=H.length,L=[];r--;)L[r]=U.trex(H[r]);return U.box.apply(null,[U.types.mvex].concat(L))},U.mvhd=function(H,r){r*=H;var L=Math.floor(r/(Y+1)),v=Math.floor(r%(Y+1)),g=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 U.box(U.types.mvhd,g)},U.sdtp=function(H){var r=H.samples||[],L=new Uint8Array(4+r.length),v,g;for(v=0;v<r.length;v++)g=r[v].flags,L[v+4]=g.dependsOn<<4|g.isDependedOn<<2|g.hasRedundancy;return U.box(U.types.sdtp,L)},U.stbl=function(H){return U.box(U.types.stbl,U.stsd(H),U.box(U.types.stts,U.STTS),U.box(U.types.stsc,U.STSC),U.box(U.types.stsz,U.STSZ),U.box(U.types.stco,U.STCO))},U.avc1=function(H){var r=[],L=[],v,g,p;for(v=0;v<H.sps.length;v++)g=H.sps[v],p=g.byteLength,r.push(p>>>8&255),r.push(p&255),r=r.concat(Array.prototype.slice.call(g));for(v=0;v<H.pps.length;v++)g=H.pps[v],p=g.byteLength,L.push(p>>>8&255),L.push(p&255),L=L.concat(Array.prototype.slice.call(g));var u=U.box(U.types.avcC,new Uint8Array([1,r[3],r[4],r[5],252|3,224|H.sps.length].concat(r).concat([H.pps.length]).concat(L))),h=H.width,c=H.height,o=H.pixelRatio[0],l=H.pixelRatio[1];return U.box(U.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,h>>8&255,h&255,c>>8&255,c&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),u,U.box(U.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),U.box(U.types.pasp,new Uint8Array([o>>24,o>>16&255,o>>8&255,o&255,l>>24,l>>16&255,l>>8&255,l&255])))},U.esds=function(H){var r=H.config.length;return new Uint8Array([0,0,0,0,3,23+r,0,1,0,4,15+r,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([r]).concat(H.config).concat([6,1,2]))},U.mp4a=function(H){var r=H.samplerate;return U.box(U.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,H.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]),U.box(U.types.esds,U.esds(H)))},U.mp3=function(H){var r=H.samplerate;return U.box(U.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,H.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]))},U.stsd=function(H){return H.type==="audio"?!H.isAAC&&H.codec==="mp3"?U.box(U.types.stsd,U.STSD,U.mp3(H)):U.box(U.types.stsd,U.STSD,U.mp4a(H)):U.box(U.types.stsd,U.STSD,U.avc1(H))},U.tkhd=function(H){var r=H.id,L=H.duration*H.timescale,v=H.width,g=H.height,p=Math.floor(L/(Y+1)),u=Math.floor(L%(Y+1));return U.box(U.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,r&255,0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,u>>24,u>>16&255,u>>8&255,u&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,v>>8&255,v&255,0,0,g>>8&255,g&255,0,0]))},U.traf=function(H,r){var L=U.sdtp(H),v=H.id,g=Math.floor(r/(Y+1)),p=Math.floor(r%(Y+1));return U.box(U.types.traf,U.box(U.types.tfhd,new Uint8Array([0,0,0,0,v>>24,v>>16&255,v>>8&255,v&255])),U.box(U.types.tfdt,new Uint8Array([1,0,0,0,g>>24,g>>16&255,g>>8&255,g&255,p>>24,p>>16&255,p>>8&255,p&255])),U.trun(H,L.length+16+20+8+16+8+8),L)},U.trak=function(H){return H.duration=H.duration||4294967295,U.box(U.types.trak,U.tkhd(H),U.mdia(H))},U.trex=function(H){var r=H.id;return U.box(U.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},U.trun=function(H,r){var L=H.samples||[],v=L.length,g=12+16*v,p=new Uint8Array(g),u,h,c,o,l,s;for(r+=8+g,p.set([0,0,15,1,v>>>24&255,v>>>16&255,v>>>8&255,v&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255],0),u=0;u<v;u++)h=L[u],c=h.duration,o=h.size,l=h.flags,s=h.cts,p.set([c>>>24&255,c>>>16&255,c>>>8&255,c&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255,l.isLeading<<2|l.dependsOn,l.isDependedOn<<6|l.hasRedundancy<<4|l.paddingValue<<1|l.isNonSync,l.degradPrio&240<<8,l.degradPrio&15,s>>>24&255,s>>>16&255,s>>>8&255,s&255],12+16*u);return U.box(U.types.trun,p)},U.initSegment=function(H){U.types||U.init();var r=U.moov(H),L=new Uint8Array(U.FTYP.byteLength+r.byteLength);return L.set(U.FTYP),L.set(r,U.FTYP.byteLength),L},U}();j.types=void 0,j.HDLR_TYPES=void 0,j.STTS=void 0,j.STSC=void 0,j.STCO=void 0,j.STSZ=void 0,j.VMHD=void 0,j.SMHD=void 0,j.STSD=void 0,j.FTYP=void 0,j.DINF=void 0,J.default=j},"./src/remux/mp4-remuxer.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return s}),P.d(J,"normalizePts",function(){return a});var Y=P("./src/polyfills/number.ts"),j=P("./src/remux/aac-helper.ts"),U=P("./src/remux/mp4-generator.ts"),z=P("./src/events.ts"),H=P("./src/errors.ts"),r=P("./src/utils/logger.ts"),L=P("./src/types/loader.ts"),v=P("./src/utils/timescale-conversion.ts");function g(){return g=Object.assign||function(D){for(var A=1;A<arguments.length;A++){var O=arguments[A];for(var C in O)Object.prototype.hasOwnProperty.call(O,C)&&(D[C]=O[C])}return D},g.apply(this,arguments)}var p=10*1e3,u=1024,h=1152,c=null,o=null,l=!1,s=function(){function D(O,C,x,f){if(f===void 0&&(f=""),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=O,this.config=C,this.typeSupported=x,this.ISGenerated=!1,c===null){var w=navigator.userAgent||"",b=w.match(/Chrome\/(\d+)/i);c=b?parseInt(b[1]):0}if(o===null){var y=navigator.userAgent.match(/Safari\/(\d+)/i);o=y?parseInt(y[1]):0}l=!!c&&c<75||!!o&&o<600}var A=D.prototype;return A.destroy=function(){},A.resetTimeStamp=function(C){r.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=C},A.resetNextTimestamp=function(){r.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},A.resetInitSegment=function(){r.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},A.getVideoStartPts=function(C){var x=!1,f=C.reduce(function(w,b){var y=b.pts-w;return y<-4294967296?(x=!0,a(w,b.pts)):y>0?w:b.pts},C[0].pts);return x&&r.logger.debug("PTS rollover detected"),f},A.remux=function(C,x,f,w,b,y,B,F){var _,M,I,m,W,$,ae=b,ue=b,Oe=C.pid>-1,ve=x.pid>-1,Ee=x.samples.length,xe=C.samples.length>0,Ie=Ee>1,de=(!Oe||xe)&&(!ve||Ie)||this.ISGenerated||B;if(de){this.ISGenerated||(I=this.generateIS(C,x,b));var ce=this.isVideoContiguous,ie=-1;if(Ie&&(ie=R(x.samples),!ce&&this.config.forceKeyFrameOnDiscontinuity))if($=!0,ie>0){r.logger.warn("[mp4-remuxer]: Dropped "+ie+" out of "+Ee+" video samples due to a missing keyframe");var fe=this.getVideoStartPts(x.samples);x.samples=x.samples.slice(ie),x.dropped+=ie,ue+=(x.samples[0].pts-fe)/(x.timescale||9e4)}else ie===-1&&(r.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ee+" video samples"),$=!1);if(this.ISGenerated){if(xe&&Ie){var le=this.getVideoStartPts(x.samples),ke=a(C.samples[0].pts,le)-le,Ne=ke/x.inputTimeScale;ae+=Math.max(0,Ne),ue+=Math.max(0,-Ne)}if(xe){if(C.samplerate||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),I=this.generateIS(C,x,b)),M=this.remuxAudio(C,ae,this.isAudioContiguous,y,ve||Ie||F===L.PlaylistLevelType.AUDIO?ue:void 0),Ie){var Ae=M?M.endPTS-M.startPTS:0;x.inputTimeScale||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),I=this.generateIS(C,x,b)),_=this.remuxVideo(x,ue,ce,Ae)}}else Ie&&(_=this.remuxVideo(x,ue,ce,0));_&&(_.firstKeyFrame=ie,_.independent=ie!==-1)}}return this.ISGenerated&&(f.samples.length&&(W=this.remuxID3(f,b)),w.samples.length&&(m=this.remuxText(w,b))),{audio:M,video:_,initSegment:I,independent:$,text:m,id3:W}},A.generateIS=function(C,x,f){var w=C.samples,b=x.samples,y=this.typeSupported,B={},F=!Object(Y.isFiniteNumber)(this._initPTS),_="audio/mp4",M,I,m;if(F&&(M=I=Infinity),C.config&&w.length&&(C.timescale=C.samplerate,C.isAAC||(y.mpeg?(_="audio/mpeg",C.codec=""):y.mp3&&(C.codec="mp3")),B.audio={id:"audio",container:_,codec:C.codec,initSegment:!C.isAAC&&y.mpeg?new Uint8Array(0):U.default.initSegment([C]),metadata:{channelCount:C.channelCount}},F&&(m=C.inputTimeScale,M=I=w[0].pts-Math.round(m*f))),x.sps&&x.pps&&b.length&&(x.timescale=x.inputTimeScale,B.video={id:"main",container:"video/mp4",codec:x.codec,initSegment:U.default.initSegment([x]),metadata:{width:x.width,height:x.height}},F)){m=x.inputTimeScale;var W=this.getVideoStartPts(b),$=Math.round(m*f);I=Math.min(I,a(b[0].dts,W)-$),M=Math.min(M,W-$)}if(Object.keys(B).length)return this.ISGenerated=!0,F&&(this._initPTS=M,this._initDTS=I),{tracks:B,initPTS:M,timescale:m}},A.remuxVideo=function(C,x,f,w){var b=C.inputTimeScale,y=C.samples,B=[],F=y.length,_=this._initPTS,M=this.nextAvcDts,I=8,m,W,$,ae=Number.POSITIVE_INFINITY,ue=Number.NEGATIVE_INFINITY,Oe=0,ve=!1;if(!f||M===null){var Ee=x*b,xe=y[0].pts-a(y[0].dts,y[0].pts);M=Ee-xe}for(var Ie=0;Ie<F;Ie++){var de=y[Ie];if(de.pts=a(de.pts-_,M),de.dts=a(de.dts-_,M),de.dts>de.pts){var ce=9e4*.2;Oe=Math.max(Math.min(Oe,de.pts-de.dts),-1*ce)}de.dts<y[Ie>0?Ie-1:Ie].dts&&(ve=!0)}ve&&y.sort(function(wt,St){var dt=wt.dts-St.dts,Bt=wt.pts-St.pts;return dt||Bt}),W=y[0].dts,$=y[y.length-1].dts;var ie=Math.round(($-W)/(F-1));if(Oe<0){if(Oe<ie*-2){r.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(v.toMsFromMpegTsClock)(-ie,!0)+" ms");for(var fe=Oe,le=0;le<F;le++)y[le].dts=fe=Math.max(fe,y[le].pts-ie),y[le].pts=Math.max(fe,y[le].pts)}else{r.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(v.toMsFromMpegTsClock)(Oe,!0)+" ms to overcome this issue");for(var ke=0;ke<F;ke++)y[ke].dts=y[ke].dts+Oe}W=y[0].dts}if(f){var Ne=W-M,Ae=Ne>ie,Le=Ne<-1;if(Ae||Le){Ae?r.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(Ne,!0)+" ms ("+Ne+"dts) hole between fragments detected, filling it"):r.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(-Ne,!0)+" ms ("+Ne+"dts) overlapping between fragments detected"),W=M;var Fe=y[0].pts-Ne;y[0].dts=W,y[0].pts=Fe,r.logger.log("Video: First PTS/DTS adjusted: "+Object(v.toMsFromMpegTsClock)(Fe,!0)+"/"+Object(v.toMsFromMpegTsClock)(W,!0)+", delta: "+Object(v.toMsFromMpegTsClock)(Ne,!0)+" ms")}}l&&(W=Math.max(0,W));for(var oe=0,ge=0,we=0;we<F;we++){for(var De=y[we],je=De.units,Ve=je.length,Je=0,Xe=0;Xe<Ve;Xe++)Je+=je[Xe].data.length;ge+=Je,oe+=Ve,De.length=Je,De.dts=Math.max(De.dts,W),De.pts=Math.max(De.pts,De.dts,0),ae=Math.min(De.pts,ae),ue=Math.max(De.pts,ue)}$=y[F-1].dts;var et=ge+4*oe+8,Ze;try{Ze=new Uint8Array(et)}catch(wt){this.observer.emit(z.Events.ERROR,z.Events.ERROR,{type:H.ErrorTypes.MUX_ERROR,details:H.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:et,reason:"fail allocating video mdat "+et});return}var rt=new DataView(Ze.buffer);rt.setUint32(0,et),Ze.set(U.default.types.mdat,4);for(var Be=0;Be<F;Be++){for(var ut=y[Be],it=ut.units,He=0,We=0,Re=it.length;We<Re;We++){var be=it[We],Ce=be.data,re=be.data.byteLength;rt.setUint32(I,re),I+=4,Ze.set(Ce,I),I+=re,He+=4+re}if(Be<F-1)m=y[Be+1].dts-ut.dts;else{var se=this.config,he=ut.dts-y[Be>0?Be-1:Be].dts;if(se.stretchShortVideoTrack&&this.nextAudioPts!==null){var me=Math.floor(se.maxBufferHole*b),Se=(w?ae+w*b:this.nextAudioPts)-ut.pts;Se>me?(m=Se-he,m<0&&(m=he),r.logger.log("[mp4-remuxer]: It is approximately "+Se/90+" ms to the next segment; using duration "+m/90+" ms for the last video frame.")):m=he}else m=he}var Ue=Math.round(ut.pts-ut.dts);B.push(new E(ut.key,m,He,Ue))}if(B.length&&c&&c<70){var Ke=B[0].flags;Ke.dependsOn=2,Ke.isNonSync=0}console.assert(m!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=M=$+m,this.isVideoContiguous=!0;var ot=U.default.moof(C.sequenceNumber++,W,g({},C,{samples:B})),mt="video",ft={data1:ot,data2:Ze,startPTS:ae/b,endPTS:(ue+m)/b,startDTS:W/b,endDTS:M/b,type:mt,hasAudio:!1,hasVideo:!0,nb:B.length,dropped:C.dropped};return C.samples=[],C.dropped=0,console.assert(Ze.length,"MDAT length must not be zero"),ft},A.remuxAudio=function(C,x,f,w,b){var y=C.inputTimeScale,B=C.samplerate?C.samplerate:y,F=y/B,_=C.isAAC?u:h,M=_*F,I=this._initPTS,m=!C.isAAC&&this.typeSupported.mpeg,W=[],$=C.samples,ae=m?0:8,ue=this.nextAudioPts||-1,Oe=x*y;if(this.isAudioContiguous=f=f||$.length&&ue>0&&(w&&Math.abs(Oe-ue)<9e3||Math.abs(a($[0].pts-I,Oe)-ue)<20*M),$.forEach(function(Ce){Ce.pts=a(Ce.pts-I,Oe)}),!f||ue<0){if($=$.filter(function(Ce){return Ce.pts>=0}),!$.length)return;b===0?ue=0:w?ue=Math.max(0,Oe):ue=$[0].pts}if(C.isAAC)for(var ve=b!==void 0,Ee=this.config.maxAudioFramesDrift,xe=0,Ie=ue;xe<$.length;xe++){var de=$[xe],ce=de.pts,ie=ce-Ie,fe=Math.abs(1e3*ie/y);if(ie<=-Ee*M&&ve)xe===0&&(r.logger.warn("Audio frame @ "+(ce/y).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ie/y)+" ms."),this.nextAudioPts=ue=Ie=ce);else if(ie>=Ee*M&&fe<p&&ve){var le=Math.round(ie/M);Ie=ce-le*M,Ie<0&&(le--,Ie+=M),xe===0&&(this.nextAudioPts=ue=Ie),r.logger.warn("[mp4-remuxer]: Injecting "+le+" audio frame @ "+(Ie/y).toFixed(3)+"s due to "+Math.round(1e3*ie/y)+" ms gap.");for(var ke=0;ke<le;ke++){var Ne=Math.max(Ie,0),Ae=j.default.getSilentFrame(C.manifestCodec||C.codec,C.channelCount);Ae||(r.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Ae=de.unit.subarray()),$.splice(xe,0,{unit:Ae,pts:Ne}),Ie+=M,xe++}}de.pts=Ie,Ie+=M}for(var Le=null,Fe=null,oe,ge=0,we=$.length;we--;)ge+=$[we].unit.byteLength;for(var De=0,je=$.length;De<je;De++){var Ve=$[De],Je=Ve.unit,Xe=Ve.pts;if(Fe!==null){var et=W[De-1];et.duration=Math.round((Xe-Fe)/F)}else if(f&&C.isAAC&&(Xe=ue),Le=Xe,ge>0){ge+=ae;try{oe=new Uint8Array(ge)}catch(Ce){this.observer.emit(z.Events.ERROR,z.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(!m){var Ze=new DataView(oe.buffer);Ze.setUint32(0,ge),oe.set(U.default.types.mdat,4)}}else return;oe.set(Je,ae);var rt=Je.byteLength;ae+=rt,W.push(new E(!0,_,rt,0)),Fe=Xe}var Be=W.length;if(!Be)return;var ut=W[W.length-1];this.nextAudioPts=ue=Fe+F*ut.duration;var it=m?new Uint8Array(0):U.default.moof(C.sequenceNumber++,Le/F,g({},C,{samples:W}));C.samples=[];var He=Le/y,We=ue/y,Re="audio",be={data1:it,data2:oe,startPTS:He,endPTS:We,startDTS:He,endDTS:We,type:Re,hasAudio:!0,hasVideo:!1,nb:Be};return this.isAudioContiguous=!0,console.assert(oe.length,"MDAT length must not be zero"),be},A.remuxEmptyAudio=function(C,x,f,w){var b=C.inputTimeScale,y=C.samplerate?C.samplerate:b,B=b/y,F=this.nextAudioPts,_=(F!==null?F:w.startDTS*b)+this._initDTS,M=w.endDTS*b+this._initDTS,I=B*u,m=Math.ceil((M-_)/I),W=j.default.getSilentFrame(C.manifestCodec||C.codec,C.channelCount);if(r.logger.warn("[mp4-remuxer]: remux empty Audio"),!W){r.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var $=[],ae=0;ae<m;ae++){var ue=_+ae*I;$.push({unit:W,pts:ue,dts:ue})}return C.samples=$,this.remuxAudio(C,x,f,!1)},A.remuxID3=function(C,x){var f=C.samples.length;if(!f)return;for(var w=C.inputTimeScale,b=this._initPTS,y=this._initDTS,B=0;B<f;B++){var F=C.samples[B];F.pts=a(F.pts-b,x*w)/w,F.dts=a(F.dts-y,x*w)/w}var _=C.samples;return C.samples=[],{samples:_}},A.remuxText=function(C,x){var f=C.samples.length;if(!f)return;for(var w=C.inputTimeScale,b=this._initPTS,y=0;y<f;y++){var B=C.samples[y];B.pts=a(B.pts-b,x*w)/w}C.samples.sort(function(_,M){return _.pts-M.pts});var F=C.samples;return C.samples=[],{samples:F}},D}();function a(D,A){var O;if(A===null)return D;for(A<D?O=-8589934592:O=8589934592;Math.abs(D-A)>4294967296;)D+=O;return D}function R(D){for(var A=0;A<D.length;A++)if(D[A].key)return A;return-1}var E=function(A,O,C,x){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=O,this.size=C,this.cts=x,this.flags=new S(A)},S=function(A){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=A?2:1,this.isNonSync=A?0:1}},"./src/remux/passthrough-remuxer.ts":function(ne,J,P){"use strict";P.r(J);var Y=P("./src/polyfills/number.ts"),j=P("./src/utils/mp4-tools.ts"),U=P("./src/loader/fragment.ts"),z=P("./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 g=v.prototype;return g.destroy=function(){},g.resetTimeStamp=function(u){this.initPTS=u,this.lastEndDTS=null},g.resetNextTimestamp=function(){this.lastEndDTS=null},g.resetInitSegment=function(u,h,c){this.audioCodec=h,this.videoCodec=c,this.generateInitSegment(u),this.emitInitSegment=!0},g.generateInitSegment=function(u){var h=this.audioCodec,c=this.videoCodec;if(!u||!u.byteLength){this.initTracks=void 0,this.initData=void 0;return}var o=this.initData=Object(j.parseInitSegment)(u);h||(h=L(o.audio,U.ElementaryStreamTypes.AUDIO)),c||(c=L(o.video,U.ElementaryStreamTypes.VIDEO));var l={};o.audio&&o.video?l.audiovideo={container:"video/mp4",codec:h+","+c,initSegment:u,id:"main"}:o.audio?l.audio={container:"audio/mp4",codec:h,initSegment:u,id:"audio"}:o.video?l.video={container:"video/mp4",codec:c,initSegment:u,id:"main"}:z.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=l},g.remux=function(u,h,c,o,l){var s=this.initPTS,a=this.lastEndDTS,R={audio:void 0,video:void 0,text:o,id3:c,initSegment:void 0};Object(Y.isFiniteNumber)(a)||(a=this.lastEndDTS=l||0);var E=h.samples;if(!E||!E.length)return R;var S={initPTS:void 0,timescale:1},D=this.initData;if((!D||!D.length)&&(this.generateInitSegment(E),D=this.initData),!D||!D.length)return z.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),R;this.emitInitSegment&&(S.tracks=this.initTracks,this.emitInitSegment=!1),Object(Y.isFiniteNumber)(s)||(this.initPTS=S.initPTS=s=r(D,E,a));var A=Object(j.getDuration)(E,D),O=a,C=A+O;Object(j.offsetStartDTS)(D,E,s),A>0?this.lastEndDTS=C:(z.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var x=!!D.audio,f=!!D.video,w="";x&&(w+="audio"),f&&(w+="video");var b={data1:E,startPTS:O,startDTS:O,endPTS:C,endDTS:C,type:w,hasAudio:x,hasVideo:f,nb:1,dropped:0};return R.audio=b.type==="audio"?b:void 0,R.video=b.type!=="audio"?b:void 0,R.text=o,R.id3=c,R.initSegment=S,R},v}(),r=function(g,p,u){return Object(j.getStartDTS)(g,p)-u};function L(v,g){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"||g===U.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}J.default=H},"./src/task-loop.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return Y});var Y=function(){function j(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var U=j.prototype;return U.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},U.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},U.onHandlerDestroyed=function(){},U.hasInterval=function(){return!!this._tickInterval},U.hasNextTick=function(){return!!this._tickTimer},U.setInterval=function(H){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,H),!0)},U.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},U.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},U.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},U.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},U.doTick=function(){},j}()},"./src/types/cmcd.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"CMCDVersion",function(){return Y}),P.d(J,"CMCDObjectType",function(){return j}),P.d(J,"CMCDStreamingFormat",function(){return U}),P.d(J,"CMCDStreamType",function(){return z});var Y=1,j;(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"})(j||(j={}));var U;(function(H){H.DASH="d",H.HLS="h",H.SMOOTH="s",H.OTHER="o"})(U||(U={}));var z;(function(H){H.VOD="v",H.LIVE="l"})(z||(z={}))},"./src/types/level.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"HlsSkip",function(){return U}),P.d(J,"getSkipValue",function(){return z}),P.d(J,"HlsUrlParameters",function(){return H}),P.d(J,"Level",function(){return r});function Y(L,v){for(var g=0;g<v.length;g++){var p=v[g];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(L,p.key,p)}}function j(L,v,g){return v&&Y(L.prototype,v),g&&Y(L,g),L}var U;(function(L){L.No="",L.Yes="YES",L.v2="v2"})(U||(U={}));function z(L,v){var g=L.canSkipUntil,p=L.canSkipDateRanges,u=L.endSN,h=v!==void 0?v-u:0;return g&&h<g?p?U.v2:U.Yes:U.No}var H=function(){function L(g,p,u){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=g,this.part=p,this.skip=u}var v=L.prototype;return v.addDirectives=function(p){var u=new self.URL(p);return this.msn!==void 0&&u.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&u.searchParams.set("_HLS_part",this.part.toString()),this.skip&&u.searchParams.set("_HLS_skip",this.skip),u.toString()},L}(),r=function(){function L(v){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[v.url],this.attrs=v.attrs,this.bitrate=v.bitrate,v.details&&(this.details=v.details),this.id=v.id||0,this.name=v.name,this.width=v.width||0,this.height=v.height||0,this.audioCodec=v.audioCodec,this.videoCodec=v.videoCodec,this.unknownCodecs=v.unknownCodecs,this.codecSet=[v.videoCodec,v.audioCodec].filter(function(g){return g}).join(",").replace(/\.[^.,]+/g,"")}return j(L,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(g){var p=g%this.url.length;this._urlId!==p&&(this.details=void 0,this._urlId=p)}}]),L}()},"./src/types/loader.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"PlaylistContextType",function(){return Y}),P.d(J,"PlaylistLevelType",function(){return j});var Y;(function(U){U.MANIFEST="manifest",U.LEVEL="level",U.AUDIO_TRACK="audioTrack",U.SUBTITLE_TRACK="subtitleTrack"})(Y||(Y={}));var j;(function(U){U.MAIN="main",U.AUDIO="audio",U.SUBTITLE="subtitle"})(j||(j={}))},"./src/types/transmuxer.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"ChunkMetadata",function(){return Y});var Y=function(z,H,r,L,v,g){L===void 0&&(L=0),v===void 0&&(v=-1),g===void 0&&(g=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=j(),this.buffering={audio:j(),video:j(),audiovideo:j()},this.level=z,this.sn=H,this.id=r,this.size=L,this.part=v,this.partial=g};function j(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"AttrList",function(){return U});var Y=/^(\d+)x(\d+)$/,j=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,U=function(){function z(r){typeof r=="string"&&(r=z.parseAttrList(r));for(var L in r)r.hasOwnProperty(L)&&(this[L]=r[L])}var H=z.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 g=new Uint8Array(v.length/2),p=0;p<v.length/2;p++)g[p]=parseInt(v.slice(p*2,p*2+2),16);return g}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 g=this[L];return g?parseFloat(g):v},H.enumeratedString=function(L){return this[L]},H.bool=function(L){return this[L]==="YES"},H.decimalResolution=function(L){var v=Y.exec(this[L]);return v===null?void 0:{width:parseInt(v[1],10),height:parseInt(v[2],10)}},z.parseAttrList=function(L){var v,g={},p='"';for(j.lastIndex=0;(v=j.exec(L))!==null;){var u=v[2];u.indexOf(p)===0&&u.lastIndexOf(p)===u.length-1&&(u=u.slice(1,-1)),g[v[1]]=u}return g},z}()},"./src/utils/binary-search.ts":function(ne,J,P){"use strict";P.r(J);var Y={search:function(U,z){for(var H=0,r=U.length-1,L=null,v=null;H<=r;){L=(H+r)/2|0,v=U[L];var g=z(v);if(g>0)H=L+1;else if(g<0)r=L-1;else return v}return null}};J.default=Y},"./src/utils/buffer-helper.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"BufferHelper",function(){return U});var Y=P("./src/utils/logger.ts"),j={length:0,start:function(){return 0},end:function(){return 0}},U=function(){function z(){}return z.isBuffered=function(r,L){try{if(r){for(var v=z.getBuffered(r),g=0;g<v.length;g++)if(L>=v.start(g)&&L<=v.end(g))return!0}}catch(p){}return!1},z.bufferInfo=function(r,L,v){try{if(r){var g=z.getBuffered(r),p=[],u;for(u=0;u<g.length;u++)p.push({start:g.start(u),end:g.end(u)});return this.bufferedInfo(p,L,v)}}catch(h){}return{len:0,start:L,end:L,nextStart:void 0}},z.bufferedInfo=function(r,L,v){L=Math.max(0,L),r.sort(function(S,D){var A=S.start-D.start;return A||D.end-S.end});var g=[];if(v)for(var p=0;p<r.length;p++){var u=g.length;if(u){var h=g[u-1].end;r[p].start-h<v?r[p].end>h&&(g[u-1].end=r[p].end):g.push(r[p])}else g.push(r[p])}else g=r;for(var c=0,o,l=L,s=L,a=0;a<g.length;a++){var R=g[a].start,E=g[a].end;if(L+v>=R&&L<E)l=R,s=E,c=s-L;else if(L+v<R){o=R;break}}return{len:c,start:l||0,end:s||0,nextStart:o}},z.getBuffered=function(r){try{return r.buffered}catch(L){return Y.logger.log("failed to get media.buffered",L),j}},z}()},"./src/utils/cea-608-parser.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"Row",function(){return s}),P.d(J,"CaptionScreen",function(){return a});var Y=P("./src/utils/logger.ts"),j={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},U=function(C){var x=C;return j.hasOwnProperty(C)&&(x=j[C]),String.fromCharCode(x)},z=15,H=100,r={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},L={17:2,18:4,21:6,22:8,23:10,19:13,20:15},v={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},g={25:2,26:4,29:6,30:8,31:10,27:13,28:15},p=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],u;(function(O){O[O.ERROR=0]="ERROR",O[O.TEXT=1]="TEXT",O[O.WARNING=2]="WARNING",O[O.INFO=2]="INFO",O[O.DEBUG=3]="DEBUG",O[O.DATA=3]="DATA"})(u||(u={}));var h=function(){function O(){this.time=null,this.verboseLevel=u.ERROR}var C=O.prototype;return C.log=function(f,w){this.verboseLevel>=f&&Y.logger.log(this.time+" ["+f+"] "+w)},O}(),c=function(C){for(var x=[],f=0;f<C.length;f++)x.push(C[f].toString(16));return x},o=function(){function O(x,f,w,b,y){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=x||"white",this.underline=f||!1,this.italics=w||!1,this.background=b||"black",this.flash=y||!1}var C=O.prototype;return C.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},C.setStyles=function(f){for(var w=["foreground","underline","italics","background","flash"],b=0;b<w.length;b++){var y=w[b];f.hasOwnProperty(y)&&(this[y]=f[y])}},C.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},C.equals=function(f){return this.foreground===f.foreground&&this.underline===f.underline&&this.italics===f.italics&&this.background===f.background&&this.flash===f.flash},C.copy=function(f){this.foreground=f.foreground,this.underline=f.underline,this.italics=f.italics,this.background=f.background,this.flash=f.flash},C.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},O}(),l=function(){function O(x,f,w,b,y,B){this.uchar=void 0,this.penState=void 0,this.uchar=x||" ",this.penState=new o(f,w,b,y,B)}var C=O.prototype;return C.reset=function(){this.uchar=" ",this.penState.reset()},C.setChar=function(f,w){this.uchar=f,this.penState.copy(w)},C.setPenState=function(f){this.penState.copy(f)},C.equals=function(f){return this.uchar===f.uchar&&this.penState.equals(f.penState)},C.copy=function(f){this.uchar=f.uchar,this.penState.copy(f.penState)},C.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},O}(),s=function(){function O(x){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var f=0;f<H;f++)this.chars.push(new l);this.logger=x,this.pos=0,this.currPenState=new o}var C=O.prototype;return C.equals=function(f){for(var w=!0,b=0;b<H;b++)if(!this.chars[b].equals(f.chars[b])){w=!1;break}return w},C.copy=function(f){for(var w=0;w<H;w++)this.chars[w].copy(f.chars[w])},C.isEmpty=function(){for(var f=!0,w=0;w<H;w++)if(!this.chars[w].isEmpty()){f=!1;break}return f},C.setCursor=function(f){this.pos!==f&&(this.pos=f),this.pos<0?(this.logger.log(u.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>H&&(this.logger.log(u.DEBUG,"Too large cursor position "+this.pos),this.pos=H)},C.moveCursor=function(f){var w=this.pos+f;if(f>1)for(var b=this.pos+1;b<w+1;b++)this.chars[b].setPenState(this.currPenState);this.setCursor(w)},C.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},C.insertChar=function(f){f>=144&&this.backSpace();var w=U(f);if(this.pos>=H){this.logger.log(u.ERROR,"Cannot insert "+f.toString(16)+" ("+w+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(w,this.currPenState),this.moveCursor(1)},C.clearFromPos=function(f){var w;for(w=f;w<H;w++)this.chars[w].reset()},C.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},C.clearToEndOfRow=function(){this.clearFromPos(this.pos)},C.getTextString=function(){for(var f=[],w=!0,b=0;b<H;b++){var y=this.chars[b].uchar;y!==" "&&(w=!1),f.push(y)}return w?"":f.join("")},C.setPenStyles=function(f){this.currPenState.setStyles(f);var w=this.chars[this.pos];w.setPenState(this.currPenState)},O}(),a=function(){function O(x){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var f=0;f<z;f++)this.rows.push(new s(x));this.logger=x,this.currRow=z-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var C=O.prototype;return C.reset=function(){for(var f=0;f<z;f++)this.rows[f].clear();this.currRow=z-1},C.equals=function(f){for(var w=!0,b=0;b<z;b++)if(!this.rows[b].equals(f.rows[b])){w=!1;break}return w},C.copy=function(f){for(var w=0;w<z;w++)this.rows[w].copy(f.rows[w])},C.isEmpty=function(){for(var f=!0,w=0;w<z;w++)if(!this.rows[w].isEmpty()){f=!1;break}return f},C.backSpace=function(){var f=this.rows[this.currRow];f.backSpace()},C.clearToEndOfRow=function(){var f=this.rows[this.currRow];f.clearToEndOfRow()},C.insertChar=function(f){var w=this.rows[this.currRow];w.insertChar(f)},C.setPen=function(f){var w=this.rows[this.currRow];w.setPenStyles(f)},C.moveCursor=function(f){var w=this.rows[this.currRow];w.moveCursor(f)},C.setCursor=function(f){this.logger.log(u.INFO,"setCursor: "+f);var w=this.rows[this.currRow];w.setCursor(f)},C.setPAC=function(f){this.logger.log(u.INFO,"pacData = "+JSON.stringify(f));var w=f.row-1;if(this.nrRollUpRows&&w<this.nrRollUpRows-1&&(w=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==w){for(var b=0;b<z;b++)this.rows[b].clear();var y=this.currRow+1-this.nrRollUpRows,B=this.lastOutputScreen;if(B){var F=B.rows[y].cueStartTime,_=this.logger.time;if(F&&_!==null&&F<_)for(var M=0;M<this.nrRollUpRows;M++)this.rows[w-this.nrRollUpRows+M+1].copy(B.rows[y+M])}}this.currRow=w;var I=this.rows[this.currRow];if(f.indent!==null){var m=f.indent,W=Math.max(m-1,0);I.setCursor(f.indent),f.color=I.chars[W].penState.foreground}var $={foreground:f.color,underline:f.underline,italics:f.italics,background:"black",flash:!1};this.setPen($)},C.setBkgData=function(f){this.logger.log(u.INFO,"bkgData = "+JSON.stringify(f)),this.backSpace(),this.setPen(f),this.insertChar(32)},C.setRollUpRows=function(f){this.nrRollUpRows=f},C.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(u.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(u.TEXT,this.getDisplayText());var f=this.currRow+1-this.nrRollUpRows,w=this.rows.splice(f,1)[0];w.clear(),this.rows.splice(this.currRow,0,w),this.logger.log(u.INFO,"Rolling up")},C.getDisplayText=function(f){f=f||!1;for(var w=[],b="",y=-1,B=0;B<z;B++){var F=this.rows[B].getTextString();F&&(y=B+1,f?w.push("Row "+y+": '"+F+"'"):w.push(F.trim()))}return w.length>0&&(f?b="["+w.join(" | ")+"]":b=w.join(`
|
|
`)),b},C.getTextAndFormat=function(){return this.rows},O}(),R=function(){function O(x,f,w){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=x,this.outputFilter=f,this.mode=null,this.verbose=0,this.displayedMemory=new a(w),this.nonDisplayedMemory=new a(w),this.lastOutputScreen=new a(w),this.currRollUpRow=this.displayedMemory.rows[z-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=w}var C=O.prototype;return C.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[z-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},C.getHandler=function(){return this.outputFilter},C.setHandler=function(f){this.outputFilter=f},C.setPAC=function(f){this.writeScreen.setPAC(f)},C.setBkgData=function(f){this.writeScreen.setBkgData(f)},C.setMode=function(f){if(f===this.mode)return;this.mode=f,this.logger.log(u.INFO,"MODE="+f),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=f},C.insertChars=function(f){for(var w=0;w<f.length;w++)this.writeScreen.insertChar(f[w]);var b=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(u.INFO,b+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(u.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},C.ccRCL=function(){this.logger.log(u.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},C.ccBS=function(){if(this.logger.log(u.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},C.ccAOF=function(){},C.ccAON=function(){},C.ccDER=function(){this.logger.log(u.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},C.ccRU=function(f){this.logger.log(u.INFO,"RU("+f+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(f)},C.ccFON=function(){this.logger.log(u.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},C.ccRDC=function(){this.logger.log(u.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},C.ccTR=function(){this.logger.log(u.INFO,"TR"),this.setMode("MODE_TEXT")},C.ccRTD=function(){this.logger.log(u.INFO,"RTD"),this.setMode("MODE_TEXT")},C.ccEDM=function(){this.logger.log(u.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},C.ccCR=function(){this.logger.log(u.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},C.ccENM=function(){this.logger.log(u.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},C.ccEOC=function(){if(this.logger.log(u.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var f=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=f,this.writeScreen=this.nonDisplayedMemory,this.logger.log(u.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},C.ccTO=function(f){this.logger.log(u.INFO,"TO("+f+") - Tab Offset"),this.writeScreen.moveCursor(f)},C.ccMIDROW=function(f){var w={flash:!1};if(w.underline=f%2===1,w.italics=f>=46,w.italics)w.foreground="white";else{var b=Math.floor(f/2)-16,y=["white","green","blue","cyan","red","yellow","magenta"];w.foreground=y[b]}this.logger.log(u.INFO,"MIDROW: "+JSON.stringify(w)),this.writeScreen.setPen(w)},C.outputDataUpdate=function(f){f===void 0&&(f=!1);var w=this.logger.time;if(w===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=w:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,w,this.lastOutputScreen),f&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:w),this.lastOutputScreen.copy(this.displayedMemory))},C.cueSplitAtTime=function(f){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,f,this.displayedMemory),this.cueStartTime=f))},O}(),E=function(){function O(x,f,w){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var b=new h;this.channels=[null,new R(x,f,b),new R(x+1,w,b)],this.cmdHistory=A(),this.logger=b}var C=O.prototype;return C.getHandler=function(f){return this.channels[f].getHandler()},C.setHandler=function(f,w){this.channels[f].setHandler(w)},C.addData=function(f,w){var b,y,B,F=!1;this.logger.time=f;for(var _=0;_<w.length;_+=2){if(y=w[_]&127,B=w[_+1]&127,y===0&&B===0)continue;if(this.logger.log(u.DATA,"["+c([w[_],w[_+1]])+"] -> ("+c([y,B])+")"),b=this.parseCmd(y,B),b||(b=this.parseMidrow(y,B)),b||(b=this.parsePAC(y,B)),b||(b=this.parseBackgroundAttributes(y,B)),!b&&(F=this.parseChars(y,B),F)){var M=this.currentChannel;if(M&&M>0){var I=this.channels[M];I.insertChars(F)}else this.logger.log(u.WARNING,"No channel found yet. TEXT-MODE?")}!b&&!F&&this.logger.log(u.WARNING,"Couldn't parse cleaned data "+c([y,B])+" orig: "+c([w[_],w[_+1]]))}},C.parseCmd=function(f,w){var b=this.cmdHistory,y=(f===20||f===28||f===21||f===29)&&w>=32&&w<=47,B=(f===23||f===31)&&w>=33&&w<=35;if(!(y||B))return!1;if(D(f,w,b))return S(null,null,b),this.logger.log(u.DEBUG,"Repeated command ("+c([f,w])+") is dropped"),!0;var F=f===20||f===21||f===23?1:2,_=this.channels[F];return f===20||f===21||f===28||f===29?w===32?_.ccRCL():w===33?_.ccBS():w===34?_.ccAOF():w===35?_.ccAON():w===36?_.ccDER():w===37?_.ccRU(2):w===38?_.ccRU(3):w===39?_.ccRU(4):w===40?_.ccFON():w===41?_.ccRDC():w===42?_.ccTR():w===43?_.ccRTD():w===44?_.ccEDM():w===45?_.ccCR():w===46?_.ccENM():w===47&&_.ccEOC():_.ccTO(w-32),S(f,w,b),this.currentChannel=F,!0},C.parseMidrow=function(f,w){var b=0;if((f===17||f===25)&&w>=32&&w<=47){if(f===17?b=1:b=2,b!==this.currentChannel)return this.logger.log(u.ERROR,"Mismatch channel in midrow parsing"),!1;var y=this.channels[b];return y?(y.ccMIDROW(w),this.logger.log(u.DEBUG,"MIDROW ("+c([f,w])+")"),!0):!1}return!1},C.parsePAC=function(f,w){var b,y=this.cmdHistory,B=(f>=17&&f<=23||f>=25&&f<=31)&&w>=64&&w<=127,F=(f===16||f===24)&&w>=64&&w<=95;if(!(B||F))return!1;if(D(f,w,y))return S(null,null,y),!0;var _=f<=23?1:2;w>=64&&w<=95?b=_===1?r[f]:v[f]:b=_===1?L[f]:g[f];var M=this.channels[_];return M?(M.setPAC(this.interpretPAC(b,w)),S(f,w,y),this.currentChannel=_,!0):!1},C.interpretPAC=function(f,w){var b,y={color:null,italics:!1,indent:null,underline:!1,row:f};return w>95?b=w-96:b=w-64,y.underline=(b&1)===1,b<=13?y.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(b/2)]:b<=15?(y.italics=!0,y.color="white"):y.indent=Math.floor((b-16)/2)*4,y},C.parseChars=function(f,w){var b,y=null,B=null;if(f>=25?(b=2,B=f-8):(b=1,B=f),B>=17&&B<=19){var F;B===17?F=w+80:B===18?F=w+112:F=w+144,this.logger.log(u.INFO,"Special char '"+U(F)+"' in channel "+b),y=[F]}else f>=32&&f<=127&&(y=w===0?[f]:[f,w]);if(y){var _=c(y);this.logger.log(u.DEBUG,"Char codes = "+_.join(",")),S(f,w,this.cmdHistory)}return y},C.parseBackgroundAttributes=function(f,w){var b=(f===16||f===24)&&w>=32&&w<=47,y=(f===23||f===31)&&w>=45&&w<=47;if(!(b||y))return!1;var B,F={};f===16||f===24?(B=Math.floor((w-32)/2),F.background=p[B],w%2===1&&(F.background=F.background+"_semi")):w===45?F.background="transparent":(F.foreground="black",w===47&&(F.underline=!0));var _=f<=23?1:2,M=this.channels[_];return M.setBkgData(F),S(f,w,this.cmdHistory),!0},C.reset=function(){for(var f=0;f<Object.keys(this.channels).length;f++){var w=this.channels[f];w&&w.reset()}this.cmdHistory=A()},C.cueSplitAtTime=function(f){for(var w=0;w<this.channels.length;w++){var b=this.channels[w];b&&b.cueSplitAtTime(f)}},O}();function S(O,C,x){x.a=O,x.b=C}function D(O,C,x){return x.a===O&&x.b===C}function A(){return{a:null,b:null}}J.default=E},"./src/utils/codecs.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"isCodecType",function(){return j}),P.d(J,"isCodecSupportedInMp4",function(){return U});var Y={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function j(z,H){var r=Y[H];return!!r&&r[z.slice(0,4)]===!0}function U(z,H){return MediaSource.isTypeSupported((H||"video")+'/mp4;codecs="'+z+'"')}},"./src/utils/cues.ts":function(ne,J,P){"use strict";P.r(J);var Y=P("./src/utils/vttparser.ts"),j=P("./src/utils/webvtt-parser.ts"),U=P("./src/utils/texttrack-utils.ts"),z=/\s/,H={newCue:function(L,v,g,p){for(var u=[],h,c,o,l,s,a=self.VTTCue||self.TextTrackCue,R=0;R<p.rows.length;R++)if(h=p.rows[R],o=!0,l=0,s="",!h.isEmpty()){for(var E=0;E<h.chars.length;E++)z.test(h.chars[E].uchar)&&o?l++:(s+=h.chars[E].uchar,o=!1);h.cueStartTime=v,v===g&&(g+=1e-4),l>=16?l--:l++;var S=Object(Y.fixLineBreaks)(s.trim()),D=Object(j.generateCueId)(v,g,S);(!L||!L.cues||!L.cues.getCueById(D))&&(c=new a(v,g,S),c.id=D,c.line=R+1,c.align="left",c.position=10+Math.min(80,Math.floor(l*8/32)*10),u.push(c))}return L&&u.length&&(u.sort(function(A,O){return A.line==="auto"||O.line==="auto"?0:A.line>8&&O.line>8?O.line-A.line:A.line-O.line}),u.forEach(function(A){return Object(U.addCueToTrack)(L,A)})),u}};J.default=H},"./src/utils/discontinuities.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"findFirstFragWithCC",function(){return z}),P.d(J,"shouldAlignOnDiscontinuities",function(){return H}),P.d(J,"findDiscontinuousReferenceFrag",function(){return r}),P.d(J,"adjustSlidingStart",function(){return v}),P.d(J,"alignStream",function(){return g}),P.d(J,"alignPDT",function(){return u}),P.d(J,"alignFragmentByPDTDelta",function(){return h}),P.d(J,"alignMediaPlaylistByPDT",function(){return c});var Y=P("./src/polyfills/number.ts"),j=P("./src/utils/logger.ts"),U=P("./src/controller/level-helper.ts");function z(o,l){for(var s=null,a=0,R=o.length;a<R;a++){var E=o[a];if(E&&E.cc===l){s=E;break}}return s}function H(o,l,s){return!!(l.details&&(s.endCC>s.startCC||o&&o.cc<s.startCC))}function r(o,l){var s=o.fragments,a=l.fragments;if(!a.length||!s.length){j.logger.log("No fragments to align");return}var R=z(s,a[0].cc);if(!R||R&&!R.startPTS){j.logger.log("No frag in previous level to align on");return}return R}function L(o,l){if(o){var s=o.start+l;o.start=o.startPTS=s,o.endPTS=s+o.duration}}function v(o,l){for(var s=l.fragments,a=0,R=s.length;a<R;a++)L(s[a],o);l.fragmentHint&&L(l.fragmentHint,o),l.alignedSliding=!0}function g(o,l,s){if(!l)return;p(o,s,l),!s.alignedSliding&&l.details&&u(s,l.details),!s.alignedSliding&&l.details&&!s.skippedSegments&&Object(U.adjustSliding)(l.details,s)}function p(o,l,s){if(H(o,s,l)){var a=r(s.details,l);a&&Object(Y.isFiniteNumber)(a.start)&&(j.logger.log("Adjusting PTS using last level due to CC increase within current level "+l.url),v(a.start,l))}}function u(o,l){if(!l.fragments.length||!o.hasProgramDateTime||!l.hasProgramDateTime)return;var s=l.fragments[0].programDateTime,a=o.fragments[0].programDateTime,R=(a-s)/1e3+l.fragments[0].start;R&&Object(Y.isFiniteNumber)(R)&&(j.logger.log("Adjusting PTS using programDateTime delta "+(a-s)+"ms, sliding:"+R.toFixed(3)+" "+o.url+" "),v(R,o))}function h(o,l){var s=o.programDateTime;if(!s)return;var a=(s-l)/1e3;o.start=o.startPTS=a,o.endPTS=a+o.duration}function c(o,l){if(!l.fragments.length||!o.hasProgramDateTime||!l.hasProgramDateTime)return;var s=l.fragments[0].programDateTime,a=l.fragments[0].start,R=s-a*1e3;o.fragments.forEach(function(E){h(E,R)}),o.fragmentHint&&h(o.fragmentHint,R),o.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ne,J,P){"use strict";P.r(J);var Y=P("./src/utils/ewma.ts"),j=function(){function U(H,r,L){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=L,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Y.default(H),this.fast_=new Y.default(r)}var z=U.prototype;return z.update=function(r,L){var v=this.slow_,g=this.fast_;this.slow_.halfLife!==r&&(this.slow_=new Y.default(r,v.getEstimate(),v.getTotalWeight())),this.fast_.halfLife!==L&&(this.fast_=new Y.default(L,g.getEstimate(),g.getTotalWeight()))},z.sample=function(r,L){r=Math.max(r,this.minDelayMs_);var v=8*L,g=r/1e3,p=v/g;this.fast_.sample(g,p),this.slow_.sample(g,p)},z.canEstimate=function(){var r=this.fast_;return r&&r.getTotalWeight()>=this.minWeight_},z.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},z.destroy=function(){},U}();J.default=j},"./src/utils/ewma.ts":function(ne,J,P){"use strict";P.r(J);var Y=function(){function j(z,H,r){H===void 0&&(H=0),r===void 0&&(r=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=z,this.alpha_=z?Math.exp(Math.log(.5)/z):0,this.estimate_=H,this.totalWeight_=r}var U=j.prototype;return U.sample=function(H,r){var L=Math.pow(this.alpha_,H);this.estimate_=r*(1-L)+L*this.estimate_,this.totalWeight_+=H},U.getTotalWeight=function(){return this.totalWeight_},U.getEstimate=function(){if(this.alpha_){var H=1-Math.pow(this.alpha_,this.totalWeight_);if(H)return this.estimate_/H}return this.estimate_},j}();J.default=Y},"./src/utils/fetch-loader.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"fetchSupported",function(){return h});var Y=P("./src/polyfills/number.ts"),j=P("./src/loader/load-stats.ts"),U=P("./src/demux/chunk-cache.ts");function z(a,R){a.prototype=Object.create(R.prototype),a.prototype.constructor=a,g(a,R)}function H(a){var R=typeof Map=="function"?new Map:void 0;return H=function(S){if(S===null||!v(S))return S;if(typeof S!="function")throw new TypeError("Super expression must either be null or a function");if(typeof R!="undefined"){if(R.has(S))return R.get(S);R.set(S,D)}function D(){return r(S,arguments,p(this).constructor)}return D.prototype=Object.create(S.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),g(D,S)},H(a)}function r(a,R,E){return L()?r=Reflect.construct:r=function(D,A,O){var C=[null];C.push.apply(C,A);var x=Function.bind.apply(D,C),f=new x;return O&&g(f,O.prototype),f},r.apply(null,arguments)}function L(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}function v(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function g(a,R){return g=Object.setPrototypeOf||function(S,D){return S.__proto__=D,S},g(a,R)}function p(a){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(E){return E.__proto__||Object.getPrototypeOf(E)},p(a)}function u(){return u=Object.assign||function(a){for(var R=1;R<arguments.length;R++){var E=arguments[R];for(var S in E)Object.prototype.hasOwnProperty.call(E,S)&&(a[S]=E[S])}return a},u.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 c=function(){function a(E){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=E.fetchSetup||l,this.controller=new self.AbortController,this.stats=new j.LoadStats}var R=a.prototype;return R.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},R.abortInternal=function(){var S=this.response;(!S||!S.ok)&&(this.stats.aborted=!0,this.controller.abort())},R.abort=function(){var S;this.abortInternal(),(S=this.callbacks)!==null&&S!==void 0&&S.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},R.load=function(S,D,A){var O=this,C=this.stats;if(C.loading.start)throw new Error("Loader can only be used once.");C.loading.start=self.performance.now();var x=o(S,this.controller.signal),f=A.onProgress,w=S.responseType==="arraybuffer",b=w?"byteLength":"length";this.context=S,this.config=D,this.callbacks=A,this.request=this.fetchSetup(S,x),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){O.abortInternal(),A.onTimeout(C,S,O.response)},D.timeout),self.fetch(this.request).then(function(y){if(O.response=O.loader=y,!y.ok){var B=y.status,F=y.statusText;throw new s(F||"fetch, bad network response",B,y)}return C.loading.first=Math.max(self.performance.now(),C.loading.start),C.total=parseInt(y.headers.get("Content-Length")||"0"),f&&Object(Y.isFiniteNumber)(D.highWaterMark)?O.loadProgressively(y,C,S,D.highWaterMark,f):w?y.arrayBuffer():y.text()}).then(function(y){var B=O.response;self.clearTimeout(O.requestTimeout),C.loading.end=Math.max(self.performance.now(),C.loading.first),C.loaded=C.total=y[b];var F={url:B.url,data:y};f&&!Object(Y.isFiniteNumber)(D.highWaterMark)&&f(C,S,y,B),A.onSuccess(F,C,S,B)}).catch(function(y){if(self.clearTimeout(O.requestTimeout),C.aborted)return;var B=y.code||0;A.onError({code:B,text:y.message},S,y.details)})},R.getCacheAge=function(){var S=null;if(this.response){var D=this.response.headers.get("age");S=D?parseFloat(D):null}return S},R.loadProgressively=function(S,D,A,O,C){O===void 0&&(O=0);var x=new U.default,f=S.body.getReader(),w=function b(){return f.read().then(function(y){if(y.done)return x.dataLength&&C(D,A,x.flush(),S),Promise.resolve(new ArrayBuffer(0));var B=y.value,F=B.length;return D.loaded+=F,F<O||x.dataLength?(x.push(B),x.dataLength>=O&&C(D,A,x.flush(),S)):C(D,A,B,S),b()}).catch(function(){return Promise.reject()})};return w()},a}();function o(a,R){var E={method:"GET",mode:"cors",credentials:"same-origin",signal:R,headers:new self.Headers(u({},a.headers))};return a.rangeEnd&&E.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),E}function l(a,R){return new self.Request(a.url,R)}var s=function(a){z(R,a);function R(E,S,D){var A;return A=a.call(this,E)||this,A.code=void 0,A.details=void 0,A.code=S,A.details=D,A}return R}(H(Error));J.default=c},"./src/utils/imsc1-ttml-parser.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"IMSC1_CODEC",function(){return v}),P.d(J,"parseIMSC1",function(){return h});var Y=P("./src/utils/mp4-tools.ts"),j=P("./src/utils/vttparser.ts"),U=P("./src/utils/vttcue.ts"),z=P("./src/demux/id3.ts"),H=P("./src/utils/timescale-conversion.ts"),r=P("./src/utils/webvtt-parser.ts");function L(){return L=Object.assign||function(O){for(var C=1;C<arguments.length;C++){var x=arguments[C];for(var f in x)Object.prototype.hasOwnProperty.call(x,f)&&(O[f]=x[f])}return O},L.apply(this,arguments)}var v="stpp.ttml.im1t",g=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,p=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,u={left:"start",center:"center",right:"end",start:"start",end:"end"};function h(O,C,x,f,w){var b=Object(Y.findBox)(new Uint8Array(O),["mdat"]);if(b.length===0){w(new Error("Could not parse IMSC1 mdat"));return}var y=b[0],B=Object(z.utf8ArrayToStr)(new Uint8Array(O,y.start,y.end-y.start)),F=Object(H.toTimescaleFromScale)(C,1,x);try{f(c(B,F))}catch(_){w(_)}}function c(O,C){var x=new DOMParser,f=x.parseFromString(O,"text/xml"),w=f.getElementsByTagName("tt")[0];if(!w)throw new Error("Invalid ttml");var b={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},y=Object.keys(b).reduce(function(I,m){return I[m]=w.getAttribute("ttp:"+m)||b[m],I},{}),B=w.getAttribute("xml:space")!=="preserve",F=l(o(w,"styling","style")),_=l(o(w,"layout","region")),M=o(w,"body","[begin]");return[].map.call(M,function(I){var m=s(I,B);if(!m||!I.hasAttribute("begin"))return null;var W=S(I.getAttribute("begin"),y),$=S(I.getAttribute("dur"),y),ae=S(I.getAttribute("end"),y);if(W===null)throw E(I);if(ae===null){if($===null)throw E(I);ae=W+$}var ue=new U.default(W-C,ae-C,m);ue.id=Object(r.generateCueId)(ue.startTime,ue.endTime,ue.text);var Oe=_[I.getAttribute("region")],ve=F[I.getAttribute("style")];ue.position=10,ue.size=80;var Ee=a(Oe,ve),xe=Ee.textAlign;if(xe){var Ie=u[xe];Ie&&(ue.lineAlign=Ie),ue.align=xe}return L(ue,Ee),ue}).filter(function(I){return I!==null})}function o(O,C,x){var f=O.getElementsByTagName(C)[0];return f?[].slice.call(f.querySelectorAll(x)):[]}function l(O){return O.reduce(function(C,x){var f=x.getAttribute("xml:id");return f&&(C[f]=x),C},{})}function s(O,C){return[].slice.call(O.childNodes).reduce(function(x,f,w){var b;return f.nodeName==="br"&&w?x+`
|
|
`:(b=f.childNodes)!==null&&b!==void 0&&b.length?s(f,C):C?x+f.textContent.trim().replace(/\s+/g," "):x+f.textContent},"")}function a(O,C){var x="http://www.w3.org/ns/ttml#styling",f=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return f.reduce(function(w,b){var y=R(C,x,b)||R(O,x,b);return y&&(w[b]=y),w},{})}function R(O,C,x){return O.hasAttributeNS(C,x)?O.getAttributeNS(C,x):null}function E(O){return new Error("Could not parse ttml timestamp "+O)}function S(O,C){if(!O)return null;var x=Object(j.parseTimeStamp)(O);return x===null&&(g.test(O)?x=D(O,C):p.test(O)&&(x=A(O,C))),x}function D(O,C){var x=g.exec(O),f=(x[4]|0)+(x[5]|0)/C.subFrameRate;return(x[1]|0)*3600+(x[2]|0)*60+(x[3]|0)+f/C.frameRate}function A(O,C){var x=p.exec(O),f=Number(x[1]),w=x[2];switch(w){case"h":return f*3600;case"m":return f*60;case"ms":return f*1e3;case"f":return f/C.frameRate;case"t":return f/C.tickRate}return f}},"./src/utils/logger.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"enableLogs",function(){return r}),P.d(J,"logger",function(){return L});var Y=function(){},j={trace:Y,debug:Y,log:Y,warn:Y,info:Y,error:Y},U=j;function z(v){var g=self.console[v];return g?g.bind(self.console,"["+v+"] >"):Y}function H(v){for(var g=arguments.length,p=new Array(g>1?g-1:0),u=1;u<g;u++)p[u-1]=arguments[u];p.forEach(function(h){U[h]=v[h]?v[h].bind(v):z(h)})}function r(v){if(self.console&&v===!0||typeof v=="object"){H(v,"debug","log","info","warn","error");try{U.log()}catch(g){U=j}}else U=j}var L=U},"./src/utils/mediakeys-helper.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"KeySystems",function(){return Y}),P.d(J,"requestMediaKeySystemAccess",function(){return j});var Y;(function(U){U.WIDEVINE="com.widevine.alpha",U.PLAYREADY="com.microsoft.playready"})(Y||(Y={}));var j=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"getMediaSource",function(){return Y});function Y(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"bin2str",function(){return H}),P.d(J,"readUint16",function(){return r}),P.d(J,"readUint32",function(){return L}),P.d(J,"writeUint32",function(){return v}),P.d(J,"findBox",function(){return g}),P.d(J,"parseSegmentIndex",function(){return p}),P.d(J,"parseInitSegment",function(){return u}),P.d(J,"getStartDTS",function(){return h}),P.d(J,"getDuration",function(){return c}),P.d(J,"computeRawDurationFromSamples",function(){return o}),P.d(J,"offsetStartDTS",function(){return l}),P.d(J,"segmentValidRange",function(){return s}),P.d(J,"appendUint8Array",function(){return a});var Y=P("./src/utils/typed-array.ts"),j=P("./src/loader/fragment.ts"),U=Math.pow(2,32)-1,z=[].push;function H(R){return String.fromCharCode.apply(null,R)}function r(R,E){"data"in R&&(E+=R.start,R=R.data);var S=R[E]<<8|R[E+1];return S<0?65536+S:S}function L(R,E){"data"in R&&(E+=R.start,R=R.data);var S=R[E]<<24|R[E+1]<<16|R[E+2]<<8|R[E+3];return S<0?4294967296+S:S}function v(R,E,S){"data"in R&&(E+=R.start,R=R.data),R[E]=S>>24,R[E+1]=S>>16&255,R[E+2]=S>>8&255,R[E+3]=S&255}function g(R,E){var S=[];if(!E.length)return S;var D,A,O;"data"in R?(D=R.data,A=R.start,O=R.end):(D=R,A=0,O=D.byteLength);for(var C=A;C<O;){var x=L(D,C),f=H(D.subarray(C+4,C+8)),w=x>1?C+x:O;if(f===E[0])if(E.length===1)S.push({data:D,start:C+8,end:w});else{var b=g({data:D,start:C+8,end:w},E.slice(1));b.length&&z.apply(S,b)}C=w}return S}function p(R){var E=g(R,["moov"]),S=E[0],D=S?S.end:null,A=g(R,["sidx"]);if(!A||!A[0])return null;var O=[],C=A[0],x=C.data[0],f=x===0?8:16,w=L(C,f);f+=4;var b=0,y=0;x===0?f+=8:f+=16,f+=2;var B=C.end+y,F=r(C,f);f+=2;for(var _=0;_<F;_++){var M=f,I=L(C,M);M+=4;var m=I&2147483647,W=(I&2147483648)>>>31;if(W===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var $=L(C,M);M+=4,O.push({referenceSize:m,subsegmentDuration:$,info:{duration:$/w,start:B,end:B+m-1}}),B+=m,M+=4,f=M}return{earliestPresentationTime:b,timescale:w,version:x,referencesCount:F,references:O,moovEndOffset:D}}function u(R){for(var E=[],S=g(R,["moov","trak"]),D=0;D<S.length;D++){var A=S[D],O=g(A,["tkhd"])[0];if(O){var C=O.data[O.start],x=C===0?12:20,f=L(O,x),w=g(A,["mdia","mdhd"])[0];if(w){C=w.data[w.start],x=C===0?12:20;var b=L(w,x),y=g(A,["mdia","hdlr"])[0];if(y){var B=H(y.data.subarray(y.start+8,y.start+12)),F={soun:j.ElementaryStreamTypes.AUDIO,vide:j.ElementaryStreamTypes.VIDEO}[B];if(F){var _=g(A,["mdia","minf","stbl","stsd"])[0],M=void 0;_&&(M=H(_.data.subarray(_.start+12,_.start+16))),E[f]={timescale:b,type:F},E[F]={timescale:b,id:f,codec:M}}}}}}var I=g(R,["moov","mvex","trex"]);return I.forEach(function(m){var W=L(m,4),$=E[W];$&&($.default={duration:L(m,12),flags:L(m,20)})}),E}function h(R,E){return g(E,["moof","traf"]).reduce(function(S,D){var A=g(D,["tfdt"])[0],O=A.data[A.start],C=g(D,["tfhd"]).reduce(function(x,f){var w=L(f,4),b=R[w];if(b){var y=L(A,4);O===1&&(y*=Math.pow(2,32),y+=L(A,8));var B=b.timescale||9e4,F=y/B;if(isFinite(F)&&(x===null||F<x))return F}return x},null);return C!==null&&isFinite(C)&&(S===null||C<S)?C:S},null)||0}function c(R,E){for(var S=0,D=0,A=0,O=g(R,["moof","traf"]),C=0;C<O.length;C++){var x=O[C],f=g(x,["tfhd"])[0],w=L(f,4),b=E[w];if(!b)continue;var y=b.default,B=L(f,0)|(y==null?void 0:y.flags),F=y==null?void 0:y.duration;B&8&&(B&2?F=L(f,12):F=L(f,8));for(var _=b.timescale||9e4,M=g(x,["trun"]),I=0;I<M.length;I++){if(F){var m=L(M[I],4);S=F*m}else S=o(M[I]);b.type===j.ElementaryStreamTypes.VIDEO?D+=S/_:b.type===j.ElementaryStreamTypes.AUDIO&&(A+=S/_)}}if(D===0&&A===0){var W=p(R);if(W!=null&&W.references)return W.references.reduce(function($,ae){return $+ae.info.duration||0},0)}return D||A}function o(R){var E=L(R,0),S=8;E&1&&(S+=4),E&4&&(S+=4);for(var D=0,A=L(R,4),O=0;O<A;O++){if(E&256){var C=L(R,S);D+=C,S+=4}E&512&&(S+=4),E&1024&&(S+=4),E&2048&&(S+=4)}return D}function l(R,E,S){g(E,["moof","traf"]).forEach(function(D){g(D,["tfhd"]).forEach(function(A){var O=L(A,4),C=R[O];if(!C)return;var x=C.timescale||9e4;g(D,["tfdt"]).forEach(function(f){var w=f.data[f.start],b=L(f,4);if(w===0)v(f,4,b-S*x);else{b*=Math.pow(2,32),b+=L(f,8),b-=S*x,b=Math.max(b,0);var y=Math.floor(b/(U+1)),B=Math.floor(b%(U+1));v(f,4,y),v(f,8,B)}})})})}function s(R){var E={valid:null,remainder:null},S=g(R,["moof"]);if(S){if(S.length<2)return E.remainder=R,E}else return E;var D=S[S.length-1];return E.valid=Object(Y.sliceUint8)(R,0,D.start-8),E.remainder=Object(Y.sliceUint8)(R,D.start-8),E}function a(R,E){var S=new Uint8Array(R.length+E.length);return S.set(R),S.set(E,R.length),S}},"./src/utils/output-filter.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return Y});var Y=function(){function j(z,H){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=z,this.trackName=H}var U=j.prototype;return U.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},U.newCue=function(H,r,L){(this.startTime===null||this.startTime>H)&&(this.startTime=H),this.endTime=r,this.screen=L,this.timelineController.createCaptionsTrack(this.trackName)},U.reset=function(){this.cueRanges=[]},j}()},"./src/utils/texttrack-utils.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"sendAddTrackEvent",function(){return j}),P.d(J,"addCueToTrack",function(){return U}),P.d(J,"clearCurrentCues",function(){return z}),P.d(J,"removeCuesInRange",function(){return H}),P.d(J,"getCuesInRange",function(){return L});var Y=P("./src/utils/logger.ts");function j(v,g){var p;try{p=new Event("addtrack")}catch(u){p=document.createEvent("Event"),p.initEvent("addtrack",!1,!1)}p.track=v,g.dispatchEvent(p)}function U(v,g){var p=v.mode;if(p==="disabled"&&(v.mode="hidden"),v.cues&&!v.cues.getCueById(g.id))try{if(v.addCue(g),!v.cues.getCueById(g.id))throw new Error("addCue is failed for: "+g)}catch(h){Y.logger.debug("[texttrack-utils]: "+h);var u=new self.TextTrackCue(g.startTime,g.endTime,g.text);u.id=g.id,v.addCue(u)}p==="disabled"&&(v.mode=p)}function z(v){var g=v.mode;if(g==="disabled"&&(v.mode="hidden"),v.cues)for(var p=v.cues.length;p--;)v.removeCue(v.cues[p]);g==="disabled"&&(v.mode=g)}function H(v,g,p){var u=v.mode;if(u==="disabled"&&(v.mode="hidden"),v.cues&&v.cues.length>0)for(var h=L(v.cues,g,p),c=0;c<h.length;c++)v.removeCue(h[c]);u==="disabled"&&(v.mode=u)}function r(v,g){if(g<v[0].startTime)return 0;var p=v.length-1;if(g>v[p].endTime)return-1;for(var u=0,h=p;u<=h;){var c=Math.floor((h+u)/2);if(g<v[c].startTime)h=c-1;else if(g>v[c].startTime&&u<p)u=c+1;else return c}return v[u].startTime-g<g-v[h].startTime?u:h}function L(v,g,p){var u=[],h=r(v,g);if(h>-1)for(var c=h,o=v.length;c<o;c++){var l=v[c];if(l.startTime>=g&&l.endTime<=p)u.push(l);else if(l.startTime>p)return u}return u}},"./src/utils/time-ranges.ts":function(ne,J,P){"use strict";P.r(J);var Y={toString:function(U){for(var z="",H=U.length,r=0;r<H;r++)z+="["+U.start(r).toFixed(3)+","+U.end(r).toFixed(3)+"]";return z}};J.default=Y},"./src/utils/timescale-conversion.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"toTimescaleFromBase",function(){return j}),P.d(J,"toTimescaleFromScale",function(){return U}),P.d(J,"toMsFromMpegTsClock",function(){return z}),P.d(J,"toMpegTsClockFromTimescale",function(){return H});var Y=9e4;function j(r,L,v,g){v===void 0&&(v=1),g===void 0&&(g=!1);var p=r*L*v;return g?Math.round(p):p}function U(r,L,v,g){return v===void 0&&(v=1),g===void 0&&(g=!1),j(r,L,1/v,g)}function z(r,L){return L===void 0&&(L=!1),j(r,1e3,1/Y,L)}function H(r,L){return L===void 0&&(L=1),j(r,Y,1/L)}},"./src/utils/typed-array.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"sliceUint8",function(){return Y});function Y(j,U,z){return Uint8Array.prototype.slice?j.slice(U,z):new Uint8Array(Array.prototype.slice.call(j,U,z))}},"./src/utils/vttcue.ts":function(ne,J,P){"use strict";P.r(J),J.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var Y=["","lr","rl"],j=["start","middle","end","left","right"];function U(v,g){if(typeof g!="string")return!1;if(!Array.isArray(v))return!1;var p=g.toLowerCase();return~v.indexOf(p)?p:!1}function z(v){return U(Y,v)}function H(v){return U(j,v)}function r(v){for(var g=arguments.length,p=new Array(g>1?g-1:0),u=1;u<g;u++)p[u-1]=arguments[u];for(var h=1;h<arguments.length;h++){var c=arguments[h];for(var o in c)v[o]=c[o]}return v}function L(v,g,p){var u=this,h={enumerable:!0};u.hasBeenReset=!1;var c="",o=!1,l=v,s=g,a=p,R=null,E="",S=!0,D="auto",A="start",O=50,C="middle",x=50,f="middle";Object.defineProperty(u,"id",r({},h,{get:function(){return c},set:function(b){c=""+b}})),Object.defineProperty(u,"pauseOnExit",r({},h,{get:function(){return o},set:function(b){o=!!b}})),Object.defineProperty(u,"startTime",r({},h,{get:function(){return l},set:function(b){if(typeof b!="number")throw new TypeError("Start time must be set to a number.");l=b,this.hasBeenReset=!0}})),Object.defineProperty(u,"endTime",r({},h,{get:function(){return s},set:function(b){if(typeof b!="number")throw new TypeError("End time must be set to a number.");s=b,this.hasBeenReset=!0}})),Object.defineProperty(u,"text",r({},h,{get:function(){return a},set:function(b){a=""+b,this.hasBeenReset=!0}})),Object.defineProperty(u,"region",r({},h,{get:function(){return R},set:function(b){R=b,this.hasBeenReset=!0}})),Object.defineProperty(u,"vertical",r({},h,{get:function(){return E},set:function(b){var y=z(b);if(y===!1)throw new SyntaxError("An invalid or illegal string was specified.");E=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"snapToLines",r({},h,{get:function(){return S},set:function(b){S=!!b,this.hasBeenReset=!0}})),Object.defineProperty(u,"line",r({},h,{get:function(){return D},set:function(b){if(typeof b!="number"&&b!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");D=b,this.hasBeenReset=!0}})),Object.defineProperty(u,"lineAlign",r({},h,{get:function(){return A},set:function(b){var y=H(b);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");A=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"position",r({},h,{get:function(){return O},set:function(b){if(b<0||b>100)throw new Error("Position must be between 0 and 100.");O=b,this.hasBeenReset=!0}})),Object.defineProperty(u,"positionAlign",r({},h,{get:function(){return C},set:function(b){var y=H(b);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");C=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"size",r({},h,{get:function(){return x},set:function(b){if(b<0||b>100)throw new Error("Size must be between 0 and 100.");x=b,this.hasBeenReset=!0}})),Object.defineProperty(u,"align",r({},h,{get:function(){return f},set:function(b){var y=H(b);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");f=y,this.hasBeenReset=!0}})),u.displayState=void 0}return L.prototype.getCueAsHTML=function(){var v=self.WebVTT;return v.convertCueToDOMTree(self,this.text)},L}()},"./src/utils/vttparser.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"parseTimeStamp",function(){return U}),P.d(J,"fixLineBreaks",function(){return g}),P.d(J,"VTTParser",function(){return p});var Y=P("./src/utils/vttcue.ts"),j=function(){function u(){}var h=u.prototype;return h.decode=function(o,l){if(!o)return"";if(typeof o!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(o))},u}();function U(u){function h(o,l,s,a){return(o|0)*3600+(l|0)*60+(s|0)+parseFloat(a||0)}var c=u.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return c?parseFloat(c[2])>59?h(c[2],c[3],0,c[4]):h(c[1],c[2],c[3],c[4]):null}var z=function(){function u(){this.values=Object.create(null)}var h=u.prototype;return h.set=function(o,l){!this.get(o)&&l!==""&&(this.values[o]=l)},h.get=function(o,l,s){return s?this.has(o)?this.values[o]:l[s]:this.has(o)?this.values[o]:l},h.has=function(o){return o in this.values},h.alt=function(o,l,s){for(var a=0;a<s.length;++a)if(l===s[a]){this.set(o,l);break}},h.integer=function(o,l){/^-?\d+$/.test(l)&&this.set(o,parseInt(l,10))},h.percent=function(o,l){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(l)){var s=parseFloat(l);if(s>=0&&s<=100)return this.set(o,s),!0}return!1},u}();function H(u,h,c,o){var l=o?u.split(o):[u];for(var s in l){if(typeof l[s]!="string")continue;var a=l[s].split(c);if(a.length!==2)continue;var R=a[0],E=a[1];h(R,E)}}var r=new Y.default(0,0,""),L=r.align==="middle"?"middle":"center";function v(u,h,c){var o=u;function l(){var R=U(u);if(R===null)throw new Error("Malformed timestamp: "+o);return u=u.replace(/^[^\sa-zA-Z-]+/,""),R}function s(R,E){var S=new z;H(R,function(O,C){var x;switch(O){case"region":for(var f=c.length-1;f>=0;f--)if(c[f].id===C){S.set(O,c[f].region);break}break;case"vertical":S.alt(O,C,["rl","lr"]);break;case"line":x=C.split(","),S.integer(O,x[0]),S.percent(O,x[0])&&S.set("snapToLines",!1),S.alt(O,x[0],["auto"]),x.length===2&&S.alt("lineAlign",x[1],["start",L,"end"]);break;case"position":x=C.split(","),S.percent(O,x[0]),x.length===2&&S.alt("positionAlign",x[1],["start",L,"end","line-left","line-right","auto"]);break;case"size":S.percent(O,C);break;case"align":S.alt(O,C,["start",L,"end","left","right"]);break}},/:/,/\s/),E.region=S.get("region",null),E.vertical=S.get("vertical","");var D=S.get("line","auto");D==="auto"&&r.line===-1&&(D=-1),E.line=D,E.lineAlign=S.get("lineAlign","start"),E.snapToLines=S.get("snapToLines",!0),E.size=S.get("size",100),E.align=S.get("align",L);var A=S.get("position","auto");A==="auto"&&r.position===50&&(A=E.align==="start"||E.align==="left"?0:E.align==="end"||E.align==="right"?100:50),E.position=A}function a(){u=u.replace(/^\s+/,"")}if(a(),h.startTime=l(),a(),u.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);u=u.substr(3),a(),h.endTime=l(),a(),s(u,h)}function g(u){return u.replace(/<br(?: \/)?>/gi,`
|
|
`)}var p=function(){function u(){this.state="INITIAL",this.buffer="",this.decoder=new j,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var h=u.prototype;return h.parse=function(o){var l=this;o&&(l.buffer+=l.decoder.decode(o,{stream:!0}));function s(){var A=l.buffer,O=0;for(A=g(A);O<A.length&&A[O]!=="\r"&&A[O]!==`
|
|
`;)++O;var C=A.substr(0,O);return A[O]==="\r"&&++O,A[O]===`
|
|
`&&++O,l.buffer=A.substr(O),C}function a(A){H(A,function(O,C){},/:/)}try{var R="";if(l.state==="INITIAL"){if(!/\r\n|\n/.test(l.buffer))return this;R=s();var E=R.match(/^()?WEBVTT([ \t].*)?$/);if(!E||!E[0])throw new Error("Malformed WebVTT signature.");l.state="HEADER"}for(var S=!1;l.buffer;){if(!/\r\n|\n/.test(l.buffer))return this;S?S=!1:R=s();switch(l.state){case"HEADER":/:/.test(R)?a(R):R||(l.state="ID");continue;case"NOTE":R||(l.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(R)){l.state="NOTE";break}if(!R)continue;if(l.cue=new Y.default(0,0,""),l.state="CUE",R.indexOf("-->")===-1){l.cue.id=R;continue}case"CUE":if(!l.cue){l.state="BADCUE";continue}try{v(R,l.cue,l.regionList)}catch(A){l.cue=null,l.state="BADCUE";continue}l.state="CUETEXT";continue;case"CUETEXT":{var D=R.indexOf("-->")!==-1;if(!R||D&&(S=!0)){l.oncue&&l.cue&&l.oncue(l.cue),l.cue=null,l.state="ID";continue}if(l.cue===null)continue;l.cue.text&&(l.cue.text+=`
|
|
`),l.cue.text+=R}continue;case"BADCUE":R||(l.state="ID")}}}catch(A){l.state==="CUETEXT"&&l.cue&&l.oncue&&l.oncue(l.cue),l.cue=null,l.state=l.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(l){o.onparsingerror&&o.onparsingerror(l)}return o.onflush&&o.onflush(),this},u}()},"./src/utils/webvtt-parser.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"generateCueId",function(){return p}),P.d(J,"parseWebVTT",function(){return h});var Y=P("./src/polyfills/number.ts"),j=P("./src/utils/vttparser.ts"),U=P("./src/demux/id3.ts"),z=P("./src/utils/timescale-conversion.ts"),H=P("./src/remux/mp4-remuxer.ts"),r=/\r\n|\n\r|\n|\r/g,L=function(o,l,s){return s===void 0&&(s=0),o.substr(s,l.length)===l},v=function(o){var l=parseInt(o.substr(-3)),s=parseInt(o.substr(-6,2)),a=parseInt(o.substr(-9,2)),R=o.length>9?parseInt(o.substr(0,o.indexOf(":"))):0;if(!Object(Y.isFiniteNumber)(l)||!Object(Y.isFiniteNumber)(s)||!Object(Y.isFiniteNumber)(a)||!Object(Y.isFiniteNumber)(R))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+o);return l+=1e3*s,l+=60*1e3*a,l+=60*60*1e3*R,l},g=function(o){for(var l=5381,s=o.length;s;)l=l*33^o.charCodeAt(--s);return(l>>>0).toString()};function p(c,o,l){return g(c.toString())+g(o.toString())+g(l)}var u=function(o,l,s){var a=o[l],R=o[a.prevCC];if(!R||!R.new&&a.new){o.ccOffset=o.presentationOffset=a.start,a.new=!1;return}for(;(E=R)!==null&&E!==void 0&&E.new;){var E;o.ccOffset+=a.start-R.start,a.new=!1,a=R,R=o[a.prevCC]}o.presentationOffset=s};function h(c,o,l,s,a,R,E,S){var D=new j.VTTParser,A=Object(U.utf8ArrayToStr)(new Uint8Array(c)).trim().replace(r,`
|
|
`).split(`
|
|
`),O=[],C=Object(z.toMpegTsClockFromTimescale)(o,l),x="00:00.000",f=0,w=0,b,y=!0,B=!1;D.oncue=function(F){var _=s[a],M=s.ccOffset,I=(f-C)/9e4;if(_!=null&&_.new&&(w!==void 0?M=s.ccOffset=_.start:u(s,a,I)),I&&(M=I-s.presentationOffset),B){var m=F.endTime-F.startTime,W=Object(H.normalizePts)((F.startTime+M-w)*9e4,R*9e4)/9e4;F.startTime=W,F.endTime=W+m}var $=F.text.trim();F.text=decodeURIComponent(encodeURIComponent($)),F.id||(F.id=p(F.startTime,F.endTime,$)),F.endTime>0&&O.push(F)},D.onparsingerror=function(F){b=F},D.onflush=function(){if(b){S(b);return}E(O)},A.forEach(function(F){if(y)if(L(F,"X-TIMESTAMP-MAP=")){y=!1,B=!0,F.substr(16).split(",").forEach(function(_){L(_,"LOCAL:")?x=_.substr(6):L(_,"MPEGTS:")&&(f=parseInt(_.substr(7)))});try{w=v(x)/1e3}catch(_){B=!1,b=_}return}else F===""&&(y=!1);D.parse(F+`
|
|
`)}),D.flush()}},"./src/utils/xhr-loader.ts":function(ne,J,P){"use strict";P.r(J);var Y=P("./src/utils/logger.ts"),j=P("./src/loader/load-stats.ts"),U=/^age:\s*[\d.]+\s*$/m,z=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 j.LoadStats,this.retryDelay=0}var r=H.prototype;return r.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},r.abortInternal=function(){var v=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),v&&(v.onreadystatechange=null,v.onprogress=null,v.readyState!==4&&(this.stats.aborted=!0,v.abort()))},r.abort=function(){var v;this.abortInternal(),(v=this.callbacks)!==null&&v!==void 0&&v.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},r.load=function(v,g,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=g,this.callbacks=p,this.retryDelay=g.retryDelay,this.loadInternal()},r.loadInternal=function(){var v=this.config,g=this.context;if(!v)return;var p=this.loader=new self.XMLHttpRequest,u=this.stats;u.loading.first=0,u.loaded=0;var h=this.xhrSetup;try{if(h)try{h(p,g.url)}catch(l){p.open("GET",g.url,!0),h(p,g.url)}p.readyState||p.open("GET",g.url,!0);var c=this.context.headers;if(c)for(var o in c)p.setRequestHeader(o,c[o])}catch(l){this.callbacks.onError({code:p.status,text:l.message},g,p);return}g.rangeEnd&&p.setRequestHeader("Range","bytes="+g.rangeStart+"-"+(g.rangeEnd-1)),p.onreadystatechange=this.readystatechange.bind(this),p.onprogress=this.loadprogress.bind(this),p.responseType=g.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),v.timeout),p.send()},r.readystatechange=function(){var v=this.context,g=this.loader,p=this.stats;if(!v||!g)return;var u=g.readyState,h=this.config;if(p.aborted)return;if(u>=2)if(self.clearTimeout(this.requestTimeout),p.loading.first===0&&(p.loading.first=Math.max(self.performance.now(),p.loading.start)),u===4){g.onreadystatechange=null,g.onprogress=null;var c=g.status;if(c>=200&&c<300){p.loading.end=Math.max(self.performance.now(),p.loading.first);var o,l;if(v.responseType==="arraybuffer"?(o=g.response,l=o.byteLength):(o=g.responseText,l=o.length),p.loaded=p.total=l,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(p,v,o,g),!this.callbacks)return;var a={url:g.responseURL,data:o};this.callbacks.onSuccess(a,p,v,g)}else p.retry>=h.maxRetry||c>=400&&c<499?(Y.logger.error(c+" while loading "+v.url),this.callbacks.onError({code:c,text:g.statusText},v,g)):(Y.logger.warn(c+" 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)},r.loadtimeout=function(){Y.logger.warn("timeout while loading "+this.context.url);var v=this.callbacks;v&&(this.abortInternal(),v.onTimeout(this.stats,this.context,this.loader))},r.loadprogress=function(v){var g=this.stats;g.loaded=v.loaded,v.lengthComputable&&(g.total=v.total)},r.getCacheAge=function(){var v=null;if(this.loader&&U.test(this.loader.getAllResponseHeaders())){var g=this.loader.getResponseHeader("age");v=g?parseFloat(g):null}return v},H}();J.default=z}}).default})},vHTk:function(nt,ye,Q){nt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wzkS:function(nt,ye,Q){"use strict";Q.d(ye,"c",function(){return j}),Q.d(ye,"b",function(){return U}),Q.d(ye,"d",function(){return z}),Q.d(ye,"a",function(){return r}),Q.d(ye,"e",function(){return L});var ne=Q("9og8"),J=Q("WmNS"),P=Q.n(J),Y=Q("ErOA");function j(v){return Object(Y.c)("libraries/".concat(v,".json"))}function U(){return Object(Y.c)("library_tags.json")}function z(v){return H.apply(this,arguments)}function H(){return H=Object(ne.a)(P.a.mark(function v(g){var p;return P.a.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,Object(Y.b)("attachments/".concat(g,".json"));case 2:return p=h.sent,h.abrupt("return",p.status===0);case 4:case"end":return h.stop()}},v)})),H.apply(this,arguments)}function r(v){return Object(Y.f)("libraries.json",v)}function L(v,g){return Object(Y.g)("libraries/".concat(v,".json"),g)}},y5JW:function(nt,ye,Q){"use strict";Q.d(ye,"c",function(){return c}),Q.d(ye,"a",function(){return o});var ne=Q("DZo9"),J=Q("8z0m"),P=Q("+L6B"),Y=Q("2/Rp"),j=Q("9og8"),U=Q("miYZ"),z=Q("tsqr"),H=Q("k1fw"),r=Q("oBTY"),L=Q("WmNS"),v=Q.n(L),g=Q("q1tI"),p=Q.n(g),u=Q("m3rI"),h=Q("wzkS"),c="\u3000\u3000";function o(l){var s=["Bytes","KB","MB","GB","TB"];if(l==0)return"0 Byte";var a=parseInt(""+Math.floor(Math.log(l)/Math.log(1024)),10);return(l/Math.pow(1024,a)).toFixed(1)+" "+s[a]}ye.b=function(l){var s=l.value,a=s===void 0?[]:s,R=l.action,E=l.onChange,S=l.className,D=l.maxSize,A=D===void 0?150:D,O=l.title,C=O===void 0?"\u6587\u4EF6\u4E0A\u4F20":O,x=l.accept,f=x===void 0?null:x,w={multiple:!1,fileList:a,accept:f,withCredentials:!0,beforeUpload:function(B){var F=B.size/1024/1024;return!0},action:"".concat(u.a.API_SERVER,"/api/attachments.json"),onChange:function(B){var F,_,M=Object(r.a)(B.fileList);if(M=M.map(function(W){return W.name.indexOf(c)===-1&&(W.name="".concat(W.name).concat(c).concat(o(W.size))),Object(H.a)({},W)}),B.file.status==="done"&&((F=B.file)===null||F===void 0||((_=F.response)===null||_===void 0)?void 0:_.status)===-1){var I,m;z.b.error((I=B.file)===null||I===void 0||((m=I.response)===null||m===void 0)?void 0:m.message),E([]);return}E(M)},onRemove:function(){var y=Object(j.a)(v.a.mark(function F(_){var M,I,m;return v.a.wrap(function($){for(;;)switch($.prev=$.next){case 0:if(M=_.size/1024/1024,!(_.status==="uploading")){$.next=3;break}return $.abrupt("return",!0);case 3:if(M<A){$.next=7;break}return $.abrupt("return",!0);case 7:if(I=_.response?_.response.id:_.uid,!I){$.next=15;break}return $.next=11,Object(h.d)(_.response?_.response.id:_.id);case 11:return m=$.sent,$.abrupt("return",m);case 15:return $.abrupt("return",!0);case 16:case"end":return $.stop()}},F)}));function B(F){return y.apply(this,arguments)}return B}()};function b(y){y.preventDefault(),y.stopPropagation()}return p.a.createElement("div",{className:"single-upload ".concat(S||"")},p.a.createElement(J.a,w,p.a.createElement(Y.a,{type:"primary",title:a.length>0?"\u6BCF\u6B21\u53EA\u80FD\u4E0A\u4F20\u4E00\u4E2A\u8D44\u6E90\uFF0C \u5220\u9664\u4E0B\u9762\u8D44\u6E90\u53EF\u91CD\u65B0\u4E0A\u4F20 ":"",disabled:a.length>0,ghost:!0},C),p.a.createElement("span",{onClick:b,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",A,"M)"," ")))}},yQHh:function(nt,ye,Q){}}]);
|